[
  {
    "path": ".changeset/README.md",
    "content": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works\nwith multi-package repos, or single-package repos to help you version and publish your code. You can\nfind the full documentation for it [in our repository](https://github.com/changesets/changesets)\n\nWe have a quick list of common questions to get you started engaging with this project in\n[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)\n"
  },
  {
    "path": ".changeset/config.json",
    "content": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@1.6.0/schema.json\",\n  \"changelog\": \"@changesets/cli/changelog\",\n  \"commit\": false,\n  \"linked\": [],\n  \"access\": \"public\",\n  \"baseBranch\": \"main\",\n  \"ignore\": [\"@snowpack/test-*\"]\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_style = space\nindent_size = 2\ninsert_final_newline = true\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @snowpackjs/maintainers\ndocs/* @snowpackjs/docs\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---bug-report.yml",
    "content": "name: \"\\U0001F41B Bug Report\"\ndescription: Report an issue or possible bug\ntitle: \"\\U0001F41B BUG:\"\nlabels: []\nassignees: []\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.\n  - type: checkboxes\n    attributes:\n      label: Quick checklist\n      options:\n        - label: I am using the **latest version of Snowpack** and all plugins.\n  - type: input\n    attributes:\n      label: What package manager are you using?\n      placeholder: npm, yarn, pnpm\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: What operating system are you using?\n      placeholder: macOS, Windows, Linux\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Describe the bug\n      description: A clear and concise description of what the bug is.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Steps to reproduce\n      description: Describe the bug in steps that we can reproduce ourselves.\n      value: |\n        1. `npx create-snowpack-app` using template <NAME>\n        2. ...\n        3. ...\n        4. ...\n        5. Error! Describe what went wrong (and what was expected instead)...\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: Link to minimal reproducible example (optional)\n      description: 'Issues with easy reproductions are more likely to get fixed, faster.'\n      placeholder: 'https://github.com/username/repo'\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---feature-request.yml",
    "content": "name: \"\\U0001F4A1 Feature Request\"\ndescription: 'Submit an RFC or suggest an idea for this project'\ntitle: \"\\U0001F4A1 RFC: \"\nlabels: ['feature']\nassignees: []\nbody:\n  - type: markdown\n    attributes:\n      value: Thanks for taking the time to suggest a new feature! Please fill out this form as completely as possible.\n  - type: textarea\n    attributes:\n      label: Motivation\n      description: |\n        A quick, clear and concise description of what the problem is.\n\n        **Please include links to relevant issues, Discord convos, and anything else.**\n      placeholder: I want to be able to...\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Proposed solution\n      description: Your take on one (or more) possible solution(s) to problem.\n      value: |\n        ### Possible solutions\n\n        ### Alternatives considered\n\n        ### Risks, downsides, and/or tradeoffs\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Detailed design\n      description: |\n        🛑 **Just looking for feedback on an idea? Leave this section blank.**\n\n        Otherwise, explain the exact steps required to implement this change.\n        Include specific details that would help someone implement this feature.\n  - type: textarea\n    attributes:\n      label: Open questions\n      description: |\n        Are there any open questions remaining? List them here.\n  - type: checkboxes\n    attributes:\n      label: Help make it happen!\n      description: 'Tip: RFCs with contributing authors are much more likely to get done!'\n      options:\n        - label: I am willing to submit a PR to implement this change.\n        - label: I am willing to submit a PR to implement this change, but would need some guidance.\n        - label: I am not willing to submit a PR to implement this change.\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: 💬 Everything else\n    about: Ask questions and get help from our community!\n    url: https://github.com/withastro/snowpack/discussions\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "<!--\n---- ⛔ STOP!\n----\n---- This project supports GitHub's new Discussions feature!\n---- Issues are handled a little bit differently than you might be used to.\n----\n---- ❗️ Don't start by creating a new issue. Instead, create a discussion:\n----   🔎 Search Existing:   https://github.com/withastro/snowpack/discussions\n----   📝 Create New:        https://github.com/withastro/snowpack/discussions/category_choices\n----\n---- More information on how our team manages issues & discussions:\n----   https://github.com/withastro/snowpack/discussions/613#discussioncomment-41103\n--->\n\n**Original Discussion:** <!-- URL to discussion -->\n**/cc** <!-- @mention everyone from discussion -->\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "## Changes\n\n<!-- What does this change, in plain language? -->\n<!-- Before/after screenshots may be helpful.  -->\n\n## Testing\n\n<!-- How was this change tested? -->\n<!-- DON'T DELETE THIS SECTION! If no tests added, explain why -->\n\n## Docs\n\n<!-- Was public documentation updated? -->\n<!-- DON'T DELETE THIS SECTION! If no docs added, explain why (e.g. \"bug fix only\") -->\n"
  },
  {
    "path": ".github/workflows/format.yml",
    "content": "name: 'Format Code'\n\non:\n  push:\n    branches:\n      - main\n\nenv:\n  node_version: 14\n\njobs:\n  format:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n        with:\n          ref: ${{ github.head_ref }}\n      - uses: actions/setup-node@v2\n        with:\n          node-version: ${{ env.node_version }}\n      - name: yarn install\n        run: yarn --frozen-lockfile\n        env:\n          CI: true\n      - name: yarn format\n        run: yarn format\n      - name: Commit changes\n        uses: stefanzweifel/git-auto-commit-action@v4\n        with:\n          commit_message: '[ci] yarn format'\n          branch: ${{ github.head_ref }}\n          push_options: --force\n"
  },
  {
    "path": ".github/workflows/lint.yml",
    "content": "name: Lint Code\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\nenv:\n  node_version: 14\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js ${{ env.node_version }}\n        uses: actions/setup-node@v2\n        with:\n          node-version: ${{ env.node_version }}\n      - name: lint\n        run: |\n          yarn --ignore-engines --frozen-lockfile\n          yarn build\n          yarn lint\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "# Inspired by https://bret.io/projects/package-automation/\n\nname: Create Release\n\non:\n  workflow_dispatch:\n    inputs:\n      tag:\n        description: 'what kind of release? (ex: \"next\", \"latest\")'\n        required: true\n      packagePath:\n        description: 'path to package? (ex: \"snowpack\", \"plugins/plugin-babel\")'\n        required: true\n\nenv:\n  node_version: 14\n\njobs:\n  version_and_release:\n    runs-on: ubuntu-latest\n    steps:\n      # SETUP:\n      - uses: actions/checkout@v2\n        with:\n          fetch-depth: 0\n      - name: Use Node.js ${{ env.node_version }}\n        uses: actions/setup-node@v2\n        with:\n          node-version: ${{ env.node_version }}\n          # (REQUIRED) setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token.\n          registry-url: 'https://registry.npmjs.org'\n      - run: git config --global user.email \"github-ci@snowpack.dev\"\n      - run: git config --global user.name \" ${{ github.actor }}\"\n      - run: yarn --frozen-lockfile\n\n      # PUBLISH:\n      - run: node -e \"require('./scripts/release.cjs')('${{ github.event.inputs.packagePath }}', '${{ github.event.inputs.tag }}')\"\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: Test Code\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  test:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os: [ubuntu-latest, windows-latest]\n        node-version: [12.x, 14.x, 16.x]\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js ${{ matrix.node-version }}\n        uses: actions/setup-node@v2\n        with:\n          node-version: ${{ matrix.node-version }}\n      - name: build\n        run: |\n          yarn --ignore-engines --frozen-lockfile\n          yarn build\n        env:\n          CI: true\n      - name: test\n        run: yarn test\n        env:\n          CI: true\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n.build\n.idea\n.snowpack\n.vercel\nlerna-debug.log\nnode_modules\npackage-lock.json\ncreate-snowpack-app/*/build\ntest/__temp__\ntest/build/**/build\ntest/build/**/TEST_BUILD_OUT\ntest/build/**/web_modules\ntest/create-snowpack-app/test-install\ntest/esinstall/**/web_modules\nyarn-error.log\n\n# Ignore files that are copied from /docs\nwww/_template/**/*.md\n!www/_template/posts/**/*.md\n"
  },
  {
    "path": ".prettierignore",
    "content": "vendor\ndist\ntest/build/**/build\ncreate-snowpack-app/**/build\npackages\npkg\nTEST_BUILD_OUT\nweb_modules\ntest/create-snowpack-app/test-install\n.snowpack\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n## Version 3.x\n\nThe CHANGELOG.md for the current 3.x version of Snowpack is maintained in the `/snowpack` directory at: https://github.com/withastro/snowpack/blob/main/snowpack/CHANGELOG.md\n\n## Version 2.x\n\nThe CHANGELOG.md for version 2.x is currently maintained in a discussion so that you can subscribe for updates:\n**https://github.com/withastro/snowpack/discussions/1183**\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n- Using welcoming and inclusive language\n- Being respectful of differing viewpoints and experiences\n- Gracefully accepting constructive criticism\n- Focusing on what is best for the community\n- Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n- The use of sexualized language or imagery and unwelcome sexual attention or\n  advances\n- Trolling, insulting/derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or electronic\n  address, without explicit permission\n- Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at info@pika.dev. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributions Welcome!\n\nInterested in contributing? We'd love your help!\n\nIf you run into problems or find something confusing, please share it with us in [this discussion](https://github.com/withastro/snowpack/discussions/958). A great experience for new contributors is very important to us!\n\nPlease note that all activity on the [`snowpackjs/snowpack` repository](https://github.com/withastro/snowpack) and our [Discord][discord] is moderated and will be strictly enforced under Snowpack's [Contributor Code of Conduct](CODE_OF_CONDUCT.md).\n\nOur [issue tracker](https://github.com/withastro/snowpack/issues) is always organized with a selection of high-priority bugs, feature requests, and [\"help wanted!\"](https://github.com/withastro/snowpack/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)/[\"good first issue\"](https://github.com/withastro/snowpack/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) items. For general package troubleshooting and discussions, check out our [Package Community](https://www.pika.dev/npm/snowpack/discuss) discussion board.\n\n## Requirements\n\nSnowpack uses [yarn workspaces](https://classic.yarnpkg.com/) to manage multiple packages contained in this repository. To contribute, [make sure that you have Yarn installed on your machine](https://classic.yarnpkg.com/en/docs/install).\n\n## Initial setup\n\n```bash\ngit clone https://github.com/withastro/snowpack.git\ncd snowpack\nyarn\n```\n\n## Checking out and building a branch\n\n```bash\ngit checkout some-branch-name\nyarn # in case dependencies have changed\nyarn build # re-builds all packages\n# that's it! Your monorepo is set up and ready to run/test.\n```\n\n## Build after changes\n\nSome packages in the repo are written in JavaScript, and require no build step. Others (like Snowpack itself) are written in TypeScript, and require a build step to run.\n\n```bash\n# Option 1: A one-time build step\nyarn build\n\n# Option 2: Start a persistent TypeScript watcher, recompiling on every change\n# Recommended for active development, when many changes are required\nyarn build:watch\n```\n\n## Updating and adding packages\n\nSince this is a monorepo with several packages, if you want to update/add packages in the subrepos like `create-snowpack-app/app-template-11ty` you'll want to run the commands in the target subdirectory like\n\n```bash\ncd create-snowpack-app/app-template-vue\nyarn add vue@latest\n```\n\n## Tests\n\nWe recommend running all tests before you submit a PR. Tests will not work unless you have run a build `yarn build`.\n\n### Running tests\n\nFrom the repository's root folder, run\n\n```bash\nyarn build\nyarn test\nyarn test:dev # sometimes flaky on windows, see #1171\n```\n\n### Snapshot tests\n\n_Update March 2021: we’re working on improving this and would love your help converting old test directories to smaller TypeScript tests/fixtures!_\n\nAll new tests should live in either `test/snowpack`, `test/esinstall`, or the `test` directory of one of our plugins (ex: `plugins/plugin-dotenv/test/plugin.test.js`). `test/build` is considered legacy and is in the process of getting converted into `test/snowpack`.\n\nThe way our snapshot tests work is they test Snowpack by building a project. Because Snowpack's build method uses the dev server internally, this is a good way to test the build behavior of both dev & build together.\n\nYou'll almost always have a \"failed\" snapshot test when you make a contribution because your new change will make the final build different. You'll want to take a new snapshot. To do this run:\n\n```bash\nyarn test -u\n```\n\nYou'll notice this changes the snapshot file. Commit this change and submit it along with your PR.\n\n### Filtering tests\n\nJest supports basic test filtering to only run a subset of our test suite. The [`--testNamePattern`](https://jestjs.io/docs/en/cli#--testnamepatternregex) flag also works as well.\n\n```bash\nyarn test treeshake\n```\n\n## Run local snowpack in another project\n\nYou can run your local snowpack by path\n\n```bash\nyarn build\ncd path/to/some-other-project\n/path/to/snowpack-repository/snowpack/index.bin.js dev --verbose --reload\n```\n\nOr by linking the global `snowpack` library to your local clone\n\n```bash\ncd snowpack\nnpm link\ncd path/to/some-other-project\nsnowpack dev --verbose --reload\n```\n\nTo test a local version of the CLI tool use\n\n```bash\nnode /path/to/snowpack-repository/create-snowpack-app/cli [my-new-dir] --template @snowpack/app-template-vue\n```\n\nTo test a local version of the `create-snowpack-app` templates use\n\n```bash\nnpx create-snowpack-app [my-new-dir] --template ./path/to/template\n```\n\nNote the path must start with must start with a `.` to be considered local\n\nThe `--verbose` flag enables additional logs which will help to identify the source of a problem. The `--reload` will clear the local cache which might have been created by a different `snowpack` version. Learn more about [Snowpack's CLI flags](/reference/cli-command-line-interface).\n\n## Documentation\n\nThe [Snowpack website](https://snowpack.dev) source is located in [`/www`](./www). The documentation source files are located in [`/docs`](./docs) for contributor convenience.\n\nThe directories inside of `/docs` are automatically copied to `/www/_template`, so relative URLs in the documentation use `/www` as their base path.\n\n### Localization\n\nIf you’d like to help localize, we’d love your help! This is our proposed structure for [`/docs`](./docs):\n\n- English translations in the root (e.g. `/docs/tutorials/getting-started.md` is English)\n- All other languages located in `/docs/[ISO 639-1]/` folders, mirroring structure (e.g. `/docs/tutorials/es/getting-started.md`).\n\nSome other considerations:\n\n- The `.md` filename should match its English name, only to mark it as the same document. Within the document itself, the title shown to users will be localized.\n- We’re open to having locale-specific guides that don’t exist in English, but please [start a discussion][discussion] before doing so, so we understand the context.\n\n## Pull Request Guidelines\n\nCheckout a topic branch from a base branch, e.g. `main`, and merge back against that branch.\n\nIf adding a feature, it probably should have been brought up in a [discussion][discussion] instead before the PR was created.\n\nSome tips for creating your first pull request:\n\n- Provide background for why a PR was created.\n- Link to any relevant issues, discussions, or past PRs.\n- Add accompanying tests if applicable.\n- Ensure all tests have been passed.\n- Be sure to add a [changesets][changesets] message along with your commit! Our friendly 🤖 bot will help guide you with more instructions.\n\n## Discussion\n\n[Join the Pika Discord][discord]\n\n[changesets]: https://github.com/atlassian/changesets\n[discord]: https://discord.gg/rS8SnRk\n[discussion]: https://github.com/withastro/snowpack/discussions\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Fred K. Schott\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "> **Update (April 20, 2022):** Snowpack is no longer actively maintained and is not recommended for new projects.\n> \n> Check out [Vite](https://vitejs.dev/) for a well-maintained Snowpack alternative.  \n> See also: [esbuild](https://esbuild.github.io/), [parcel](https://parceljs.org/)\n\n<h1>Snowpack</h1>\n\nSnowpack is a lightning-fast frontend build tool, designed to leverage JavaScript's native module system (<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import\">known as ESM</a>). It is an alternative to heavier, more complex bundlers like webpack or Parcel in your development workflow.\n\n### Key Features\n\n- Develop faster, with a dev server that starts up in **50ms or less.**\n- See changes reflected [instantly in the browser.](https://www.snowpack.dev/concepts/hot-module-replacement)\n- Integrate your favorite bundler for a [production-optimized build.](https://www.snowpack.dev/concepts/build-pipeline)\n- Enjoy out-of-the-box support for [TypeScript, JSX, CSS Modules and more.](https://www.snowpack.dev/reference/supported-files)\n- Connect your favorite tools with [third-party plugins.](https://www.snowpack.dev/plugins)\n\n**💁 More info at the official [Snowpack website ➞](https://snowpack.dev)**\n\n<br/>\n\n> **Contributor Guidelines:** [CONTRIBUTING.md](./CONTRIBUTING.md)  \n> **License:** [MIT](https://github.com/withastro/snowpack/blob/main/LICENSE)\n"
  },
  {
    "path": "create-snowpack-app/README.md",
    "content": "## 👉 [`create-snowpack-app`](./cli)\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-lit-element/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-scripts-lit-element\",\n  \"version\": \"2.0.0\",\n  \"main\": \"snowpack.config.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-scripts-lit-element#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-scripts-lit-element\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.14.0\",\n    \"@snowpack/plugin-babel\": \"^2.1.7\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-lit-element/snowpack.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst url = require('url');\n\nconst isTS = fs.existsSync(url.pathToFileURL(path.join(process.cwd(), 'tsconfig.json')));\n\nmodule.exports = {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: ['@snowpack/plugin-babel', '@snowpack/plugin-dotenv'],\n  devOptions: {},\n  packageOptions: {},\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-lit-element/tsconfig.base.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\",\n    /* more strict checking for errors that per-file transpilers like `esbuild` would crash */\n    \"isolatedModules\": true,\n    /* noEmit - We only use TypeScript for type checking. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/babel.config.json",
    "content": "{\n  \"presets\": [\n    [\n      \"@babel/preset-react\",\n      {\n        \"pragma\": \"h\",\n        \"pragmaFrag\": \"Fragment\"\n      }\n    ],\n    [\n      \"@babel/preset-typescript\",\n      {\n        \"jsxPragma\": \"h\"\n      }\n    ]\n  ],\n  \"env\": {\n    \"development\": {\n      \"plugins\": [\"@prefresh/babel-plugin\"]\n    }\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/jest/babelTransform.js",
    "content": "// @remove-file-on-eject\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n('use strict');\n\nconst babelJest = require('babel-jest');\n\nmodule.exports = babelJest.createTransformer({\n  presets: [\n    [\n      '@babel/preset-env',\n      {\n        targets: {\n          node: 'current',\n        },\n      },\n    ],\n    [\n      '@babel/preset-react',\n      {\n        pragma: 'h',\n        pragmaFrag: 'Fragment',\n      },\n    ],\n    [\n      '@babel/preset-typescript',\n      {\n        jsxPragma: 'h',\n      },\n    ],\n  ],\n});\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/jest/cssTransform.js",
    "content": "// @remove-on-eject-begin\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n// @remove-on-eject-end\n'use strict';\n\n// This is a custom Jest transformer turning style imports into empty objects.\n// http://facebook.github.io/jest/docs/en/webpack.html\n\nmodule.exports = {\n  process() {\n    return 'module.exports = {};';\n  },\n  getCacheKey() {\n    // The output is always the same.\n    return 'cssTransform';\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/jest/fileTransform.js",
    "content": "'use strict';\nconst path = require('path');\n\nmodule.exports = {\n  process(src, filename) {\n    const assetFilename = path.basename(filename);\n    return `module.exports = {\n      __esModule: true,\n      default: ${JSON.stringify(assetFilename)},\n    };`;\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/jest.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\n// Use this instead of `paths.testsSetup` to avoid putting\n// an absolute filename into configuration after ejecting.\n// const setupTestsFile = fs.existsSync(paths.testsSetup)\n//   ? `<rootDir>/src/setupTests.js`\n//   : undefined;\nconst setupTestsFile = true;\n\nmodule.exports = function () {\n  return {\n    verbose: true,\n\n    setupFiles: [require.resolve('react-app-polyfill/jsdom')],\n    setupFilesAfterEnv: setupTestsFile ? ['<rootDir>/jest.setup.js'] : [],\n    testMatch: [\n      '<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',\n      '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',\n    ],\n    transform: {\n      '^.+\\\\.(js|jsx|ts|tsx)$': path.resolve(__dirname, 'jest/babelTransform.js'),\n      '^.+\\\\.css$': path.resolve(__dirname, 'jest/cssTransform.js'),\n      '^(?!.*\\\\.(js|jsx|ts|tsx|css|json)$)': path.resolve(__dirname, 'jest/fileTransform.js'),\n    },\n    transformIgnorePatterns: ['node_modules'],\n    // transformIgnorePatterns: [\n    //   \"[/\\\\\\\\]node_modules[/\\\\\\\\].+\\\\.(js|jsx|ts|tsx)$\",\n    //   \"^.+\\\\.module\\\\.(css|sass|scss)$\",\n    // ],\n  };\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-scripts-preact\",\n  \"version\": \"2.0.1\",\n  \"main\": \"snowpack.config.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-scripts-preact#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-scripts-preact\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.14.0\",\n    \"@babel/preset-env\": \"^7.14.0\",\n    \"@babel/preset-react\": \"^7.13.13\",\n    \"@babel/preset-typescript\": \"^7.13.0\",\n    \"@prefresh/babel-plugin\": \"^0.4.1\",\n    \"@prefresh/snowpack\": \"^3.1.2\",\n    \"@snowpack/plugin-babel\": \"^2.1.7\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"babel-jest\": \"^26.6.3\",\n    \"react-app-polyfill\": \"^2.0.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/snowpack.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst cwd = process.cwd();\nconst isTS = fs.existsSync(path.join(cwd, 'tsconfig.json'));\n\nmodule.exports = {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: ['@snowpack/plugin-babel', '@prefresh/snowpack', '@snowpack/plugin-dotenv'],\n  packageOptions: {},\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-preact/tsconfig.base.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"jsxFactory\": \"h\",\n    \"baseUrl\": \"./\",\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\",\n    /* more strict checking for errors that per-file transpilers like `esbuild` would crash */\n    \"isolatedModules\": true,\n    /* noEmit - We only use TypeScript for type checking. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/babel.config.json",
    "content": "{\n  \"presets\": [[\"@babel/preset-react\"], \"@babel/preset-typescript\"]\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/jest/babelTransform.js",
    "content": "// @remove-file-on-eject\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nconst importMetaBabelPlugin = require('./importMetaBabelPlugin');\nconst babelJestModule = require('babel-jest');\nconst babelJest = babelJestModule.__esModule ? babelJestModule.default : babelJestModule;\n\nmodule.exports = babelJest.createTransformer({\n  presets: ['babel-preset-react-app', '@babel/preset-react', '@babel/preset-typescript'],\n  plugins: [[importMetaBabelPlugin]],\n});\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/jest/cssTransform.js",
    "content": "// @remove-on-eject-begin\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n// @remove-on-eject-end\n'use strict';\n\n// This is a custom Jest transformer turning style imports into empty objects.\n// http://facebook.github.io/jest/docs/en/webpack.html\n\nmodule.exports = {\n  process() {\n    return 'module.exports = {};';\n  },\n  getCacheKey() {\n    // The output is always the same.\n    return 'cssTransform';\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/jest/esbuildTransform.js",
    "content": "// NOTE: THIS IS CURRENTLY DISABLED UNTIL ESBUILD SUPPORTS ESM->CJS WITHOUT BUNDLING\n// SEE: https://github.com/evanw/esbuild/issues/109\n\n'use strict';\nconst path = require('path');\nconst execa = require('execa');\nconst esbuildPath = require.resolve('esbuild');\nconst esbuildBin = path.resolve(esbuildPath, '..', '..', 'bin', 'esbuild');\n\nmodule.exports = {\n  process(code, filename) {\n    const result = execa.sync(\n      esbuildBin,\n      [\n        `--loader=${path.extname(filename).substr(1)}`,\n        '--format=cjs',\n        '--platform=node',\n        '--target=es2019',\n      ],\n      {input: code},\n    );\n    return {code: result.stdout};\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/jest/fileTransform.js",
    "content": "'use strict';\nconst path = require('path');\n\nmodule.exports = {\n  process(src, filename) {\n    const assetFilename = path.basename(filename);\n    return `module.exports = {\n      __esModule: true,\n      default: ${JSON.stringify(assetFilename)},\n    };`;\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/jest/importMetaBabelPlugin.js",
    "content": "'use strict';\n\nconst template = require('@babel/template').default;\n\n/**\n * Add import.meta.env support\n * Note: import.meta.url is not supported at this time\n */\nmodule.exports = function importMetaBabelPlugin() {\n  const ast = template.ast(`\n  ({\n    env: {\n      ...Object.fromEntries(\n        Object.entries(process.env).filter(([k]) => /^SNOWPACK_PUBLIC_/.test(k)),\n      ),\n      MODE: 'test',\n      NODE_ENV: 'test',\n    },\n  })\n`);\n  return {\n    visitor: {\n      MetaProperty(path) {\n        path.replaceWith(ast);\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/jest.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\n// Use this instead of `paths.testsSetup` to avoid putting\n// an absolute filename into configuration after ejecting.\n// const setupTestsFile = fs.existsSync(paths.testsSetup)\n//   ? `<rootDir>/src/setupTests.js`\n//   : undefined;\nconst setupTestsFile = true;\n\nmodule.exports = function () {\n  return {\n    verbose: true,\n\n    setupFiles: [require.resolve('react-app-polyfill/jsdom')],\n    setupFilesAfterEnv: setupTestsFile ? ['<rootDir>/jest.setup.js'] : [],\n    testMatch: [\n      '<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',\n      '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',\n    ],\n    transform: {\n      '^.+\\\\.(js|jsx|ts|tsx)$': path.resolve(__dirname, 'jest/babelTransform.js'),\n      '^.+\\\\.css$': path.resolve(__dirname, 'jest/cssTransform.js'),\n      '^(?!.*\\\\.(js|jsx|ts|tsx|css|json)$)': path.resolve(__dirname, 'jest/fileTransform.js'),\n    },\n    transformIgnorePatterns: ['node_modules'],\n    testEnvironment: 'jsdom',\n    // transformIgnorePatterns: [\n    //   \"[/\\\\\\\\]node_modules[/\\\\\\\\].+\\\\.(js|jsx|ts|tsx)$\",\n    //   \"^.+\\\\.module\\\\.(css|sass|scss)$\",\n    // ],\n  };\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-scripts-react\",\n  \"version\": \"2.0.1\",\n  \"main\": \"snowpack.config.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-scripts-react#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-scripts-react\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.14.0\",\n    \"@babel/preset-react\": \"^7.13.13\",\n    \"@babel/preset-typescript\": \"^7.13.0\",\n    \"@snowpack/plugin-babel\": \"^2.1.7\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-react-refresh\": \"^2.5.0\",\n    \"@snowpack/plugin-typescript\": \"^1.2.1\",\n    \"babel-jest\": \"^27.2.2\",\n    \"babel-preset-react-app\": \"^10.0.0\",\n    \"react-app-polyfill\": \"^2.0.0\"\n  },\n  \"peerDependencies\": {\n    \"jest\": \"^27.2.2\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/snowpack.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst cwd = process.cwd();\nconst isTS = fs.existsSync(path.join(cwd, 'tsconfig.json'));\n\nmodule.exports = {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: [\n    '@snowpack/plugin-react-refresh',\n    '@snowpack/plugin-babel',\n    '@snowpack/plugin-dotenv',\n    ...(isTS ? ['@snowpack/plugin-typescript'] : []),\n  ],\n  devOptions: {},\n  packageOptions: {},\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-react/tsconfig.base.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\",\n    /* more strict checking for errors that per-file transpilers like `esbuild` would crash */\n    \"isolatedModules\": true,\n    /* noEmit - We only use TypeScript for type checking. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-svelte/jest/babelTransform.js",
    "content": "// @remove-file-on-eject\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\nconst fs = require('fs');\nconst path = require('path');\nconst babelJest = require('babel-jest');\nconst importMetaBabelPlugin = require('./importMetaBabelPlugin');\n\nconst userBabelConfig = getUserBabelConfig();\n\nmodule.exports = babelJest.createTransformer({\n  presets: [\n    [\n      '@babel/preset-env',\n      {\n        targets: {\n          node: 'current',\n        },\n      },\n    ],\n    ...(userBabelConfig.presets || []),\n  ],\n  plugins: [[importMetaBabelPlugin]],\n});\n\nfunction getUserBabelConfig() {\n  const userBabelConfigLoc = path.join(process.cwd(), 'babel.config.json');\n  if (fs.existsSync(userBabelConfigLoc)) {\n    return require(userBabelConfigLoc);\n  }\n\n  return {};\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-svelte/jest/importMetaBabelPlugin.js",
    "content": "'use strict';\n\nconst template = require('@babel/template').default;\n\n/**\n * Add import.meta.env support\n * Note: import.meta.url is not supported at this time\n */\nmodule.exports = function importMetaBabelPlugin() {\n  const ast = template.ast(`\n  ({\n    env: {\n      ...Object.fromEntries(\n        Object.entries(process.env).filter(([k]) => /^SNOWPACK_PUBLIC_/.test(k)),\n      ),\n      MODE: 'test',\n      NODE_ENV: 'test',\n    },\n  })\n`);\n  return {\n    visitor: {\n      MetaProperty(path) {\n        path.replaceWith(ast);\n      },\n    },\n  };\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-svelte/jest.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\n// Use this instead of `paths.testsSetup` to avoid putting\n// an absolute filename into configuration after ejecting.\n// const setupTestsFile = fs.existsSync(paths.testsSetup)\n//   ? `<rootDir>/src/setupTests.js`\n//   : undefined;\nconst setupTestsFile = true;\n\nmodule.exports = function () {\n  const userSvelteConfig = getUserSvelteConfig();\n\n  return {\n    testMatch: [\n      '<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',\n      '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',\n    ],\n    transform: {\n      '^.+\\\\.svelte$': ['jest-transform-svelte', {preprocess: userSvelteConfig.preprocess}],\n      '^.+\\\\.(js|ts)$': path.resolve(__dirname, 'jest/babelTransform.js'),\n    },\n    moduleFileExtensions: ['js', 'ts', 'svelte'],\n    testPathIgnorePatterns: ['node_modules'],\n    transformIgnorePatterns: ['node_modules'],\n    bail: false,\n    verbose: true,\n    setupFilesAfterEnv: setupTestsFile ? ['<rootDir>/jest.setup.js'] : [],\n  };\n};\n\nfunction getUserSvelteConfig() {\n  const userSvelteConfigLoc = path.join(process.cwd(), 'svelte.config.js');\n  if (fs.existsSync(userSvelteConfigLoc)) {\n    return require(userSvelteConfigLoc);\n  }\n\n  return {};\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-svelte/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-scripts-svelte\",\n  \"version\": \"2.0.1\",\n  \"main\": \"snowpack.config.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-scripts-svelte#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-scripts-svelte\"\n  },\n  \"peerDependencies\": {\n    \"svelte\": \"^3.21.0\"\n  },\n  \"devDependencies\": {\n    \"svelte\": \"^3.21.0\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.14.0\",\n    \"@babel/preset-typescript\": \"^7.13.0\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-svelte\": \"^3.6.1\",\n    \"babel-jest\": \"^26.6.3\",\n    \"jest-transform-svelte\": \"^2.1.1\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-svelte/snowpack.config.js",
    "content": "module.exports = {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: ['@snowpack/plugin-svelte', '@snowpack/plugin-dotenv'],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-vue/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-scripts-vue\",\n  \"version\": \"2.0.0\",\n  \"main\": \"snowpack.config.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-scripts-vue#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-scripts-vue\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.0.4\",\n    \"@snowpack/plugin-vue\": \"^2.2.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-vue/snowpack.config.js",
    "content": "module.exports = {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: ['@snowpack/plugin-vue', '@snowpack/plugin-dotenv'],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-scripts-vue/tsconfig.base.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"es2015\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\",\n    /* more strict checking for errors that per-file transpilers like `esbuild` would crash */\n    \"isolatedModules\": true,\n    /* noEmit - We only use TypeScript for type checking. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/.eleventy.js",
    "content": "module.exports = function (eleventyConfig) {\n  eleventyConfig.setTemplateFormats([\n    // Templates:\n    'html',\n    'njk',\n    'md',\n    // Static Assets:\n    'css',\n    'jpeg',\n    'jpg',\n    'png',\n    'svg',\n    'woff',\n    'woff2',\n  ]);\n  eleventyConfig.addPassthroughCopy('static');\n\n  return {\n    dir: {\n      input: '_template',\n      includes: '../_includes',\n      output: '_output',\n    },\n  };\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) or [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle) to your `snowpack.config.mjs` config file.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_includes/layouts/base.njk",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/static/favicon.png\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/static/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>  \n    <div class=\"banner\">\n      <img height=\"128px\" style=\"padding-right: 0\" id=\"img\" src=\"/static/logo.svg\" />\n      <svg height=\"32px\" aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"plus\" class=\"svg-inline--fa fa-plus fa-w-14\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"></path></svg>\n      <svg height=\"64px\" style=\"padding-left: 8px;\" viewBox=\"0 0 640 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n        <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"currentColor\" fill-rule=\"evenodd\">\n            <g id=\"mountain-solid\" transform=\"translate(-1.000000, 0.000000)\" fill-rule=\"nonzero\">\n                <path d=\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\" id=\"Shape\"></path>\n            </g>\n        </g>\n      </svg>\n    </div>\n\n    {{ content | safe }}\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_output/about/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/static/favicon.png\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/static/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>  \n    <div class=\"banner\">\n      <img height=\"128px\" style=\"padding-right: 0\" id=\"img\" src=\"/static/logo.svg\" />\n      <svg height=\"32px\" aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"plus\" class=\"svg-inline--fa fa-plus fa-w-14\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"></path></svg>\n      <svg height=\"64px\" style=\"padding-left: 8px;\" viewBox=\"0 0 640 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n        <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"currentColor\" fill-rule=\"evenodd\">\n            <g id=\"mountain-solid\" transform=\"translate(-1.000000, 0.000000)\" fill-rule=\"nonzero\">\n                <path d=\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\" id=\"Shape\"></path>\n            </g>\n        </g>\n      </svg>\n    </div>\n\n    <h1>About</h1>\n<p><a href=\"https://www.11ty.dev/\">11ty</a>, powered by <a href=\"http://snowpack.dev/\">Snowpack</a>.</p>\n<br/>\n<p><a href=\"/\">Back to Home</a></p>\n\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_output/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/static/favicon.png\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/static/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>  \n    <div class=\"banner\">\n      <img height=\"128px\" style=\"padding-right: 0\" id=\"img\" src=\"/static/logo.svg\" />\n      <svg height=\"32px\" aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"plus\" class=\"svg-inline--fa fa-plus fa-w-14\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\"></path></svg>\n      <svg height=\"64px\" style=\"padding-left: 8px;\" viewBox=\"0 0 640 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n        <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"currentColor\" fill-rule=\"evenodd\">\n            <g id=\"mountain-solid\" transform=\"translate(-1.000000, 0.000000)\" fill-rule=\"nonzero\">\n                <path d=\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\" id=\"Shape\"></path>\n            </g>\n        </g>\n      </svg>\n    </div>\n\n    \n<canvas id=\"canvas\"></canvas>\n<script type=\"module\" src=\"/dist/index.js\"></script>\n<a href=\"/about\">About Page</a>\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_output/static/index.css",
    "content": "body {\n  background: #222;\n  color: #eee;\n  font-family: Arial, Helvetica, sans-serif;\n  text-align: center;\n}\na {\n  color: #aaa;\n}\n.banner {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.banner img,\n.banner svg {\n  display: block;\n  padding: 1.5rem;\n}\n\n#canvas {\n  display: block;\n  margin: 0rem auto;\n  width: 720px;\n  height: 420px;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_template/about.md",
    "content": "---\nlayout: layouts/base.njk\n---\n\n# About\n\n[11ty](https://www.11ty.dev/), powered by [Snowpack](http://snowpack.dev/).\n\n<br/>\n\n[Back to Home](/)\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_template/index.njk",
    "content": "---\nlayout: layouts/base.njk\n---\n\n<canvas id=\"canvas\"></canvas>\n<script type=\"module\" src=\"/dist/index.js\"></script>\n<a href=\"/about\">About Page</a>"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_template/static/index.css",
    "content": "body {\n  background: #222;\n  color: #eee;\n  font-family: Arial, Helvetica, sans-serif;\n  text-align: center;\n}\na {\n  color: #aaa;\n}\n.banner {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.banner img,\n.banner svg {\n  display: block;\n  padding: 1.5rem;\n}\n\n#canvas {\n  display: block;\n  margin: 0rem auto;\n  width: 720px;\n  height: 420px;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/_template/static/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-11ty\",\n  \"description\": \"A preconfigured template for Snowpack with Eleventy\",\n  \"version\": \"2.0.1\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-11ty#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-11ty\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.js\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.js\\\"\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {\n    \"canvas-confetti\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"@11ty/eleventy\": \"^0.11.0\",\n    \"@snowpack/plugin-run-script\": \"^2.3.0\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.3.7\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    _output: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: [\n    ['@snowpack/plugin-run-script', { cmd: 'eleventy', watch: '$1 --watch' }],\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    // Eleventy updates multiple files at once, so add a 300ms delay before we trigger a browser update\n    hmrDelay: 300,\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-11ty/src/index.js",
    "content": "/**\n * This file is just a silly example to show everything working in the browser.\n * When you're ready to start on your site, clear the file. Happy hacking!\n **/\n\nimport confetti from 'canvas-confetti';\n\nconfetti.create(document.getElementById('canvas'), {\n  resize: true,\n  useWorker: true,\n})({ particleCount: 200, spread: 200 });\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-blank/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) or [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle) to your `snowpack.config.mjs` config file.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-blank\",\n  \"description\": \"A preconfigured template for Snowpack with Prettier\",\n  \"version\": \"2.2.0\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-blank#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-blank\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.js\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.js\\\"\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.3.7\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/dist/index.css\" />\n    <script type=\"module\" src=\"/dist/index.js\" defer></script>\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\"img\" src=\"/logo.svg\" />\n    <p>Page has been open for <code id=\"counter\">0</code> seconds.</p>\n    <p>\n      <a href=\"https://developer.mozilla.org/en-US/docs/Learn\">\n        Learn web development\n      </a>\n    </p>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <!--\n      This HTML file is a template.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: [\n    /* ... */\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/src/index.css",
    "content": "body {\n  font-size: calc(10px + 2vmin);\n  font-family: Arial, Helvetica, sans-serif;\n}\n\n#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\n\np {\n  display: block;\n  margin: 1rem auto;\n  text-align: center;\n}\n\n#counter {\n  background-color: rgb(46, 94, 130);\n  color: white;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n\na {\n  color: rgb(46, 94, 130);\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank/src/index.js",
    "content": "const counter = document.querySelector('#counter');\nlet seconds = 0;\n\nsetInterval(() => {\n  seconds += 1;\n  counter.textContent = seconds;\n}, 1000);\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) or [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle) to your `snowpack.config.mjs` config file.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-blank-typescript\",\n  \"description\": \"A preconfigured template for Snowpack with Typescript\",\n  \"version\": \"2.2.0\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-blank-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-blank-typescript\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.{ts,js}\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.{ts,js}\\\"\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"@snowpack/plugin-typescript\": \"^1.2.1\",\n    \"@types/snowpack-env\": \"^2.3.3\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.3.7\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/dist/index.css\" />\n    <script type=\"module\" src=\"/dist/index.js\" defer></script>\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\"img\" src=\"/logo.svg\" />\n    <p>Page has been open for <code id=\"counter\">0</code> seconds.</p>\n    <p>\n      <a href=\"https://developer.mozilla.org/en-US/docs/Learn\">\n        Learn web development\n      </a>\n    </p>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <!--\n      This HTML file is a template.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: [\n    [\n      '@snowpack/plugin-typescript',\n      {\n        /* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */\n        ...(process.versions.pnp ? { tsc: 'yarn pnpify tsc' } : {}),\n      },\n    ],\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/src/index.css",
    "content": "body {\n  font-size: calc(10px + 2vmin);\n  font-family: Arial, Helvetica, sans-serif;\n}\n\n#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\n\np {\n  display: block;\n  margin: 1rem auto;\n  text-align: center;\n}\n\n#counter {\n  background-color: rgb(46, 94, 130);\n  color: white;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n\na {\n  color: rgb(46, 94, 130);\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/src/index.ts",
    "content": "const counter = document.querySelector('#counter') as HTMLSpanElement;\nlet seconds = 0;\n\nsetInterval(() => {\n  seconds += 1;\n  counter.textContent = seconds.toString();\n}, 1000);\n\nexport {};\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/tsconfig.json",
    "content": "{\n  \"include\": [\"src\", \"types\"],\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    /* paths - import rewriting/resolving */\n    \"paths\": {\n      // If you configured any Snowpack aliases, add them here.\n      // Add this line to get types for streaming imports (packageOptions.source=\"remote\"):\n      //     \"*\": [\".snowpack/types/*\"]\n      // More info: https://www.snowpack.dev/guides/streaming-imports\n    },\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\",\n    /* more strict checking for errors that per-file transpilers like `esbuild` would crash */\n    \"isolatedModules\": true,\n    /* noEmit - We only use TypeScript for type checking. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"useDefineForClassFields\": true\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-blank-typescript/types/static.d.ts",
    "content": "/* Use this file to declare any custom file extensions for importing */\n/* Use this folder to also add/extend a package d.ts file, if needed. */\n\n/* CSS MODULES */\ndeclare module '*.module.css' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.scss' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.sass' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.less' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.styl' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\n\n/* CSS */\ndeclare module '*.css';\ndeclare module '*.scss';\ndeclare module '*.sass';\ndeclare module '*.less';\ndeclare module '*.styl';\n\n/* IMAGES */\ndeclare module '*.svg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.bmp' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.gif' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpeg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.png' {\n  const ref: string;\n  export default ref;\n}\n\n/* CUSTOM: ADD YOUR OWN HERE */\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds the app for production to the `dist/` folder.\nIt correctly bundles the app in production mode and optimizes the build for the best performance.\n\n## Directives\n\nIn case you need to add a directive like `classMap` you should add the extension to the import:\n\n```\nimport { classMap } from \"lit-html/directives/class-map.js\";\n```\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/babel.config.json",
    "content": "{\n  \"plugins\": [\n    [\"@babel/plugin-proposal-decorators\", { \"decoratorsBeforeExport\": true }],\n    [\"@babel/plugin-proposal-class-properties\", { \"loose\": true }]\n  ]\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-lit-element\",\n  \"description\": \"A preconfigured template for Snowpack with LitElement\",\n  \"version\": \"2.1.2\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-lit-element#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-lit-element\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.js\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.js\\\"\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {\n    \"lit-element\": \"^2.4.0\",\n    \"lit-html\": \"^1.4.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/plugin-proposal-class-properties\": \"^7.13.0\",\n    \"@babel/plugin-proposal-decorators\": \"^7.13.15\",\n    \"@snowpack/plugin-babel\": \"^2.1.7\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.3.7\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/public/index.css",
    "content": "body {\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n  color: white;\n  margin: 0;\n  padding: 0;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <app-root></app-root>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: ['@snowpack/plugin-babel', '@snowpack/plugin-dotenv'],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/src/app-root.js",
    "content": "import { customElement, property, LitElement, html, css } from 'lit-element';\n\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n  @property() message = 'Learn LitElement';\n\n  static get styles() {\n    return css`\n      h1 {\n        font-size: 4rem;\n      }\n      .wrapper {\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        flex-direction: column;\n        height: 100vh;\n        background-color: #2196f3;\n        background: linear-gradient(315deg, #b4d2ea 0%, #2196f3 100%);\n        font-size: 24px;\n      }\n      .link {\n        color: white;\n      }\n    `;\n  }\n\n  render() {\n    return html`\n      <div class=\"wrapper\">\n        <h1>LitElement + Snowpack</h1>\n        <p>Edit <code>src/app-root.js</code> and save to reload.</p>\n        <a\n          class=\"link\"\n          href=\"https://lit-element.polymer-project.org/\"\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n        >\n          ${this.message}\n        </a>\n      </div>\n    `;\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element/src/index.js",
    "content": "import './app-root';\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds the app for production to the `dist/` folder.\nIt correctly bundles the app in production mode and optimizes the build for the best performance.\n\n## Directives\n\nIn case you need to add a directive like `classMap` you should add the extension to the import:\n\n```\nimport { classMap } from \"lit-html/directives/class-map.js\";\n```\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/babel.config.json",
    "content": "{\n  \"presets\": [\"@babel/preset-typescript\"],\n  \"plugins\": [\n    [\"@babel/plugin-proposal-decorators\", { \"decoratorsBeforeExport\": true }],\n    [\"@babel/plugin-proposal-class-properties\", { \"loose\": true }]\n  ]\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-lit-element-typescript\",\n  \"description\": \"A preconfigured template for Snowpack with TypeScript and LitElement\",\n  \"version\": \"2.1.3\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-lit-element-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-lit-element-typescript\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.ts\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.ts\\\"\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {\n    \"lit-element\": \"^2.4.0\",\n    \"lit-html\": \"^1.4.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/plugin-proposal-class-properties\": \"^7.13.0\",\n    \"@babel/plugin-proposal-decorators\": \"^7.13.15\",\n    \"@babel/preset-typescript\": \"^7.13.0\",\n    \"@snowpack/plugin-babel\": \"^2.1.7\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-typescript\": \"^1.2.1\",\n    \"@types/snowpack-env\": \"^2.3.3\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.3.7\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/public/index.css",
    "content": "body {\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\n  color: white;\n  margin: 0;\n  padding: 0;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <app-root></app-root>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: [\n    '@snowpack/plugin-babel',\n    '@snowpack/plugin-dotenv',\n    [\n      '@snowpack/plugin-typescript',\n      {\n        /* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */\n        ...(process.versions.pnp ? { tsc: 'yarn pnpify tsc' } : {}),\n      },\n    ],\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/src/app-root.ts",
    "content": "import { customElement, property, LitElement, html, css } from 'lit-element';\n\n@customElement('app-root')\nexport class AppRoot extends LitElement {\n  @property() message = 'Learn LitElement';\n\n  static get styles() {\n    return css`\n      h1 {\n        font-size: 4rem;\n      }\n      .wrapper {\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        flex-direction: column;\n        height: 100vh;\n        background-color: #2196f3;\n        background: linear-gradient(315deg, #b4d2ea 0%, #2196f3 100%);\n        font-size: 24px;\n      }\n      .link {\n        color: white;\n      }\n    `;\n  }\n\n  render() {\n    return html`\n      <div class=\"wrapper\">\n        <h1>LitElement + Snowpack</h1>\n        <p>Edit <code>src/app-root.ts</code> and save to reload.</p>\n        <a\n          class=\"link\"\n          href=\"https://lit-element.polymer-project.org/\"\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n        >\n          ${this.message}\n        </a>\n      </div>\n    `;\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/src/index.ts",
    "content": "import './app-root';\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/tsconfig.json",
    "content": "{\n  \"include\": [\"src\", \"types\"],\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    /* paths - import rewriting/resolving */\n    \"paths\": {\n      // If you configured any Snowpack aliases, add them here.\n      // Add this line to get types for streaming imports (packageOptions.source=\"remote\"):\n      //     \"*\": [\".snowpack/types/*\"]\n      // More info: https://www.snowpack.dev/guides/streaming-imports\n    },\n    /* noEmit - Snowpack builds (emits) files, not tsc. */\n    \"noEmit\": true,\n    /* LitElement - Add decorator support! */\n    \"experimentalDecorators\": true,\n    \"emitDecoratorMetadata\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"types\": [\"snowpack-env\"],\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\"\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-lit-element-typescript/types/static.d.ts",
    "content": "/* Use this file to declare any custom file extensions for importing */\n/* Use this folder to also add/extend a package d.ts file, if needed. */\n\n/* CSS MODULES */\ndeclare module '*.module.css' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.scss' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.sass' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.less' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.styl' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\n\n/* CSS */\ndeclare module '*.css';\ndeclare module '*.scss';\ndeclare module '*.sass';\ndeclare module '*.less';\ndeclare module '*.styl';\n\n/* IMAGES */\ndeclare module '*.svg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.bmp' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.gif' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpeg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.png' {\n  const ref: string;\n  export default ref;\n}\n\n/* CUSTOM: ADD YOUR OWN HERE */\n"
  },
  {
    "path": "create-snowpack-app/app-template-minimal/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) or [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle) to your `snowpack.config.mjs` config file.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-minimal/index.css",
    "content": "/* Add CSS styles here! */\nbody {\n  font-family: sans-serif;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-minimal/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Starter Snowpack App\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Starter Snowpack App</title>\n  </head>\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n    <script type=\"module\" src=\"/index.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-minimal/index.js",
    "content": "/* Add JavaScript code here! */\nconsole.log('Hello World! You did it! Welcome to Snowpack :D');\n"
  },
  {
    "path": "create-snowpack-app/app-template-minimal/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-minimal\",\n  \"description\": \"A preconfigured minimal template for Snowpack\",\n  \"version\": \"2.1.1\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-minimal\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.3.7\"\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-minimal/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    /* ... */\n  },\n  plugins: [\n    /* ... */\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-preact/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm test\n\nLaunches the test runner in the interactive watch mode.\nSee the section about running tests for more information.\n\n### npm run build\n\nBuilds the app for production to the `build/` folder.\nIt correctly bundles Preact in production mode and optimizes the build for the best performance.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-preact\",\n  \"description\": \"A preconfigured template for Snowpack with Preact\",\n  \"version\": \"2.1.2\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-preact\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.{js,jsx}\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.{js,jsx}\\\"\",\n    \"test\": \"web-test-runner \\\"src/**/*.test.jsx\\\"\"\n  },\n  \"dependencies\": {\n    \"preact\": \"^10.5.13\"\n  },\n  \"devDependencies\": {\n    \"@prefresh/snowpack\": \"^3.0.0\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/web-test-runner-plugin\": \"^0.2.2\",\n    \"@testing-library/preact\": \"^2.0.1\",\n    \"@web/test-runner\": \"^0.13.3\",\n    \"chai\": \"^4.3.4\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.8.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: ['@snowpack/plugin-dotenv', '@prefresh/snowpack'],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n\n  alias: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n.App-logo {\n  height: 36vmin;\n  pointer-events: none;\n  margin-bottom: 3rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/src/App.jsx",
    "content": "import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport logo from './logo.png';\nimport './App.css';\n\nfunction App() {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Create the counter (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.jsx</code> and save to reload.\n        </p>\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n        <p>\n          <a\n            className=\"App-link\"\n            href=\"https://preactjs.com\"\n            target=\"_blank\"\n            rel=\"noopener noreferrer\"\n          >\n            Learn Preact\n          </a>\n        </p>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/src/App.test.jsx",
    "content": "import { h } from 'preact';\nimport { render } from '@testing-library/preact';\nimport { expect } from 'chai';\nimport App from './App';\n\ndescribe('<App>', () => {\n  it('renders learn react link', () => {\n    const { getByText } = render(<App />);\n    const linkElement = getByText(/learn preact/i);\n    expect(document.body.contains(linkElement));\n  });\n});\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/src/index.jsx",
    "content": "import { h, render } from 'preact';\nimport 'preact/devtools';\nimport App from './App.js';\nimport './index.css';\n\nrender(<App />, document.getElementById('root'));\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact/web-test-runner.config.js",
    "content": "process.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm test\n\nLaunches the test runner in the interactive watch mode.\nSee the section about running tests for more information.\n\n### npm run build\n\nBuilds the app for production to the `build/` folder.\nIt correctly bundles Preact in production mode and optimizes the build for the best performance.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-preact-typescript\",\n  \"description\": \"A preconfigured template for Snowpack with Preact and Typescript\",\n  \"version\": \"2.1.3\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-preact-typescript\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.{js,jsx}\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.{js,jsx}\\\"\",\n    \"test\": \"web-test-runner \\\"src/**/*.test.tsx\\\"\"\n  },\n  \"dependencies\": {\n    \"preact\": \"^10.5.13\"\n  },\n  \"devDependencies\": {\n    \"@prefresh/snowpack\": \"^3.0.0\",\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-typescript\": \"^1.2.1\",\n    \"@snowpack/web-test-runner-plugin\": \"^0.2.2\",\n    \"@testing-library/preact\": \"^2.0.1\",\n    \"@types/chai\": \"^4.2.17\",\n    \"@types/mocha\": \"^8.2.2\",\n    \"@web/test-runner\": \"^0.13.3\",\n    \"chai\": \"^4.3.4\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.8.0\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: [\n    '@prefresh/snowpack',\n    '@snowpack/plugin-dotenv',\n    [\n      '@snowpack/plugin-typescript',\n      {\n        /* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */\n        ...(process.versions.pnp ? { tsc: 'yarn pnpify tsc' } : {}),\n      },\n    ],\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n.App-logo {\n  height: 36vmin;\n  pointer-events: none;\n  margin-bottom: 3rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/src/App.test.tsx",
    "content": "import { h } from 'preact';\nimport { render } from '@testing-library/preact';\nimport { expect } from 'chai';\nimport App from './App';\n\ndescribe('<App>', () => {\n  it('renders learn react link', () => {\n    const { getByText } = render(<App />);\n    const linkElement = getByText(/learn preact/i);\n    expect(document.body.contains(linkElement));\n  });\n});\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/src/App.tsx",
    "content": "import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport logo from './logo.png';\nimport './App.css';\n\nfunction App() {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Create the counter (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.jsx</code> and save to reload.\n        </p>\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n        <p>\n          <a\n            className=\"App-link\"\n            href=\"https://preactjs.com\"\n            target=\"_blank\"\n            rel=\"noopener noreferrer\"\n          >\n            Learn Preact\n          </a>\n        </p>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/src/index.tsx",
    "content": "import { h, render } from 'preact';\nimport 'preact/devtools';\nimport App from './App.js';\nimport './index.css';\n\nconst root = document.getElementById('root')\n\nif (root) {\n  render(<App />, root);\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/tsconfig.json",
    "content": "{\n  \"include\": [\"src\", \"types\"],\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"jsxFactory\": \"h\",\n    \"baseUrl\": \"./\",\n    /* paths - import rewriting/resolving */\n    \"paths\": {\n      // If you configured any Snowpack aliases, add them here.\n      // Add this line to get types for streaming imports (packageOptions.source=\"remote\"):\n      //     \"*\": [\".snowpack/types/*\"]\n      // More info: https://www.snowpack.dev/guides/streaming-imports\n    },\n    /* noEmit - Snowpack builds (emits) files, not tsc. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"types\": [\"mocha\", \"snowpack-env\"],\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\"\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/types/static.d.ts",
    "content": "/* Use this file to declare any custom file extensions for importing */\n/* Use this folder to also add/extend a package d.ts file, if needed. */\n\n/* CSS MODULES */\ndeclare module '*.module.css' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.scss' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.sass' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.less' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.styl' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\n\n/* CSS */\ndeclare module '*.css';\ndeclare module '*.scss';\ndeclare module '*.sass';\ndeclare module '*.less';\ndeclare module '*.styl';\n\n/* IMAGES */\ndeclare module '*.svg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.bmp' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.gif' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpeg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.png' {\n  const ref: string;\n  export default ref;\n}\n\n/* CUSTOM: ADD YOUR OWN HERE */\n"
  },
  {
    "path": "create-snowpack-app/app-template-preact-typescript/web-test-runner.config.js",
    "content": "process.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-react/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like \"@snowpack/plugin-webpack\" to your `snowpack.config.mjs` config file.\n\n### npm test\n\nLaunches the application test runner.\nRun with the `--watch` flag (`npm test -- --watch`) to run in interactive watch mode.\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-react\",\n  \"description\": \"A preconfigured template for Snowpack with React\",\n  \"version\": \"2.1.2\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-react\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.{js,jsx}\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.{js,jsx}\\\"\",\n    \"test\": \"web-test-runner \\\"src/**/*.test.jsx\\\"\"\n  },\n  \"dependencies\": {\n    \"react\": \"^17.0.2\",\n    \"react-dom\": \"^17.0.2\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-react-refresh\": \"^2.5.0\",\n    \"@snowpack/web-test-runner-plugin\": \"^0.2.2\",\n    \"@testing-library/react\": \"^11.2.6\",\n    \"@web/test-runner\": \"^0.13.3\",\n    \"chai\": \"^4.3.4\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.8.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: ['@snowpack/plugin-react-refresh', '@snowpack/plugin-dotenv'],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/src/App.jsx",
    "content": "import React, { useState, useEffect } from 'react';\nimport logo from './logo.svg';\nimport './App.css';\n\nfunction App() {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Create the counter (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.jsx</code> and save to reload.\n        </p>\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n        <p>\n          <a\n            className=\"App-link\"\n            href=\"https://reactjs.org\"\n            target=\"_blank\"\n            rel=\"noopener noreferrer\"\n          >\n            Learn React\n          </a>\n        </p>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/src/App.test.jsx",
    "content": "import * as React from 'react';\nimport { render } from '@testing-library/react';\nimport { expect } from 'chai';\nimport App from './App';\n\ndescribe('<App>', () => {\n  it('renders learn react link', () => {\n    const { getByText } = render(<App />);\n    const linkElement = getByText(/learn react/i);\n    expect(document.body.contains(linkElement));\n  });\n});\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/src/index.jsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App.jsx';\nimport './index.css';\n\nReactDOM.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n  document.getElementById('root'),\n);\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react/web-test-runner.config.js",
    "content": "process.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like \"@snowpack/plugin-webpack\" to your `snowpack.config.mjs` config file.\n\n### npm test\n\nLaunches the application test runner.\nRun with the `--watch` flag (`npm test -- --watch`) to run in interactive watch mode.\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-react-typescript\",\n  \"description\": \"A preconfigured template for Snowpack with React and TypeScript\",\n  \"version\": \"2.1.3\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-react-typescript\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"format\": \"prettier --write \\\"src/**/*.{js,jsx,ts,tsx}\\\"\",\n    \"lint\": \"prettier --check \\\"src/**/*.{js,jsx,ts,tsx}\\\"\",\n    \"test\": \"web-test-runner \\\"src/**/*.test.tsx\\\"\"\n  },\n  \"dependencies\": {\n    \"react\": \"^17.0.2\",\n    \"react-dom\": \"^17.0.2\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-react-refresh\": \"^2.5.0\",\n    \"@snowpack/plugin-typescript\": \"^1.2.1\",\n    \"@snowpack/web-test-runner-plugin\": \"^0.2.2\",\n    \"@testing-library/react\": \"^11.2.6\",\n    \"@types/chai\": \"^4.2.17\",\n    \"@types/mocha\": \"^8.2.2\",\n    \"@types/react\": \"^17.0.4\",\n    \"@types/react-dom\": \"^17.0.3\",\n    \"@types/snowpack-env\": \"^2.3.3\",\n    \"@web/test-runner\": \"^0.13.3\",\n    \"chai\": \"^4.3.4\",\n    \"prettier\": \"^2.2.1\",\n    \"snowpack\": \"^3.8.0\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: { url: '/', static: true },\n    src: { url: '/dist' },\n  },\n  plugins: [\n    '@snowpack/plugin-react-refresh',\n    '@snowpack/plugin-dotenv',\n    [\n      '@snowpack/plugin-typescript',\n      {\n        /* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */\n        ...(process.versions.pnp ? { tsc: 'yarn pnpify tsc' } : {}),\n      },\n    ],\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/src/App.test.tsx",
    "content": "import * as React from 'react';\nimport { render } from '@testing-library/react';\nimport { expect } from 'chai';\nimport App from './App';\n\ndescribe('<App>', () => {\n  it('renders learn react link', () => {\n    const { getByText } = render(<App />);\n    const linkElement = getByText(/learn react/i);\n    expect(document.body.contains(linkElement));\n  });\n});\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/src/App.tsx",
    "content": "import React, { useState, useEffect } from 'react';\nimport logo from './logo.svg';\nimport './App.css';\n\ninterface AppProps {}\n\nfunction App({}: AppProps) {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Create the counter (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.tsx</code> and save to reload.\n        </p>\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n        <p>\n          <a\n            className=\"App-link\"\n            href=\"https://reactjs.org\"\n            target=\"_blank\"\n            rel=\"noopener noreferrer\"\n          >\n            Learn React\n          </a>\n        </p>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n    \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n    monospace;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/src/index.tsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport './index.css';\n\nReactDOM.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n  document.getElementById('root'),\n);\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/tsconfig.json",
    "content": "{\n  \"include\": [\"src\", \"types\"],\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    /* paths - import rewriting/resolving */\n    \"paths\": {\n      // If you configured any Snowpack aliases, add them here.\n      // Add this line to get types for streaming imports (packageOptions.source=\"remote\"):\n      //     \"*\": [\".snowpack/types/*\"]\n      // More info: https://www.snowpack.dev/guides/streaming-imports\n    },\n    /* noEmit - Snowpack builds (emits) files, not tsc. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"types\": [\"mocha\", \"snowpack-env\"],\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\"\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/types/static.d.ts",
    "content": "/* Use this file to declare any custom file extensions for importing */\n/* Use this folder to also add/extend a package d.ts file, if needed. */\n\n/* CSS MODULES */\ndeclare module '*.module.css' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.scss' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.sass' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.less' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\ndeclare module '*.module.styl' {\n  const classes: { [key: string]: string };\n  export default classes;\n}\n\n/* CSS */\ndeclare module '*.css';\ndeclare module '*.scss';\ndeclare module '*.sass';\ndeclare module '*.less';\ndeclare module '*.styl';\n\n/* IMAGES */\ndeclare module '*.svg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.bmp' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.gif' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpeg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.png' {\n  const ref: string;\n  export default ref;\n}\n\n/* CUSTOM: ADD YOUR OWN HERE */\n"
  },
  {
    "path": "create-snowpack-app/app-template-react-typescript/web-test-runner.config.js",
    "content": "process.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm test\n\nLaunches the test runner in the interactive watch mode.\nSee the section about running tests for more information.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) or [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle) to your `snowpack.config.mjs` config file.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-svelte\",\n  \"description\": \"A preconfigured template for Snowpack with Svelte\",\n  \"version\": \"2.1.2\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-svelte\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"test\": \"web-test-runner \\\"src/**/*.test.js\\\"\"\n  },\n  \"dependencies\": {\n    \"svelte\": \"^3.37.0\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-svelte\": \"^3.6.1\",\n    \"@snowpack/web-test-runner-plugin\": \"^0.2.2\",\n    \"@testing-library/svelte\": \"^3.0.3\",\n    \"@web/test-runner\": \"^0.13.3\",\n    \"chai\": \"^4.3.4\",\n    \"snowpack\": \"^3.8.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: ['@snowpack/plugin-svelte', '@snowpack/plugin-dotenv'],\n  routes: [\n    /* Example: Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/src/App.svelte",
    "content": "<script>\n  import {onMount} from 'svelte';\n  let count = 0;\n  onMount(() => {\n    const interval = setInterval(() => count++, 1000);\n    return () => {\n      clearInterval(interval);\n    };\n  });\n</script>\n\n<style>\n  :global(body) {\n    margin: 0;\n    font-family: Arial, Helvetica, sans-serif;\n  }\n  .App {\n    text-align: center;\n  }\n  .App code {\n    background: #0002;\n    padding: 4px 8px;\n    border-radius: 4px;\n  }\n  .App p {\n    margin: 0.4rem;\n  }\n\n  .App-header {\n    background-color: #f9f6f6;\n    color: #333;\n    min-height: 100vh;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    font-size: calc(10px + 2vmin);\n  }\n  .App-link {\n    color: #ff3e00;\n  }\n  .App-logo {\n    height: 36vmin;\n    pointer-events: none;\n    margin-bottom: 3rem;\n    animation: App-logo-pulse infinite 1.6s ease-in-out alternate;\n  }\n  @keyframes App-logo-pulse {\n    from {\n      transform: scale(1);\n    }\n    to {\n      transform: scale(1.06);\n    }\n  }\n</style>\n\n<div class=\"App\">\n  <header class=\"App-header\">\n    <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n    <p>Edit <code>src/App.svelte</code> and save to reload.</p>\n    <p>Page has been open for <code>{count}</code> seconds.</p>\n    <p>\n      <a class=\"App-link\" href=\"https://svelte.dev\" target=\"_blank\" rel=\"noopener noreferrer\">\n        Learn Svelte\n      </a>\n    </p>\n  </header>\n</div>\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/src/App.test.js",
    "content": "import {render} from '@testing-library/svelte';\nimport {expect} from 'chai';\nimport App from './App.svelte';\n\ndescribe('<App>', () => {\n  it('renders learn svelte link', () => {\n    const {getByText} = render(App);\n    const linkElement = getByText(/learn svelte/i);\n    expect(document.body.contains(linkElement));\n  });\n});\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/src/index.js",
    "content": "import App from './App.svelte';\n\nlet app = new App({\n  target: document.body,\n});\n\nexport default app;\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n  import.meta.hot.dispose(() => {\n    app.$destroy();\n  });\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte/web-test-runner.config.js",
    "content": "process.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/CHANGELOG.md",
    "content": "# @snowpack/app-template-svelte-typescript\n\n## 2.1.5\n\n### Patch Changes\n\n- fed2c940: Remove default language option as its use is discouraged\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm test\n\nLaunches the test runner in the interactive watch mode.\nSee the section about running tests for more information.\n\n### npm run build\n\nBuilds a static copy of your site to the `build/` folder.\nYour app is ready to be deployed!\n\n**For the best production performance:** Add a build bundler plugin like [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) or [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle) to your `snowpack.config.mjs` config file.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-svelte-typescript\",\n  \"description\": \"A preconfigured template for Snowpack with Svelte and TypeScript\",\n  \"version\": \"2.1.5\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-svelte-typescript\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"test\": \"web-test-runner \\\"src/**/*.test.ts\\\"\"\n  },\n  \"dependencies\": {\n    \"svelte\": \"^3.37.0\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.2.0\",\n    \"@snowpack/plugin-svelte\": \"^3.6.1\",\n    \"@snowpack/plugin-typescript\": \"^1.2.1\",\n    \"@snowpack/web-test-runner-plugin\": \"^0.2.2\",\n    \"@testing-library/svelte\": \"^3.0.3\",\n    \"@tsconfig/svelte\": \"^1.0.10\",\n    \"@types/chai\": \"^4.2.17\",\n    \"@types/mocha\": \"^8.2.2\",\n    \"@types/snowpack-env\": \"^2.3.3\",\n    \"@web/test-runner\": \"^0.13.3\",\n    \"chai\": \"^4.3.4\",\n    \"snowpack\": \"^3.8.8\",\n    \"svelte-preprocess\": \"^4.7.2\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: [\n    '@snowpack/plugin-svelte',\n    '@snowpack/plugin-dotenv',\n    [\n      '@snowpack/plugin-typescript',\n      {\n        /* Yarn PnP workaround: see https://www.npmjs.com/package/@snowpack/plugin-typescript */\n        ...(process.versions.pnp ? {tsc: 'yarn pnpify tsc'} : {}),\n      },\n    ],\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/src/App.svelte",
    "content": "<script lang=\"ts\">\n  import {onMount} from 'svelte'\n\n  let count: number = 0\n  onMount(() => {\n    const interval = setInterval(() => count++, 1000)\n    return () => {\n      clearInterval(interval)\n    }\n  })\n</script>\n\n<style>\n  :global(body) {\n    margin: 0;\n    font-family: Arial, Helvetica, sans-serif;\n  }\n\n  .App {\n    text-align: center;\n  }\n\n  .App code {\n    background: #0002;\n    padding: 4px 8px;\n    border-radius: 4px;\n  }\n\n  .App p {\n    margin: 0.4rem;\n  }\n\n  .App-header {\n    background-color: #f9f6f6;\n    color: #333;\n    min-height: 100vh;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    font-size: calc(10px + 2vmin);\n  }\n\n  .App-link {\n    color: #ff3e00;\n  }\n\n  .App-logo {\n    height: 36vmin;\n    pointer-events: none;\n    margin-bottom: 3rem;\n    animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n  }\n\n  @keyframes App-logo-spin {\n    from {\n      transform: scale(1);\n    }\n    to {\n      transform: scale(1.06);\n    }\n  }\n</style>\n\n<div class=\"App\">\n  <header class=\"App-header\">\n    <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\"/>\n    <p>Edit <code>src/App.svelte</code> and save to reload.</p>\n    <p>Page has been open for <code>{count}</code> seconds.</p>\n    <p>\n      <a class=\"App-link\" href=\"https://svelte.dev\" target=\"_blank\" rel=\"noopener noreferrer\">\n        Learn Svelte\n      </a>\n    </p>\n  </header>\n</div>\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/src/App.test.ts",
    "content": "import {render} from '@testing-library/svelte';\nimport {expect} from 'chai';\nimport App from './App.svelte';\n\ndescribe('<App>', () => {\n  it('renders learn svelte link', () => {\n    const {getByText} = render(App);\n    const linkElement = getByText(/learn svelte/i);\n    expect(document.body.contains(linkElement));\n  });\n});\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/src/index.ts",
    "content": "import App from './App.svelte';\n\nvar app = new App({\n  target: document.body,\n});\n\nexport default app;\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n  import.meta.hot.dispose(() => {\n    app.$destroy();\n  });\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/svelte.config.js",
    "content": "const autoPreprocess = require('svelte-preprocess');\n\nmodule.exports = {\n  preprocess: autoPreprocess(),\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/tsconfig.json",
    "content": "{\n  \"extends\": \"@tsconfig/svelte/tsconfig.json\",\n  \"include\": [\"src\", \"types\"],\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    /* paths - import rewriting/resolving */\n    \"paths\": {\n      // If you configured any Snowpack aliases, add them here.\n      // Add this line to get types for streaming imports (packageOptions.source=\"remote\"):\n      //     \"*\": [\".snowpack/types/*\"]\n      // More info: https://www.snowpack.dev/guides/streaming-imports\n    },\n    /* noEmit - Snowpack builds (emits) files, not tsc. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"types\": [\"mocha\", \"snowpack-env\"],\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"useDefineForClassFields\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\"\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/types/static.d.ts",
    "content": "/* Use this file to declare any custom file extensions for importing */\n/* Use this folder to also add/extend a package d.ts file, if needed. */\n\n/* CSS MODULES */\ndeclare module '*.module.css' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.scss' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.sass' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.less' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.styl' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\n\n/* CSS */\ndeclare module '*.css';\ndeclare module '*.scss';\ndeclare module '*.sass';\ndeclare module '*.less';\ndeclare module '*.styl';\n\n/* IMAGES */\ndeclare module '*.svg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.bmp' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.gif' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpeg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.png' {\n  const ref: string;\n  export default ref;\n}\n\n/* CUSTOM: ADD YOUR OWN HERE */\n"
  },
  {
    "path": "create-snowpack-app/app-template-svelte-typescript/web-test-runner.config.js",
    "content": "process.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-vue/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm test\n\n**⚠️ NOTE:** Vue 3 testing support is still in progress. This template does not ship with a test runner.\n\n### npm run build\n\nBuilds the app for production to the `build/` folder.\nIt correctly bundles Vue in production mode and optimizes the build for the best performance.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-vue\",\n  \"description\": \"A preconfigured template for Snowpack with Vue\",\n  \"version\": \"2.1.2\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-vue\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {\n    \"vue\": \"^3.0.11\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-vue\": \"^2.4.0\",\n    \"snowpack\": \"^3.3.7\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon-32x32.png\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: ['@snowpack/plugin-vue', '@snowpack/plugin-dotenv'],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/src/App.vue",
    "content": "<template>\n  <div class=\"App\">\n    <header class=\"App-header\">\n      <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n      <p>\n        Edit\n        <code>src/App.vue</code> and save to reload.\n      </p>\n      <a\n        class=\"App-link\"\n        href=\"https://vuejs.org\"\n        target=\"_blank\"\n        rel=\"noopener noreferrer\"\n      >{{ message }}</a>\n    </header>\n  </div>\n</template>\n\n<script>\nexport default {\n  data() {\n    return {\n      message: \"Learn Vue\"\n    };\n  }\n};\n</script>\n\n<style>\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\n</style>\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue/src/index.js",
    "content": "import {createApp} from 'vue';\nimport App from './App.vue';\n\nconst app = createApp(App);\napp.mount('#app');\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n  import.meta.hot.dispose(() => {\n    app.unmount();\n  });\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/.npmignore",
    "content": ".build\nbuild"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/README.md",
    "content": "# New Project\n\n> ✨ Bootstrapped with Create Snowpack App (CSA).\n\n## Available Scripts\n\n### npm start\n\nRuns the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n### npm test\n\n**⚠️ NOTE:** Vue 3 testing support is still in progress. This template does not ship with a test runner.\n\n### npm run build\n\nBuilds the app for production to the `build/` folder.\nIt correctly bundles Vue in production mode and optimizes the build for the best performance.\n\n### Q: What about Eject?\n\nNo eject needed! Snowpack guarantees zero lock-in, and CSA strives for the same.\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/package.json",
    "content": "{\n  \"name\": \"@snowpack/app-template-vue-typescript\",\n  \"description\": \"A preconfigured template for Snowpack with Vue and TypeScript\",\n  \"version\": \"2.1.2\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/app-template-vue-typescript\"\n  },\n  \"keywords\": [\n    \"csa-template\"\n  ],\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\",\n    \"type-check\": \"tsc\",\n    \"test\": \"echo \\\"This template does not include a test runner by default.\\\" && exit 1\"\n  },\n  \"dependencies\": {\n    \"vue\": \"^3.0.11\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.1.0\",\n    \"@snowpack/plugin-vue\": \"^2.4.0\",\n    \"snowpack\": \"^3.3.7\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon-32x32.png\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: {url: '/', static: true},\n    src: {url: '/dist'},\n  },\n  plugins: [\n    '@snowpack/plugin-vue',\n    '@snowpack/plugin-vue/plugin-tsx-jsx.js',\n    '@snowpack/plugin-dotenv',\n  ],\n  routes: [\n    /* Enable an SPA Fallback in development: */\n    // {\"match\": \"routes\", \"src\": \".*\", \"dest\": \"/index.html\"},\n  ],\n  optimize: {\n    /* Example: Bundle your final build: */\n    // \"bundle\": true,\n  },\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/src/App.vue",
    "content": "<template>\n  <div class=\"App\">\n    <header class=\"App-header\">\n      <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n      <p>\n        Edit\n        <code>src/App.vue</code> and save to reload.\n      </p>\n      <p class=\"App-tsx\">\n        <FooTsxVue />\n        <FooTsx />\n        <BarJsxVue />\n        <BarJsx />\n      </p>\n      <a class=\"App-link\" href=\"https://vuejs.org\" target=\"_blank\" rel=\"noopener noreferrer\">{{\n        state.message\n      }}</a>\n    </header>\n  </div>\n</template>\n\n<script lang=\"ts\">\nimport {defineComponent, reactive} from 'vue';\n\ninterface State {\n  message: string;\n}\n\nexport default defineComponent({\n  setup() {\n    const state = reactive({\n      message: 'Learn Vue',\n    });\n    return {\n      state,\n    };\n  },\n});\n</script>\n\n<style>\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n.App-tsx {\n  display: flex;\n}\n.App-tsx > div {\n  margin-left: 30px;\n  font-size: 16px;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\n</style>\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/src/index.js",
    "content": "import {createApp} from 'vue';\nimport App from './App.vue';\n\nconst app = createApp(App);\napp.mount('#app');\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n  import.meta.hot.dispose(() => {\n    app.unmount();\n  });\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/tsconfig.json",
    "content": "{\n  \"include\": [\"src\", \"types\"],\n  \"compilerOptions\": {\n    \"module\": \"esnext\",\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"baseUrl\": \"./\",\n    /* paths - import rewriting/resolving */\n    \"paths\": {\n      // If you configured any Snowpack aliases, add them here.\n      // Add this line to get types for streaming imports (packageOptions.source=\"remote\"):\n      //     \"*\": [\".snowpack/types/*\"]\n      // More info: https://www.snowpack.dev/guides/streaming-imports\n    },\n    /* noEmit - Snowpack builds (emits) files, not tsc. */\n    \"noEmit\": true,\n    /* Additional Options */\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"resolveJsonModule\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"importsNotUsedAsValues\": \"error\"\n  }\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/types/shims-vue.d.ts",
    "content": "declare module '*.vue' {\n  import {defineComponent} from 'vue';\n  const component: ReturnType<typeof defineComponent>;\n  export default component;\n}\n"
  },
  {
    "path": "create-snowpack-app/app-template-vue-typescript/types/static.d.ts",
    "content": "/* Use this file to declare any custom file extensions for importing */\n/* Use this folder to also add/extend a package d.ts file, if needed. */\n\n/* CSS MODULES */\ndeclare module '*.module.css' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.scss' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.sass' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.less' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\ndeclare module '*.module.styl' {\n  const classes: {[key: string]: string};\n  export default classes;\n}\n\n/* CSS */\ndeclare module '*.css';\ndeclare module '*.scss';\ndeclare module '*.sass';\ndeclare module '*.less';\ndeclare module '*.styl';\n\n/* IMAGES */\ndeclare module '*.svg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.bmp' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.gif' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.jpeg' {\n  const ref: string;\n  export default ref;\n}\ndeclare module '*.png' {\n  const ref: string;\n  export default ref;\n}\n\n/* CUSTOM: ADD YOUR OWN HERE */\n"
  },
  {
    "path": "create-snowpack-app/cli/README.md",
    "content": "# Create Snowpack App (CSA)\n\n```sh\nnpx create-snowpack-app new-dir --template @snowpack/app-template-NAME [--use-yarn | --use-pnpm | --no-install | --no-git]\n```\n\n## Official App Templates\n\n- [@snowpack/app-template-blank](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-blank)\n- [@snowpack/app-template-blank-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-blank-typescript)\n- [@snowpack/app-template-11ty](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-11ty)\n- [@snowpack/app-template-lit-element](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-lit-element)\n- [@snowpack/app-template-lit-element-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-lit-element-typescript)\n- [@snowpack/app-template-preact](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact)\n- [@snowpack/app-template-preact-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact-typescript)\n- [@snowpack/app-template-react](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react)\n- [@snowpack/app-template-react-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react-typescript)\n- [@snowpack/app-template-svelte](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte)\n- [@snowpack/app-template-svelte-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte-typescript)\n- [@snowpack/app-template-vue](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue)\n- [@snowpack/app-template-vue-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue-typescript)\n\n### Featured Community Templates\n\n- [snowpack-template-preset-env](https://github.com/argyleink/snowpack-template-preset-env) (PostCSS + Babel)\n- [11st-Starter-Kit](https://github.com/stefanfrede/11st-starter-kit) (11ty +\n  Snowpack + tailwindcss)\n- [app-template-rescript-react](https://github.com/jihchi/app-template-rescript-react) (ReScript & rescript-react on top of [@snowpack/app-template-react](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react))\n- [svelte-tailwind](https://github.com/agneym/svelte-tailwind-snowpack) (Adds PostCSS and TailwindCSS using [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess))\n- [snowpack-react-tailwind](https://github.com/mrkldshv/snowpack-react-tailwind) (React + Snowpack + Tailwindcss)\n- [hyperapp-snowpack](https://github.com/bmartel/hyperapp-snowpack) (Hyperapp + Snowpack + TailwindCSS)\n- [snowpack-vue-capacitor-2-demo](https://github.com/brodybits/snowpack-vue-capacitor-2-demo) Demo of Snowpack with Vue and [Capacitor mobile app framework](https://capacitorjs.com/) version 2, originally generated from `@snowpack/vue-template` template, see [discussion #905](https://github.com/withastro/snowpack/discussions/905)\n- [snowpack-react-ssr](https://github.com/matthoffner/snowpack-react-ssr) (React + Server Side Rendering)\n- [snowpack-app-template-preact-hmr-tailwind](https://github.com/Mozart409/snowpack-app-template-preact-hmr-tailwind) (Snowpack + Preact + HMR + Tailwindcss)\n- [snowpack-mdx-chakra](https://github.com/molebox/snowpack-mdx)(An opinionated template setup with MDX, Chakra-ui for styling, theme and components, and React Router v6 for routing.)\n- [app-template-sstt](https://github.com/LBrian/app-template-s2t2) (S2T2 - Snowpack + Svelte + Typescript + TailwindCSS)\n- [snowpack-svelte-ts-tw](https://github.com/GarrettCannon/snowpack-svelte-ts-tw) (Snowpack + Svelte + Typescript + TailwindCSS)\n- [snowpack-template-tailwind](https://github.com/jonalvarezz/snowpack-template-tailwind) (Snowpack + TailwindCSS + Autopublish to GitHub Pages)\n- [glimmer-snowpack](https://github.com/rajasegar/glimmer-snowpack) (Snowpack + [Glimmer.js](https://glimmerjs.com))\n- [snowpack-cycle](https://github.com/rajasegar/snowpack-cycle) (A pre-configured Snowpack app template for [Cycle.js](https://cycle.js.org))\n- [@snowpack-angular/template](https://github.com/YogliB/snowpack-angular/tree/main/templates/base) (A preconfigured template for Snowpack with [Angular](https://angular.io))\n- [snowpack-solid](https://github.com/amoutonbrady/snowpack-solid) (A pre-configured Snowpack app template for [Solid](https://github.com/ryansolid/solid))\n- [snowpack-template-ts-rust-wasm](https://github.com/jake-pauls/snowpack-template-ts-rust-wasm) (Snowpack + Typescript + Rust + WebAssembly)\n- PRs that add a link to this list are welcome!\n"
  },
  {
    "path": "create-snowpack-app/cli/createSnowpackApp.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst execa = require('execa');\nconst yargs = require('yargs-parser');\nconst {copy, removeSync} = require('fs-extra');\nconst colors = require('kleur');\n\nconst errorAlert = `${colors.red('[ERROR]')}`;\nconst errorLink = `${colors.dim(colors.underline('https://github.com/withastro/snowpack'))}`;\n\nfunction logError(msg) {\n  console.error(`${errorAlert} ${msg} ${errorLink}`);\n  process.exit(1);\n}\n\nfunction hasPmInstalled(packageManager) {\n  try {\n    execa.commandSync(`${packageManager} --version`);\n    return true;\n  } catch (err) {\n    return false;\n  }\n}\n\nfunction validateArgs(args) {\n  const {template, useYarn, usePnpm, force, target, install, verbose, git = true, _} = yargs(args);\n  const toInstall = install !== undefined ? install : true;\n  const toInitializeGitRepo = git !== undefined ? git : true;\n  if (useYarn && usePnpm) {\n    logError('You can not use Yarn and pnpm at the same time.');\n  }\n  if (useYarn && !hasPmInstalled('yarn')) {\n    logError(`Yarn doesn't seem to be installed.`);\n  }\n  if (usePnpm && !hasPmInstalled('pnpm')) {\n    logError(`pnpm doesn't seem to be installed.`);\n  }\n  if (!target && _.length === 2) {\n    logError('Missing --target directory.');\n  }\n  if (typeof template !== 'string') {\n    logError('Missing --template argument.');\n  }\n  if (_.length > 3) {\n    logError('Unexpected extra arguments.');\n  }\n  const targetDirectoryRelative = target || _[2];\n  const targetDirectory = path.resolve(process.cwd(), targetDirectoryRelative);\n  if (fs.existsSync(targetDirectory) && !force) {\n    logError(`${targetDirectory} already exists. Use \\`--force\\` to overwrite this directory.`);\n  }\n  return {\n    template,\n    useYarn,\n    usePnpm,\n    targetDirectoryRelative,\n    targetDirectory,\n    toInstall,\n    toInitializeGitRepo,\n    verbose,\n  };\n}\n\nasync function verifyProjectTemplate(isLocalTemplate, {template, dir}) {\n  let keywords;\n  if (isLocalTemplate) {\n    const packageManifest = path.join(dir, 'package.json');\n    keywords = require(packageManifest).keywords;\n  } else {\n    try {\n      const {stdout} = await execa('npm', ['info', template, 'keywords', '--json']);\n      keywords = JSON.parse(stdout);\n    } catch (err) {\n      console.log();\n      if (err.stderr) {\n        console.error(\n          `${errorAlert} Unable to find \"${colors.cyan(template)}\" in the npm registry.`,\n        );\n      } else {\n        console.log(err);\n      }\n      console.error(`${errorAlert} Cannot continue safely. Exiting...`);\n      process.exit(1);\n    }\n  }\n\n  if (!keywords || !keywords.includes('csa-template')) {\n    console.error(\n      `\\n${errorAlert} The template is not a CSA template (missing \"${colors.yellow(\n        'csa-template',\n      )}\" keyword in package.json), check the template name to make sure you are using the current template name.`,\n    );\n    console.error(`${errorAlert} Cannot continue safely. Exiting...`);\n    process.exit(1);\n  }\n}\n\nasync function cleanProject(dir) {\n  const packageManifest = path.join(dir, 'package.json');\n  removeSync(path.join(dir, 'package-lock.json'));\n  removeSync(path.join(dir, 'node_modules'));\n\n  const {scripts, webDependencies, dependencies, devDependencies} = require(packageManifest);\n  const {prepare, start, build, test, ...otherScripts} = scripts;\n  await fs.promises.writeFile(\n    packageManifest,\n    JSON.stringify(\n      {\n        scripts: {prepare, start, build, test, ...otherScripts},\n        webDependencies,\n        dependencies,\n        devDependencies,\n      },\n      null,\n      2,\n    ),\n  );\n\n  const gitignore = path.join(dir, '.gitignore');\n  if (!fs.existsSync(gitignore)) {\n    await fs.promises.writeFile(gitignore, ['.snowpack', 'build', 'node_modules'].join('\\n'));\n  }\n}\n\nasync function initializeGitRepo(targetDirectory) {\n  console.log(`\\n  - Initializing git repo.\\n`);\n  try {\n    await execa('git', ['init'], {cwd: targetDirectory});\n    await execa('git', ['add', '-A'], {cwd: targetDirectory});\n    await execa('git', ['commit', '-m', 'initial commit'], {\n      cwd: targetDirectory,\n    });\n    console.log(`  - ${colors.green('Success!')}`);\n  } catch (err) {\n    console.log(`  - ${colors.yellow('Could not complete git repository initialization.')}`);\n  }\n}\n\nconst {\n  template,\n  useYarn,\n  usePnpm,\n  toInstall,\n  toInitializeGitRepo,\n  targetDirectoryRelative,\n  targetDirectory,\n  verbose,\n} = validateArgs(process.argv);\n\nlet installer = 'npm';\nif (useYarn) {\n  installer = 'yarn';\n} else if (usePnpm) {\n  installer = 'pnpm';\n}\n\nconst isLocalTemplate = template.startsWith('.'); // must start with a `.` to be considered local\nconst installedTemplate = isLocalTemplate\n  ? path.resolve(process.cwd(), template) // handle local template\n  : path.join(targetDirectory, 'node_modules', template); // handle template from npm/yarn\n\n(async () => {\n  await verifyProjectTemplate(isLocalTemplate, {dir: installedTemplate, template});\n\n  console.log(`\\n  - Using template ${colors.cyan(template)}`);\n  console.log(`  - Creating a new project in ${colors.cyan(targetDirectory)}`);\n  fs.mkdirSync(targetDirectory, {recursive: true});\n  await fs.promises.writeFile(path.join(targetDirectory, 'package.json'), `{\"name\": \"my-csa-app\"}`);\n  // fetch from npm or GitHub if not local (which will be most of the time)\n  if (!isLocalTemplate) {\n    try {\n      await execa(\n        'npm',\n        ['install', template, '--ignore-scripts', '--loglevel', verbose ? 'verbose' : 'error'],\n        {\n          cwd: targetDirectory,\n          all: true,\n        },\n      );\n    } catch (err) {\n      // Only log output if the command failed\n      console.error(err.all);\n      throw err;\n    }\n  }\n  await copy(installedTemplate, targetDirectory);\n  await cleanProject(targetDirectory);\n\n  if (toInstall) {\n    console.log(`  - Installing package dependencies. This might take a couple of minutes.\\n`);\n\n    const npmInstallOptions = {\n      cwd: targetDirectory,\n      stdio: 'inherit',\n    };\n\n    function installProcess(packageManager) {\n      switch (packageManager) {\n        case 'npm':\n          return execa(\n            'npm',\n            ['install', '--loglevel', verbose ? 'verbose' : 'error'],\n            npmInstallOptions,\n          );\n        case 'yarn':\n          return execa('yarn', [verbose ? '--verbose' : '--silent'], npmInstallOptions);\n        case 'pnpm':\n          return execa(\n            'pnpm',\n            ['install', `--reporter=${verbose ? 'default' : 'silent'}`],\n            npmInstallOptions,\n          );\n        default:\n          throw new Error('Unspecified package installer.');\n      }\n    }\n\n    const npmInstallProcess = installProcess(installer);\n    npmInstallProcess.stdout && npmInstallProcess.stdout.pipe(process.stdout);\n    npmInstallProcess.stderr && npmInstallProcess.stderr.pipe(process.stderr);\n    await npmInstallProcess;\n  } else {\n    console.log(`  - Skipping \"${installer} install\" step\\n`);\n  }\n\n  if (toInitializeGitRepo) {\n    await initializeGitRepo(targetDirectory);\n  }\n\n  function formatCommand(command, description) {\n    return '  ' + command.padEnd(17) + colors.dim(description);\n  }\n\n  console.log(``);\n  console.log(colors.bold(colors.underline(`Quickstart:`)));\n  console.log(``);\n  console.log(`  cd ${targetDirectoryRelative}`);\n  console.log(`  ${installer} start`);\n  console.log(``);\n  console.log(colors.bold(colors.underline(`All Commands:`)));\n  console.log(``);\n  console.log(\n    formatCommand(\n      `${installer} install`,\n      `Install your dependencies. ${\n        toInstall ? '(We already ran this one for you!)' : '(You asked us to skip this step!)'\n      }`,\n    ),\n  );\n  console.log(formatCommand(`${installer} start`, 'Start your development server.'));\n  console.log(formatCommand(`${installer} run build`, 'Build your website for production.'));\n  console.log(formatCommand(`${installer} test`, 'Run your tests.'));\n  console.log(``);\n})();\n"
  },
  {
    "path": "create-snowpack-app/cli/index.js",
    "content": "#!/usr/bin/env node\n'use strict';\n\nconst currentVersion = process.versions.node;\nconst requiredMajorVersion = parseInt(currentVersion.split('.')[0], 10);\nconst minimumMajorVersion = 10;\n\nif (requiredMajorVersion < minimumMajorVersion) {\n  console.error(`Node.js v${currentVersion} is out of date and unsupported!`);\n  console.error(`Please use Node.js v${minimumMajorVersion} or higher.`);\n  process.exit(1);\n}\n\nrequire('./createSnowpackApp');\n"
  },
  {
    "path": "create-snowpack-app/cli/package.json",
    "content": "{\n  \"name\": \"create-snowpack-app\",\n  \"version\": \"1.10.0\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"create-snowpack-app/cli\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"bin\": {\n    \"create-snowpack-app\": \"./index.js\"\n  },\n  \"dependencies\": {\n    \"execa\": \"^5.1.1\",\n    \"fs-extra\": \"^9.0.0\",\n    \"kleur\": \"^4.1.1\",\n    \"yargs-parser\": \"^20.0.0\"\n  }\n}\n"
  },
  {
    "path": "docs/README.md",
    "content": "<h1>Documentation</h1>\n\n**📚 To read our documentation, please visit the official [Snowpack website ➞](https://snowpack.dev)**\n\n---\n\n**🙋 To contribute to our documentation, please read our [Contributor Guidelines ➞](../CONTRIBUTING.md#Documentation)**\n"
  },
  {
    "path": "docs/concepts/build-pipeline.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: The Build Pipeline\ndescription: Snowpack Build creates a production-ready website with or without a bundler\n---\n\n![build output example](/img/snowpack-build-example.png)\n\n`snowpack build` - When you're ready to deploy your application, run the build command to generate a static production build of your site. Building is tightly integrated with your dev setup so that you are guaranteed to get a near-exact copy of the same code that you saw during development.\n\n### Bundle for Production\n\n**You should be able to use a bundler because you want to, and not because you need to.** That was the original concept that Snowpack was designed to address. Snowpack treats bundling as an optional production optimization, which means you're free to skip over the extra complexity of bundling until you need it.\n\nBy default, `snowpack build` will build your site using the same unbundled approach as the `dev` command. This is fine for most projects, but you also may still want to bundle for production. Legacy browser support, code minification, code-splitting, tree-shaking, dead code elimination, and other performance optimizations can all be handled in Snowpack via bundling.\n\nBundlers normally require dozens or even hundreds of lines of configuration, but with Snowpack it's just a one-line plugin with no config required. This is possible because Snowpack builds your application _before_ sending it to the bundler, so the bundler never sees your custom source code (JSX, TS, Svelte, Vue, etc.) and instead needs to worry only about building common HTML, CSS, and JS.\n\n```js\n// Bundlers plugins are pre-configured to work with Snowpack apps.\n// No config required! You just need to install the plugin first.\n{\n  \"plugins\": [[\"@snowpack/plugin-webpack\"]]\n}\n```\n\nSee [our bundling guides](/guides/optimize-and-bundle) for more information about connecting bundled (or unbundled) optimization plugins for your production builds.\n\n## Legacy Browser Support\n\nYou can customize the set of browsers you'd like to support via the `package.json` \"browserslist\" property, going all the way back to IE11. This will be picked up when you run `snowpack build` to build for production.\n\n```js\n/* package.json */\n\"browserslist\": \">0.75%, not ie 11, not UCAndroid >0, not OperaMini all\",\n```\n\nIf you're worried about legacy browsers, you should also add a bundler to your production build. Check out our [section on bundling for deployment](/guides/optimize-and-bundle) for more info.\n\nNote: During development (`snowpack dev`) we perform no transpilation for older browsers. Make sure that you're using a modern browser during development.\n"
  },
  {
    "path": "docs/concepts/dev-server.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: The Dev Server\ndescription: Snowpack's dev server is fast because it only rebuilds the files you change. Powered by ESM (ES modules).\n---\n\n![dev command output example](/img/snowpack-dev-startup-2.png)\n\n`snowpack dev` - Snowpack's dev server is an instant dev environment for [unbundled development.](/concepts/how-snowpack-works) The dev server will build a file only when it's requested by the browser. That means that Snowpack can start up instantly (usually in **<50ms**) and scale to infinitely large projects without slowing down. In contrast, it's common to see 30+ second dev startup times when building large apps with a traditional bundler.\n\nSnowpack supports JSX & TypeScript source code by default. You can extend your build even further with [custom plugins](/plugins) that connect Snowpack with your favorite build tools: TypeScript, Babel, Vue, Svelte, PostCSS, Sass... go wild!\n"
  },
  {
    "path": "docs/concepts/hot-module-replacement.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: HMR + Fast Refresh\ndescription: Snowpack's ESM-powered unbundled development means near-instant single file builds that only take 10-25ms to load and update in the browser.\n---\n\nHot Module Replacement (HMR) is the ability to push file updates to the browser without triggering a full page refresh. Imagine changing some CSS, hitting save, and then instantly seeing your change reflected on the page without a refresh. That's HMR.\n\nHMR is not unique to Snowpack. However, Snowpack's ability to leverage ESM for unbundled development introduces near-instant single file builds that only take 10-25ms to load and update in the browser.\n\nSnowpack ships with ready, out-of-the-box HMR support for the following file types:\n\n- CSS\n- CSS Modules\n- JSON\n\nJavaScript HMR is also supported out-of-the-box, but often requires a few additional lines of code to properly integrate with your frontend framework's \"render\" function. See \"Enabling HMR + Fast Refresh\" below.\n\n## Fast Refresh\n\nIn addition to normal HMR, Snowpack also supports **Fast Refresh** for most popular frameworks like React, Preact and Svelte. Fast Refresh is a framework-specific enhancement to HMR, which applies single file updates in a way that preserves component state across updates. Changes to a `<Timer />` component, for example, would be applied without resetting the component's internal state.\n\nFast Refresh makes development even faster, especially when working on popups and other secondary view states that normally would require a click to re-open or re-visit after every change.\n\n## Enabling HMR + Fast Refresh\n\nSnowpack supports HMR for all popular frontend frameworks. **[Create Snowpack App (CSA)](https://github.com/withastro/snowpack/blob/main/create-snowpack-app) ships with HMR enabled by default.** You can setup HMR yourself with just a few lines of code, and Fast Refresh can be enabled automatically via plugin:\n\n- Preact: [@prefresh/snowpack](https://www.npmjs.com/package/@prefresh/snowpack)\n- React: [@snowpack/plugin-react-refresh](https://www.npmjs.com/package/@snowpack/plugin-react-refresh)\n- Svelte: [@snowpack/plugin-svelte](https://www.npmjs.com/package/@snowpack/plugin-svelte)\n- Vue (HMR only): [A few lines of code](https://github.com/withastro/snowpack/blob/main/create-snowpack-app/app-template-vue/src/index.js#L7-L14)\n\nFor more advanced HMR integrations, Snowpack created the [esm-hmr spec](https://github.com/snowpackjs/esm-hmr), a standard HMR API for any ESM-based dev environment:\n\n```js\n// HMR Code Snippet Example\nif (import.meta.hot) {\n  import.meta.hot.accept(({module}) => {\n    // Accept the module, apply it into your application.\n  });\n}\n```\n\nCheck out the full [ESM-HMR API reference](https://github.com/snowpackjs/esm-hmr) on GitHub.\n"
  },
  {
    "path": "docs/concepts/how-snowpack-works.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: How Snowpack Works\ndescription: Snowpack serves your application unbundled during development. Each file is built only once and is cached until it changes.\n---\n\n### Summary\n\n**Snowpack is a modern, lightweight build tool for faster web development.** Traditional JavaScript build tools like webpack and Parcel need to rebuild & rebundle entire chunks of your application every time you save a single file. This rebundling step introduces lag between hitting save on your changes and seeing them reflected in the browser.\n\nSnowpack serves your application **unbundled during development.** Each file needs to be built only once and then is cached forever. When a file changes, Snowpack rebuilds that single file. There's no time wasted re-bundling every change, just instant updates in the browser (made even faster via [Hot-Module Replacement (HMR)](/concepts/hot-module-replacement)). You can read more about this approach in our [Snowpack 2.0 Release Post.](/posts/2020-05-26-snowpack-2-0-release/)\n\nSnowpack's **unbundled development** still supports the same **bundled builds** that you're used to for production. When you go to build your application for production, you can plug in your favorite bundler via an official Snowpack plugin for Webpack or Rollup (coming soon). With Snowpack already handling your build, there's no complex bundler config required.\n\n**Snowpack gets you the best of both worlds:** fast, unbundled development with optimized performance in your bundled production builds.\n\n![webpack vs. snowpack diagram](/img/snowpack-unbundled-example-3.png)\n\n### Unbundled Development\n\n**Unbundled development** is the idea of shipping individual files to the browser during development. Files can still be built with your favorite tools (like Babel, TypeScript, Sass) and then loaded individually in the browser with dependencies thanks to ESM `import` and `export` syntax. Any time you change a file, Snowpack rebuilds only that file.\n\nThe alternative is **bundled development.** Almost every popular JavaScript build tool today focuses on bundled development. Running your entire application through a bundler introduces additional work and complexity to your dev workflow that is unnecessary now that ESM is widely supported. Every change -- on every save -- must be rebundled with the rest of your application before your changes can be reflected in your browser.\n\nUnbundled development has several advantages over the traditional bundled development approach:\n\n- Single-file builds are fast.\n- Single-file builds are deterministic.\n- Single-file builds are easier to debug.\n- Project size doesn’t affect dev speed.\n- Individual files cache better.\n\nThat last point is key: **Every file is built individually and cached indefinitely.** Your dev environment will never build a file more than once and your browser will never download a file twice (until it changes). This is the real power of unbundled development.\n\n### Using NPM Dependencies\n\nNPM packages are mainly published using a module syntax (Common.js, or CJS) that can't run on the web without some build processing. Even if you write your application using browser-native ESM `import` and `export` statements that would all run directly in the browser, trying to import any one npm package will force you back into bundled development.\n\n**Snowpack takes a different approach:** Instead of bundling your entire application for this one requirement, Snowpack processes your dependencies separately. Here's how it works:\n\n```\nnode_modules/react/**/*     -> http://localhost:3000/web_modules/react.js\nnode_modules/react-dom/**/* -> http://localhost:3000/web_modules/react-dom.js\n```\n\n1. Snowpack scans your website/application for all used npm packages.\n2. Snowpack reads these installed dependencies from your `node_modules` directory.\n3. Snowpack bundles all of your dependencies separately into single JavaScript files. For example: `react` and `react-dom` are converted to `react.js` and `react-dom.js`, respectively.\n4. Each resulting file can be run directly in the browser, and imported via ESM `import` statements.\n5. Because your dependencies rarely change, Snowpack rarely needs to rebuild them.\n\nAfter Snowpack builds your dependencies, any package can be imported and run directly in the browser with zero additional bundling or tooling required. This ability to import npm packages natively in the browser (without a bundler) is the foundation that all unbundled development and the rest of Snowpack is built on top of.\n\n```html\n<!-- This runs directly in the browser with `snowpack dev` -->\n<body>\n  <script type=\"module\">\n    import React from 'react';\n    console.log(React);\n  </script>\n</body>\n```\n"
  },
  {
    "path": "docs/guides/babel.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'Babel'\ntags: communityGuide\npublished: true\nimg: '/img/logos/babel.svg'\nimgBackground: '#323330'\ndescription: How to use Babel in your Snowpack project.\n---\n\n[Babel](https://babeljs.io/) is a popular JavaScript transpiler that includes a huge ecosystem of plugins.\n\n**You probably don't need Babel!** Snowpack has built-in support for JSX and TypeScript transpilation. Only use Babel if you need to customize how your JavaScript/TypeScript files are built using custom Babel plugins/presets.\n\n**To use Babel with Snowpack:** add the [@snowpack/plugin-babel](https://www.npmjs.com/package/@snowpack/plugin-babel) plugin to your project.\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    \"plugins\": [\n+     ['@snowpack/plugin-babel'],\n    ],\n  };\n```\n"
  },
  {
    "path": "docs/guides/connecting-tools.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: The Snowpack Guide to connecting your favorite tools\ndescription: 'How do you use your favorite tools in Snowpack? This Guide will help you get started'\npublished: true\n---\n\nOne of the most common questions we get is \"How do I connect my favorite tool to Snowpack?\" In this guide we'll go over the three different ways that you can integrate third-party tooling into your Snowpack dev environment or build pipeline:\n\n- Snowpack plugin\n- Integrated CLI script (via `@snowpack/plugin-run-script`)\n- Run separately, outside of Snowpack (ex: in your `package.json`)\n\n## Integrating a Tool With a Snowpack Plugin\n\nThe best way to connect a new tool to Snowpack is to search our [plugin catalog](/plugins) for a relevant plugin. Most likely, someone already created a plugin to help you integrate your favorite tool with ease.\n\nTo add a plugin first install using your package manager, then add the plugin name to the `plugins` section in your Snowpack configuration file. Many plugins have their own totally optional configuration options. These are covered in each plugin's documentation.\n\nFor example, if you'd like to use sass, you can install [`@snowpack/plugin-sass`\n](https://www.npmjs.com/package/@snowpack/plugin-sass) with npm:\n\n```bash\nnpm install @snowpack/plugin-sass\n```\n\nThen if you don't already have a Snowpack configuration file (`snowpack.config.mjs`) you can create one with this command:\n\n```bash\nsnowpack init\n```\n\nOpen up `snowpack.config.mjs` and add the name of your new plugin to the plugins object:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    plugins: [\n-    /* ... */\n+    '@snowpack/plugin-sass',\n    ],\n  };\n```\n\nWhat about the other optional configuration options? [The `@snowpack/plugin-sass` documentation](https://github.com/withastro/snowpack/tree/main/plugins/plugin-sass) lists all the options and where to put them in the `snowpack.config.mjs` file. If I wanted the `compressed` output `style` I'd turn the `@snowpack/plugin-sass` value into an array with an object containing the configuration:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    plugins: [\n-     '@snowpack/plugin-sass'\n+     ['@snowpack/plugin-sass', { style: 'compressed'}]\n    ],\n  };\n```\n\nIf there isn't a plugin yet, you might be interested in making one. Check out our [Plugin API](/reference/plugins)\n\n## Connect any other Script/CLI using plugin-run-script and plugin-build-script\n\nIf you can't find a plugin that fits your needs and don't want to write your own, you can also run CLI commands directly as a part of your build using one of our two utility plugins: `@snowpack/plugin-build-script` & `@snowpack/plugin-run-script`.\n\n#### @snowpack/plugin-build-script\n\n```js\n// snowpack.config.mjs\n// [npm install @snowpack/plugin-build-script]\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        cmd: 'postcss',\n        input: ['.css'],\n        output: ['.css'],\n      },\n    ],\n  ],\n};\n```\n\nThis plugin allows you to connect any CLI into your build process. Just give it a `cmd` CLI command that can take input from `stdin` and emit the build result via `stdout`. Check out the [plugin documentation](https://github.com/withastro/snowpack/tree/main/plugins/plugin-build-script) for more information.\n\n#### @snowpack/plugin-run-script\n\n```js\n// snowpack.config.mjs\n// [npm install @snowpack/plugin-run-script]\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-run-script',\n      {\n        cmd: 'eleventy',\n        watch: '$1 --watch',\n      },\n    ],\n  ],\n};\n```\n\nThis plugin allows you to run any CLI command as a part of your dev and build workflow. This plugin doesn't affect your build output, but it is useful for connecting developer tooling directly into Snowpack. Use this to add meaningful feedback to your dev console as you type, like TypeScript type-checking and ESLint lint errors. This doesn't affect how Snowpack builds your site. Check out the [plugin documentation](https://github.com/withastro/snowpack/tree/main/plugins/plugin-run-script) for more information.\n\n### Examples\n\n#### PostCSS\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        cmd: 'postcss',\n        input: ['.css'],\n        output: ['.css'],\n      },\n    ],\n  ],\n};\n```\n\nThe [`postcss-cli`](https://github.com/postcss/postcss-cli) package must be installed manually. You can configure PostCSS with a `postcss.config.js` file in your current working directory.\n\n#### ESLint\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-run-script',\n      {\n        cmd: 'eslint src --ext .js,.jsx,.ts,.tsx',\n        // Optional: Use npm package \"eslint-watch\" to run on every file change\n        watch: 'esw -w --clear src --ext .js,.jsx,.ts,.tsx',\n      },\n    ],\n  ],\n};\n```\n"
  },
  {
    "path": "docs/guides/hmr.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Hot Module Replacement (HMR)\ndescription: Enable Snowpack's Hot Module Replacement (HMR) on your development server.\npublished: false\n---\n\n<div class=\"stub\">\nThis article is a stub, you can help fix it by removing duplicate content from /concepts/hot-module-replacement and writing it in a <a href=\"https://diataxis.fr/how-to-guides/\">how-to guide format</a>\n</div>\n\nHot Module Replacement (HMR) is the ability for Snowpack to push file changes to the browser without triggering a full page refresh. This article is about enabling HMR and connecting to the HMR dev server.\n\nFor instructions on using HMR, refer to the `import.meta.hot` API documentation.\n\n### Is HMR Connected?\n\nYou can tell if HMR is connected by checking your browser dev console. If you see the following message, that means that HMR is enabled and connected.\n\n```\n[ESM-HMR] listening for file changes..\n```\n\n### Enable HMR: Snowpack Dev Server\n\nHMR is enabled by default when you run `snowpack dev`. The Snowpack dev server will add the necessary scripts for your browser, and no configuration is required for most users. You can toggle this support off during development via the [`devOptions.hmr` configuration option](/reference/configuration).\n\n### Enable HMR: Custom Server\n\n_Note: Full HMR is not yet supported. Only full page reloads are currently working. Follow updates here: [https://github.com/withastro/snowpack/issues/1935](https://github.com/withastro/snowpack/issues/1935)_\n\nIf you use your own server (ex: Rails) to serve your application during development, there are a couple of small steps to enable HMR.\n\nHMR is not enabled by default if you are using `snowpack build --watch` for local development (instead of `snowpack dev`). Set `devOptions.hmr: true` in your Snowpack configuration (or, use `--hmr`) to enable HMR support in your application.\n\nWe also recommend that you manually add the Snowpack HMR client to your HTML (development only, not needed in production):\n\n```html\n<!-- Load the script to enable HMR. -->\n<script type=\"module\" src=\"/_snowpack/hmr-client.js\"></script>\n```\n\n### Configuring HMR\n\nHMR is powered by a WebSocket connection between the client and Snowpack. If you are having trouble connecting to the client, you may need need to tell it where Snowpack's HMR Websocket server is running.\n\nFirst, make sure that `devOptions.hmr` is set to true. This guarantees that the HMR Websocket is running and ready to accept connections in both `dev` and `build`.\n\nBy default, the client will try to connect to the HMR server at the current host (ex: `localhost`) using one of two ports:\n\n- `snowpack dev`: The same port as the dev server\n- `snowpack build`: port `12321`\n\nYou can control this by setting `devOptions.hmrPort` manually via configuration or setting the following global script variable somewhere on the page **before** the `hmr-client.js` script runs:\n\n```html\n<!-- Optional: Set the HMR websocket URL, overrides default -->\n<script>\n  window.HMR_WEBSOCKET_URL = 'ws://localhost:4444';\n</script>\n<script type=\"module\" src=\"/_snowpack/hmr-client.js\"></script>\n```\n\n### Disable HMR\n\nSet `devOptions.hmr` to false to disable HMR in all cases.\n"
  },
  {
    "path": "docs/guides/https-ssl-certificates.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: SSL Certificates\ndescription: How to use HTTPs during development and generate SSL certifcates for your Snowpack build.\n---\n\n<div class=\"notification\">\nThis guide has an example repo:\n<a href=\"https://github.com/withastro/snowpack/tree/main/examples/https-ssl-certificates/\">\n    examples/https-ssl-certificates\n</a>\n</div>\n\n```\nnpm start -- --secure\n```\n\nSnowpack provides an easy way to use a local HTTPS server during development through the use of the `--secure` flag. When enabled, Snowpack will look for a `snowpack.key` and `snowpack.crt` file in the root directory and use that to create an HTTPS server with HTTP2 support enabled. Optionally, you may customize which TLS certificate and private key files by passing them directly to `devOptions.secure`.\n\n```js\nconst fs = require('fs');\n\nconst cert = fs.readFileSync('/path/to/server.crt');\nconst key = fs.readFileSync('/path/to/server.key');\n\nmodule.exports = {\n  devOptions: {\n    secure: {cert, key},\n  },\n};\n```\n\n### Generating SSL Certificates\n\nYou can automatically generate credentials for your project via either:\n\n- [devcert (no install required, but openssl is a prerequisite)](https://github.com/davewasmer/devcert-cli): `npx devcert-cli generate localhost`\n- [mkcert (install required)](https://github.com/FiloSottile/mkcert): `mkcert -install && mkcert -key-file snowpack.key -cert-file snowpack.crt localhost`\n\nIn most situations you should add personally generated certificate files (`snowpack.key` and `snowpack.crt`) to your `.gitignore` file.\n"
  },
  {
    "path": "docs/guides/jest.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'Jest'\ntags: communityGuide\nimg: '/img/logos/jest.svg'\nimgBackground: '#d14c53'\npublished: true\ndescription: How to use Jest, a popular test runner, with Snowpack.\n---\n\n[Jest](https://jestjs.io/) is a popular Node.js test runner for Node.js & web projects. Jest can be used with any frontend project as long as you configure how Jest should build your frontend files to run on Node.js. Many projects will try to manage this configuration for you, since it can get complicated.\n\nSnowpack ships pre-built Jest configuration files for several popular frameworks. If you need to use Jest for any reason,consider extending one of these packages:\n\n- React: [@snowpack/app-scripts-react](https://www.npmjs.com/package/@snowpack/app-scripts-react)\n- Preact: [@snowpack/app-scripts-preact](https://www.npmjs.com/package/@snowpack/app-scripts-preact)\n- Svelte: [@snowpack/app-scripts-svelte](https://www.npmjs.com/package/@snowpack/app-scripts-svelte)\n\nNote: You will need a `jest.setup.js` file in the root directory of your project.\n\n### Example\n\n```js\n// jest.config.js\n// Example: extending a pre-built Jest configuration file\nmodule.exports = {\n  ...require('@snowpack/app-scripts-preact/jest.config.js')(),\n};\n```\n"
  },
  {
    "path": "docs/guides/optimize-and-bundle.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Optimize & Bundle for Production\npublished: true\ndescription: How to optimize your Snowpack build for production, with or without a bundler.\n---\n\n`snowpack build` builds your site into web native JS, CSS, and HTML files. This \"unbundled\" deployment can be enough for small sites, but many developers prefer to optimize and bundle their final site for production performance.\n\nSnowpack can run all sorts of optimizations on your final build to handle legacy browser support, code minification, code-splitting, tree-shaking, dead code elimination, preloading, bundling, and more.\n\nSnowpack build optimizations come in two flavors: **built-in** (esbuild) & **plugin** (webpack, rollup, or whatever else you might like to run).\n\n### Option 1: Built-in Optimizations\n\nSnowpack recently released a built-in optimization pipeline powered by [esbuild](https://esbuild.github.io/). Using this built-in optimizer, you can now bundle, transpile, and minify your production builds 10x-100x faster than Webpack or Rollup. However, esbuild is still young and [not yet production-ready](https://esbuild.github.io/faq/#production-readiness). At the moment, we only recommended this for smaller projects.\n\n```js\n// snowpack.config.mjs\n// Example: Using Snowpack's built-in bundling support\nexport default {\n  optimize: {\n    bundle: true,\n    minify: true,\n    target: 'es2018',\n  },\n};\n```\n\nThe full supported interface is:\n\n```ts\nexport interface OptimizeOptions {\n  entrypoints: 'auto' | string[] | ((options: {files: string[]}) => string[]);\n  preload: boolean;\n  bundle: boolean;\n  loader?: {[ext: string]: Loader};\n  sourcemap: boolean | 'external' | 'inline' | 'both';\n  splitting: boolean;\n  treeshake: boolean;\n  manifest: boolean;\n  minify: boolean;\n  target: 'es2020' | 'es2019' | 'es2018' | 'es2017';\n}\n```\n\n### Option 2: Optimize Plugins\n\nSnowpack supports popular bundlers via plugin:\n\n- webpack (recommended!): [@snowpack/plugin-webpack](https://www.npmjs.com/package/@snowpack/plugin-webpack)\n- Rollup: [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle)\n\n**For now, we recommend using @snowpack/plugin-webpack until our built-in optimize support is more mature.**\n\nCheck out our [Plugins Catalog](/plugins) to browse all available Snowpack plugins, and read the [Plugins Guide](/guides/plugins) if you're interested in creating your own.\n"
  },
  {
    "path": "docs/guides/plugins.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Creating Your Own Plugin\ndescription: Learn the basics of our Plugin API through working examples.\n---\n\nA **Snowpack plugin** lets you extend Snowpack with new behaviors. Plugins can hook into different stages of the Snowpack build pipeline to add support for new file types and your favorite dev tools. Add plugins to support Svelte, compile Sass to CSS, convert SVGs to React components, bundle your final build, type check during development, and much more.\n\nThis guide takes you though creating and publishing your first plugin.\n\n- The basic structure of Snowpack plugins\n- How to choose the right hooks from the Snowpack Plugin API\n- How to publish your plugin and add it to our [Plugin](/plugins) directory\n\nPrerequisites: Snowpack plugins are written in JavaScript and run via Node.js so basic knowledge of both is required.\n\n## Creating and testing your first plugin\n\nIn this step you'll create a simple plugin scaffold that you can turn into a fuctional plugin based on the examples in the guide.\n\nCreate a directory for your plugin called `my-snowpack-plugin` and inside it create a `my-snowpack-plugin.js` file:\n\n```js\n// my-snowpack-plugin.js\n// Example: a basic Snowpack plugin file, customize the name of the file and the value of the name in the object\n// snowpackConfig = The Snowpack configuration object\n// pluginOptions = user-provided configuration options\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-snowpack-plugin',\n  };\n};\n```\n\nTo test your new plugin, run `npm init` to create a basic `package.json` then run `npm link` in your plugin’s directory to expose the plugin globally (on your development machine).\n\nFor testing, [create a new, example Snowpack project](/tutorials/getting-started) in a different directory. In your example Snowpack project, run `npm install && npm link my-snowpack-plugin` (use the name from your plugin’s `package.json`).\n\n> The alternative would be to use `npm install --save-dev path_to_your_plugin`, which would create the \"symlink-like\" entry in your example Snowpack project’s `package.json`\n\nIn your example Snowpack project, add your plugin to the `snowpack.config.mjs` along with any plugin options you’d like to test:\n\n```js\n// snowpack.config.mjs\n// Example: enabling a Snowpack plugin called \"my-snowpack-plugin\"\nexport default {\n  plugins: ['my-snowpack-plugin'],\n};\n```\n\n## Testing and Troubleshooting\n\n- TODO: create a full how to test procedure\n- HINT: Add `--verbose` to the command to see the steps, e.g. `snowpack dev --verbose` or `snowpack build --verbose`\n\n## Adding user-configurable options to your plugin\n\nTODO make this a real example\nIn this step, you'll learn how to add user-configurable options to your plugin and to use them in your plugin code.\n\nIn your example Snowpack project, instead of enabling the plugin as a string containing the plugin name, use an array. The first item is name of your plugin and the second a new object containing the plugin options.\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    plugins: [\n-     'my-snowpack-plugin'\n+     ['my-snowpack-plugin', { optionA: 'foo', optionB: true }]\n    ]\n  };\n```\n\nYou access these through the `pluginOptions`\n\n```diff\n  // my-snowpack-plugin.js\n  module.exports = function (snowpackConfig, pluginOptions) {\n+   let optionA = pluginOptions.optionA;\n+   let optionB = pluginOptions.optionB;\n    return {\n      name: 'my-snowpack-plugin',\n    };\n  };\n```\n\n### Plugin Use-Cases\n\nSnowpack uses an internal **Build Pipeline** to build files in your application for development and production. Every source file passes through the build pipeline, which means that Snowpack can build more than just JavaScript. Images, CSS, SVGs and more can all be built by Snowpack.\n\n#### Build Plugins\n\nSnowpack finds the first plugin that claims to `resolve` the given file. It then calls that plugin's `load()` method to load the file into your application. This is where compiled languages (TypeScript, Sass, JSX, etc.) are loaded and compiled to something that can run on the web (JS, CSS, etc).\n\n#### Transform Plugins\n\nOnce loaded, every file passes through the build pipeline again to run through matching `transform()` methods of all plugins that offer the method. Plugins can transform a file to modify its contents before finishing the file build.\n\n#### Dev Tooling Plugins\n\nSnowpack plugins support a `run()` method which lets you run any CLI tool and connect its output into Snowpack. You can use this to run your favorite dev tools (linters, TypeScript, etc.) with Snowpack and automatically report their output back through the Snowpack developer console. If the command fails, you can optionally fail your production build.\n\n#### Bundler Plugins\n\nSnowpack builds you a runnable, unbundled website by default, but you can optimize this final build with your favorite bundler (webpack, Rollup, Parcel, etc.) through the plugin `optimize()` method. When a bundler plugin is used, Snowpack will run the bundler on your build automatically to optimize it.\n\nSee our official [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack) bundler plugin for an example of using the current interface.\n\n### Example: Getting Started\n\nTo create a Snowpack plugin, you can start with the following file template:\n\n```js\n// my-snowpack-plugin.js\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-snowpack-plugin',\n    // ...\n  };\n};\n```\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      './my-snowpack-plugin.js',\n      {\n        optionA: 'foo',\n        optionB: 'bar',\n      },\n    ],\n  ],\n};\n```\n\nA Snowpack plugin should be distributed as a function that can be called with plugin-specific options to return a plugin object.\nSnowpack will automatically call this function to load your plugin. That function accepts 2 parameters, in this order:\n\n1. the [Snowpack configuration object](/reference/configuration) (`snowpackConfig`)\n1. (optional) user-provided config options (`pluginOptions`)\n\n### Example: Transform a File\n\nFor our first example, we’ll look at transforming a file.\n\n```js\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-commenter-plugin',\n    async transform({id, contents, isDev, fileExt}) {\n      if (fileExt === '.js') {\n        return `/* I’m a comment! */ ${contents}`;\n      }\n    },\n  };\n};\n```\n\nThe object returned by this function is a **Snowpack Plugin**. A plugin consists of a `name` property and some hooks into the Snowpack lifecycle to customizes your build pipeline or dev environment. In the example above we have:\n\n- The **name** property: The name of your plugin. This is usually the same as your package name if published to npm.\n- The **transform** method: A function that allows you to transform & modify built files. In this case, we add a simple comment (`/* I’m a comment */`) to the beginning of every JS file in your build.\n\nThis covers the basics of single-file transformations. In our next example, we’ll show how to compile a source file and change the file extension in the process.\n\n### Example: Build From Source\n\nWhen you build files from source, you also have the ability to transform the file type from source code to web code. In this example, we'll use Babel to load several types of files as input and output JavaScript in the final build:\n\n```js\nconst babel = require('@babel/core');\n\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-babel-plugin',\n    resolve: {\n      input: ['.js', '.jsx', '.ts', '.tsx', '.mjs'],\n      output: ['.js'],\n    },\n    async load({filePath}) {\n      const result = await babel.transformFileAsync(filePath);\n      return result.code;\n    },\n  };\n};\n```\n\nThis is a simplified version of the official Snowpack Babel plugin, which builds all JavaScript, TypeScript, and JSX files in your application with the `load()` method.\n\nThe `load()` method is responsible for loading and build files from disk while the `resolve` property tells Snowpack which files the plugin can load and what to expect as output. In this case, the plugin claims responsibility for files matching any of the file extensions found in `resolve.input`, and outputs `.js` JavaScript (declared via `resolve.output`). `resolve.output` can also use a multi-part extension such as `.module.css` or `.hbs.js`—files will be matched from most specific extension to least.\n\n**See it in action:** Let's say that we have a source file at `src/components/App.jsx`. Because the `.jsx` file extension matches an extension in our plugin's `resolve.input` array, Snowpack lets this plugin claim responsibility for loading this file. `load()` executes, Babel builds the JSX input file from disk, and JavaScript is returned to the final build.\n\n### Example: Multi-File Building\n\nFor a more complicated example, we’ll take one input file (`.svelte`) and use it to generate 2 output files (`.js` and `.css`).\n\n```js\nconst fs = require('fs').promises;\nconst svelte = require('svelte/compiler');\n\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-svelte-plugin',\n    resolve: {\n      input: ['.svelte'],\n      output: ['.js', '.css'],\n    },\n    async load({filePath}) {\n      const fileContents = await fs.readFile(filePath, 'utf-8');\n      const {js, css} = svelte.compile(fileContents, {filename: filePath});\n      return {\n        '.js': js && js.code,\n        '.css': css && css.code,\n      };\n    },\n  };\n};\n```\n\nThis is a simplified version of the official Snowpack Svelte plugin. Don't worry if you're not familiar with Svelte, just know that building a Svelte file (`.svelte`) generates both JS & CSS for our final build.\n\nIn that case, the `resolve` property takes only a single `input` file type (`['.svelte']`) but two `output` file types (`['.js', '.css']`). This matches the result of Svelte's build process and the returned entries of our `load()` method.\n\n**See it in action:** Let's say that we have a source file at `src/components/App.svelte`. Because the `.svelte` file extension matches an extension in our plugin's `resolve.input` array, Snowpack lets this plugin claim responsibility for loading this file. `load()` executes, Svelte builds the file from disk, and both JavaScript & CSS are returned to the final build.\n\nNotice that `.svelte` is missing from `resolve.output` and isn't returned by `load()`. Only the files returned by the `load()` method are included in the final build. If you wanted your plugin to keep the original source file in your final build, you could add `{ '.svelte': contents }` to the return object.\n\n### Example: Server-Side Rendering (SSR)\n\nPlugins can produce server-optimized code for SSR via the `load()` plugin hook. The `isSSR` flag tells the plugin that Snowpack is requesting your file for the server, and that it will expect a response that will run on the server.\n\nSome frameworks/languages (like React) run the same code on both the browser and the server. Others (like Svelte) will create different output for the server than the browser. In the example below, we use the `isSSR` flag to tell the Svelte compiler to generate server-optimized code when requested by Snowpack.\n\n```js\nconst svelte = require('svelte/compiler');\nconst fs = require('fs');\n\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'basic-svelte-plugin',\n    resolve: {\n      input: ['.svelte'],\n      output: ['.js', '.css'],\n    },\n    async load({filePath, isSSR}) {\n      const svelteOptions = {\n        /* ... */\n      };\n      const codeToCompile = fs.readFileSync(filePath, 'utf-8');\n      const result = svelte.compile(codeToCompile, {\n        ...svelteOptions,\n        ssr: isSSR,\n      });\n      // ...\n    },\n  };\n};\n```\n\nIf you're not sure if your plugin needs special SSR support, you are probably fine to skip this and ignore the `isSSR` flag in your plugin. Many languages won't need this, and SSR is always an intentional opt-in by the user.\n\n### Example: Optimizing & Bundling\n\nSnowpack supports pluggable bundlers and other build optimizations via the `optimize()` hook. This method runs after the build and gives plugins a chance to optimize the final build directory. Webpack, Rollup, and other build-only optimizations should use this hook.\n\n```js\nmodule.exports = function(snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-custom-webpack-plugin',\n    async optimize({ buildDirectory }) {\n      await webpack.run({...});\n    }\n  };\n};\n```\n\nThis is an (obviously) simplified version of the `@snowpack/plugin-webpack` plugin. When the build command has finished building your application, this plugin hook is called with the `buildDirectory` path as an argument. It's up to the plugin to read build files from this directory and write any changes back to the directory. Changes should be made in place, so write files only at the end and be sure to clean up after yourself (if a file is no longer needed after optimizing/bundling, it is safe to remove).\n\n### Testing\n\nTo develop and test a Snowpack plugin, the strategy is the same as with other npm packages:\n\n- Create your new plugin project (either with `npm init` or `yarn init`) with, for example, npm name: `my-snowpack-plugin` and paste in it the above-mentioned code snipped\n- Run `npm link` in your plugin’s project folder to expose the plugin globally (in regard to your development machine).\n- Create a new, example Snowpack project in a different location for testing\n- In your example Snowpack project, run `npm install && npm link my-snowpack-plugin` (use the name from your plugin’s `package.json`).\n  - Be aware that `npm install` will remove your linked plugin, so on any install, you will need to redo the `npm link my-snowpack-plugin`.\n  - (The alternative would be to use `npm install --save-dev &lt;folder_to_your_plugin_project&gt;`, which would create the \"symlink-like\" entry in your example Snowpack project’s `package.json`)\n\nIn your example Snowpack project, add your plugin to the `snowpack.config.mjs` along with any plugin options you’d like to test:\n\n```js\nexport default {\n  plugins: [\n    [\n      'my-snowpack-plugin',\n      {\n        'option-1': 'testing',\n        'another-option': false,\n      },\n    ],\n  ],\n};\n```\n\n### Publishing a Plugin\n\nTo share a plugin with the world, you can publish it to npm. For example, take a look at [snowpack-plugin-starter-template](https://github.com/withastro/snowpack-plugin-starter-template) which can get you up-and-running quickly. You can either copy this outright or simply take what you need.\n\nIn general, make sure to mind the following checklist:\n\n- ✔️ Your `package.json` file has a `main` entry pointing to the final build\n- ✔️ Your code is compiled to run on Node >= 10\n- ✔️ Your package README contains a list of custom options, if your plugin is configurable\n\n### Tips / Gotchas\n\n- Remember: A source file will always be loaded by the first `load()` plugin to claim it, but the build result will be run through every `transform` function.\n- Snowpack will always keep the original file name (`App`) and only ever change the extension in the build.\n- Extensions in Snowpack always have a leading `.` character (e.g. `.js`, `.ts`). This is to match Node’s `path.extname()` behavior, as well as make sure we’re not matching extension substrings (e.g. if we matched `js` at the end of a file, we also don’t want to match `.mjs` files by accident; we want to be explicit there).\n- The `resolve.input` and `resolve.output` file extension arrays are vital to how Snowpack understands your build pipeline, and are always required for `load()` to run correctly.\n- If `load()` doesn't return anything, the file isn’t loaded and the `load()` of the next suitable plugin is called.\n- If `transform()` doesn't return anything, the file isn’t transformed.\n- If you want to build a plugin that runs some code only on initialization (such as `@snowpack/plugin-dotenv`), put your side-effect code inside the function that returns your plugin. But be sure to still return a plugin object. A simple `{ name }` object will do.\n"
  },
  {
    "path": "docs/guides/postcss.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'PostCSS'\ntags: communityGuide\npublished: true\nimg: '/img/logos/postcss.svg'\nimgBackground: '#f8f8f2'\ndescription: How to use PostCSS in your Snowpack project.\n---\n\n[PostCSS](https://postcss.org/) is a popular CSS transpiler with support for [a huge ecosystem of plugins.](https://github.com/postcss/postcss#plugins)\n\n**To use PostCSS with Snowpack:** Install [@snowpack/plugin-postcss](https://www.npmjs.com/package/@snowpack/plugin-postcss), [PostCSS](https://www.npmjs.com/package/postcss), and your PostCSS plugins, then add this plugin to your Snowpack config.\n\n```diff\n// snowpack.config.mjs\nexport default {\n+  plugins: ['@snowpack/plugin-postcss'],\n};\n```\n\nLastly, add a `postcss.config.js` file. By default, @snowpack/plugin-postcss looks for this in the root directory of your project, but you can customize this with the `config` option. See [the plugin README](https://www.npmjs.com/package/@snowpack/plugin-postcss) for all available options.\n\n```js\n// postcss.config.js\nmodule.exports = {\n  plugins: [\n    // Replace below with your plugins\n    require('cssnano'),\n    require('postcss-preset-env'),\n  ],\n};\n```\n\nBe aware that this plugin will run on all CSS in your project, including any files that compiled to CSS (like `.scss` Sass files).\n"
  },
  {
    "path": "docs/guides/preact.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Preact\ntags: communityGuide\nimg: '/img/logos/preact.svg'\nimgBackground: '#333333'\ndescription: With Snowpack you can import and use Preact without any custom configuration needed.\n---\n\nYou can import and use Preact without any custom configuration needed.\n\n**To use `preact/compat`:** (the Preact+React compatability layer) alias the \"compat\" package to React in your install options:\n\n```js\n// Example: Lets you import \"react\" in your application, but uses preact internally\n// snowpack.config.mjs\nexport default {\n  alias: {\n    react: 'preact/compat',\n    'react-dom': 'preact/compat',\n  },\n};\n```\n"
  },
  {
    "path": "docs/guides/react-global-imports.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: React + babel-plugin-import-global\npublished: false\n---\n\n<div class=\"notification\">\n  This guide has an example repo:\n  <a href=\"https://github.com/withastro/snowpack/examples/react-global-imports\">examples/react-global-imports</a>\n</div>\n\n_Based on [app-template-react][app-template-react]_\n\nExample of using Snowpack in conjuction with [babel-plugin-import-global][babel-plugin-import-global]. This is useful when you need to need to inject an import statement at the top of every file, such as React:\n\n```jsx\n// \"import React from 'react'\" no longer needed!\nfunction MyComponent() {\n  // …\n}\n\nexport default MyComponent;\n```\n\nTo recreate this setup, follow 2 steps:\n\n1. Create a [babel.config.js](./babel.config.js) file in the root of the project. Copy the settings shown.\n2. Install [@snowpack/plugin-babel][snowpack-babel] and add it to [snowpack.config.mjs](./snowpack.config.js)\n\n### ⚠️ Caveat\n\nWhen you use [@snowpack/plugin-babel][snowpack-babel], you miss out on the faster builds that come from Snowpack‘s default JS builder, [esbuild][esbuild] (we don‘t run both together to avoid conflict). However, if you skip Babel, you will have to manually place `import` statements yourself at the top of every file.\n\nWe‘d recommend being explicit and manually managing every `import` statement yourself. You can simplify your setup, speed up your builds, and you might see benefits from being explicit. In order to do this, simply use our [React starter template][app-template-react]. No setup required.\n\nBut if you‘ve weighed the tradeoffs and decide that a slower build is worth it to get global import functionality, then start from the example here.\n\n[app-template-react]: https://github.com/withastro/snowpack/create-snowpack-app/app-template-react\n[babel-plugin-import-global]: https://www.npmjs.com/package/babel-plugin-import-global\n[esbuild]: https://esbuild.github.io/\n[snowpack-babel]: https://github.com/withastro/snowpack/plugins/plugin-babel\n"
  },
  {
    "path": "docs/guides/react-loadable-components.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: React + Loadable Components\npublished: false\n---\n\n<div class=\"notification\">\n  This guide has an example repo:\n  <a href=\"https://github.com/withastro/snowpack/examples/react-loadable-components\">examples/react-loadable-components</a>\n</div>\n\n_Based on [app-template-react][app-template-react]_\n\nYou can lazy load React components in Snowpack when needed with React‘s builtin `React.lazy` ([docs][react-lazy]):\n\n```jsx\nimport React, {useState, useEffect, Suspense} from 'react';\n\nconst Async = React.lazy(() => import('./Async'));\n\nfunction Component() {\n  return (\n    <div>\n      <Suspense fallback={<div>Loading...</div>}>\n        <Async />\n      </Suspense>\n    </div>\n  );\n}\n```\n\nThis works out-of-the-box in Snowpack, with no configuration needed!\n\n### Learn more\n\n- [`React.lazy` documentation on reactjs.org][react-lazy]\n\n[react-lazy]: https://reactjs.org/docs/code-splitting.html#reactlazy\n"
  },
  {
    "path": "docs/guides/routing.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Routing\npublished: true\ndescription: This guide will walk you through some common routing scenarios and how to configure the routes option to support them in development.\n---\n\nAs a web build tool, Snowpack has no knowledge of how (or where) your application is served in production. But Snowpack's dev server can be customized to recreate something close to your production environment for local development.\n\nThis guide will walk you through some common routing scenarios and how to configure the `routes` option to support them in development.\n\n### Scenario 1: SPA Fallback Paths\n\nSingle Page Applications (SPA) give the client application complete control over routing logic. The web host itself has no idea what is a valid route and what is a 404, since that logic lives completely in the client. Therefore, every route (valid or not) must be served the same HTML response that will load and run the HTML/JS/CSS application in the browser. This special file is called the \"SPA Fallback\".\n\nTo implement this pattern, you'll want to define a single \"catch-all\" route for development:\n\n```js\n// snowpack.config.mjs\nexport default {\n  routes: [\n    {\n      match: 'routes',\n      src: '.*',\n      dest: '/index.html',\n    },\n  ],\n};\n```\n\nThis tells Snowpack's dev server to serve the fallback `/index.html` URL for all routes (`.*` in RegEx means \"match everything\").\n\n`\"match\": \"routes\"` refers to all URLs that either do not include a file extension or that include the \".html\" file extension. If you changed the above example to `\"match\": \"all\"` instead, then all URLs (including JS, CSS, Image files and more) would respond with the fallback HTML file.\n\n### Scenario 2: Proxy API Paths\n\nMany modern frontend applications will talk directly to an API. Often this API is hosted as a seperate application at another domain (ex: `api.example.com/users`) and no special server configuration is needed to talk with it. However in some cases, your API may be hosted at the same domain as your website using a different path scheme (ex: `www.example.com/api/users`).\n\nTo serve the correct API response to a URL like `/api/users` in development, you can configure Snowpack to proxy some requests to another server. In this example, we'll proxy all \"/api/\\*\" requests to another server that we have running locally on port `3001`:\n\n```js\n// snowpack.config.mjs\nimport proxy from 'http2-proxy';\n\nexport default {\n  routes: [\n    {\n      src: '/api/.*',\n      dest: (req, res) => {\n        // remove /api prefix (optional)\n        req.url = req.url.replace(/^\\/api\\//, '/');\n\n        return proxy.web(req, res, {\n          hostname: 'localhost',\n          port: 3001,\n        });\n      },\n    },\n  ],\n};\n```\n\nWe recommend the [http2-proxy](https://www.npmjs.com/package/http2-proxy) library for proxying requests to another server, which supports a wide range of options to customize how each request is proxied. But feel free to implement the `dest` proxy function however you like. Your own server logic could even be called directly inside of the `dest` function, however this is not recommended over proxying.\n\n### Scenario 3: Proxy WebSocket Requests\n\nProxied requests can be upgraded to a WebSocket connection via the \"upgrade\" event handler. This allows you to proxy WebSocket requests through the Snowpack dev server during development. You can learn more about the upgrade mechanism on [MDN Web Docs.](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism#upgrading_to_a_websocket_connection).\n\n```js\n// snowpack.config.mjs\nimport proxy = from 'http2-proxy';\n\nexport default {\n  routes: [\n    {\n      src: '/ws',\n      upgrade: (req, socket, head) => {\n        const defaultWSHandler = (err, req, socket, head) => {\n          if (err) {\n            console.error('proxy error', err);\n            socket.destroy();\n          }\n        };\n\n        proxy.ws(\n          req,\n          socket,\n          head,\n          {\n            hostname: 'localhost',\n            port: 3001,\n          },\n          defaultWSHandler,\n        );\n      },\n    },\n  ],\n};\n```\n\n### Scenario 4: Custom Server Rendering\n\nIf you only use Snowpack to build assets and rely on your own custom server (ex: Rails, Laravel, etc) for serving HTML, then you probably have no use for routing. Consider reading our guide on [Server-Side Rendering (SSR)](/guides/server-side-render) which explains how to integrate Snowpack into your own server as middleware.\n"
  },
  {
    "path": "docs/guides/sass.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'Sass'\ntags: communityGuide\npublished: true\nimg: '/img/logos/sass.svg'\nimgBackground: '#bf4080'\ndescription: How to use SASS with Snowpack using the Snowpack SASS plugin\n---\n\n[Sass](https://www.sass-lang.com/) is a stylesheet language that’s compiled to CSS. It allows you to use variables, nested rules, mixins, functions, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized and makes it easy to share design within and across projects.\n\nTo use Sass with Snowpack, install [@snowpack/plugin-sass](https://www.npmjs.com/package/@snowpack/plugin-sass) (Sass automatically included) and add it to your `snowpack.config.mjs` file. See README on npm or [GitHub](https://github.com/withastro/snowpack/tree/main/plugins/plugin-sass#plugin-options) for plugin options.\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    plugins: [\n+    '@snowpack/plugin-sass',\n    ],\n  };\n```\n"
  },
  {
    "path": "docs/guides/server-side-render.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Server-Side Rendering (SSR)\ndescription: This guide will walk you through three different options for setting up Snowpack with your own custom server.\npublished: true\n---\n\nServer-side rendering (SSR) can refer to several similar developer stories:\n\n- Using Snowpack with a server web framework like Rails or Express\n- Using Snowpack to power a server-side frontend framework kit like Next.js or SvelteKit\n- Any project configuration where your HTML is generated at runtime, outside of your static build.\n\nThis guide will walk you through three options for setting up Snowpack with your own custom server:\n\n1. `snowpack build --watch` - Serve files out of the static build directory.\n2. `startServer({ ... })` - Serve files on-demand via Snowpack's JavaScript API.\n3. `getServerRuntime({ ... })` - Run your built JS files server-side, directly inside of Node.js.\n\n### Option 1: Static Serving\n\nServing built files directly out of Snowpack's `build/` directory is the easiest way to get started with Snowpack. Run `snowpack build` to build your site to a static directory, and then make sure that your HTML server response includes the appropriate `script` & `link` tags to load your Snowpack-built JavaScript and CSS:\n\n```html\n<!-- Example: If you own the server HTML response, make sure that you host the built assets and load the correct JS/CSS files in your HTML.  -->\n<script type=\"module\" src=\"/dist/index.js\"></script>\n```\n\nDuring development, Snowpack will rebuild files on every change thanks to the `--watch` command. To enable dev features like automatic page reloads and hot module replacement (HMR), check out the [\"Custom Server\" section](/guides/hmr#enable-hmr%3A-custom-server) of our HMR guide for more info.\n\nThis setup also has the benefit of pulling from the same `build/` directory in both development and production. You can control this `build/` output behavior yourself by passing different `--out` CLI flags to Snowpack for development vs production. You can even pass entirely different config files via the `--config` CLI flag, or put custom logic in your `snowpack.config.mjs` file to behave differently for different builds.\n\nThe downside of this static approach is that you need to wait for Snowpack to build the entire `build/` directory on startup before your site will run. This is something that all other build tools (like Webpack) have to deal with, but Snowpack has the ability to build files only when they are requested by the browser, leading to ~0ms startup wait time.\n\n### Option 2: On Demand Serving (Middleware)\n\nThe best developer experience is achieved by loading files on-demand. This removes any need for work on startup, giving you a faster developer environment no matter how large your project grows.\n\n```js\nconst {startServer} = require('snowpack');\nconst server = await startServer({ ... });\n\n// Example: Express\n// On request, build each file on request and respond with its built contents\napp.use((req, res, next) => {\n  try {\n    const buildResult = await server.loadUrl(req.url);\n    res.send(buildResult.contents);\n  } catch (err) {\n    next(err);\n  }\n});\n```\n\nNote that you'll still need to set up static file serving out of the `build/` directory for production deployments. For that reason, this can be seen as an enhancement over the static setup in Option 1 for faster development speeds.\n\nWhile our official API is written in JavaScript and requires Node.js to run, you could implement your own API for any language/environment using the `snowpack dev` CLI command to start the server and loading assets directly by fetching each URL.\n\n### Option 3: Server-Side Rendering (SSR)\n\nSome frontend applications are also designed to run on the server. In the two previous sections, we've just been loading and serving Snowpack files to the client. In this final section, we'll look into how your project can run Snowpack-built JavaScript on the server and return server-rendered HTML to the client for a faster first page load.\n\nSnowpack provides an Node.js SSR Runtime API to help you run & render your application server-side. `getServerRuntime()` returns a `runtime` instance that can be used to import Snowpack-built modules into your current Node.js process, on-demand. This runtime handles the transformation from browser ESM to Node.js Common.js (CJS) so that it can run directly in server without issues.\n\n```js\nconst {readFileSync} = require('fs');\nconst {startServer} = require('snowpack');\nconst server = await startServer({ ... });\nconst runtime = server.getServerRuntime();\n\n// Advanced Example: Express + React SSR\napp.use(async (req, res, next) => {\n  // Server-side import our React component\n  const importedComponent = await runtime.importModule('/dist/MyReactComponent.js');\n  const MyReactComponent = importedComponent.exports.default;\n  // Render your react component to HTML\n  const html = ReactDOMServer.renderToString(React.createElement(MyReactComponent, null));\n  // Load contents of index.html\n  const htmlFile = readFileSync('./index.html', 'utf8');\n  // Inserts the rendered React HTML into our main div\n  const document = htmlFile.replace(/<div id=\"app\"><\\/div>/, `<div id=\"app\">${html}</div>`);\n  // Sends the response back to the client\n  res.send(document);\n});\n```\n\n`getServerRuntime()` is a lower-level tool to help you implement SSR in your project. However, building a custom SSR setup is an advanced task. If you prefer not to implement this yourself, check out some of the new Snowpack-powered application frameworks and static site generators like [SvelteKit](https://svelte.dev/blog/whats-the-deal-with-sveltekit) and [Microsite](https://www.npmjs.com/package/microsite).\n"
  },
  {
    "path": "docs/guides/streaming-imports.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Streaming Imports\npublished: true\nstream: Fetch your npm dependencies on-demand from a remote ESM CDN.\n---\n\nSnowpack v3.0 introduces a new feature called **Streaming Imports** that fetches imported packages on-demand during development and building. By managing your frontend dependencies with Snowpack, you can leave `npm` for your tooling-only packages or even drop your dependency on `npm`/`yarn`/`pnpm` all together.\n\n## Enable Streaming Imports\n\n```js\n// snowpack.config.mjs\nexport default {\n  packageOptions: {\n    source: 'remote',\n  },\n};\n```\n\nSet `packageOptions.source` to \"remote\" to enable streaming imports. This tells Snowpack to fetch your imports from the Skypack CDN instead of bundling them locally. Read our [full documentation on `packageOptions`](/reference/configuration#packageoptions.source%3Dremote) to learn more about customizing this behavior.\n\n## How Streaming Imports Work\n\nWhen you enable streaming imports and run `snowpack dev`, the local server will start fetching all imports from `https://pkg.snowpack.dev`. For example, `import \"preact\"` in your project will become something like `import \"https://pkg.snowpack.dev/preact\"` in the browser. This tells Snowpack (or the browser) to import your package by URL, and only fetch the package ESM when needed. Snowpack is able to cache the response for future, offline use.\n\nThe translation is done by the web server, so your source file will still contain the bare `import \"preact\"` statement. When you run `snowpack build`, the generated files in the build folder will contain `import '../_snowpack/pkg/preact.js';`.\n\n`pkg.snowpack.dev` is our ESM Package CDN, powered by [Skypack](https://www.skypack.dev/). Every npm package is hosted as ESM, and any legacy non-ESM packages are upconverted to ESM on the CDN itself.\n\n> _**Note:** In some rare cases, a nested import from a package will result in an invalid resource reference on Skypack. Explicitly setting the `packageOptions.origin` to `\"https://cdn.skypack.dev\"` (rather than using the default `pkg.snowpack.dev` shim) seems to resolve the issue._\n\n## Benefits of Streaming Imports\n\nStreaming dependencies have several benefits over the traditional \"npm install + local bundling\" approach:\n\n- **Speed:** Skip the install + build steps for dependencies, and load your dependencies as pre-build ESM code directly from an ESM CDN like [Skypack](https://www.skypack.dev/). Dependencies are cached locally for offline reuse.\n- **Safety:** ESM packages are pre-built and never given access to [run code on your machine](https://www.usenix.org/system/files/sec19-zimmermann.pdf). Packages only run in the browser sandbox.\n- **Simplicity:** ESM packages are managed by Snowpack, so frontend projects that don't need Node.js (Rails, PHP, etc.) can drop the `npm` CLI entirely if they choose.\n- **No Impact on Final Build:** Streaming imports are still transpiled and bundled with the rest of your final build, and tree-shaken to your exact imports. The end result is a final build that's nearly identical to what it would have been otherwise.\n\n## Snowpack-Managed Dependencies\n\nBy default, Snowpack fetches the latest version of every package available. Breaking changes are possible over time without a way to manage your dependencies by version.\n\nSnowpack uses a `snowpack.deps.json` in your project to manage your dependency versions. If you're familiar with `npm install`, your `snowpack.deps.json` file is like a combined `package.json` and `package-lock.json`.\n\nTwo commands are available to work with this file: `snowpack add` and `snowpack rm`.\n\nRunning `snowpack add [package-name]` for the first time will create a new `snowpack.deps.json` file in your project to store information about your new dependency, like desired SemVer version range and lockfile information.\n\n## Using Streaming Imports with TypeScript\n\n```js\n// snowpack.config.mjs /w TypeScript Support\nexport default {\n  packageOptions: {\n    source: 'remote',\n    types: true,\n  },\n};\n```\n\nSetting `types=true` tells Snowpack to install TypeScript types in your project. Snowpack will install those types into a local `.snowpack/types` directory in your project, which you can then point to in your project `tsconfig.json` to get automatic types for your npm packages:\n\n```js\n// Example: tsconfig.json /w Snowpack streaming imports\n\"baseUrl\": \"./\",\n\"paths\": {\"*\": [\".snowpack/types/*\"]},\n```\n\nWhen you start your project (with either `snowpack dev` or `snowpack build`) Snowpack will sync this `.snowpack/types` directory and download any new types that you might need. You can also trigger a sync anytime manually via `snowpack prepare`.\n\n## Using Streaming Imports with Non-JS Packages (Svelte, Vue, etc.)\n\nSkypack (the CDN that powers `pkg.snowpack.dev`) will always prefer a package JavaScript entrypoint over any source `.svelte` and `.vue` files. This works for most packages (including most Svelte & Vue packages) but may cause trouble in some projects. In a future release, we'll add better support to build these kinds of packages locally.\n\n## What do I do if a package isn't supported / working?\n\nSkypack (the CDN that powers `pkg.snowpack.dev`) is always improving, and its goal is to support all packages. If you find a package that doesn't work, report it to [Skypack's issue tracker](https://github.com/snowpackjs/skypack-cdn/issues) on GitHub. Many of Snowpack's core contributors also work on Skypack, and will be happy to take a look at the broken package.\n\nIn a future release, we'll add better support to replace broken packages locally.\n"
  },
  {
    "path": "docs/guides/tailwind-css.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'Tailwind CSS'\ntags: communityGuide\npublished: true\nimg: '/img/logos/tailwind.svg'\nimgBackground: '#f2f8f8'\ndescription: How to use Tailwind CSS with Snowpack.\n---\n\n[Tailwind](https://tailwindcss.com) is a popular class-based CSS utility library. Loading it in Snowpack is easy, and only requires a few steps!\n\n## Setup\n\nTailwind’s [JIT mode][tailwind-jit] is the new, recommended way to use Tailwind. To set this up in a Snowpack project, do the following:\n\n#### 1. Install dependencies\n\nFrom the root of your project, install tailwindcss, PostCSS, and the Snowpack PostCSS plugin.\n\n```\nnpm install --save-dev tailwindcss @snowpack/plugin-postcss postcss\n```\n\n#### 2. Configure\n\nYou’ll need to create two files in the root of your project: `postcss.config.js` and `tailwind.config.js`:\n\n```js\n// postcss.config.js\nmodule.exports = {\n  plugins: {\n    tailwindcss: {},\n    // other plugins can go here, such as autoprefixer\n  },\n};\n```\n\n```js\n// tailwind.config.js\nmodule.exports = {\n  mode: 'jit',\n  purge: ['./public/**/*.html', './src/**/*.{js,jsx,ts,tsx,vue}'],\n  // specify other options here\n};\n```\n\n_Note: be sure to set `purge: []` correctly for your project structure_\n\nAlso, you’ll need to add the Snowpack PostCSS plugin to your Snowpack config, and set the [Tailwind config option][config-tailwind], if you haven‘t already:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    mount: {\n      src: '/_dist',\n      public: '/',\n    },\n+   devOptions: {\n+     tailwindConfig: './tailwind.config.js',\n+   },\n+   plugins: [\n+     '@snowpack/plugin-postcss',\n+   ],\n  };\n```\n\n#### 3. Import Tailwind in your CSS\n\nFrom any global CSS file, add the [Tailwind utilites][tailwind-utilities] you need (if you don’t have a global CSS file, we recommend creating one at `/public/global.css`):\n\n```css\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\nWhen you load these with Snowpack, you should see these replaced with Tailwind CSS instead.\n\n⚠️ Make sure you’re importing this file in your main HTML file, like so:\n\n```diff\n  <head>\n+   <link rel=\"stylesheet\" type=\"text/css\" href=\"/global.css\" />\n  </head>\n```\n\n## More reading\n\n- [Official Tailwind Documentation][tailwind-postcss]\n- [PostCSS + Snowpack][snowpack-postcss]\n\n[config-tailwind]: https://snowpack.dev/reference/configuration#devoptions.tailwindConfig\n[snowpack-postcss]: /guides/postcss/\n[tailwind-jit]: https://tailwindcss.com/docs/just-in-time-mode\n[tailwind-postcss]: https://tailwindcss.com/docs/installation/#using-tailwind-with-postcss\n[tailwind-utilities]: https://tailwindcss.com/docs/adding-new-utilities#using-css\n"
  },
  {
    "path": "docs/guides/testing.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Testing\npublished: true\ndescription: How to choose and use a JavaScript test runner for your Snowpack site.\n---\n\nSnowpack supports all of the popular JavaScript testing frameworks that you're already familiar with. Mocha, Jest, Jasmine, AVA and Cypress are all supported in Snowpack applications, if integrated correctly.\n\n**We currently recommend [@web/test-runner](https://www.npmjs.com/package/@web/test-runner) (WTR) for testing in Snowpack projects.** When benchmarked, it performed faster than Jest (our previous recommendation) while also providing an environment for testing that more closely matches production. Most importantly, WTR runs the same Snowpack build pipeline that you've already configured for your project, so there's no second build configuration needed to run your tests. This improves test confidence while removing 100s of extra build dependencies to your project.\n\n### Testing Guides\n\n- [@web/test-runner](/guides/web-test-runner) (Recommended)\n- [jest](/guides/jest)\n"
  },
  {
    "path": "docs/guides/upgrade-guide.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Snowpack Upgrade Guide\npublished: true\ndescription: How to upgrade to Snowpack v3 from older versions of Snowpack.\n---\n\nSnowpack v3.0 was released on January 12th with several new features and some breaking changes. This guide is designed to help you upgrade a project from older versions of Snowpack v1 or v2.\n\n## Upgrading from Snowpack v3 Release Candidate\n\nOur v3.0 Release Candidate was meant to be a close-to-final release, but some major changes still got in between then and the v3.0 final release. Snowpack will warn when any outdated APIs are used, and guide you through the upgrade process.\n\nIn the future, Snowpack Release Candidates will be much closer to final API.\n\n## Upgrading from Snowpack v2\n\nSnowpack v3.0 was mainly designed around new features, and therefore didn't have many major breaking changes introduced. However, there are some changes to be aware of:\n\n- **Config name changes:** There was some cleanup of legacy behavior and renaming of old configuration values. Snowpack will warn you of all known name changes when run Snowpack v3.0 for the first time, with instructions to help you upgrade.\n- **package.json \"homepage\" no longer sets \"baseUrl\":** This was a behavior of Create React App that we'd originally tried to match. However, it became confusing to explain to users. In Snowpack v3.0, set \"buildOptions.baseUrl\" directly.\n- **Improved support for relative paths in configuration:** All relative paths in configuration files are now relative to the configuration file itself. Previously, all relative config paths were resolved based on the current working directory of wherever you ran Snowpack, which meant that behavior of the config file changed depending on where you ran it. You can also now set the project `\"root\"`/`--root` directory, which is useful if you run Snowpack from a different directory than the project iself (ex: in monorepos).\n- **More clear build file naming:** Snowpack v3.0 introduced some cleanup around build file names that you may see when you upgrade projects. The biggest change is to files like `.svelte` and `.vue`, which now have their JS & CSS built to `.svelte.js` and `.svelte.css` respectively. This change shouldn't be noticable to most, but it is good to know.\n- **More clear handling of absolute import URLs:** In Snowpack, it's now possible to import something by its final URL using an absolute URL. `import \"/dist/index.js\"`, for example, will now import whatever file is built to `/dist/index.js`. Previously, this behavior was undefined. Relative URLs can still be used to import files relative to the source file itself.\n\n## Upgrading from Snowpack v1\n\nSnowpack v1 only supported installing npm packages as ESM, and had a more limited scope than Snowpack does today. If you are coming from Snowpack v1.0, you may be able to use our internal package installer library [esinstall](https://www.npmjs.com/package/esinstall) directly. `esinstall` is a JavaScript library that implements most of what Snowpack v1.0 gave you via the command-line.\n\n`snowpack build` builds your site into web native JS, CSS, and HTML files. This \"unbundled\" deployment can be enough for small sites, but many developers prefer to optimize and bundle their final site for production performance.\n\nSnowpack can run all sorts of optimizations on your final build to handle legacy browser support, code minification, code-splitting, tree-shaking, dead code elimination, preloading, bundling, and more.\n\nSnowpack build optimizations come in two flavors: **built-in** (esbuild) & **plugin** (webpack, rollup, or whatever else you might like to run).\n\n### Option 1: Built-in Optimizations\n\nSnowpack recently released a built-in optimization pipeline powered by [esbuild](https://esbuild.github.io/). Using this built-in optimizer, you can now bundle, transpile, and minify your production builds 10x-100x faster than Webpack or Rollup. However, esbuild is still young and [not yet production-ready](https://esbuild.github.io/faq/#production-readiness). At the moment, we only recommended this for smaller projects.\n\n```js\n// snowpack.config.mjs\n// Example: Using Snowpack's built-in bundling support\nexport default {\n  optimize: {\n    bundle: true,\n    minify: true,\n    target: 'es2018',\n  },\n};\n```\n\nThe full supported interface is:\n\n```ts\nexport interface OptimizeOptions {\n  entrypoints: 'auto' | string[] | ((options: {files: string[]}) => string[]);\n  preload: boolean;\n  bundle: boolean;\n  loader?: {[ext: string]: Loader};\n  sourcemap: boolean | 'external' | 'inline' | 'both';\n  splitting: boolean;\n  treeshake: boolean;\n  manifest: boolean;\n  minify: boolean;\n  target: 'es2020' | 'es2019' | 'es2018' | 'es2017';\n}\n```\n\n### Option 2: Optimize Plugins\n\nSnowpack supports popular bundlers via plugin:\n\n- webpack (recommended!): [@snowpack/plugin-webpack](https://www.npmjs.com/package/@snowpack/plugin-webpack)\n- Rollup: [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle)\n\n**For now, we recommend using @snowpack/plugin-webpack until our built-in optimize support is more mature.**\n\nCheck out our [Plugins Catalog](/plugins) to browse all available Snowpack plugins, and read the [Plugins Guide](/guides/plugins) if you're interested in creating your own.\n"
  },
  {
    "path": "docs/guides/wasm.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'WASM'\ntags: communityGuide\npublished: true\nimg: '/img/logos/wasm.svg'\nimgBackground: '#f2f2f8'\ndescription: How to use WASM in your Snowpack project.\n---\n\n[WASM (short for WebAssembly)](https://webassembly.org/) is a portable compilation target for programming languages, enabling deployment on the web for client and server applications.\n\n**To use WASM with Snowpack:** Use the browser's native [`WebAssembly`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly) & [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) APIs to load a WASM file into your application:\n\n```js\n// Example: Load WASM in your project\nconst wasm = await WebAssembly.instantiateStreaming(\n  fetch('/example.wasm'),\n  /* { ... } */\n);\n```\n\nIn the future, we may add `import \"/example.wasm\"` ESM import support to automate this support for you. However, today WASM import support differs from bundler-to-bundler.\n\nIn any case, WASM import support would just be a shortcut or wrapper around the code snippet above. You can recreate this helper today in your own project:\n\n```js\n// Example: WASM Loader (move this into some utility/helper file for reuse)\nexport function loadWasm(url, importObject = {module: {}, env: {abort() {}}}) => {\n  const result = await WebAssembly.instantiateStreaming(fetch(url), importObject);\n  return result.instance; // or, return result;\n}\n\nconst wasm = await loadWasm('/example.wasm');\n```\n"
  },
  {
    "path": "docs/guides/web-test-runner.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: '@web/test-runner'\ntags: communityGuide\nimg: '/img/logos/modern-web.svg'\nimgBackground: '#f2f2f8'\ndescription: How to use @web/test-runner in your Snowpack project.\n---\n\n[@web/test-runner](https://www.npmjs.com/package/@web/test-runner) is our recommended test runner for Snowpack projects. Read more about why we recommend @web/test-runner in our [Snowpack Testing Guide](/guides/testing).\n\n## Setup\n\nThis guide shows how to set up @web/test-runner and [@snowpack/web-test-runner-plugin](https://www.npmjs.com/package/@snowpack/web-test-runner-plugin) for a React project. The end result recreates the test configuration in [app-template-react](https://github.com/withastro/snowpack/blob/main/create-snowpack-app/app-template-react), one of our Create Snowpack App starter templates. If you're using a different framework, tweak React specific steps appropriately.\n\n#### 1. Install dependencies\n\nThe base testing dependencies (don't hit Enter just yet!):\n\n```\nnpm install --save-dev @web/test-runner @snowpack/web-test-runner-plugin chai\n```\n\nIf using React, Vue, Svelte, or Preact, add the corresponding [Testing Library](https://testing-library.com/) (in this case `@testing-library/react`).\n\nIf using TypeScript, add `@types/mocha` and `@types/chai`.\n\n#### 2. Configure\n\nCreate a new `web-test-runner.config.js` file in your project root:\n\n```js\nprocess.env.NODE_ENV = 'test';\n\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n```\n\n⚠️ Don't add @snowpack/web-test-runner-plugin to plugins in your `snowpack.config.mjs` file! It only needs to be in `web-test-runner.config.js`. If you need to specify test options, use [testOptions](https://www.snowpack.dev/reference/configuration#testoptions).\n\n#### 3. Script\n\nAdd a `test` script to your project `package.json`:\n\n```diff\n\"scripts\": {\n  \"start\": \"snowpack dev\",\n  \"build\": \"snowpack build\",\n+  \"test\": \"web-test-runner \\\\\\\"src/**/*.test.jsx\\\\\\\"\",\n  ...\n},\n```\n\nIf needed, swap `.jsx` with the file type(s) containing your tests.\n\nTo specify multiple test file types, enclose with curly brackets and separate with commas. For example, to match `.jsx`, `.js`, and `.ts` files, the script would be:\n\n```\n\"test\": \"web-test-runner \\\\\\\"src/**/*.test.{jsx,js,ts}\\\\\\\"\",\n```\n\n> 💡 Tip: `wtr` can be used as a shorthand for `web-test-runner`.\n"
  },
  {
    "path": "docs/guides/web-worker.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'Web Workers'\ntags: communityGuide\npublished: true\ndescription: How to use Web Workers in your Snowpack project.\n---\n\n[Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) are a simple means for web content to run scripts in background threads.\n\n**To use Web Workers with Snowpack:** Use the browser's native [Web Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Web_Workers_API) directly:\n\n```js\n// Example: Load a Web Worker in your project\nconst myWorker = new Worker(new URL('./worker.js', import.meta.url));\n```\n\nPassing a `URL` to the Worker constructor (instead of a string literal) is recommended, but not required. Using a string literal (ex: `new Worker('./worker.js')`) may prevent some optimizations when you build your site for production.\n\nAlso note that the URL passed to the `Worker` must match the final URL which may differ from the path on disk. For example, `./worker.js` would still be used even if the original file on disk was `worker.ts`. `mount` destinations should also be used here, if needed.\n\n### ESM Web Worker Support\n\n**ESM syntax (`import`/`export`) in Web Workers is still not supported in all modern browsers.** Snowpack v3.0.0 and the Snowpack Webpack v5 plugin will both support automatic bundling once released. Until then, you'll need to write self-contained, single-file Web Workers (no ESM `import`/`export` statements) or pre-bundle your web workers yourself.\n\n```js\nconst worker = new Worker(new URL('./esm-worker.js', import.meta.url), {\n  name: 'my-worker',\n  type: 'module',\n});\n```\n\n<!--\nTO REPLACE THE PREVIOUS PARAGRAPH ON v3.0.0 LAUNCH DAY:\n\nModern browsers have begun to support ESM syntax (`import`/`export`) inside of Web Workers. However, some notable exceptions still exist. To use ESM syntax inside of a web worker, consult [caniuse.com](https://caniuse.com/mdn-api_worker_worker_ecmascript_modules) and choose a supported browser for your local development. When you build for production, choose a bundler that will bundle your Web Worker to remove ESM import/export syntax. Currently, Snowpack's builtin bundler and @snowpack/plugin-webpack both support automatic Web Worker bundling to remove ESM syntax from web workers.\n\n\n```js\nconst worker = new Worker(\n  new URL('./esm-worker.js', import.meta.url),\n  {\n    name: 'my-worker',\n    type: import.meta.env.MODE === 'development' ? \"module\" : \"classic\"\n  }\n);\n```\n\n-->\n"
  },
  {
    "path": "docs/guides/workbox.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Workbox\ntags: communityGuide\ndescription: The Workbox CLI integrates well with Snowpack.\n---\n\n<div class=\"stub\">\nThis article is a stub, you can help expand it into <a href=\"https://diataxis.fr/how-to-guides/\">how-to guide format</a>\n</div>\n\nThe [Workbox CLI](https://developers.google.com/web/tools/workbox/modules/workbox-cli) integrates well with Snowpack. Run the wizard to bootstrap your first configuration file, and then run `workbox generateSW` to generate your service worker.\n\nRemember that Workbox expects to be run every time you deploy, as a part of a production build process. If you don't have one yet, create package.json [`\"deploy\"` and/or `\"build\"` scripts](https://michael-kuehnel.de/tooling/2018/03/22/helpers-and-tips-for-npm-run-scripts.html) to automate your production build process.\n"
  },
  {
    "path": "docs/posts/2020-05-26-snowpack-2-0-release.md",
    "content": "---\nlayout: ../../layouts/post.astro\nbannerVideo: '/img/extra-space-4.mp4'\npermalink: '/posts/2020-05-26-snowpack-2-0-release/'\ntitle: Snowpack v2.0\ndescription: 'Build web applications with less tooling and faster iteration.'\ntagline: v2.0.0 release post\ndate: 2020-05-26\n---\n\nAfter 40+ beta versions & release candidates we are very excited to introduce **Snowpack 2.0: A build system for the modern web.**\n\n- Starts up in <50ms and stays fast in large projects.\n- Bundle-free development with bundled production builds.\n- Built-in support for TypeScript, JSX, CSS Modules and more.\n- Works with React, Preact, Vue, Svelte, and all your favorite libraries.\n- [Create Snowpack App (CSA)](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli) starter templates.\n\n<br/>\n\n```bash\n# install with npm\nnpm install --save-dev snowpack\n\n# install with yarn\nyarn add --dev snowpack\n```\n\n## The Road to Snowpack 2.0\n\nSnowpack 1.0 was designed for a simple mission: install npm packages to run directly in the browser. The theory was that JavaScript packages are the only thing still **_requiring_** the use of a bundler during development. Remove that requirement, remove the bundler, and speed up web development for everyone.\n\nGuess what? It worked! Thousands of developers started using Snowpack to install their dependencies and build websites with less tooling. A whole new type of faster, lighter-weight dev environment suddenly became possible.\n\n**Snowpack 2.0 is a build system designed for this new era of web development.** Snowpack removes the bundler from your dev environment, leveraging native [ES Module (ESM)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) support to serve built files directly to the browser. This isn't just a faster tool, it's a new approach to web build systems.\n\n## The Rise of O(1) Build Systems\n\n![webpack vs. snowpack diagram](/img/snowpack-unbundled-example-3.png)\n\n**Bundling is a process of `O(n)` complexity.** When you change a file, you can't just rebuild that one file. You often need to rebuild and rebundle an entire chunk of your application across multiple related files to properly accept the new changes.\n\n**Snowpack is an O(1) build system.** The term was first coined by [Ives van Hoorne](https://www.youtube.com/watch?v=Yu9zcJJ4Uz0) and it perfectly encapsulates our vision for the future of web development. Every file built with Snowpack can be expressed as a function: `build(file) => result`. When a file is changed during development, only that file is rebuilt.\n\nThis has several advantages over the traditional bundled dev approach:\n\n- O(1) builds are faster.\n- O(1) builds are predictable.\n- O(1) builds are easy to reason about & configure.\n- Project size doesn't affect build time during development.\n- Individual files cache better.\n\nThat last point is key: every built file is cached individually and reused indefinitely. **If you never change a file, you will never need to re-build it again.**\n\n## `dev` A Faster Dev Environment\n\n![dev command output example](/img/snowpack-dev-startup-2.png)\n\nRun `snowpack dev` to start your new web dev environment and the first thing you'll notice is **how flippin' fast O(1) build tooling is.** Snowpack starts up in less than 50ms. That's no typo: 50 milliseconds or less.\n\nWith no bundling work needed to start, your server spins up immediately. On your very first page load, Snowpack builds your first requested files and then caches them for future use. Even if your project contains a million different files, Snowpack builds only those needed to load the current page. This is how Snowpack stays fast.\n\n`snowpack dev` includes a development server and a bunch of familiar features right out of the box:\n\n- TypeScript Support\n- JSX Support\n- Hot Module Replacement (HMR)\n- Importing CSS & CSS Modules\n- Importing Images & Other Assets\n- Custom Routing\n- Proxying Requests\n\n## Customizing Your Build\n\n[Build Scripts](/concepts/build-pipeline) let you connect your favorite build tools. With Snowpack, you express every build as a linear `input -> build -> output` workflow. This allow Snowpack to pipe your files into and out of any existing UNIX-y CLI tools without the need for a special plugin ecosystem.\n\n```js\n// snowpack.config.json\n{\n  \"scripts\": {\n    // Pipe every \"*.css\" file through the PostCSS CLI\n    // stdin (source file) > postcss > stdout (build output)\n    \"build:css\": \"postcss\",\n  }\n}\n```\n\nIf you've ever used your `package.json` \"scripts\" config, this format should feel familiar. We love the simplicity of using your CLIs directly without an unnecessary plugin system. We hope this pattern offers a similar intuitive design.\n\nIf you want more control over your build (or want to write your own build tool) Snowpack also supports [third-party JavaScript plugins](/plugins). [Check out our docs](/concepts/build-pipeline) to learn more about customizing your build.\n\n## `build` Bundling for Production\n\n![build output example](/img/snowpack-build-example.png)\n\nTo be clear, Snowpack isn't against bundling for production. In fact, we recommend it. File minification, compression, dead-code elimination and network optimizations can all make a bundled site run faster for your users, which is the ultimate goal of any build tool.\n\nSnowpack treats bundling as a final, production-only build optimization. By bundling as the final step, you avoid mixing build logic and bundle logic in the same huge configuration file. Instead, your bundler gets already-built files and can focus solely on what it does best: bundling.\n\nSnowpack maintains official plugins for both Webpack & Parcel. Connect your favorite, and then run `snowpack build` to build your site for production.\n\n```js\n// snowpack.config.json\n{\n  // Optimize your production builds with Webpack\n  \"plugins\": [[\"@snowpack/plugin-webpack\", {/* ... */}]]\n}\n```\n\nIf you don't want to use a bundler, that's okay too. Snowpack's default build will give you an unbundled site that also runs just fine. This is what the Snowpack project has been all about from the start: **Use a bundler because you want to, and not because you need to.**\n\n## Try Snowpack Today\n\nWe are so excited to share this all with you today. Download Snowpack to experience the future of web development.\n\n```\nnpm i snowpack@latest --save-dev\n```\n\nIf you already have an existing Snowpack application, Snowpack 2.0 will walk you through updating any outdated configuration. Snowpack's original package installer still works as expected, and with the new `dev` & `build` commands Snowpack even manages your web packages for you.\n\n**[Check out our docs site to learn more.](https://www.snowpack.dev/)**\n\n#### Create Snowpack App\n\nThe easiest way to get started with Snowpack is with [Create Snowpack App (CSA)](https://github.com/withastro/snowpack). CSA automatically initializes a starter application for you with a pre-configured, Snowpack-powered dev environment.\n\n```bash\nnpx create-snowpack-app new-dir --template [SELECT FROM BELOW] [--use-yarn]\n```\n\n- [@snowpack/app-template-blank](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-blank)\n- [@snowpack/app-template-react](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react)\n- [@snowpack/app-template-react-typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react-typescript)\n- [@snowpack/app-template-preact](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact)\n- [@snowpack/app-template-svelte](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte)\n- [@snowpack/app-template-vue](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue)\n- [@snowpack/app-template-lit-element](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-lit-element)\n- [@snowpack/app-template-11ty](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-11ty)\n- **[See all community templates](https://github.com/withastro/snowpack/tree/main/create-snowpack-app)**\n\n🐹 Happy hacking!\n\n---\n\n_Thank you to all of our [80+ contributors](https://github.com/withastro/snowpack/graphs/contributors) for making this release possible._\n_Thanks to [Melissa McEwen](https://twitter.com/melissamcewen) & [@TheoOnTwitch](https://twitter.com/TheoOnTwitch) for helping to edit this post._\n"
  },
  {
    "path": "docs/posts/2020-07-30-snowpack-2-7-release.md",
    "content": "---\nlayout: ../../layouts/post.astro\ntitle: Snowpack 2.7\ndescription: 'A new plugin API plus smaller, faster production builds.'\ntagline: v2.7.0 release post\npermalink: '/posts/2020-07-30-snowpack-2-7-release/'\ndate: 2020-07-30\nbannerImage: '/img/banner-2.jpg'\n---\n\nHappy release day! We are excited to announce Snowpack v2.7 with a handful of new features improving stability and the overall developer experience:\n\n- **Redesigned plugin API** plus [new guides for plugin authors](/plugins)\n- **Import aliasing** and new ways to customize Snowpack\n- **Improved build performance** with smaller, faster builds\n- **New Svelte + TypeScript** app templates\n- **Bug fixes, usability improvements & more!**\n\n<br/>\n\nPlus, we hit some VERY exciting project milestones last month:\n\n- ❤️ **150** [open source contributors](https://github.com/withastro/snowpack/graphs/contributors) (and growing!)\n- 🏆 **1000+** discussions, issues, and pull requests\n- ⭐️ **10,000+** stars on GitHub\n- 👋 **New companies using Snowpack:** [Alibaba](https://www.1688.com/) & [Airhacks](https://airhacks.com/)\n\n<br/>\n\nIf you've been waiting for an excuse to give Snowpack a try, now is a great time to start! Try out a Create Snowpack App (CSA) template or install Snowpack into any existing project:\n\n```bash\n# install with npm\nnpm install --save-dev snowpack\n\n# install with yarn\nyarn add --dev snowpack\n```\n\n## Redesigned Plugin API\n\nSnowpack v2.7 features an major rewrite of our internal build pipeline to support a more reliable and expressive plugin API. New optimizations and file type builders are unlocked with the redesigned `load()`, `transform()`, `run()` and `optimize()` plugin hooks (with more on the way in future versions).\n\n![snowpack screenshot](/img/snowpack-27-screenshot-1.png)\n\nSnowpack 2.7 is fully backwards compatible with older plugins, so you can upgrade Snowpack without worrying about version mismatches.\n\nEvery hook is documented in our new [Plugins Guide](/plugins) for plugin authors. The new API is heavily inspired by [Rollup](https://rollupjs.org/), so we hope it already feels familiar to many of you.\n\n## Simplified Configuration\n\n![snowpack screenshot](/img/snowpack-27-screenshot-3.png)\n\nSnowpack v2.0 originally introduced the concept of build `\"scripts\"` as a way to configure anything from file building to HTTP request proxying. Scripts were flexible, but hard to document and frustrating to debug.\n\nOur internal plugin rewrite presented an opportunity to improve the developer experience while keeping the flexibility of direct CLI tooling. You can now connect third-party tooling directly into Snowpack's build pipeline using one of two new utility plugins:\n\n- `@snowpack/plugin-build-script`: Use any CLI directly to build files for Snowpack.\n- `@snowpack/plugin-run-script`: Run arbitrary CLI commands during dev/build.\n\nOther options like `mount`, `proxy`, and `alias` (see below) are now easier to customize as well with top-level config options that take the guesswork out of common configuration.\n\nThe `\"scripts\"` configuration format will continue to be supported in Snowpack v2, but we recommend migrating any custom scripts to `\"plugins\"` and plan to remove support in a future major release.\n\n## New: Import Aliasing\n\n![snowpack screenshot](/img/snowpack-27-screenshot-2.png)\n\nIn previous versions of Snowpack, import aliasing was hard to understand and configure (and it didn’t support all types of aliasing). Starting in Snowpack v2.7, [Import Aliases](/reference/configuration) gets a new top-level `alias` config so that you can define as many custom aliases as you'd like. Package import aliases are also supported.\n\n## Improved Build Performance\n\nSnowpack's official webpack plugin is now more powerful than ever, with new support for multi-page website bundling and better default performance settings (based on the [latest research from Google](https://web.dev/granular-chunking-nextjs/)). Special shout out to [@mxmul](https://github.com/mxmul) (Yelp) for leading these community contributions!\n\nIf you don't use a bundler in production, you'll still see a smaller build. That's because Snowpack v2.7 now ships with minification on by default. We plan to keep improving the default unbundled build performance story over the next few releases, so stay tuned.\n\n## Svelte + TypeScript Support\n\n![snowpack screenshot](/img/svelte-ts.png)\n\nLast week, [Svelte announced official support for TypeScript](https://svelte.dev/blog/svelte-and-typescript). We're huge fans of both projects and couldn't pass up the chance to test the new support out in a brand new Svelte + TypeScript app template for Snowpack.\n\nVisit [Create Snowpack App](https://github.com/withastro/snowpack/tree/main/create-snowpack-app) for a list of all of our new app templates.\n\n## Thank You, Contributors!\n\nFinally, Snowpack wouldn't be possible without the [150+ contributors](https://github.com/withastro/snowpack/graphs/contributors) who contributed features, fixes, and documentation improvements. Thanks again for all of your help.\n\n-- Snowpack Maintainers\n\n<div class=\"notification\">\nPsst... In case you missed it, <a href=\"https://www.skypack.dev/\">check out our latest project: Skypack</a> - the new JavaScript CDN that lets you load any npm package directly in the browser.\n</div>\n\n<a href=\"https://twitter.com/snowpackjs\" target=\"_blank\">\n<svg aria-hidden=\"true\" width=\"32\" focusable=\"false\" data-prefix=\"fab\" data-icon=\"twitter\" class=\"svg-inline--fa fa-twitter fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z\"></path></svg>\n<a href=\"https://twitter.com/snowpackjs\">Follow @snowpackjs on Twitter and don't miss future updates!</a>\n</a>\n"
  },
  {
    "path": "docs/posts/2020-12-03-snowpack-3-release-candidate.md",
    "content": "---\nlayout: ../../layouts/post.astro\ntitle: 'Snowpack v3.0 Release Candidate'\ntagline: New features to change the way you build for the web.\ndescription: 'New features to change the way you build for the web. Snowpack v3.0 will release on January 6th, 2021 (the one-year anniversary of its original launch post). This is our biggest release yet with some serious new features, including a new way to load npm packages on-demand that lets you skip the `npm install` step entirely.'\ndate: 2020-12-03\n---\n\n**tl;dr:** Snowpack v3.0 will release on January 6th, 2021 (the one-year anniversary of its original launch post). This is our biggest release yet with some serious new features, including **a new way to load npm imports on-demand** and skip the frontend `npm install` step entirely.\n\n**Update:** Release was delayed for a week for some finishing touches. New release date is January 13th! [More info on Discord](https://discord.com/channels/712696926406967308/783454799051489301/796785330932940800).\n\nBest of all: it's all available to try today!\n\n## What's New?\n\nSnowpack v3 will focus on the polish & official release of four features already available today in the current version of Snowpack (v2.18.0) under the `experiments` flag:\n\n- `experiments.source` - Streaming npm imports, no install step required.\n- `experiments.optimize` - Built-in bundling, preloading, and asset minifying.\n- `experiments.routes` - Advanced config for HTML fallbacks and API proxies.\n- `import 'snowpack'` - A brand new JavaScript API for Snowpack integrations.\n\n<video preload=\"auto\" autoplay loop muted playsinline>\n    <source src=\"/img/snowpackskypack.webm\" type=\"video/webm\">\n    <source src=\"/img/snowpackskypack.mp4\" type=\"video/mp4\">\n</video>\n\n## New: Streaming Package Imports\n\nSnowpack has always pushed the limits of frontend development, and this release is no different. Snowpack v3.0 introduces an exciting new feature to speed up & simplify your development workflow.\n\nTypically, JavaScript dependencies are installed and managed locally by a package manager CLI like `npm`, `yarn` or `pnpm`. Packages are often bloated with unrelated files and almost never run directly in the browser. Additional steps are required to process, build and bundle these installed packages so that they can actually run in browser.\n\n**What if we could simplify this? What if Snowpack could skip the \"npm install\" step entirely and just fetch the relevant, pre-built package code on-demand via ESM?**\n\n```js\n// you do this:\nimport * as React from 'react';\n\n// but get behavior like this:\nimport * as React from 'https://cdn.skypack.dev/react@17.0.1';\n```\n\nThat URL in the example above points to [Skypack](https://www.skypack.dev/), a popular JavaScript CDN that we built to serve every npm package as ESM. Importing dependencies by URL like this is well supported in Snowpack, Deno, and all major browsers. But writing these URLs directly into your source code isn't ideal and makes development impossible without a network connection.\n\n**Snowpack v3.0 brings together the best of both worlds:** Get the simplicity of `import 'react'` in your own source code and let Snowpack fetch these dependencies behind the scenes, pre-built and ready to run in the browser. Snowpack caches everything for you automatically, so you can continue to work offline without relying on Skypack besides the first package fetch.\n\nThis has several benefits over the traditional \"npm install\" approach:\n\n- **Speed:** Skip the install + build steps for dependencies, and load your dependencies as pre-build ESM code.\n- **Safety:** ESM packages are pre-built into JavaScript for you and never given access to [run code on your machine](https://www.usenix.org/system/files/sec19-zimmermann.pdf). Third-party code only ever run in the browser sandbox.\n- **Simplicity:** ESM packages are managed by Snowpack, so frontend projects that don't need Node.js (Rails, PHP, etc.) can drop the npm CLI entirely if they choose.\n- **Same Final Build:** When you build your site for production, package code is transpiled with the rest of your site and tree-shaken to your exact imports, resulting in a final build that's nearly identical.\n\nIf this all sounds too wild for you, don't worry. This is **100% opt-in** behavior for those who want it. By default, Snowpack will continue to pull your npm package dependencies out of your project `node_modules` directory like it always has.\n\nCheck out our guide on [Streaming Package Imports](/guides/streaming-imports) to learn more about how to enable this new behavior in your project today. In a future release, we hope to open this up to custom ESM package sources and other CDNs as well.\n\n![js api](/img/post-snowpackv3-esbuild.png)\n\n## Built-in Optimizations, Powered by esbuild\n\n[esbuild](https://esbuild.github.io/) is a marvel: it performs 100× faster than most other popular bundlers and over 300× faster than Parcel (by esbuild's own benchmarks). esbuild is written in Go, a compiled language that can parallelize heavy bundling workloads where other popular bundlers -- written in JavaScript -- cannot.\n\nSnowpack already uses esbuild internally as our default single-file builder for JavaScript, TypeScript and JSX files. Snowpack v3.0 takes this integration one step further, with a new built-in build optimization pipeline. Bundle, minify, and transpile your site for production in 1/100th of the time of other bundlers.\n\nSnowpack is able to adopt esbuild today thanks to an early bet that we made on the future of bundling: **bundling is a post-build optimization, and not the core foundation that everything is built on top of.** Thanks to this early design decision, esbuild can be plugged in and swapped out of your Snowpack build as easily as any other bundler.\n\nesbuild is still a young project, but it's future looks promising. In the meantime, we will also continue to invest in the existing Webpack & Rollup bundler plugins for a long time to come.\n\nTo get started, check out the `experiments.optimize` option in our newest [Optimizing Your Snowpack Build](/guides/optimize-and-bundle) guide.\n\n![js api](/img/post-snowpackv3-routes.png)\n\n## Routing\n\nSnowpack's new `experiments.routes` configuration lets you define routes that align your dev environment with production. This unlocks some interesting new use-cases, including:\n\n- **API Proxies** - Route all `/api/*` URLs to another URL or localhost port.\n- **SPA Fallbacks** - Serve an app shell `index.html` to all requested routes.\n- **Faster Site Loads** - Speed up your site and serve different HTML shell files for each route.\n- **Island Architecture** - Serve HTML that renders individual components on the page, in parallel. (Made popular by [Jason Miller](https://twitter.com/_developit) in [this blog post](https://jasonformat.com/islands-architecture/)).\n- **Mimic Vercel/Netlify** - Re-create your Vercel or Netlify routes in development. Or, create a Snowpack plugin to automatically generate these routes from your `vercel.json` or `_redirects` file at startup.\n\nWhile API proxying and SPA fallbacks have already been supported in Snowpack for a while now, this brings them all together into a single, expressive new API.\n\n![js api](/img/post-snowpackv3-jsapi.png)\n\n## A New JavaScript API\n\nSnowpack's new JavaScript API grants you more advanced control over Snowpack's dev server and build pipeline, helping you build more powerful integrations on top of Snowpack to unlock new kinds of dev tooling and server-side rendering (SSR) solutions.\n\nThe Svelte team recently made news with [SvelteKit](https://svelte.dev/blog/whats-the-deal-with-sveltekit): An official, zero-effort SSR app framework for Svelte apps. SvelteKit is powered internally by Snowpack, using our brand-new JavaScript API to manage your build pipeline and build files on-demand. Snowpack speeds up development and helps to cut SvelteKit's startup time to near-zero.\n\nCheck out our new [JavaScript API reference](/reference/javascript-interface) to start building your own custom integrations on top of Snowpack. Or, read through our new guide on [Server-Side Rendering](/guides/server-side-render) to get started with a custom SSR integration for production.\n\n## Installation\n\nYou can install the Snowpack v3.0 release candidate today by running:\n\n```\nnpm install snowpack@next\n```\n\nSince all v3.0 features already exist in Snowpack today, our existing documentation site applies to both v2 & v3. At this point only very old, undocumented, legacy behavior has been removed from the `next` v3.0 branch.\n\nFeatures under the `experiments` flag may continue to change as we get closer to the official release date. By the end of the year, you can expect that these features will move out from behind the `experiments` flag and into top-level config objects in the `next` v3.0 branch.\n\nLearn more at [snowpack.dev](https://www.snowpack.dev). Happy hacking!\n"
  },
  {
    "path": "docs/posts/2021-01-13-snowpack-3-0.md",
    "content": "---\nlayout: ../../layouts/post.astro\ntitle: 'Snowpack v3.0'\ndescription: Snowpack v3.0 is here! Our biggest release yet with some serious new features, including pre-bundled streaming imports, built-in bundling & optimizations, new JavaScript APIs, and more.'\ndate: 2021-01-13\n---\n\nSnowpack v3.0 is here! This is our biggest release yet with brand new features including:\n\n- **Pre-bundled streaming imports** - Import any npm package, on-demand.\n- **Integrated build optimizations** - Built-in bundling, preloading, minification, and more.\n- **JavaScript API** - Integrate with Snowpack's brand new native JS API.\n- **Node.js Runtime API** - Import your Snowpack-built files directly into Node.js.\n- **Bug fixes, stability improvements, and a whole lot more!**\n\nInstall the newest version of Snowpack to get started:\n\n```\n$ npm install snowpack@^3.0.0\n```\n\nOr, try out one of our updated [Create Snowpack App](https://www.npmjs.com/package/create-snowpack-app) starter templates:\n\n```\n$ npx create-snowpack-app new-project-directory --template  @snowpack/app-template-react\n```\n\n## Reimagining Web Development for ESM\n\n1 year ago, Snowpack first released with the mission to reimagine web development for modern JavaScript and ESM. Snowpack leverages modern web features to deliver a frontend build tool that needs just 50ms to start up & react to new file changes, regardless of project size. In comparison, traditional web bundlers could take several seconds or even full minutes to start up in large projects.\n\nSnowpack v3.0 marks another huge leap on our mission to push web development forward with the release of **streaming imports**. Streaming imports make it possible to import any package directly into your project, pre-built and pre-bundled for immediate use. It's the power of the entire JavaScript ecosystem, at your fingertips.\n\n<video preload=\"auto\" autoplay loop muted playsinline>\n <source src=\"/img/streaming-imports-demo.webm\" type=\"video/webm\">\n <source src=\"/img/streaming-imports-demo.mp4\" type=\"video/mp4\">\n</video>\n\n## What are Streaming Imports?\n\nThe typical web developer installs and manages their JavaScript dependencies locally using a package manager CLI like `npm`, `yarn` or `pnpm`. These npm packages can't run directly in the browser, so additional work is needed to resolve, process, build and bundle these packages for the browser before you can actually use them.\n\n**What if we could simplify this? What if you could skip the \"npm install\" step entirely and just fetch the relevant, pre-built package code on-demand via ESM import?**\n\n```js\n// you do this:\nimport * as React from 'react';\n\n// but get behavior like this:\nimport * as React from 'https://cdn.skypack.dev/react@17.0.1';\n```\n\nThat URL in the example above points to [Skypack](https://www.skypack.dev/), a popular JavaScript CDN that we built to serve every package on npm as ESM. Importing dependencies by URL like this is well supported in Snowpack, Deno, and all major browsers. But writing these URLs directly into your source code isn't ideal and makes development impossible without a network connection.\n\n**Snowpack v3.0 brings together the best of both worlds:** Get the simplicity of `import 'react'` in your own source code and let Snowpack fetch these dependencies behind the scenes, pre-built and ready to run in the browser. Snowpack caches everything for you automatically, so you can continue to work offline after the first package fetch.\n\nThis new workflow has several benefits over the traditional \"npm install\" approach:\n\n- **Speed:** Skip the install + build steps for dependencies, and load your dependencies on-demand as pre-build, pre-bundled ESM code.\n- **Safety:** ESM packages are pre-built into JavaScript for you and never given access to [run code on your machine](https://www.usenix.org/system/files/sec19-zimmermann.pdf). Third-party code only ever runs sandboxed in the browser.\n- **Less Tooling:** ESM packages are managed by Snowpack, so frontend projects that don't need Node.js (Rails, PHP, etc.) can drop the npm CLI entirely if they choose.\n- **Identical Final Build:** When you build your site for production, package code is transpiled with the rest of your site and tree-shaken to your exact set of imports.\n\nThis is our bet on the future of web development. But if this all sounds too wild for you or you have some technical reason to keep managing your dependencies with npm, don't worry. This is **100% opt-in** behavior for those who want it. By default, Snowpack will continue to pull your npm package dependencies out of your project `node_modules` directory like it always has.\n\nCheck out our guide on [Streaming Package Imports](/guides/streaming-imports) to learn more about how to enable this new behavior in your project today.\n\n![js api](/img/post-snowpackv3-esbuild.png)\n\n## Built-in Optimizations, Powered by esbuild\n\n[esbuild](https://esbuild.github.io/) is a marvel: it performs 100x faster than most other popular bundlers their own benchmarks. esbuild is written in Go, a compiled language that can parallelize heavy bundling workloads where other popular bundlers -- written in JavaScript -- cannot.\n\nSnowpack already uses esbuild internally as our default single-file builder for JavaScript, TypeScript and JSX files. Snowpack v3.0 takes this integration one step further, with a new built-in build optimization pipeline. Bundle, minify, and transpile your site for production in 1/100th of the time of other bundlers.\n\nSnowpack is able to adopt esbuild today thanks to an early bet that we made on the future of bundling: **bundling is just a post-build optimization.** Thanks to this early design decision, esbuild can be plugged in and swapped out of your Snowpack build as easily as any other bundler.\n\nesbuild is still a young project, but its future looks promising. In the meantime, we will also continue to invest in the existing bundler plugins for a long time to come, so that more mature projects can continue to use mature bundlers like Webpack & Rollup.\n\nTo get started, check out the `optimize` option in our newest [Optimizing Your Snowpack Build](/guides/optimize-and-bundle) guide.\n\n![js api](/img/post-snowpackv3-jsapi.png)\n\n## A New JavaScript API\n\nSnowpack's new JavaScript API grants you more advanced control over Snowpack's dev server and build pipeline, helping you build more powerful integrations on top of Snowpack to unlock new kinds of dev tooling and server-side rendering (SSR) solutions.\n\n[SvelteKit](https://svelte.dev/blog/whats-the-deal-with-sveltekit) is the new official web app framework from the Svelte team, built with Snowpack. SvelteKit uses our new JavaScript API to manage the build pipeline and build files on-demand. Snowpack helps SvelteKit speed up development, with zero rapid updates on file change and zero upfront server start-up cost.\n\n[Microsite](https://www.npmjs.com/package/microsite) is another exciting new project built with Snowpack. Microsite is a Static Site Generator (SSG) for Preact that features automatic partial hydration, so that you send as little JavaScript down to the client as possible.\n\nCheck out our new [JavaScript API reference](/reference/javascript-interface) to start building your own custom integrations on top of Snowpack.\n\n![js api](/img/post-snowpackv3-runtime.png)\n\n## A New Node.js Runtime\n\nSpeaking of Svelte, this next feature comes directly out of our collaboration with the Svelte team. As a part of building out SvelteKit, Rich Harris created a server-side runtime for Snowpack. This runtime lets you import any Snowpack-built file directly into Node.js, handling things like ESM->CJS conversion and CSS extraction automatically.\n\nThe result is a unified build pipeline across both Node.js and the frontend, with all of the on-demand build performance benefits of Snowpack. Importing frontend code to run in Node.js unlocks features like true server-side rendering (SSR), test runner integrations for Jest/uvu/Mocha, and more.\n\nCheck out our new [SSR guide](/guides/server-side-render) to get started and learn more about all of the different ways that you can connect to your Snowpack build.\n\n<div style=\"text-align:center; font-size: 120px; margin-top: 5rem; margin-bottom: -2rem; line-height: 1;\">🥳</div>\n\n## Snowpack's One Year Anniversary\n\nLast week marked Snowpack's one-year anniversary of the original v1.0.0 release. Looking back, I'm blown away by everything that's happened since:\n\n- 150+ releases (from `v0.0.1`, all the way to v3.0 today)\n- [100+ Snowpack plugins](https://www.snowpack.dev/plugins) to choose from (and growing fast!)\n- [100+ individual contributors](https://github.com/withastro/snowpack/graphs/contributors)\n- [15,000+ stars on GitHub](https://github.com/withastro/snowpack/stargazers)\n- #1 Developer Productivity Boost Winner, [2020 JS Open Source Awards](https://osawards.com/javascript/2020)\n- #1 Highest Developer Interest, [2020 State of JS](https://2020.stateofjs.com/en-US/technologies/build-tools/)\n- #1 Highest Developer Satisfaction (tied), 2020 State of JS\n\nA huge thank you to everyone who has contributed code to Snowpack, and the hundreds of developers joining us on GitHub and on [Discord](https://discord.com/invite/snowpack). This project wouldn't exist today without you and your support. Thank you!\n\n-- Fred K. Schott [(@FredKSchott)](https://twitter.com/FredKSchott)\n"
  },
  {
    "path": "docs/reference/cli-command-line-interface.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Command Line API\ndescription: The Snowpack Command Line tool's API, commands, and flags.\n---\n\n### Commands\n\n```\n$ snowpack --help\n\nsnowpack init         Create a new project config file.\nsnowpack dev          Develop your app locally.\nsnowpack build        Build your app for production.\n\n...\n```\n\n### Flags\n\n```bash\n# Show helpful info\n$ snowpack --help\n\n# Show additional debugging logs\n$ snowpack --verbose\n\n# {devOptions: {open: 'none'}}\n$ snowpack dev --open none\n\n# {buildOptions: {clean: true/false}}\n$ snowpack build --clean\n$ snowpack build --no-clean\n```\n\n**CLI flags will be merged with (and take priority over) your config file values.** Every config value outlined below can also be passed as a CLI flag. Additionally, Snowpack also supports the following flags:\n\n- **`--config [path]`** Set the path to your project config file.\n- **`--help`** Show this help.\n- **`--version`** Show the current version.\n- **`--reload`** Clear the local cache. Useful for troubleshooting installer issues.\n"
  },
  {
    "path": "docs/reference/common-error-details.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Common Error Details\ndescription: How to troubleshoot common issues and error messagesm, plus our resources for getting help.\n---\n\nThis page details several common issues and error messages. For further help we have an active [GitHub Discussion forum](https://github.com/withastro/snowpack/discussions)and [Discord](https://discord.gg/snowpack). Developers and community contributors frequently answer questions on both.\n\n### No such file or directory\n\n```\nENOENT: no such file or directory, open …/node_modules/csstype/index.js\n```\n\nThis error message would sometimes occur in older versions of Snowpack.\n\n**To solve this issue:** Upgrade to Snowpack `v2.6.0` or higher. If you continue to see this unexpected error in newer versions of Snowpack, please file an issue.\n\n### Package exists but package.json \"exports\" does not include entry\n\nNode.js recently added support for a package.json \"exports\" entry that defines which files you can and cannot import from within a package. Preact, for example, defines an \"exports\" map that allows you to to import \"preact/hooks\" but not \"preact/some/custom/file-path.js\". This allows packages to control their \"public\" interface.\n\nIf you see this error message, that means that you've imported a file path not allowed in the export map. If you believe this to be an error, reach out to the package author to request the file be added to their export map.\n\n### Uncaught SyntaxError: The requested module './XXXXXX.js' does not provide an export named 'YYYYYY'\n\nIf you are using TypeScript, this error could occur if you are importing or exporting something that only exists in TypeScript (like a type or interface) and doesn't actually exist in the final JavaScript code.\n\nOur built-in TypeScript support can detect type-only imports and will attempt to remove them automatically. This is however much more difficult for type-only export statements, because Snowpack cannot detect that an exported symbol is a type without keeping context across multiple files. For example, a statement such as `export { MyInterfaceName }` will not work in Snowpack.\n\n**To solve:** Enable [`isolatedModules`](https://www.typescriptlang.org/tsconfig#isolatedModules) in `tsconfig.json` to identify problematic cases. Use `import type { MyInterfaceName }` and `export type { MyInterfaceName }` to help Snowpack ignore types.\n\nThis error could also appear if named imports are used with older, Common.js npm packages. Thanks to improvements in our package scanner this is no longer a common issue for most packages. However, some packages are written or compiled in a way that makes automatic import scanning impossible.\n\n**To solve:** Use the default import (`import pkg from 'my-old-package'`) for legacy Common.js/UMD packages that cannot be analyzed. Or, add the package name to your `packageOptions.namedExports` configuration for runtime import scanning.\n\n```js\n// snowpack.config.mjs\nexport default {\n  packageOptions: {\n    namedExports: ['@shopify/polaris-tokens'],\n  },\n};\n```\n\n### Installing Non-JS Packages\n\nWhen installing packages from npm, you may encounter some file formats that can run only with additional parsing/processing. First check to see if there is a [Snowpack plugin for the type of file](/plugins).\n\nBecause our internal installer is powered by Rollup, you can also add Rollup plugins to your [Snowpack config](/reference/configuration) to handle these special, rare files:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n+   rollup: {\n+     plugins: [require('rollup-plugin-sass')()],\n+   },\n  };\n```\n\nRefer to [Rollup’s documentation on plugins](https://rollupjs.org/guide/en/#using-plugins) for more information.\n\n### RangeError: Invalid WebSocket frame: RSV1 must be clear\n\n**To solve this issue:** Use any other port than `8080` for the dev server. To do so, specify a port in your [Snowpack config](/reference/configuration):\n\n```diff\n  // snowpack.config.mjs\n  export default {\n+   devOptions: {\n+     port: 3000,\n+   },\n  };\n```\n\n### Package \"[name]\" not found. Have you installed it?\n\nThis warning appears when Snowpack believes something to be in `node_modules`, but can’t find it. This typically happens because you‘ve tried to import something without a leading `/`, `./`, or `../`.\n\nHere are some possible fixes:\n\n#### I’m trying to import a file from npm\n\nIf you were trying to import an npm package, try running the following:\n\n```\nnpm install [package].\n```\n\nThen re-running Snowpack. If the issue still persists, try telling Snowpack where to find this with [an alias](https://www.snowpack.dev/reference/configuration#alias):\n\n```diff\n  // snowpack.config.mjs\n  export default {\n+   alias: {\n+     myPackage: './path/to/myPackage',\n+   },\n  };\n```\n\n#### I’m trying to import a local `.js` file\n\nIf you‘re getting this error while trying to import a local file, the fix usually looks like this:\n\n```diff\n- import myFile from 'myFile.js';\n+ import myFile from './myFile.js';\n```\n\nIf the issue still persists, [please open an issue](https://github.com/withastro/snowpack/issues/new/choose).\n\n#### I’m trying to import a local `.css` file\n\nThe fix for `.css` files is similar to JS. Prefix a `./` to the import path like so:\n\n```diff\n- @import \"myfile.css\";\n+ @import \"./myfile.css\";\n```\n\nWhile it’s true you may be used to writing CSS without the `./`, and a browser respects it, Snowpack works a little differently. Because we let you import from npm seamlessly, `myfile.css` will be resolved as an npm package whereas `/myfile.css`, `./myfile.css`, and `../myfile.css` will be resolved as local project files.\n\nAlso, `./myfile.css` is perfectly-valid, and it’s good to get in the habit of using it consistently to prevent ambiguous resolution.\n"
  },
  {
    "path": "docs/reference/configuration.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: snowpack.config.js\ndescription: The Snowpack configuration API reference.\n---\n\n```js\n// Example: snowpack.config.mjs\n// The added \"@type\" comment will enable TypeScript type information via VSCode, etc.\n\n/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  plugins: [\n    /* ... */\n  ],\n};\n```\n\nTo generate a basic configuration file scaffold in your Snowpack project run `snowpack init`.\n\n## mode\n\n**Type**: `\"test\" | \"development\" | \"production\"`\n**Default**: `\"development\"` for `snowpack dev`, `\"production\"` for `snowpack build`.\n\nSpecifies the \"mode\" that Snowpack should run in. The main impact of this is the value of `import.meta.env.MODE` at runtime, although there are some other key differences between modes:\n\n- `\"test\"`: `testOptions.files` are not excluded, and will be scanned & built as normal source files. Useful when running tests on top of Snowpack.\n\n## root\n\n**Type**: `string`\n**Default**: `/`\n\nSpecify the root of a project using Snowpack. (Previously: `config.cwd`)\n\n## workspaceRoot\n\n**Type**: `string`\n\nSpecify the root of your workspace or monorepo, if you are using one. When configured, Snowpack will treat any sibling packages in your workspace like source files, and pass them through your unbundled Snowpack build pipeline during development. This allows for fast refresh, HMR support, file change watching, and other dev improvements when working in monorepos.\n\nWhen you build your site for production, symlinked packages will be treated like any other package, bundled and tree-shaken into single files for faster loading.\n\n## install\n\nDeprecated! Moved to `packageOptions.knownEntrypoints`\n\n## extends\n\n**Type**: `string`\n\nInherit from a separate \"base\" config.\n\nCan be a relative file path, an npm package, or a file within an npm package. Your configuration will be merged on top of the extended base config.\n\n## exclude\n\n**Type**: `string[]`\n**Default**: `['**/node_modules/**/*']`\n\nExclude any files from the Snowpack pipeline.\n\nSupports glob pattern matching.\n\n## mount\n\n```\nmount: {\n  [path: string]: string | {url: string, resolve: boolean, static: boolean, dot: boolean}\n}\n```\n\nMount local directories to custom URLs in your built application.\n\n- `mount.url` | `string` | _required_ : The URL to mount to, matching the string in the simple form above.\n- `mount.static` | `boolean` | _optional_ | **Default**: `false` : If true, don't build files in this directory. Copy and serve them directly from disk to the browser.\n- `mount.resolve` | `boolean` | _optional_ | **Default**: `true`: If false, don't resolve JS & CSS imports in your JS, CSS, and HTML files. Instead send every import to the browser, as written.\n- `mount.dot` | `boolean` | _optional_ | **Default**: `false`: If true, include dotfiles (ex: `.htaccess`) in the final build.\n\nExample:\n\n```js\n// snowpack.config.mjs\n// Example: Basic \"mount\" usage\nexport default {\n  mount: {\n    src: '/dist',\n    public: '/',\n  },\n};\n```\n\nYou can further customize this the build behavior for any mounted directory by using the expanded object notation:\n\n <!-- snowpack/src/config.ts -->\n\n```js\n// snowpack.config.mjs\n// Example: expanded object notation \"mount\" usage\nexport default {\n  mount: {\n    // Same behavior as the \"src\" example above:\n    src: {url: '/dist'},\n    // Mount \"public\" to the root URL path (\"/*\") and serve files with zero transformations:\n    public: {url: '/', static: true, resolve: false},\n  },\n};\n```\n\n## env\n\n**Type**: `Record<string, string|boolean|undefined>`\n\nDeclare any environment variables that should be exposed on `import.meta.env` at runtime. See [Environment Variables](/reference/environment-variables) for more information.\n\n```js\n// snowpack.config.mjs\nexport default {\n  env: {\n    API_URL: 'api.google.com',\n  },\n};\n```\n\n## alias\n\n**Type**: `object` (package: package or path)\n\nConfigure import aliases for directories and packages.\n\nNote: In an older version of Snowpack, all mounted directories were also available as aliases by **Default**. As of Snowpack 2.7, this is no longer the case and no aliases are defined by **Default**.\n\n```js\n// snowpack.config.mjs\n// Example: alias types\nexport default {\n  alias: {\n    // Type 1: Package Import Alias\n    lodash: 'lodash-es',\n    react: 'preact/compat',\n    // Type 2: Local Directory Import Alias (relative to cwd)\n    components: './src/components',\n    '@app': './src',\n  },\n};\n```\n\n## plugins\n\n**Type**: `array` containing pluginName `string` or an array [`pluginName`, {`pluginOptions`}\n\nEnable Snowpack plugins and their options.\n\nAlso see our [Plugin guide](/guides/plugins)\n\n```js\n// snowpack.config.mjs\n// Example: enable plugins both simple and expanded\nexport default {\n  plugins: [\n    // Simple format: no options needed\n    'plugin-1',\n    // Expanded format: allows you to pass options to the plugin\n    ['plugin-2', {'plugin-option': false}],\n  ];\n}\n```\n\n## devOptions\n\n**Type**: `object` (option name: value)\n\nConfigure the Snowpack dev server.\n\n### devOptions.secure\n\n**Type**: `boolean` or `object`\n**Default**: `false`\n\nToggles whether Snowpack dev server should use HTTPS with HTTP2 enabled. See the [SSL Certificates](/guides/https-ssl-certificates) Guide for more information.\n\nIf the value is `true`, Snowpack will look for a `snowpack.crt` and `snowpack.key` file in your `root` directory. If the value is an `object`, you may pass your custom `cert` and `key` files directly to it.\n\n```js\n// snowpack.config.mjs\nimport fs from 'fs';\n\nconst cert = await fs.promises.readFile('/path/to/server.crt');\nconst key = await fs.promises.readFile('/path/to/server.key');\n\nexport default {\n  devOptions: {\n    secure: {cert, key},\n  },\n};\n```\n\n### devOptions.hostname\n\n**Type**: `string`\n**Default**: `localhost`\n\nThe hostname that the dev server is running on. Snowpack uses this information to configure the HMR websocket and properly open\nyour browser on startup (see: [`devOptions.open`](#devoptions.open)).\n\n### devOptions.port\n\n**Type**: `number`\n**Default**: `8080`\n\nThe port the dev server runs on.\n\n### devOptions.openUrl\n\n**Type**: `string`\n\nOptional path to append to dev server url. May also include querystring parameters, example: `test/foo.html?bar=123`.\n\n### devOptions.open\n\n**Type**: `string`\n**Default**: `\"**Default**\"`\n\nConfigures how the dev server opens in the browser when it starts.\n\nAny installed browser, e.g., \"chrome\", \"firefox\", \"brave\", or the path to a browser. Set \"none\" to disable.\n\n### devOptions.output\n\n**Type**: `\"stream\" | \"dashboard\"`\n**Default**: `\"dashboard\"`\n\nSet the output mode of the `dev` console:\n\n- `\"dashboard\"` delivers an organized layout of console output and the logs of any connected tools. This is recommended for most users and results in the best logging experience.\n- `\"stream\"` is useful when Snowpack is run in parallel with other commands, where clearing the shell would clear important output of other commands running in the same shell.\n\n### devOptions.hmr\n\n**Type**: `boolean`\n**Default**: `true`\n\nToggles HMR on the Snowpack dev server.\n\n### devOptions.hmrDelay\n\n**Type**: `number` (milliseconds)\n**Default**: `0`\n\nMilliseconds to delay HMR-triggered browser update.\n\n### devOptions.hmrPort\n\n**Type**: `number`\n**Default**: [`devOptions.port`](#devoptions.port)\n\nThe port where Snowpack's HMR Websocket runs.\n\n### devOptions.hmrErrorOverlay\n\n**Type**: `boolean`\n**Default**: `true`\n\nToggles a browser overlay that displays JavaScript runtime errors when running HMR.\n\n### devOptions.out\n\n**Type**: `string`\n**Default**: `\"build\"`\n\n_NOTE:_ Deprecated, see `buildOptions.out`.\n\n### devOptions.tailwindConfig\n\n**Type**: `string`\n\nIf using Tailwind, specify the path to your config file. e.g.: `tailwindConfig: './tailwind.config.js'`\n\n## installOptions\n\n**Type**: `object`\n\n_NOTE:_ Deprecated, see `packageOptions`.\n\n## packageOptions\n\n**Type**: `object`\n\nConfigure how npm packages are installed and used.\n\n### packageOptions.external\n\n**Type**: `string[]`\n**Example**: `\"external\": [\"fs\"]`\n\nMark some imports as external. Snowpack will ignore these imports and leave them as-is in your final build.\n\nThis is an advanced feature: Bare imports are not supported in any major browser, so an ignored import will usually fail when sent directly to the browser. This will most likely fail unless you have a specific use-case that requires it.\n\n### packageOptions.source\n\n**Type**: `\"local\" | \"remote\"`\n**Default**: `\"local\"`\n**Example**: `\"source\": \"local\"`\n\nYour JavaScript npm packages can be consumed in two different ways: **local** and **remote**. Each mode supports a different set of package options. You can choose between these two different modes by setting the `packageOptions.source` property.\n\n### packageOptions.source=local\n\nLoad your dependencies from your local `node_modules/` directory. Install and manage your dependencies using `npm` (or any other npm-ready package manager) and a project `package.json` file.\n\nThis is traditional Snowpack behavior matching Snowpack v2. This mode is recommended for anyone already using npm to manage their frontend dependencies.\n\n#### packageOptions.knownEntrypoints\n\n**Type**: `string[]`\n\nKnown dependencies to install with Snowpack. Used for installing packages any dependencies that cannot be detected by our automatic import scanner (ex: package CSS files).\n\n#### packageOptions.polyfillNode\n\n**Type**: `boolean`\n**Default**: `false`\n\nThis will automatically polyfill any Node.js dependencies as much as possible for the browser\n\nConverts packages that depend on Node.js built-in modules (`\"fs\"`, `\"path\"`, `\"url\"`, etc.). You can see the full list of supported polyfills at the [rollup-plugin-node-polyfills documentation](https://github.com/ionic-team/rollup-plugin-node-polyfills)\n\nIf you'd like to customize this polyfill behavior, you can provide your own Rollup plugin for the installer:\n\n```js\n// snowpack.config.mjs\n// Example: If `--polyfill-node` doesn't support your use-case, you can provide your own custom Node.js polyfill behavior\nimport rollupPluginNodePolyfills from 'rollup-plugin-node-polyfills';\n\nexport default {\n  packageOptions: {\n    polyfillNode: false,\n    rollup: {\n      plugins: [rollupPluginNodePolyfills({crypto: true, ...})],\n    },\n  },\n};\n```\n\nWhen `source=\"remote\"`, Node.js polyfills are always provided. Configuring this option is only supported in `source=\"local\"` mode.\n\n#### packageOptions.env\n\n**Type**: `{[ENV_NAME: string]: (string true)}`\n\nSets a `process.env.` environment variable inside the installed dependencies.\n\nIf set to true (ex: `{NODE_ENV: true}` or `--env NODE_ENV`) this will inherit from your current shell environment variable. Otherwise, set to a string (ex: `{NODE_ENV: 'production'}` or `--env NODE_ENV=production`) to set the exact value manually.\n\nThis option is only supported in `source=\"local\"` mode. `source=\"remote\"` does not support this feature yet.\n\n#### packageOptions.packageLookupFields\n\n**Type**: `string[]`\n**Example**: `\"packageLookupFields\": [\"svelte\"]`\n\nSet custom lookup fields for dependency `package.json` file entrypoints, in addition to the defaults like \"module\", \"main\", etc.\n\nThis option is only supported in `source=\"local\"` mode. `source=\"remote\"` does not support this feature yet.\n\n#### packageOptions.packageExportLookupFields\n\n**Type**: `string[]`\n**Example**: `\"packageExportLookupFields\": [\"svelte\"]`\n\nSet custom lookup fields for dependency `package.json` [\"exports\" mappings.](https://nodejs.org/api/packages.html#packages_package_entry_points)\n\nThis option is only supported in `source=\"local\"` mode. `source=\"remote\"` does not support this feature yet.\n\n#### packageOptions.rollup\n\n**Type**: `Object`\n\nAllows customization of Snowpack's internal Rollup configuration.\n\nSnowpack uses Rollup internally to install your packages. This `rollup` config option gives you deeper control over the internal Rollup configuration that we use.\n\n- packageOptions.rollup.plugins | `RollupPlugin[]` - Provide an array of custom Rollup plugins that will run on every installed package. Useful for dealing with non-standard file types in your npm packages.\n- packageOptions.rollup.dedupe | `string[]` - If needed, deduplicate multiple versions/copies of a packages to a single one. This helps prevent issues with some packages when multiple versions are installed from your node_modules tree. See [rollup-plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve#usage) for more documentation.\n- packageOptions.rollup.context | `string` - Specify top-level `this` value. Useful to silence install errors caused by legacy common.js packages that reference a top-level this variable, which does not exist in a pure ESM environment. Note that the `'THIS_IS_UNDEFINED'` warning (\"'this' keyword is equivalent to 'undefined' ... and has been rewritten\") is silenced by default, unless `--verbose` is used.\n\nThis option is only supported in `source=\"local\"` mode. `source=\"remote\"` does not support custom Rollup install options.\n\n### packageOptions.source=remote\n\nEnable streaming package imports. Load dependencies from our remote CDN. Manage your dependencies using `snowpack` and a project `snowpack.deps.json` file.\n\n[Learn more about Streaming Remote Imports](/guides/streaming-imports).\n\n#### packageOptions.origin\n\n**Type**: `string`\n**Default**: `https://pkg.snowpack.dev`\n\nThe remote origin to import packages from. When you import a new package, Snowpack will fetch those resources from this URL.\n\nCurrently, the origin must implement a specific response format that Snowpack can parse for ESM. In future versions of Snowpack we plan to add support for custom CDNs and import origins.\n\n#### packageOptions.cache\n\n**Type**: `string`\n**Default**: `.snowpack`\n\nThe location of your project cache folder, relative to the project root. Snowpack will save cached data to this folder. For example, if `packageOptions.types` is set to true, Snowpack will save TypeScript types to a `types` directory within this folder.\n\n#### packageOptions.types\n\n**Type**: `boolean`\n**Default**: `false`\n\nIf true, Snowpack will download TypeScript types for every package.\n\n## buildOptions\n\n**Type**: `object` (option name: value)\n\nConfigure your final build.\n\n### buildOptions.out\n\n**Type**: `string`\n**Default**: `\"build\"`\n\nThe local directory that we output your final build to.\n\n### buildOptions.baseUrl\n\n**Type**: `string`\n**Default**: `/`\n\nIn your HTML, replace all instances of `%PUBLIC_URL%` with this\n\nInspired by the same [Create React App](https://create-react-app.dev/docs/using-the-public-folder/) concept. This is useful if your app will be deployed to a subdirectory.\n\n### buildOptions.clean\n\n**Type**: `boolean`\n**Default**: `true`\n\nSet to `false` to prevent Snowpack from deleting the build output folder (`buildOptions.out`) between builds.\n\n### buildOptions.cacheDirPath\n\n**Type**: `string`  \n**Default**: `./node_modules/.cache/snowpack`\n\nSpecify the cache directory in which bundled Node modules will be cached.\n\n### buildOptions.webModulesUrl\n\n_NOTE:_ Deprecated, see `buildOptions.metaUrlPath`.\n\n### buildOptions.metaDir\n\n_NOTE:_ Deprecated, see `buildOptions.metaUrlPath`.\n\n### buildOptions.metaUrlPath\n\n**Type**: `string`\n**Default**: `_snowpack`\n\nRename the default directory for Snowpack metadata. In every build, Snowpack creates meta files for loading things like [HMR](/concepts/hot-module-replacement), [Environment Variables](/reference/environment-variables), and your built npm packages.\n\nWhen you build your project, this will be a path on disk relative to the `buildOptions.out` directory.\n\n### buildOptions.sourcemap\n\n**Type**: `boolean`\n**Default**: `false`\n\nGenerates source maps.\n\n**_Experimental:_** Still in progress, you may encounter some issues when using source maps until this support is finalized.\n\n### buildOptions.watch\n\n**Type**: `boolean`\n**Default**: `false`\n\nRun Snowpack's build pipeline through a file watcher. This option works best for local development when you have a custom frontend server (ex: Rails, PHP, etc.) and the Snowpack dev server cannot be used.\n\n### buildOptions.htmlFragments\n\n**Type**: `boolean`\n**Default**: `false`\n\nToggles whether HTML fragments are transformed like full HTML pages.\n\nHTML fragments are HTML files not starting with `<!doctype html>`.\n\n### buildOptions.jsxFactory\n\n**Type**: `string`\n**Default**: `React.createElement` (or `h` if Preact import is detected)\n\nSet the name of the function used to create JSX elements.\n\n### buildOptions.jsxFragment\n\n**Type**: `string`\n**Default**: `React.Fragment` (or `Fragment` if Preact import is detected)\n\nSet the name of the function used to create JSX fragments.\n\n### buildOptions.jsxInject\n\n**Type**: `string`\n**Default**: `undefined`\n\nIf set, this string can be used to automatically inject JSX imports for every JSX/TSX file.\nReact users might use `import React from 'react'` whereas Preact users might use `import { h, Fragment } from 'preact'`.\n\n## testOptions\n\nConfigure your tests.\n\n### testOptions.files\n\n**Type**: `string[]`\n**Default**: `[\"__tests__/**/*\", \"**/*.@(spec|test).*\"]`\n\nSpecifies your test files. If `NODE_ENV` is set to \"test\", Snowpack includes these files in your site build and scan them for installable dependencies. Otherwise, Snowpack excludes these files.\n\n## experiments\n\n**Type**: `object` (option name: value)\n\nThis section is currently empty! In the future, this section may be used for experimental and not yet finalized.\n"
  },
  {
    "path": "docs/reference/environment-variables.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Environment Variables\ndescription: Using environment variables with Snowpack\n---\n\nFor your safety, Snowpack supports only environment variables which begin with `SNOWPACK_PUBLIC_*`. We do this because everything in your web application is sent to the browser, and we don't want you to accidentally share sensitive keys/env variables with your public web application. Prefixing your frontend web env variables with `SNOWPACK_PUBLIC_` is a good reminder that they will be shared with the world.\n\n## Setting environment variables\n\nYou can set environment variables with snowpack in three different ways:\n\n### Option 1: CLI\n\nSet environment variables when you run the snowpack CLI:\n\n```bash\nSNOWPACK_PUBLIC_API_URL=api.google.com snowpack dev\n```\n\n### Option 2: Config file\n\n**New in v3.1.0** Pass environment variables as an object to the `env` property. Note that these environment variables do not need to use the `SNOWPACK_PUBLIC_` prefix and anything set here will be available on `import.meta.env` (see below).\n\n```js\n// snowpack.config.mjs\nexport default {\n  env: {\n    API_URL: 'api.google.com',\n  },\n};\n```\n\n**In prior versions**, we recommended setting environment variables by adding to `process.env.*` at the top of your `snowpack.config.mjs` file. This ended up being pretty confusing, so using the `env` property is now the recommended approach.\n\n```js\n// snowpack.config.mjs\nprocess.env.SNOWPACK_PUBLIC_API_URL = 'api.google.com';\n// ...rest of config\n```\n\n### Option 3: Plugin\n\nUse a plugin such as [plugin-dotenv](https://www.npmjs.com/package/@snowpack/plugin-dotenv) to load environment variables from a `.env` file.\n\n## Reading environment variables\n\nYou can read environment variables directly in your web application via `import.meta.env`. If you've ever used `process.env` in Create React App or any Webpack application, this behaves exactly the same.\n\n```js\n// `import.meta.env` - Read process.env variables in your web app\nfetch(`${import.meta.env.SNOWPACK_PUBLIC_API_URL}/users`).then(...)\n\n// Supports destructuring as well:\nconst {SNOWPACK_PUBLIC_API_URL} = import.meta.env;\nfetch(`${SNOWPACK_PUBLIC_API_URL}/users`).then(...)\n\n// Instead of `import.meta.env.NODE_ENV` use `import.meta.env.MODE`\nif (import.meta.env.MODE === 'development') {\n  // ...\n```\n\n`import.meta.env.MODE` and `import.meta.env.NODE_ENV` are also both set to the current `process.env.NODE_ENV` value, so that you can change app behavior based on dev vs. build. The env value is set to `development` during `snowpack dev`, and `production` during `snowpack build`. Use this in your application instead of `process.env.NODE_ENV`.\n\nYou can also use environment variables in HTML files. All occurrences of `%SNOWPACK_PUBLIC_*%`, `%PUBLIC_URL%`, and `%MODE%` will be replaced at build time.\n\n**Remember:** that these env variables are statically injected into your application for everyone at **build time**, and not runtime.\n"
  },
  {
    "path": "docs/reference/hot-module-replacement.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Hot Module Replacement (HMR) API\ndescription: Snowpack implements HMR via the esm-hmr spec, an attempted standard for ESM-based Hot Module Replacement (HMR).\n---\n\nSnowpack implements HMR via the [esm-hmr](https://github.com/pikapkg/esm-hmr) spec, an attempted standard for ESM-based Hot Module Replacement (HMR).\n\n```js\n// HMR Code Snippet Example\nif (import.meta.hot) {\n  import.meta.hot.accept(({module}) => {\n    // Accept the module, apply it into your application.\n  });\n}\n```\n\nFull API Reference: [snowpack/esm-hmr on GitHub](https://github.com/snowpackjs/esm-hmr)\n\n[Learn more](/concepts/hot-module-replacement) about HMR, Fast Refresh, and how it's meant to work in Snowpack.\n"
  },
  {
    "path": "docs/reference/javascript-interface.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: JavaScript API\ndescription: Snowpack's JavaScript API is for anyone who wants to integrate with some custom build pipeline or server-side rendering engine.\n---\n\nMost users will interact with Snowpack via the [command-line](/reference/cli-command-line-interface) interface (CLI). However, Snowpack also ships a JavaScript API for anyone to build on top of.\n\nThis page contains reference information on Snowpack's public API and all related data types. A full set of all data types defined within the project (public and private) can be found in [the package's `types.d.ts` file](https://unpkg.com/browse/snowpack@3.0.10/lib/types.d.ts).\n\n### createConfiguration()\n\n`createConfiguration(config?: SnowpackUserConfig) => SnowpackConfig`\n\n```js\nimport {createConfiguration} from 'snowpack';\nconst config = createConfiguration({...});\n```\n\nAlmost everything that you do with Snowpack requires a configuration object. Snowpack is designed to work with zero config, and the `config` argument that this function takes can be full, empty, or only contain a couple of properties. The rest of the configuration object will be filled out with Snowpack's usual set of defaults, outlined in our [snowpack.config.mjs documentation.](/reference/configuration).\n\nThe easiest way to think about the difference is that `SnowpackUserConfig` is the externally-documented configuration format, and `SnowpackConfig` is our internal representation with all optional/undefined values populated with the actual defaults.\n\n### loadConfiguration()\n\n`loadConfiguration(overrides?: SnowpackUserConfig, configPath?: string | undefined) => Promise<SnowpackConfig>`\n\n```js\nimport {loadConfiguration} from 'snowpack';\nconst config = await loadConfiguration({...}, '/path/to/snowpack.config.mjs');\n```\n\nSimilar to `createConfiguration`, but this function will actually check the file system to load a configuration file from disk.\n\nAll paths within that configuration file are relative to the file itself.\n\n### startServer()\n\n`function startServer({config: SnowpackUserConfig}) => Promise<SnowpackDevServer>`\n\n```js\nimport {startServer} from 'snowpack';\nconst config = createConfiguration({...});\nconst server = await startServer({config}); // returns: SnowpackDevServer\n```\n\nStart a new Snowpack dev server instance. This is the equivalent of running `snowpack dev` on the command line.\n\nOnce started, you can load files from your dev server and Snowpack will build them as requested. This is an important feature to understand: Snowpack's dev server does zero file building on startup, and instead builds files only once they are requested via the server's `loadUrl` method.\n\n### SnowpackDevServer\n\n#### SnowpackDevServer.port\n\nThe port that the server is listening on.\n\n#### SnowpackDevServer.loadUrl()\n\n`loadUrl(reqUrl: string, opt?: {isSSR?: boolean; allowStale?: boolean; encoding?: string}): Promise<LoadResult<Buffer | string>>;`\n\n```ts\nconst server = await startServer({config});\nconst {contents} = server.loadUrl('/dist/index.js', {...});\n```\n\nLoad a file and return the result. On the first request of a URL, this will kick off a build that will then be cached for all future requests during the life of the server.\n\nYou can pass `allowStale: true` to enable Snowpack's cold cache for cached results from past sessions. However, Snowpack provides no guarentee on the freshness of the cold-cache data.\n\n#### SnowpackDevServer.getUrlForFile()\n\n`getUrlForFile(fileLoc: string) => string | null;`\n\n```ts\nconst server = await startServer({config});\nconst fileUrl = server.getUrlForFile('/path/to/index.jsx');\nconst {contents} = server.loadUrl(fileUrl, {...});\n```\n\nA helper function to find the final hosted URL for any source file. Useful when combined with `loadUrl`, since you may only know a file's location on disk without knowing it's final hosted URL.\n\n#### SnowpackDevServer.getUrlForPackage()\n\n`getUrlForPackage(packageSpec: string) => Promise<string>`\n\n```ts\nconst server = await startServer({config});\nconst pkgUrl = await server.getUrlForPackage('preact');\n```\n\nA helper function to find the final hosted URL of any dependency.\n\n#### SnowpackDevServer.sendResponseError()\n\n`sendResponseError(req: http.IncomingMessage, res: http.ServerResponse, status: number) => void;`\n\nA helper function to send an error response in a server response handler. Useful when integrating Snowpack with Express, Koa, or any other Node.js server.\n\n#### SnowpackDevServer.onFileChange()\n\n`onFileChange({filePath: string}) => void;`\n\nListen for watched file change events. Useful for situations where you might want to watch the file system for changes yourself, and can save overhead/performance by hooking into our already-running watcher.\n\n#### SnowpackDevServer.shutdown()\n\n`shutdown() => Promise<void>;`\n\n```ts\nconst server = await startServer({config});\nawait server.shutdown();\n```\n\nShut down the Snowpack dev server. Cleanup any long-running commands, file watchers, etc.\n\n#### SnowpackDevServer.getServerRuntime()\n\n`getServerRuntime({invalidateOnChange?: boolean}) => ServerRuntime;`\n\n```ts\nconst server = await startServer({config});\nconst runtime = server.getServerRuntime();\nconst {helloWorld} = (await runtime.importModule('/dist/index.js')).exports;\nhelloWorld();\n```\n\nReturns an ESM Server Runtime that lets Node.js import modules directly out of Snowpack's build cache. Useful for SSR, test running frontend code, and the overall unification of your build pipeline.\n\nFor more information, check out our guide on [Server-Side Rendering](/guides/server-side-render) using the `getServerRuntime()` API.\n\n#### ServerRuntime\n\n```ts\ninterface ServerRuntime {\n  /** Import a Snowpack-build JavaScript file into Node.js. */\n  importModule(url: string) => Promise<ServerRuntimeModule>;\n  /** Invalidate a module in the internal runtime cache. */\n  invalidateModule(url: string) => void;\n}\n```\n\n#### ServerRuntimeModule\n\n```ts\ninterface ServerRuntimeModule {\n  /** The imported module. */\n  exports: any;\n  /** References to all internal CSS imports. Useful for CSS extraction. */\n  css: string[];\n}\n```\n\n### build()\n\n`build({config: SnowpackUserConfig}) => Promise<SnowpackBuildResult>`\n\n```js\nimport {build} from 'snowpack';\nconst config = createConfiguration({...});\nconst {result} = await build({config}); // returns: SnowpackBuildResult\n```\n\n#### SnowpackBuildResult.result\n\nAn in-memory manifest of all build inputs & output files.\n\n#### SnowpackBuildResult.shutdown\n\nIn `--watch` mode, the `build()` function will resolve but the build itself will continue. Use this function to shut down the build watcher.\n\nIn normal build mode (non-watch mode) this function will throw with a warning.\n\n#### SnowpackBuildResult.onFileChange\n\nIn `--watch` mode, the `build()` function will resolve but the build itself will continue. Use this function to respond to file change events without having to spin up your own file watcher.\n\nIn normal build mode (non-watch mode) this function will throw with a warning.\n\n### getUrlForFile()\n\n`getUrlForFile(fileLoc: string, config: SnowpackConfig) => string | null`\n\n```js\nimport {getUrlForFile} from 'snowpack';\nconst fileUrl = getUrlForFile('/path/to/file.js', config);\n```\n\nA helper function to find the final hosted URL for any source file. Useful when combined with `loadUrl`, since you may only know a file's location on disk without knowing it's final hosted URL.\n\nSimilar to `SnowpackDevServer.getUrlForFile()`, but requires a second `config` argument to inform the result.\n\n### clearCache()\n\n`clearCache() => Promise<void>`\n\n```js\nimport {clearCache} from 'snowpack';\nawait clearCache();\n```\n\nEquivalent of using the `--reload` flag with the `snowpack` CLI. Clears all cached data in Snowpack. Useful for troubleshooting, or clearing the cache after making some change that Snowpack couldn't detect.\n\n### logger\n\n```js\nimport {logger} from 'snowpack';\n```\n\nYou can control Snowpack's internal logger directly by importing it. Note that this is an advanced feature not needed for most users. Instead, use the `verbose` config option to enable debug logging and control log message verbosity.\n"
  },
  {
    "path": "docs/reference/plugins.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Plugin API\ndescription: The Snowpack Plugin API and how to use it.\n---\n\nLooking to get started writing your own plugin? Check out our [Plugin Guide](/guides/plugins) for an overview of how plugins work and a walk-through to help you create your own.\n\nLooking for a good summary? Check out our [\"SnowpackPlugin\" TypeScript definition](https://github.com/withastro/snowpack/blob/main/snowpack/src/types.ts#L130) for a fully documented and up-to-date overview of the Plugin API and all supported options.\n\n### Overview\n\n```js\n// my-first-snowpack-plugin.js\nmodule.exports = function (snowpackConfig, pluginOptions) {\n  return {\n    name: 'my-first-snowpack-plugin',\n    config() {\n      console.log('Success!');\n    },\n  };\n};\n\n// To use this plugin, add it to your snowpack.config.mjs:\n//\n// export default {\n//   plugins: [\n//     [\"./my-first-snowpack-plugin.js\", {/* pluginOptions */ }],\n//   ],\n// };\n```\n\nA **Snowpack Plugin** is an object interface that lets you customize Snowpack's behavior. Snowpack provides different hooks for your plugin to connect to. For example, you can add a plugin to handle Svelte files, optimize CSS, convert SVGs to React components, run TypeScript during development, and much more.\n\nSnowpack's plugin interface is inspired by [Rollup](https://rollupjs.org/). If you've ever written a Rollup plugin before, then hopefully these concepts and terms feel familiar.\n\n### Lifecycle Hooks\n\n#### config()\n\n```js\nconfig(snowpackConfig) {\n  // modify or read from the Snowpack configuration object\n}\n```\n\nUse this hook to read or make changes to the completed Snowpack configuration object. This is currently the recommended way to access the Snowpack configuration, since the one passed to the top-level plugin function is not yet finalized and may be incomplete.\n\n#### load()\n\nLoad a file from disk and build it for your application. This is most useful for taking a file type that can't run in the browser (TypeScript, Sass, Vue, Svelte) and returning JS and/or CSS. It can even be used to load JS/CSS files directly from disk with a build step like Babel or PostCSS.\n\n#### transform()\n\nTransform a file's contents. Useful for making changes to all types of build output (JS, CSS, etc.) regardless of how they were originally loaded from disk.\n\n#### run()\n\nRun a CLI command, and connect it's output into the Snowpack console. Useful for connecting tools like TypeScript.\n\n#### optimize()\n\nSnowpack’s bundler plugin API is still experimental and may change in a future release. See our official bundler plugins for an example of using the current interface:\n\n- Example: [@snowpack/plugin-webpack](https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack)\n- Example: [snowpack-plugin-rollup-bundle](https://github.com/ParamagicDev/snowpack-plugin-rollup-bundle)\n\n#### onChange()\n\nGet notified any time a watched file changes. This can be useful when paired with the `markChanged()` plugin method, to mark multiple files changed at once.\n\nSee [@snowpack/plugin-sass](https://github.com/withastro/snowpack/tree/main/plugins/plugin-sass/plugin.js) for an example of how to use this method.\n\n### Plugin Properties\n\n#### knownEntrypoints\n\n```\n// Example: Svelte plugin needs to make sure this dependency can be loaded.\nknownEntrypoints: [\"svelte/internal\"]\n```\n\nA list of any npm dependencies that are added as a part of `load()` or `transform()` that Snowpack will need to know about. Snowpack analyzes most dependency imports automatically when it scans the source code of a project, but some imports are added as a part of a `load()` or `transform()` step, which means that Snowpack would never see them. If your plugin does this, add them here.\n\n#### resolve\n\n```\n// Example: Sass plugin compiles Sass files to CSS.\nresolve: {input: [\".sass\"], output: [\".css\"]}\n\n// Example: Svelte plugin compiles Svelte files to JS & CSS.\nresolve: {input: [\".svelte\"], output: [\".js\", \".css\"]}\n```\n\nIf your plugin defines a `load()` method, Snowpack will need to know what files your plugin is responsible to load and what its output will look like. **`resolve` is needed only if you also define a `load()` method.**\n\n- `input`: An array of file extensions that this plugin will load.\n- `output`: The set of all file extensions that this plugin's `load()` method will output.\n- [Full TypeScript definition](https://github.com/withastro/snowpack/tree/main/snowpack/src/types/snowpack.ts).\n\n### Plugin Methods\n\n#### this.markChanged()\n\n```js\n// Called inside any plugin hooks\nthis.markChanged('/some/file/path.scss');\n```\n\nManually mark a file as changed, regardless of whether the file changed on disk or not. This can be useful when paired with the `markChanged()` plugin hook, to mark multiple files changed at once.\n\n- See [@snowpack/plugin-sass](https://github.com/withastro/snowpack/tree/main/plugins/plugin-sass/plugin.js) for an example of how to use this method.\n- [Full TypeScript definition](https://github.com/withastro/snowpack/blob/main/snowpack/src/types.ts).\n"
  },
  {
    "path": "docs/reference/supported-files.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Supported Files\ndescription: Snowpack ships with built-in support for many file types including json, js, ts, jsx, css, css modules, and images.\n---\n\nSnowpack ships with built-in support for the following file types, no configuration required:\n\n- JavaScript (`.js`, `.mjs`)\n- TypeScript (`.ts`, `.tsx`)\n- JSON (`.json`)\n- JSX (`.jsx`, `.tsx`)\n- CSS (`.css`)\n- CSS Modules (`.module.css`)\n- Images & Assets (`.svg`, `.jpg`, `.png`, etc.)\n- WASM (`.wasm`)\n\nTo customize build behavior and support new languages [check out our tooling guide](/guides/connecting-tools)\n\n### JavaScript & ESM\n\nSnowpack was designed to support JavaScript's native ES Module (ESM) syntax. ESM lets you define explicit imports & exports that browsers and build tools can better understand and optimize for. If you're familiar with the `import` and `export` keywords in JavaScript, then you already know ESM!\n\n```js\n// ESM Example - src/user.js\nexport function getUser() {\n  /* ... */\n}\n\n// src/index.js\nimport {getUser} from './user.js';\n```\n\nAll modern browsers support ESM, so Snowpack is able to ship this code directly to the browser during development. This is what makes Snowpack's **unbundled development** workflow possible.\n\nSnowpack also lets you import non-JavaScript files directly in your application. Snowpack handles all this for you automatically so there's nothing to configure, using the following logic:\n\n### TypeScript\n\nSnowpack includes built-in support to build TypeScript files (`*.ts`) to JavaScript.\n\nNote that this built-in support is build only. By default, Snowpack does not type-check your TypeScript code. To integrate type checking into your development/build workflow, add the [@snowpack/plugin-typescript](https://www.npmjs.com/package/@snowpack/plugin-typescript) plugin.\n\n### JSX\n\nSnowpack includes built-in support to build JSX files (`*.jsx` & `*.tsx`) to JavaScript.\n\nIf you are using Preact, Snowpack will detect this and switch to use the Preact-style JSX `h()` function. This is all done automatically for you. If you need to customize this behavior, consider adding the [@snowpack/plugin-babel](https://www.npmjs.com/package/@snowpack/plugin-babel) plugin for full compiler customization via Babel.\n\n**Note: Snowpack's default build does not support JSX in `.js`/`.ts` files.** If you can't use the `.jsx`/`.tsx` file extension, you can use [@snowpack/plugin-babel](https://www.npmjs.com/package/@snowpack/plugin-babel) to build your JavaScript instead.\n\n### JSON\n\n```js\n// Load the JSON object via the default export\nimport json from './data.json';\n```\n\nSnowpack supports importing JSON files directly into your application. Imported files return the full JSON object in the default import.\n\n### CSS\n\n```js\n// Load and inject 'style.css' onto the page\nimport './style.css';\n```\n\nSnowpack supports importing CSS files directly into your application. Imported styles expose no exports, but importing one will automatically add those styles to the page. This works for all CSS files by default, and can support compile-to-CSS languages like Sass & Less via plugins.\n\nIf you prefer not to write CSS, Snowpack also supports all popular CSS-in-JS libraries (ex: styled-components) for styling.\n\n### CSS Modules\n\n```js\n// 1. Converts './style.module.css' classnames to unique, scoped values.\n// 2. Returns an object mapping the original classnames to their final, scoped value.\nimport styles from './style.module.css';\n\n// This example uses JSX, but you can use CSS Modules with any framework.\nreturn <div className={styles.error}>Your Error Message</div>;\n```\n\nSnowpack supports CSS Modules using the `[name].module.css` naming convention. Like any CSS file, importing one will automatically apply that CSS to the page. However, CSS Modules export a special default `styles` object that maps your original classnames to unique identifiers.\n\nCSS Modules help you enforce component scoping & isolation on the frontend with unique-generated class names for your stylesheets.\n\n### Other Assets\n\n```jsx\nimport imgReference from './image.png'; // img === '/src/image.png'\nimport svgReference from './image.svg'; // svg === '/src/image.svg'\nimport txtReference from './words.txt'; // txt === '/src/words.txt'\n\n// This example uses JSX, but you can use import references with any framework.\n<img src={imgReference} />;\n```\n\nAll other assets not explicitly mentioned above can be imported via ESM `import` and will return a URL reference to the final built asset. This can be useful for referencing non-JS assets by URL, like creating an image element with a `src` attribute pointing to that image.\n\n### WASM\n\n```js\n// Loads and intializes the requested WASM file\nconst wasm = await WebAssembly.instantiateStreaming(fetch('/example.wasm'));\n```\n\nSnowpack supports loading WASM files directly into your application using the browser's [`WebAssembly`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly) API. Read our [WASM guide](/guides/wasm) to learn more.\n\n### Import NPM Packages\n\n```js\n// Returns the React & React-DOM npm packages\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n```\n\nSnowpack lets you import npm packages directly in the browser. Even if a package was published using a legacy format, Snowpack will up-convert the package to ESM before serving it to the browser.\n\nWhen you start up your dev server or run a new build, you may see a message that Snowpack is \"installing dependencies\". This means that Snowpack is converting your dependencies to run in the browser. This needs to run only once, or until you next change your dependency tree by adding or removing dependencies.\n"
  },
  {
    "path": "docs/tutorials/getting-started.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: 'Starting a New Project'\ndescription: This guide shows you how to set up Snowpack from scratch in a Node.js project. Along the way learn key concepts of Snowpack and unbundled development.\n---\n\nWelcome to Snowpack! This guide shows you how to set up Snowpack from scratch in a Node.js project. Along the way learn key concepts of Snowpack and unbundled development\n\nIn this guide you'll learn\n\n- What makes Snowpack so fast? (hint: unbundled development!)\n- What are JavaScript ES Modules (ESM)?\n- Creating your first project\n- Starting Snowpack's development server\n- Building your first project\n- Customizing Snowpack with plugins\n\n> 💡 Tip: This guide walks you through creating the [Snowpack minimal app template](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/) from scratch. Spin up a copy of the final [using the create-snowpack-app command line tool](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/).\n\nPrerequisites: Snowpack is a command line tool installed from npm. This guide assumes a basic understanding of JavaScript, npm, and how to run commands in the terminal.\n\nSnowpack also requires a modern browser during development. Any semi-recent release of Firefox, Chrome, Safari, or Edge for example.\n\n## Install Snowpack\n\nTo get started, create an empty directory for your new Snowpack project. Create the new directory using your favorite GUI or by running the command line as shown here:\n\n```bash\nmkdir my-first-snowpack\ncd my-first-snowpack\n```\n\nSnowpack is a package installed from npm. Create a `package.json` file in your project directory to manage your dependencies. Run this command in your project to create a simple, empty `package.json`:\n\n```bash\nnpm init\n```\n\n> 💡 Tip: In a hurry? Run `npm init --yes` to skip the prompts and generate a package.json with npm's default, recommended fields.\n\nNow install Snowpack to your `dev dependencies` with this command:\n\n```\nnpm install --save-dev snowpack\n```\n\n> 💡 Tip: Snowpack can install globally via `npm install -g snowpack`. But, we recommend installing locally in every project via `--save-dev`/`--dev`. Run the Snowpack command-line tool locally via package.json \"scripts\", npm's `npx snowpack`, or via `yarn snowpack`.\n\n## Snowpack's development server\n\nAdding a basic HTML file allows us to run Snowpack's development server, an instant development environment for unbundled development. The development server builds a file only when it's requested by the browser. That means that Snowpack can start up instantly (usually in **<50 ms**) and scale to infinitely large projects without slowing down. In contrast, it's common to see 30+ second development startup times when building large apps with a traditional bundler.\n\nCreate an `index.html` in your project with the following contents:\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Starter Snowpack App\" />\n    <title>Starter Snowpack App</title>\n  </head>\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n  </body>\n</html>\n```\n\nAdd the Snowpack development server to `package.json` under as the `start` script:\n\n```diff\n  \"scripts\": {\n+   \"start\": \"snowpack dev\",\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n\n```\n\nRun the following on the command line to start the Snowpack development server\n\n```\nnpm run start\n```\n\nIf all went well, Snowpack automatically opens your site in a new browser!\n\n<div class=\"frame\"><img src=\"/img/guides/getting-started/run-snowpack.jpg\" alt=\"Side by side of the terminal showing the dev server output. The dev server output displays the localhost address the project is running on. In a browser window you can see the running project on localhost, which is 'Welcome to Snowpack' on a white background.\" class=\"screenshot\"/></div>\n\nCongratulations! You now have a Snowpack project up and running! Try changing the index.html and saving while the server is running, the site should refresh and show changes automatically.\n\n## Using JavaScript\n\nLearn more about how Snowpack processes JavaScript by adding a simple \"hello world\" script. JavaScript's native ES Module (ESM) syntax is the magic behind Snowpack's unbundled development. There's a good chance that you're already familiar with ESM, and you just don't know it! ESM lets you define explicit imports & exports that browsers and build tools can better understand and optimize for. If you're familiar with the `import` and `export` keywords in JavaScript, then you already know ESM!\n\nCreate a new JavaScript file called `hello-world.js` that exports a single `helloWorld` function:\n\n```js\n// my-first-snowpack/hello-world.js\nexport function helloWorld() {\n  console.log('Hello World!');\n}\n```\n\nThen create an `index.js` that imports your new module using ESM syntax:\n\n```js\n// my-first-snowpack/index.js\nimport {helloWorld} from './hello-world.js';\n\nhelloWorld();\n```\n\nSnowpack scans for files referenced in `index.html`, so add your `index.js` to `index.html` at the bottom of the `<body>` tag:\n\n```diff\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n+   <script type=\"module\" src=\"/index.js\"></script>\n  </body>\n```\n\nCheck your console on your Snowpack site. You should see \"Hello World!\" Try making a change to the module. Snowpack rebuilds that module without rebuilding the rest of your code. Snowpack builds **every file individually and caches it indefinitely.** Your development environment never builds a file more than once and your browser never downloads a file twice (until it changes). This is the real power of unbundled development, and the secret behind what makes Snowpack so fast.\n\n<div class=\"frame\"><img src=\"/img/guides/getting-started/hello-world.gif\" alt=\"Gif showing the code next to the project running in the browser. On save the console shows 'Hello World!'. On edit and save of the `hello-world.js` file to be 'Hello everyone!' instead, that instantly shows in the browser console.\" class=\"screenshot\"/></div>\n\n## Using npm Packages\n\nSnowpack builds any npm package into ESM web modules. npm packages are mainly published using a module syntax (Common.js, or CJS) that can't run on the web without some build processing. Even if you write your application using browser-native ESM `import` and `export` statements that would all run directly in the browser, trying to import any one npm package forces you back into bundled development.\n\n**Snowpack takes a different approach:** instead of bundling your entire application for this one requirement, Snowpack processes your dependencies separately. Here's how it works:\n\n```\nnode_modules/react/**/*     -> http://localhost:3000/web_modules/react.js\nnode_modules/react-dom/**/* -> http://localhost:3000/web_modules/react-dom.js\n```\n\n1. Snowpack scans your website/application for all used npm packages.\n2. Snowpack reads these installed dependencies from your `node_modules` directory.\n3. Snowpack bundles all your dependencies separately into single JavaScript files. For example: `react` and `react-dom` convert to `react.js` and `react-dom.js`, respectively.\n4. Each resulting file runs directly in the browser, and imported via ESM `import` statements.\n5. Because your dependencies rarely change, Snowpack rarely needs to rebuild them.\n\nAfter Snowpack builds your dependencies, import any package and run it directly in the browser with zero extra bundling or tooling. This ability to import npm packages natively in the browser (without a bundler) is the foundation that all unbundled development and the rest of Snowpack builds on top of.\n\nSnowpack lets you import npm packages directly in the browser. Even if a package is using a legacy format, Snowpack up-converts the package to ESM before serving it to the browser.\n\n> 💡 Tip: when you start up your development server or run a new build, you may see a message that Snowpack is \"installing dependencies.\" This means that Snowpack is converting your dependencies to run in the browser.\n\nInstall the canvas-confetti package from npm and use it with the following command:\n\n```bash\nnpm install --save canvas-confetti\n```\n\nNow head to `index.js` and add this code:\n\n```diff\nhelloWorld();\n\n+import confetti from 'canvas-confetti';\n+confetti.create(document.getElementById('canvas'), {\n+  resize: true,\n+  useWorker: true,\n+ })({ particleCount: 200, spread: 200 });\n```\n\n> 💡 Tip: did you know, with Snowpack you can also add this code directly to your HTML if you prefer!\n\nYou should now see a nifty confetti effect on your site.\n\n<div class=\"frame\"><img src=\"/img/guides/getting-started/npm-snowpack-confetti.gif\" alt=\"Gif showing the code next to the project running in the browser. When the code snippet is added and saved, a confetti effect shows in the browser\" class=\"screenshot\"/></div>\n\n> 💡 Tip: not all npm modules may work well in the browser. Modules dependent on Node.js built-in modules need a polyfill. You can enable this polyfill by setting Snowpack’s [`packageOptions.polyfillNode` configuration option](/reference/configuration#packageoptions.polyfillnode) to `true`.\n\n## Adding CSS\n\nSnowpack natively supports many file types. CSS and CSS Modules for example. Add a simple CSS file to see how it works.\n\nAdd the following css as a new `index.css` file:\n\n```css\nbody {\n  font-family: sans-serif;\n}\n```\n\nInclude it in your project by adding it to index.html in the `<head>`\n\n```diff\n    <meta name=\"description\" content=\"Starter Snowpack App\" />\n+   <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Starter Snowpack App</title>\n```\n\n<div class=\"frame\"><img src=\"/img/guides/getting-started/snowpack-font-css.jpg\" alt=\"image showing the effects of the new CSS file: the font has changed from serif to sans-serif\" class=\"screenshot\"/></div>\n\n## Build for production/deployment\n\nOK you've now built a very simple website and you want to launch it. It's time to use `snowpack build`.\n\nBy default, `snowpack build` builds your site using the same unbundled approach as the `dev` command. Building is integrated with your development setup which guarantees a near-exact copy of the same code that you saw during development.\n\nAdd the `snowpack build` command to package.json so it's easier to run on the command line:\n\n```diff\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n+   \"build\": \"snowpack build\",\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n\n  },\n\n```\n\nNow you can run this in your terminal:\n\n```bash\nnpm run build\n```\n\nYou should see a new directory called `build` that contains a copy of your Snowpack project ready for deployment.\n\n<div class=\"frame\"><img src=\"/img/guides/getting-started/snowpack-build.gif\" alt=\"GIF terminal running Snowpack build, showing output, then clicking on the new `build` directory\" class=\"screenshot\"/></div>\n\n## Next Steps\n\nYou've just learned the major concepts of unbundled developments and built a tiny Snowpack project. But that's just the beginning with Snowpack.\n\nWhat's next? Our docs site has several great resources\n\n- [Bundling for production guide](/guides/optimize-and-bundle): how to connect a bundler like Webpack to optimize code for production deployments\n- [Plugins](/plugins): a list of plugins that allow you to integrate your favorite tools with Snowpack\n- [Templates/Examples](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli): pre-built projects you can build on or just explore using many popular frameworks and tools\n- [Guides](/guides): Step by step deep dives on building with and for Snowpack. Includes frameworks like React and Svelte.\n\nIf you have any questions, comments, or corrections, we'd love to hear from you in the Snowpack [discussion](https://github.com/withastro/snowpack/discussions) forum or our [Snowpack Discord community](https://discord.gg/rS8SnRk).\n"
  },
  {
    "path": "docs/tutorials/quick-start.md",
    "content": "---\nlayout: ../../layouts/content.astro\ntitle: Quick Start\ndescription: A very basic guide for developers who want to run Snowpack as quickly as possible.\n---\n\n### Install Snowpack\n\n```bash\n# npm:\nnpm install --save-dev snowpack\n# yarn:\nyarn add --dev snowpack\n# pnpm:\npnpm add --save-dev snowpack\n```\n\n### Run the Snowpack CLI\n\n```bash\nnpx snowpack [command]\nyarn run snowpack [command]\npnpm run snowpack [command]\n```\n\nThroughout our documentation, we'll use `snowpack [command]` to document the CLI. To run your locally installed version of Snowpack, add the `npx`/`yarn run`/`pnpm run` prefix of the package manager that you used to install Snowpack.\n\nFor long-term development, the best way to use Snowpack is with a package.json script. This reduces your own need to remember exact Snowpack commands/configuration, and lets you share some common scripts with the rest of your team (if applicable).\n\n```js\n// Recommended: package.json scripts\n// npm run start (or: \"yarn run ...\", \"pnpm run ...\")\n\"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\"\n}\n```\n\n### Serve your project locally\n\n```\nsnowpack dev\n```\n\nThis starts the local dev server for development. By default this serves your current working directory to the browser, and will look for an `index.html` file to start. You can customize which directories you want to serve via the [\"mount\"](/reference/configuration) configuration.\n\n### Build your project\n\n```\nsnowpack build\n```\n\nThis builds your project into a static `build/` directory that you can deploy anywhere. You can customize your build via [configuration](/reference/configuration).\n\n### See all commands & options\n\n```\nsnowpack --help\n```\n\nThe `--help` flag will display helpful output.\n"
  },
  {
    "path": "docs/tutorials/react.md",
    "content": "---\nlayout: ../../layouts/content-with-cover.astro\ntitle: 'Getting Started with React'\ndescription: 'Get started with this in-depth tutorial on how to build React applications and websites with Snowpack and developer tools like React Fast Refresh'\ndate: 2020-12-01\ntags: communityGuide\ncover: '/img/ReactGuide.jpg'\nimg: '/img/ReactGuide.jpg'\n---\n\nSnowpack is a great fit for [React](https://reactjs.org/) projects of any size. It's easy to get started and can scale to projects containing thousands of components and pages without any impact on development speed. Unlike traditional React application tooling, Snowpack saves you from getting bogged down with complex bundler setups and configuration files.\n\nIn this guide, you'll go from an empty directory to a fully configured Snowpack project with support for React and several other useful developer tools. In the process, you'll learn:\n\n- How to set up your Snowpack development environment\n- Adding your first React component\n- Working with CSS, images and other web assets\n- Enabling [Fast Refresh](https://reactnative.dev/docs/fast-refresh) mode for React\n- Connecting your favorite tools\n\nPrerequisites: Snowpack is a command line tool installed from npm. This guide assumes a basic understanding of Node.js, npm, and how to run commands in the terminal. Knowledge of React is not required, Snowpack is a great way to learn React!\n\n> 💡 Tip: if you want to jump to the end to see a full featured React setup, the [Create Snowpack App React template](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react) comes with everything you'll learn in this guide plus other useful tools.\n\n## Getting started\n\nThe easiest way to start a new Snowpack project is with [Create Snowpack App](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli), a tool to set up Snowpack in a new directory. `@snowpack/project-template-minimal` is a Create Snowpack App template for a simple, bare-bones Snowpack project setup that the rest of this guide builds on.\n\nTo get started, open your terminal and head to a directory where you want to put your new project. Now run the following command in your terminal to create a new directory called `react-snowpack` with the minimal template automatically installed.\n\n```bash\nnpx create-snowpack-app react-snowpack --template @snowpack/app-template-minimal\n```\n\nYou can now head to the new directory and start Snowpack with the following two commands:\n\n```bash\ncd react-snowpack\nnpm run start\n```\n\nYou should see your new website up and running!\n\n> 💡 Tip: the `README.md` in your new project contains useful information about what each file does.\n\n<div class=\"frame\"><img src=\"/img/guides/react/minimalist-hello-world.png\" alt=\"screenshot of project-template-minimal, which shows 'Hello world' in text on a white background.\" class=\"screenshot\"/></div>\n\nNow that you have a basic project up and running, to install React, run the following command in your project directory:\n\n```bash\nnpm install react react-dom --save\n```\n\n> 💡 Tip: add the `--use-yarn` or `--use-pnpm` flag to use something other than npm\n\n## Create your first React component\n\nReact relies on a special templating language called JSX. If you're familiar with React then you already know JSX: it's React's templating language that allows you to write something like `<App />` or `<Header></Header>` directly in your JavaScript code.\n\nSnowpack has built in support for JSX in files using the `.jsx` extension. That means that there's no plugins or configuration needed to write your first React component. Rename `index.js` file to `index.jsx` so that Snowpack knows to handle JSX in the file:\n\n```bash\nmv index.js index.jsx\n```\n\n> 💡 Tip: you do not need to update your `index.html` script tag reference to point to `index.jsx`. Browsers don't speak JSX (or TypeScript, for that matter), so any compile-to-JS file formats compile to `.js` in the final browser build. This is good to keep in mind when you're referencing built files in HTML `<script src=\"\">` and `<link href=\"\">` elements.\n\nYou can now import React in `index.jsx` and add a simple test component just to make sure it's working:\n\n```diff\n  /* Add JavaScript code here! */\n- console.log('Hello World! You did it! Welcome to Snowpack :D');\n+ import React from 'react';\n+ import ReactDOM from 'react-dom';\n+ ReactDOM.render(<div>\"HELLO REACT\"</div>, document.getElementById('root'));\n```\n\nSince the React code is rendering into an element with the ID `root`, you'll need to add that to `index.html`:\n\n```diff\n  <body>\n-   <h1>Welcome to Snowpack!</h1>\n+   <div id=\"root\"></div>\n    <script type=\"module\" src=\"/index.js\"></script>\n  </body>\n```\n\n<div class=\"frame\"><img src=\"/img/guides/react/minimalist-hello-world-react.png\" alt=\"screenshot of the project, which shows 'HELLO REACT' on a white background\" class=\"screenshot\"/></div>\n\nYou've just created your first React component in Snowpack!\n\n## Customize your project layout\n\nSince you'll be adding a bunch of new files, you probably don't want them crowding up your top-level root directly. Snowpack is flexible enough to support whatever project layout that you prefer. In this guide, you'll learn how to use a popular project pattern from the React community.\n\n```\n📁 src : your React components and their assets (CSS, images)\n    ↳ index.jsx\n📁 public : global assets like images, fonts, icons, and global CSS\n    ↳ index.css\n    ↳ index.html\n```\n\nUse your favorite visual editor to rearrange and rename, or run these commands in the terminal:\n\n```bash\nmkdir src\nmkdir public\nmv index.jsx src/index.jsx\nmv index.html public/index.html\nmv index.css public/index.css\n```\n\nThis means if you are running Snowpack right now, the site is now broken as the files are all in different places. Lets add a \"mount\" configuration to update your site to your new project layout.\n\nThe `mount` configuration changes where Snowpack looks for and builds files. Every Snowpack project comes with a `snowpack.config.mjs` file for any configuration that you might need. Right now, you should see a configuration file with empty options. Add this to the empty `mount` object:\n\n```diff\n  export default {\n    mount: {\n-     /* ... */\n+     // directory name: 'build directory'\n+     public: '/',\n+     src: '/dist',\n    },\n  };\n```\n\n<img src=\"/img/guides/react/folderstructure.png\" alt=\"The original file configuration had Snowpack building the directory structure the same as the directories in the project, including root. Now the config builds only src and public. Src to the dist folder and public to root.\" />\n\n`mount` is part of the [Snowpack Configuration API](/reference/configuration). It allows you to customize the file structure of your project. The key is the name of the directory and the value is where you'd like them in the final build. With this new configuration, Snowpack builds files in `public` like `public/index.css` directory into `index.css`. It builds files in `src` like `src/index.js` into `/dist/index.js`, so you'll need to change that path in your `index.html`:\n\n```diff\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n    <div id=\"root\"></div>\n-   <script type=\"module\" src=\"/index.js\"></script>\n+   <script type=\"module\" src=\"/dist/index.js\"></script>\n  </body>\n```\n\nYou'll need to restart Snowpack for configuration file changes. When you start up again, if it worked, it should look the same.\n\nCreate a new file at `src/App.jsx` and paste the following code into this new file to create an `App` component:\n\n```jsx\nimport React, {useState, useEffect} from 'react';\n\nfunction App() {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Update the count (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n```\n\nNow include it in `index.jsx`\n\n```diff\n  import React from 'react';\n  import ReactDOM from 'react-dom';\n- ReactDOM.render(<div>\"HELLO WORLD\"</div>, document.getElementById('root'));\n+ import App from './App.jsx';\n+ ReactDOM.render(\n+   <React.StrictMode>\n+     <App />\n+   </React.StrictMode>,\n+   document.getElementById('root'),\n+ );\n```\n\n> 💡 Tip: [Strict Mode](https://reactjs.org/docs/strict-mode.html) is a tool for highlighting potential problems in React code.\n\nYou shouldn't need to restart Snowpack to see this, it should look like this:\n\n<div class=\"frame\"><img src=\"/img/guides/react/minimalist-hello-world-react-timer.png\" alt=\"screenshot of the project with text that says 'Page has been open for' and the number of seconds then 'seconds'\" class=\"screenshot\"/></div>\n\n## Styling your project\n\nWhen you add assets like images or CSS, Snowpack includes them in your final build. If you already know React, this process should look pretty familiar.\n\n> 💡 Tip: as you're doing this, you should not need to reload the page or restart Snowpack. Snowpack automatically updates the project in the browser as you edit code.\n\nAdd this file [`logo.svg`](https://github.com/withastro/snowpack/blob/main/create-snowpack-app/app-template-react/src/logo.svg) to your `src` directory. Now you can import it into your `App.jsx` and use it in an `img` tag to display it.\n\n```diff\n  import React, { useState, useEffect } from 'react';\n+ import logo from './logo.svg';\n\n  function App() {\n    // Create the count state.\n    const [count, setCount] = useState(0);\n    // Create the counter (+1 every second).\n    useEffect(() => {\n      const timer = setTimeout(() => setCount(count + 1), 1000);\n      return () => clearTimeout(timer);\n    }, [count, setCount]);\n    // Return the App component.\n    return (\n      <div className=\"App\">\n        <header className=\"App-header\">\n+       <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n```\n\n<div class=\"frame\"><img src=\"/img/guides/react/minimalist-hello-world-react-logo.png\" alt=\"the React logo (a blue atom) is now at the top of the page\" class=\"screenshot\"/></div>\n\nThe project already has index.css for global styles. For CSS that's only for a specific component, a common design pattern is to add it in a CSS file with the same base name as the component. The style file for `App.jsx` would be `App.css` with this pattern.\n\n> 💡 Tip: Snowpack has built-in support for [CSS Modules](/reference/supported-files) and if you'd like to use Sass there is an official [Sass Plugin](/guides/sass/).\n\nCreate `src/App.css` and add this CSS:\n\n```css\n.App {\n  text-align: center;\n}\n\n.App p {\n  margin: 0.4rem;\n}\n\n.App-logo {\n  height: 40vmin;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n```\n\nTo use this CSS, head to `App.jsx` and import it\n\n```diff\n  import logo from './logo.svg';\n+ import './App.css';\n```\n\n<div class=\"frame\"><img src=\"/img/guides/react/react.gif\" alt=\"The page now has centered items, a grey background, styled fonts, and the React logo has an animation that rotates it.\" class=\"screenshot\"/></div>\n\n## Making Snowpack Even Faster with Fast Refresh\n\n[React Fast Refresh](https://reactnative.dev/docs/fast-refresh)? What's that? It's a Snowpack enhancement that lets you push individual file changes to update the browser without refreshing the page or clearing component state.\n\nReact projects are often interactive and include state. For example, this project you're building has a state that is the amount of time on the page. When developing with state it's useful not to lose it while you edit code. React Fast Refresh shows you updates without refreshing the entire page. Showing you how to add this is also a good intro to Snowpack plugins. Snowpack starts with a minimal setup with the perspective that you can add what you need through the plugin system.\n\nStart by enabling [Hot Module Replacement](/concepts/hot-module-replacement) in your project. HMR is the system that lets Snowpack push updates to the browser without a full page refresh, a requirement for Fast Refresh. You can enable HMR for React by adding a small snippet of code to your `src/index.jsx` file.\n\n```diff\n  ReactDOM.render(\n    <React.StrictMode>\n      <App />\n    </React.StrictMode>,\n    document.getElementById('root'),\n  );\n+ // Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n+ // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\n+ if (import.meta.hot) {\n+   import.meta.hot.accept();\n+ }\n```\n\nNow when you change `App.jsx` the page updates to show your changes without a full refresh.\n\n<div class=\"frame\"><img src=\"/img/guides/react/hmr.gif\" alt=\"GIF showing code side by side with the app. A change in made to App.jsx and it shows immediately when the file is changed. The counter keeps counting uninterrupted.\" class=\"screenshot\"/></div>\n\nHMR can save you time on its own, but you may notice in the example above that the counter on the page still resets to 0. This can slow down your development, especially when you're trying to debug a specific component state problem. Lets enable Fast Refresh to preserve component state across updates.\n\nTo enable Fast Refresh, you'll need to install the `@snowpack/plugin-react-refresh` package. This package is a Snowpack plugin, which you can use to enhance or customize Snowpack with all sorts of new behaviors. To start, install the package in your project:\n\n```bash\nnpm install @snowpack/plugin-react-refresh --save-dev\n```\n\nOnce installed, you'll need to add the plugin to your Snowpack configuration file so that Snowpack knows to use it:\n\n```diff\n  module.exports = {\n    mount: {\n      public: '/',\n      src: '/dist',\n    },\n-   plugins: []\n+   plugins: ['@snowpack/plugin-react-refresh'],\n  };\n```\n\nRestart Snowpack to apply the new plugin, and then try changing the `App.jsx` component again. If Fast Refresh is working properly, the counter keeps its value across changes, without resetting to zero.\n\n<div class=\"frame\"><img src=\"/img/guides/react/react-fast-refresh.gif\" alt=\"GIF showing code side by side with the app. A change in made to App.jsx and it shows immediately when the file is changed. The counter keeps counting uninterrupted.\" class=\"screenshot\"/></div>\n\n## Going further\n\nGreat job! You're now ready to build the React project of your dreams with Snowpack. Want to tweet your accomplishment to the world? Click the button below:\n\n<a href=\"https://twitter.com/share?ref_src=twsrc%5Etfw\" class=\"twitter-share-button\" data-text=\"I just learned how to build a React app with #Snowpack. Check out the tutorial:\" data-show-count=\"false\">Tweet</a><script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n\nAt this point you have the basics and have a great starter for any React project. But if you compare with the official [Snowpack React template](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react) you'll notice it has some other developer tools you might find useful:\n\n- [Prettier](https://prettier.io/) — a popular code formatter\n- [Tests](/guides/testing) — Snowpack supports any popular JavaScript testing framework\n- [`@snowpack/plugin-dotenv`](https://github.com/withastro/snowpack/tree/main/plugins/plugin-dotenv) — Use `dotenv` in your Snowpack. This is useful for environment specific variables\n\nIf you'd like to use Typescript with Snowpack and React, check out the [Snowpack React Typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-react-typescript) starter.\n\nIf you have any questions, comments, or corrections, we'd love to hear from you in the Snowpack [discussion](https://github.com/withastro/snowpack/discussions) forum or our [Snowpack Discord community](https://discord.gg/rS8SnRk).\n"
  },
  {
    "path": "docs/tutorials/svelte.md",
    "content": "---\nlayout: ../../layouts/content-with-cover.astro\ntitle: 'Getting Started with Svelte'\ndescription: 'Get started with this in-depth tutorial on how to build Svelte applications and websites with Snowpack'\ndate: 2020-12-01\nsidebarTitle: Svelte\ntags: communityGuide\ncover: '/img/SvelteGuide.jpg'\nimg: '/img/SvelteGuide.jpg'\n---\n\nSnowpack is a great fit for [Svelte](https://svelte.dev/) projects of any size. It's easy to get started and can scale to projects containing thousands of components and pages without any impact on development speed. Unlike traditional Svelte application tooling, Snowpack saves you from getting bogged down with complex bundler setups and configuration files.\n\n> Snowpack is … astonishingly fast, and has a beautiful development experience (hot module reloading, error overlays and so on), and we've been working closely with the Snowpack team on features like SSR[Server-side rendering]. The hot module reloading is particularly revelatory. - [Rich Harris, creator of Svelte](https://svelte.dev/blog/whats-the-deal-with-sveltekit)\n\nThis guide is a step by step from an empty directory to a fully configured Snowpack project, in the process teaching:\n\n- How to set up your Snowpack development environment\n- Adding your first Svelte component\n- Importing images and other web assets\n- Enabling Hot Module Replacement (HMR)\n- Connecting your favorite tools\n\nPrerequisites: Snowpack is a command-line tool installed from npm. This guide assumes a basic understanding of Node.js, npm, and how to run commands in the terminal. Knowledge of Svelte is not required: Snowpack is an excellent way to learn Svelte!\n\n> 💡 Tip: a [Svelte/Snowpack](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte) working example is available in our Create Snowpack App templates.\n\n## Getting started\n\nThe easiest way to start a new Snowpack project is with [Create Snowpack App](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli), a tool for creating a new project based on our example templates. `@snowpack/app-template-minimal` is a Create Snowpack App template for a simple, bare-bones Snowpack project setup that the rest of this guide builds on.\n\nRun the following command in your terminal to create a new directory called `svelte-snowpack` with the minimal template installed:\n\n```bash\nnpx create-snowpack-app svelte-snowpack --template @snowpack/app-template-minimal\n```\n\nHead to the new `svelte-snowpack` directory and start Snowpack with the following two commands:\n\n```bash\ncd svelte-snowpack\nnpm run start\n```\n\nYou should see your new website up and running!\n\n<div class=\"frame\"><img src=\"/img/guides/react/minimalist-hello-world.png\" alt=\"screenshot of project-template-minimal, which shows 'Hello world' in text on a white background.\" class=\"screenshot\"/></div>\n\nNow that you have a basic project up and running! The next step is to install Svelte. Run the following command in your project directory:\n\n```bash\nnpm install svelte --save\n```\n\n> 💡 Tip: add the `--use-yarn` or `--use-pnpm` flag to use something other than npm\n\n```bash\nnpm install @snowpack/plugin-svelte --save-dev\n```\n\nSnowpack [plugins](/plugins) are a way to extend Snowpack's capabilities without having to do custom configuration yourself. Install the `@snowpack/plugin-svelte` plugin so that Snowpack knows how built `.svelte` files into JavaScript and CSS files that run in the browser:\n\nOnce installed, you'll need to add the plugin to your Snowpack configuration file (`snowpack.config.mjs`) so that Snowpack knows to use it:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    mount: {\n      /* ... */\n    },\n    plugins: [\n-     /* ... */\n+     '@snowpack/plugin-svelte',\n    ],\n  };\n```\n\nRestart your Snowpack dev server to run it with the new configuration. Exit the process (ctrl + c in most Windows/Linux/macOS) and start it again with `npm run start`.\n\n> 💡 Tip: Restart the Snowpack development server when you make configuration changes (changes to the `snowpack.config.mjs`).\n\nSnowpack will recognize the new dependency (Svelte, or \"svelte/internal\") and print the following output as installs your dependencies for the frontend:\n\n```bash\n[snowpack] installing dependencies...\n[snowpack] ✔ install complete! [0.45s]\n[snowpack]\n  ⦿ web_modules/                                size       gzip       brotli\n    ├─ svelte-hmr/runtime/hot-api-esm.js        22.17 KB   7.42 KB    6.3 KB\n    ├─ svelte-hmr/runtime/proxy-adapter-dom.js  5.17 KB    1.65 KB    1.38 KB\n    └─ svelte/internal.js                       52.78 KB   13.24 KB   11.45 KB\n```\n\n## Create your first Svelte component\n\nYou now have your Snowpack environment set up to build `.svelte` files for the browser. Now it's time to create your first Svelte component file!\n\nCreate a file named `App.svelte` in your project directory with the following code:\n\n```html\n<!-- App.svelte -->\n<script>\n  /* component logic will go here */\n</script>\n<style>\n  /* css will go here */\n</style>\n<div class=\"App\">\n  <header class=\"App-header\">\n    <a class=\"App-link\" href=\"https://svelte.dev\" target=\"_blank\" rel=\"noopener noreferrer\">\n      Learn Svelte\n    </a>\n  </header>\n</div>\n```\n\nNow you can use the new `App.svelte` file in your `index.js`:\n\n```diff\n// index.js\n\n/* Add JavaScript code here! */\n-console.log('Hello World! You did it! Welcome to Snowpack :D');\n+import App from \"./App.svelte\";\n\n+let app = new App({\n+  target: document.body,\n+});\n\n+export default app;\n```\n\nThe page should now say \"Learn Svelte\". Congratulations! you now have your first Svelte component!\n\n<div class=\"frame\"><img src=\"/img/guides/svelte/svelte-component-snowpack.gif\" alt=\"code and site side by side, site is a 'Learn Svelte' link on a white background. When the text is edit to add 'Hello world' and the file saves, the changes show up in the site immediately.\" class=\"screenshot\"/></div>\n\n## Customize your project layout\n\nSnowpack is flexible enough to support whatever project layout that you prefer. In this guide, you'll learn how to use a popular project pattern from the Svelte community.\n\n```\n📁 src : your Svelte components and their assets (CSS, images)\n    ↳ index.js\n    ↳ App.svelte\n📁 public : global assets like images, fonts, icons, and global CSS\n    ↳ index.css\n    ↳ index.html\n```\n\nUse your favorite visual editor to rearrange and rename, or run these commands in the terminal:\n\n```bash\nmkdir src\nmkdir public\nmv index.js src/index.js\nmv App.svelte src/App.svelte\nmv index.html public/index.html\nmv index.css public/index.css\n```\n\nThis means if you are running Snowpack right now, the site is now broken as the files are all in different places. Lets add a \"mount\" configuration to update your site to your new project layout.\n\nThe `mount` configuration changes where Snowpack scan for and builds files. Head back to the `snowpack.config.mjs` file you edited when you added `@snowpack/plugin-svelte`. Add this to the empty `mount` object:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    mount: {\n-     /* ... */\n+     // directory name: 'build directory'\n+     public: '/',\n+     src: '/dist',\n    },\n  };\n```\n\n<img src=\"/img/guides/folder-structure.png\" alt=\"Graphic shows the original and new folder structures side by side. Arrows indicate that the files are built to where the arrow points. The Original side shows a folder labeled ./ entire directory with an arrow pointing to a folder labeled  mysite.com/*. The New side shows a folder labeled ./src/* with an arrow pointing to a folder labeled mysite.com/_dist/*. Then a second folder labeled ./public/* with an arrow pointing to a folder labeled mysite.com/* \" />\n\n`mount` is part of the [Snowpack Configuration API](/reference/configuration). It allows you to customize the file structure of your project. The key is the name of the directory and the value is where you'd like them in the final build. With this new configuration, Snowpack builds files in the `public` directory - like `public/index.css` - into `index.css`. Likewise, it builds files in `src` like `src/index.js` into `/dist/index.js`, so change that path in your `index.html`:\n\n```diff\n<!-- public/index.html -->\n\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n-   <script type=\"module\" src=\"/index.js\"></script>\n+   <script type=\"module\" src=\"/dist/index.js\"></script>\n  </body>\n```\n\nYou'll need to restart Snowpack (stop the process in terminal and then run `npm start` again) for configuration file changes. It should look exactly as it did before, but now using your brand new project folder layout\n\n## Adding an animated Svelte Logo\n\nIn Svelte you can add CSS directly to your component. This step demonstrates this capability by adding an animated logo.\n\n[Download `logo.svg`](https://github.com/withastro/snowpack/blob/main/create-snowpack-app/app-template-svelte/public/logo.svg) to your `public` directory. Now you can add it to your `App.svelte`\n\n```diff\n<!-- src/App.svelte -->\n\n  <header class=\"App-header\">\n+   <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n    <a\n      class=\"App-link\"\n      href=\"https://svelte.dev\"\n      target=\"_blank\"\n      rel=\"noopener noreferrer\">\n      Learn Svelte\n    </a>\n```\n\n<div class=\"frame\"><img src=\"/img/guides/svelte/svelte-logo-snowpack.jpg\" alt=\"Side by side of code and site. The site now has a very large Svelte logo. The code shows the src/App.svelte file \"  class=\"screenshot\"/></div>\n\nWith Svelte, CSS can go directly in your `.svelte` component. Add this code to the top of `App.svelte` between the `<style>` tags:\n\n```html\n<!-- src/App.svelte -->\n\n<style>\n  .App-header {\n    background-color: #f9f6f6;\n    color: #333;\n    min-height: 100vh;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    font-size: calc(10px + 2vmin);\n  }\n  .App-logo {\n    height: 36vmin;\n    pointer-events: none;\n    margin-bottom: 3rem;\n    animation: App-logo-pulse infinite 1.6s ease-in-out alternate;\n  }\n  @keyframes App-logo-pulse {\n    from {\n      transform: scale(1);\n    }\n    to {\n      transform: scale(1.06);\n    }\n  }\n</style>\n```\n\n<div class=\"frame\"><img src=\"/img/guides/svelte/svelte-logo-style-snowpack.gif\" alt=\"code and site side by side, when the css is added to the Svelte component, the background becomes a beige, the logo shrinks down, and the logo has a pulsing animation\" class=\"screenshot\"/></div>\n\n## Adding a counter to your Svelte component\n\nSnowpack is one of the only Svelte dev environments to support Fast Refresh by default. With Fast Refresh, as you make changes to `.svelte` files, Snowpack pushes live updates to the browser without losing your place or resetting component state. To see this for yourself, go ahead and add a simple timer to your App.svelte component.\n\nSvelte components include component specific scripts in a `<script>` tag. Add the counter here in `App.svelte` between the `<script>` tags:\n\n```html\n<!-- src/App.svelte -->\n\n<script>\n  import {onMount} from 'svelte';\n  let count = 0;\n  onMount(() => {\n    const interval = setInterval(() => count++, 1000);\n    return () => {\n      clearInterval(interval);\n    };\n  });\n</script>\n```\n\nThen lower down in your component's body, add this code that displays the results of the timer.\n\n```diff\n<!-- src/App.svelte -->\n\n<div class=\"App\">\n    <header class=\"App-header\">\n      <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n+     <p>Page has been open for <code>{count}</code> seconds.</p>\n      <a class=\"App-link\" href=\"https://svelte.dev\" target=\"_blank\" rel=\"noopener noreferrer\">\n        Learn Svelte\n      </a>\n    </header>\n</div>\n```\n\nChange some code on the page (like the \"Learn Svelte\" button). You'll see the timer does not reset.\n\n<div class=\"frame\"><img src=\"/img/guides/svelte/svelte-snowpack-counter-1.gif\" alt=\"Showing code and site side by side, when the word 'Hello' is added to the .svelte page and the code is saved, the change shows up in the browser without the timer resetting (it keeps counting)\" class=\"screenshot\"/></div>\n\nWhat about other, non-Svelte files like `src/index.js`? To re-render your Svelte application when other files change, add this code snippet to the bottom:\n\n```diff\n<!-- src/index.js-->\n\nexport default app;\n\n+// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n+// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\n+if (import.meta.hot) {\n+  import.meta.hot.accept();\n+  import.meta.hot.dispose(() => {\n+    app.$destroy();\n+  });\n+}\n```\n\n## Going further\n\nGreat job! You're now ready to build the Svelte project of your dreams with Snowpack. Want to tweet your accomplishment to the world? Click the button below:\n\n<a href=\"https://twitter.com/share?ref_src=twsrc%5Etfw\" class=\"twitter-share-button\" data-text=\"I just learned how to build a Svelte app with #Snowpack. Check out the tutorial:\" data-show-count=\"false\">Tweet</a><script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n\nAt this point you have the basics and have a great starter for any Svelte project. The official [Snowpack Svelte](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte) example has a few other tools you might find useful:\n\n- [Prettier](https://prettier.io/) — a popular code formatter\n- [Tests](/guides/testing) — Snowpack supports any popular JavaScript testing framework\n- [`@snowpack/plugin-dotenv`](https://github.com/withastro/snowpack/tree/main/plugins/plugin-dotenv) — Use `dotenv` in your Snowpack. This is useful for environment specific variables\n\nWe also recommend the official [Svelte](https://svelte.dev/tutorial/basics) tutorial, which teaches more about how Svelte works and how to build Svelte components.\n\nIf you'd like to use Typescript with Snowpack and Svelte, check out the [Snowpack Svelte Typescript](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-svelte-typescript) template.\n\nIf you have any questions, comments, or corrections, we'd love to hear from you in the Snowpack [discussion](https://github.com/withastro/snowpack/discussions) forum or our [Snowpack Discord community](https://discord.gg/rS8SnRk).\n"
  },
  {
    "path": "docs/tutorials/vue.md",
    "content": "---\nlayout: ../../layouts/content-with-cover.astro\ntitle: 'Getting Started with Vue'\ndescription: 'Get started with this in-depth tutorial on how to build Vue applications and websites with Snowpack'\ndate: 2020-12-01\nsidebarTitle: Vue\ntags: communityGuide\n---\n\nSnowpack is a great fit for [Vue](https://vuejs.org) projects of any size. It's easy to get started and can scale to projects containing thousands of components and pages without any impact on development speed. Unlike traditional Vue application tooling, Snowpack saves you from getting bogged down with complex bundler setups and configuration files.\n\nThis guide is a step by step from an empty directory to a fully configured Snowpack project, in the process teaching:\n\n- How to set up your Snowpack development environment\n- Adding your first Vue component\n- Importing images and other web assets\n- Enabling Hot Module Replacement (HMR)\n- Connecting your favorite tools\n\nPrerequisites: Snowpack is a command-line tool installed from npm. This guide assumes a basic understanding of Node.js, npm, and how to run commands in the terminal. Knowledge of Vue is not required; Snowpack is an excellent way to learn Vue!\n\n> 💡 Tip: a [Vue/Snowpack](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue) working example is available in our Create Snowpack App templates.\n\n## Getting started\n\nThe easiest way to start a new Snowpack project is with [Create Snowpack App](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/cli), a tool for creating a new project based on our example templates. `@snowpack/app-template-minimal` is a Create Snowpack App template for a simple, bare-bones Snowpack project setup that the rest of this guide builds on.\n\nRun the following command in your terminal to create a new directory called `vue-snowpack` with the minimal template installed:\n\n```bash\nnpx create-snowpack-app vue-snowpack --template @snowpack/app-template-minimal\n```\n\nHead to the new `vue-snowpack` directory and start Snowpack with the following two commands:\n\n```bash\ncd vue-snowpack\nnpm run start\n```\n\nYou should see your new website up and running!\n\n<div class=\"frame\"><img src=\"/img/guides/react/minimalist-hello-world.png\" alt=\"screenshot of project-template-minimal, which shows 'Hello world' in text on a white background.\" class=\"screenshot\"/></div>\n\nNow that you have a basic project up and running, the next step is to install Vue. Run the following command in your project directory:\n\n```bash\nnpm install vue@3.0.11 --save\n```\n\n> 💡 Tip: add the `--use-yarn` or `--use-pnpm` flag to use something other than npm\n\n```bash\nnpm install @snowpack/plugin-vue --save-dev\n```\n\nSnowpack [plugins](/plugins) are a way to extend Snowpack's capabilities without having to do custom configuration yourself. Install the `@snowpack/plugin-vue` plugin so that Snowpack knows how built `.vue` files into JavaScript and CSS files that run in the browser:\n\nOnce installed, you'll need to add the plugin to your Snowpack configuration file (`snowpack.config.mjs`) so that Snowpack knows to use it:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    mount: {\n      /* ... */\n    },\n    plugins: [\n+    '@snowpack/plugin-vue',\n    ],\n  };\n```\n\nRestart your Snowpack dev server to run it with the new configuration. Exit the process (ctrl + c in most Windows/Linux/macOS) and start it again with `npm run start`.\n\n> 💡 Tip: Restart the Snowpack development server when you make configuration changes (changes to the `snowpack.config.mjs`).\n\nSnowpack will recognize the new dependency (Vue, or \"vue/internal\") and print the following output as installs your dependencies for the frontend:\n\n```bash\n[snowpack] installing dependencies...\n[snowpack] ✔ install complete! [0.45s]\n[snowpack]\n  + vue@3.0.11\n  └── @vue/runtime-dom@3.0.11\n    └── @vue/runtime-core@3.0.11\n      └── @vue/reactivity@3.0.11\n        └── @vue/shared@3.0.11\n```\n\n## Create your first Vue component\n\nYou now have your Snowpack environment set up to build `.vue` files for the browser. Now it's time to create your first Vue component file!\n\nCreate a file named `App.vue` in your project directory with the following code:\n\n```html\n<script>\n  export default {\n    setup() {\n      return {};\n    },\n  };\n</script>\n<template>\n  <div>Welcome to my Vue app!</div>\n</template>\n```\n\nAdd an ID of `#root` to the `body` tag in your `index.html`\n\n```diff\n// index.html\n- <body>\n+ <body id=\"root\">\n    <h1>Welcome to Snowpack!</h1>\n    <script type=\"module\" src=\"/index.js\"></script>\n  </body>\n```\n\nNow you can use the new `App.vue` file in your `index.js`:\n\n```diff\n// index.js\n- console.log('Hello World! You did it! Welcome to Snowpack :D');\n+ import { createApp } from 'vue';\n+ import App from './App.vue';\n+ createApp(App).mount('#root');\n```\n\nThe page should now say \"Welcome to my Vue app!\". Congratulations! You now have your first Vue component!\n\n## Customize your project layout\n\nSnowpack is flexible enough to support whatever project layout that you prefer. In this guide, you'll learn how to use a popular project pattern from the Vue community.\n\n```\n├── src/        <- your Vue components and their assets (CSS, images)\n│   ├── index.js\n│   └── App.vue\n└── public/     <- global assets like images, fonts, icons, and global CSS\n    ├── index.css\n    └── index.html\n```\n\nUse your favorite visual editor to rearrange and rename, or run these commands in the terminal:\n\n```bash\nmkdir src\nmkdir public\nmv index.js src/index.js\nmv App.vue src/App.vue\nmv index.html public/index.html\nmv index.css public/index.css\n```\n\nThis means if you are running Snowpack right now, the site is now broken as the files are all in different places. Lets add a \"mount\" configuration to update your site to your new project layout.\n\nThe `mount` configuration changes where Snowpack scan for and builds files. Head back to the `snowpack.config.mjs` file you edited when you added `@snowpack/plugin-vue`. Add this to the empty `mount` object:\n\n```diff\n  // snowpack.config.mjs\n  export default {\n    mount: {\n-     /* ... */\n+     public: '/',\n+     src: '/dist',\n    },\n  };\n```\n\n<img src=\"/img/guides/folder-structure.png\" alt=\"Graphic shows the original and new folder structures side by side. Arrows indicate that the files are built to where the arrow points. The Original side shows a folder labeled ./ entire directory with an arrow pointing to a folder labeled  mysite.com/*. The New side shows a folder labeled ./src/* with an arrow pointing to a folder labeled mysite.com/_dist/*. Then a second folder labeled ./public/* with an arrow pointing to a folder labeled mysite.com/* \" />\n\n`mount` is part of the [Snowpack Configuration API](/reference/configuration). It allows you to customize the file structure of your project. The key is the name of the directory and the value is where you'd like them in the final build. With this new configuration, Snowpack builds files in the `public` directory (e.g. `public/index.css -> [build]/index.css`). Likewise, it builds files in `src` (e.g. `src/index.js -> [build]/dist/index.js`, so change that path in your `index.html`:\n\n```diff\n<!-- public/index.html -->\n\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n-   <script type=\"module\" src=\"/index.js\"></script>\n+   <script type=\"module\" src=\"/dist/index.js\"></script>\n  </body>\n```\n\nYou'll need to restart Snowpack (stop the process in terminal and then run `npm start` again) for configuration file changes. It should look exactly as it did before, but now using your brand new project folder layout\n\n## Adding an animated Vue Logo\n\nIn Vue you can add CSS directly to your component. This step demonstrates this capability by adding an animated logo.\n\n[Download `logo.svg`](https://github.com/withastro/snowpack/blob/main/create-snowpack-app/app-template-vue/public/logo.svg) to your `public` directory. Now you can add it to your `App.vue`\n\n```diff\n<!-- src/App.vue -->\n\n  <header class=\"App-header\">\n+   <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n    <a\n      class=\"App-link\"\n      href=\"https://vuejs.org\"\n      target=\"_blank\"\n      rel=\"noopener noreferrer\">\n      Learn Vue\n    </a>\n```\n\nWith Vue, CSS can go directly in your `.vue` component. Add this code to the top of `App.vue` between the `<style>` tags:\n\n```html\n<!-- src/App.vue -->\n\n<style>\n  .App-header {\n    background-color: #f9f6f6;\n    color: #333;\n    min-height: 100vh;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    font-size: calc(10px + 2vmin);\n  }\n  .App-logo {\n    height: 36vmin;\n    pointer-events: none;\n    margin-bottom: 3rem;\n    animation: App-logo-pulse infinite 1.6s ease-in-out alternate;\n  }\n  @keyframes App-logo-pulse {\n    from {\n      transform: scale(1);\n    }\n    to {\n      transform: scale(1.06);\n    }\n  }\n</style>\n```\n\n## Adding a counter to your Vue component\n\nSnowpack is one of the only Vue dev environments to support Fast Refresh by default. With Fast Refresh, as you make changes to `.vue` files, Snowpack pushes live updates to the browser without losing your place or resetting component state. To see this for yourself, go ahead and add a simple timer to your `App.vue` component.\n\nVue components include component specific scripts in a `<script>` tag. Add the counter here in `App.vue` between the `<script>` tags:\n\n```html\n<!-- src/App.vue -->\n\n<script>\n  import {onMount} from 'vue';\n  let count = 0;\n  onMount(() => {\n    const interval = setInterval(() => count++, 1000);\n    return () => {\n      clearInterval(interval);\n    };\n  });\n</script>\n```\n\nThen lower down in your component's body, add this code that displays the results of the timer.\n\n```diff\n  <!-- src/App.vue -->\n\n  <div class=\"App\">\n    <header class=\"App-header\">\n      <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n+     <p>Page has been open for <code>{count}</code> seconds.</p>\n      <a class=\"App-link\" href=\"https://vuejs.org\" target=\"_blank\" rel=\"noopener noreferrer\">\n        Learn Vue\n      </a>\n    </header>\n  </div>\n```\n\nChange some code on the page (like the \"Learn Vue\" button). You'll see the timer does not reset.\n\nWhat about other, non-Vue files like `src/index.js`? To re-render your Vue application when other files change, add this code snippet to the bottom:\n\n```diff\n// src/index.js\n\n  export default app;\n\n+ // Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n+ // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\n+ if (import.meta.hot) {\n+   import.meta.hot.accept();\n+   import.meta.hot.dispose(() => {\n+     app.$destroy();\n+   });\n+ }\n```\n\n## Going further\n\nGreat job! You're now ready to build the Vue project of your dreams with Snowpack. Want to tweet your accomplishment to the world? Click the button below:\n\n<a href=\"https://twitter.com/share?ref_src=twsrc%5Etfw\" class=\"twitter-share-button\" data-text=\"I just learned how to build a Vue app with #Snowpack. Check out the tutorial:\" data-show-count=\"false\">Tweet</a><script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n\nAt this point you have the basics and have a great starter for any Vue project. The official [Snowpack Vue](https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-vue) example has a few other tools you might find useful:\n\n- [Prettier](https://prettier.io/) — a popular code formatter\n- [Tests](/guides/testing) — Snowpack supports any popular JavaScript testing framework\n- [`@snowpack/plugin-dotenv`](https://github.com/withastro/snowpack/tree/main/plugins/plugin-dotenv) — Use `dotenv` in your Snowpack. This is useful for environment specific variables\n\nIf you have any questions, comments, or corrections, we'd love to hear from you in the Snowpack [discussion](https://github.com/withastro/snowpack/discussions) forum or our [Snowpack Discord community](https://discord.gg/rS8SnRk).\n"
  },
  {
    "path": "esinstall/.gitignore",
    "content": "node_modules\nlib\n"
  },
  {
    "path": "esinstall/CHANGELOG.md",
    "content": "# esinstall\n\n## 1.1.7\n\n### Patch Changes\n\n- 9b1472f6: Lock slash package version more aggressively\n\n## 1.1.6\n\n### Patch Changes\n\n- fb7eaaa4: Allow `external` CommonJS modules to be imported properly in Node (#3473) <Matthew Phillips>\n- 1dac52b3: [ci] yarn format <matthewp>\n- afc6232f: Allow .astro files to be installed as JavaScript (#3406) <Matthew Phillips>\n\n## 1.1.5\n\n### Patch Changes\n\n- c659b7c3: [ci] yarn format <natemoo-re>\n- b375b8a3: Fix `external` behavior for local package source and SSR. (#3399) <Nate Moore>\n- 068b7d75: Set `preventAssignment` option of rollup-plugin-replace to true (#3222) <Ian VanSchooten>\n- d9956f73: add explicit \"mode\" config (#3135)\n\n## 1.1.4\n\n### Patch Changes\n\n- 9eb50368: update deps (#2928)\n- d542762a: Add execa dependency for esinstall (#3075) <Matthew Phillips>\n\n## 1.1.3\n\n### Patch Changes\n\n- 332d69ed: Adding property expr to solve #2945 (#3063) <Nahuel Veron>\n\n## 1.1.2\n\n### Patch Changes\n\n- 56c5a231: fix typo in changelog\n- 836338b5: add react-transition-group to bad cjs scanner list\n- 22dd802e: no longer need tslib workaround\n- 74c4661e: add \"events\" to bad cjs scanning packages list\n- 40f02cf4: reorder changelog entries\n- fc6c1417: Improve CSS error message (#2973) <Drew Powers>\n\n## 1.1.1\n\n### Patch Changes\n\n- e50cb745: fix better handling for unscannable cjs packages\n- 1232e252: add back cjs-cjs compat from an earlier pr (#2934)\n\n## 1.1.0\n\n### Minor Changes\n\n- bea1c56c: Simplify. cleanup, enhance snowpack internals (#2707)\n\n### Patch Changes\n\n- a800bf3d: finalize picomatch support (#2912)\n- b2738967: improve cjs<>esm conversion of named exports (#2859)\n- c3ecc7da: [ci] yarn format <natemoo-re>\n- 92057561: Fix: warn on missing export (#2826) <Nate Moore>\n- 6f514a0d: [ci] yarn format <matthewp>\n- 8280627d: fix issue with types package (#2768)\n- bb1ca50a: url not needed in esinstall\n- 19cdf5ca: ignore data imports from build or scan\n- 435692d0: make stats optional, speed up perf (#2708)\n- b82c472e: [ci] yarn format\n- 81d9ff88: fix unnecessary filtering of absolute aliases (#2424) <Jon Rimmer>\n- c0501f72: [ci] yarn format <matthewp>\n- d3b6f769: Support packages that use export maps but have no main (#2659) <Matthew Phillips>\n- 520112b6: Update the changelog <Matthew Phillips>\n\n## 1.0.5\n\n### Patch Changes\n\n- ec3c29fd: Pin rollup version to fix tree shaking bugs (#2572) <Matthew Phillips>\n- 4ffc1c10: add support for internal export map imports (#2507)\n\n## 1.0.4\n\n### Patch Changes\n\n- 150cdf30: Fix explodeExportMap expanding dirs (#2493) <Drew Powers>\n- 977621dc: properly scan named imports from events polyfill package\n\n## 1.0.3\n\n### Patch Changes\n\n- 6b105339: add esinstall missing import hint (#2299)\n- 15a27ac9: support additional main fields in sub-dependencies (#2298) <Aaron Ross>\n\n## 1.0.2\n\n### Patch Changes\n\n- 15d77ea3: cleanup\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/esinstall)._\n"
  },
  {
    "path": "esinstall/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Fred K. Schott\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "esinstall/README.md",
    "content": "# esinstall\n\n- Convert a set of imports from your `node_modules/` directory into a fresh, new 100% [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) install directory.\n- JavaScript packages are converted to ESM regardless of how they were originally authored.\n- Import your new ESM dependencies in any ESM-only environment (websites, Deno, Node.js v14).\n\n```\nnpm install esinstall\n```\n\n```js\nimport {install} from 'esinstall';\n\nawait install(['preact', 'preact/hooks'], {\n  /*options*/\n});\n// Result: Creates `preact.js` and `preact/hooks.js` inside a `web_modules/` directory in your current directory.\n```\n\n⚡️ Powering [Snowpack](https://www.snowpack.dev) and the next generation of JavaScript tooling.\n\n## Status\n\nThe core install logic of this library is considered well-tested and production-ready (1+ years of active use & development!). The JS interface is new, however, and may contain smaller bugs. We'll be working to stabilize the API over the next month, with a `1.0.0` release planned for October.\n\n## Background\n\nBefore [Snowpack](https://www.snowpack.dev/) was a frontend build tool, it was a CJS->ESM package converter. `snowpack install` would read your package.json \"dependencies\" and re-install every frontend package from your \"node_modules/\" directory to a new \"web_modules/\" directory. \"web_modules/\" was guarenteed to be 100% ESM regardless of how each package was originally written. This dramatically simplified the minimum tooling required to build a website by removing a whole class of problem for the frontend basically summarized as \"oh no this package was written for Node.js, it will never run in the browser, what do we do???\"\n\nSnowpack is now a fully-featured frontend build tool, but it's still built entirely on that original foundation. That foundation is now **esinstall**, a general-purpose JavaScript interface for creating ESM single-file versions of locally installed npm packages.\n\nOur hope is that now others can build on top of this too. And while today we're focused on the web use-case, [we're seeing a growing need for a CJS->ESM story for Node.js](https://changelog.com/jsparty/137) as well.\n\n## How it Works\n\nTo simplify things a ton, here's what **esinstall** does internally when you run `install()`:\n\n1. Resolves the given package specifiers to exact file paths in your \"node_modules/\" directory.\n2. Runs Rollup with those file paths as entrypoints, essentially \"bundling\" your dependency tree into as few JS files as possible.\n3. Writes the result to a new, fully ESM output directory.\n\nIf you check out the code, you'll see it's not as easy as it sounds. But at a high level, that's what **esinstall** is all about.\n\n## Features\n\n```js\nimport {install, printStats} from 'esinstall';\n\n// Feature: Handle CJS packages with ease, converting everything to ESM!\nawait install(['react', 'react-dom', 'react-redux', 'react-router']);\n\n// Feature: Handle CSS!\nawait install(['bootstrap/dist/css/bootstrap.min.css']);\n\n// Feature: Handle Non-standard packages!\nawait install(['some-svelte-component'], {rollup: {plugins: [require('rollup-plugin-svelte')()]}});\n\n// Feature: Print detailed install stats to the console, including installed file sizes.\nconst {success, stats} = install([...]);\nif (success) {\n  printStats(stats);\n}\n\n// Feature: Tree-shaking! Get a smaller final build by providing more detailed install targets.\nawait install(\n  [{specifier: 'preact/hooks', all: false, default: false, namespace: false, named: ['useState', 'useEffect']}],\n  {treeshake: true}\n);\n```\n\n## API\n\nStill TODO: Adding more detailed descriptions about each `InstallOptions` option.\n\n```ts\nimport {Plugin as RollupPlugin} from 'rollup';\nimport {\n  DependencyStatsOutput,\n  EnvVarReplacements,\n  ImportMap,\n  InstallTarget,\n  LoggerLevel,\n} from './types';\n\ninterface InstallOptions {\n  cwd: string;\n  alias: Record<string, string>;\n  lockfile?: ImportMap;\n  logger: AbstractLogger;\n  verbose?: boolean;\n  dest: string;\n  env: EnvVarReplacements;\n  treeshake?: boolean;\n  polyfillNode: boolean;\n  sourceMap?: boolean | 'inline';\n  externalPackage: string[];\n  externalPackageEsm: string[];\n  packageLookupFields: string[];\n  packageExportLookupFields: string[];\n  namedExports: string[];\n  rollup: {\n    context?: string;\n    plugins?: RollupPlugin[];\n    dedupe?: string[];\n  };\n}\ndeclare type InstallResult =\n  | {\n      success: false;\n      importMap: null;\n      stats: null;\n    }\n  | {\n      success: true;\n      importMap: ImportMap;\n      stats: DependencyStatsOutput;\n    };\n\nexport declare function printStats(dependencyStats: DependencyStatsOutput): string;\nexport declare function install(\n  _installTargets: (InstallTarget | string)[],\n  _options?: Partial<InstallOptions>,\n): Promise<InstallResult>;\n```\n\n## Special Thanks\n\nA huge thanks to all the contributors of Snowpack (and now **esinstall**) over the years. This wouldn't have been possible without you!\n\nAlso, it can't be stressed enough: this tool would never have existed without Rollup. If you can, consider donating to their team: https://opencollective.com/rollup\n"
  },
  {
    "path": "esinstall/index.esm.mjs",
    "content": "import Pkg from './lib/index.js';\n\nexport const printStats = Pkg.printStats;\nexport const install = Pkg.install;\n"
  },
  {
    "path": "esinstall/package.json",
    "content": "{\n  \"name\": \"esinstall\",\n  \"version\": \"1.1.7\",\n  \"description\": \"Convert packages to ESM.\",\n  \"license\": \"MIT\",\n  \"keywords\": [\n    \"install\",\n    \"web\",\n    \"dependencies\",\n    \"npm\",\n    \"esm\",\n    \"common.js\",\n    \"rollup\",\n    \"esbuild\",\n    \"cjs\"\n  ],\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/esinstall#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"esinstall\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc --noUnusedLocals false --noUnusedParameters false\",\n    \"build:watch\": \"tsc --watch --noUnusedLocals false --noUnusedParameters false\",\n    \"lint\": \"tsc --noEmit && package-check\"\n  },\n  \"types\": \"lib/index.d.ts\",\n  \"main\": \"lib/index.js\",\n  \"exports\": {\n    \"import\": \"./index.esm.mjs\",\n    \"require\": \"./lib/index.js\"\n  },\n  \"files\": [\n    \"lib\",\n    \"index.esm.mjs\"\n  ],\n  \"dependencies\": {\n    \"@rollup/plugin-commonjs\": \"^16.0.0\",\n    \"@rollup/plugin-inject\": \"^4.0.2\",\n    \"@rollup/plugin-json\": \"^4.0.0\",\n    \"@rollup/plugin-node-resolve\": \"^10.0.0\",\n    \"@rollup/plugin-replace\": \"^2.4.2\",\n    \"builtin-modules\": \"^3.2.0\",\n    \"cjs-module-lexer\": \"^1.2.1\",\n    \"es-module-lexer\": \"^0.6.0\",\n    \"execa\": \"^5.1.1\",\n    \"is-valid-identifier\": \"^2.0.2\",\n    \"kleur\": \"^4.1.1\",\n    \"mkdirp\": \"^1.0.3\",\n    \"picomatch\": \"^2.3.0\",\n    \"resolve\": \"^1.20.0\",\n    \"rimraf\": \"^3.0.0\",\n    \"rollup\": \"~2.37.1\",\n    \"rollup-plugin-polyfill-node\": \"^0.7.0\",\n    \"slash\": \"~3.0.0\",\n    \"validate-npm-package-name\": \"^3.0.0\",\n    \"vm2\": \"^3.9.2\"\n  }\n}\n"
  },
  {
    "path": "esinstall/src/entrypoints.ts",
    "content": "import {readdirSync, existsSync, realpathSync, statSync} from 'fs';\nimport path from 'path';\nimport builtinModules from 'builtin-modules';\nimport validatePackageName from 'validate-npm-package-name';\nimport {ExportField, ExportMapEntry, PackageManifestWithExports, PackageManifest} from './types';\nimport {parsePackageImportSpecifier, resolveDependencyManifest} from './util';\nimport resolve from 'resolve';\nimport picomatch from 'picomatch';\n\nexport const MAIN_FIELDS = [\n  'browser:module',\n  'module',\n  'browser',\n  'main:esnext',\n  'jsnext:main',\n  'main',\n];\n\n// Rarely, a package will ship a broken \"browser\" package.json entrypoint.\n// Ignore the \"browser\" entrypoint in those packages.\nconst BROKEN_BROWSER_ENTRYPOINT = ['@sheerun/mutationobserver-shim'];\nconst FILE_EXTENSION_REGEX = /\\..+$/;\n\nfunction getMissingEntrypointHint(\n  packageEntrypoint: string,\n  normalizedMap: Record<string, string>,\n): string | undefined {\n  const noExtensionEntrypoint = './' + packageEntrypoint.replace(FILE_EXTENSION_REGEX, '');\n  if (Reflect.get(normalizedMap, noExtensionEntrypoint)) {\n    return `Did you mean \"${noExtensionEntrypoint}\"?`;\n  }\n  const jsExtensionEntrypoint = './' + packageEntrypoint.replace(FILE_EXTENSION_REGEX, '.js');\n  if (Reflect.get(normalizedMap, jsExtensionEntrypoint)) {\n    return `Did you mean \"${jsExtensionEntrypoint}\"?`;\n  }\n  const cjsExtensionEntrypoint = './' + packageEntrypoint.replace(FILE_EXTENSION_REGEX, '.cjs');\n  if (Reflect.get(normalizedMap, cjsExtensionEntrypoint)) {\n    return `Did you mean \"${cjsExtensionEntrypoint}\"?`;\n  }\n  const mjsExtensionEntrypoint = './' + packageEntrypoint.replace(FILE_EXTENSION_REGEX, '.cjs');\n  if (Reflect.get(normalizedMap, mjsExtensionEntrypoint)) {\n    return `Did you mean \"${mjsExtensionEntrypoint}\"?`;\n  }\n  const directoryEntrypoint = './' + packageEntrypoint + '/index.js';\n  if (Reflect.get(normalizedMap, directoryEntrypoint)) {\n    return `Did you mean \"${directoryEntrypoint}\"?`;\n  }\n}\n\ntype FindManifestEntryOptions = {\n  packageLookupFields?: string[];\n  packageName?: string;\n};\n\n/**\n *\n */\nexport function findManifestEntry(\n  manifest: PackageManifest,\n  entry?: string,\n  {packageLookupFields = [], packageName}: FindManifestEntryOptions = {},\n): string | undefined {\n  let foundEntrypoint: string | undefined;\n\n  if (manifest.exports) {\n    foundEntrypoint =\n      typeof manifest.exports === 'string'\n        ? manifest.exports\n        : findExportMapEntry(manifest.exports['.'] || manifest.exports);\n\n    if (typeof foundEntrypoint === 'string') {\n      return foundEntrypoint;\n    }\n  }\n\n  foundEntrypoint = [...packageLookupFields, ...MAIN_FIELDS].map((e) => manifest[e]).find(Boolean);\n\n  if (foundEntrypoint && typeof foundEntrypoint === 'string') {\n    return foundEntrypoint;\n  }\n\n  if (!(packageName && BROKEN_BROWSER_ENTRYPOINT.includes(packageName))) {\n    // Some packages define \"browser\" as an object. We'll do our best to find the\n    // right entrypoint in an entrypoint object, or fail otherwise.\n    // See: https://github.com/defunctzombie/package-browser-field-spec\n    let browserField = manifest.browser;\n\n    if (typeof browserField === 'string') {\n      return browserField;\n    } else if (typeof browserField === 'object') {\n      let browserEntrypoint =\n        (entry && browserField[entry]) ||\n        browserField['./index.js'] ||\n        browserField['./index'] ||\n        browserField['index.js'] ||\n        browserField['index'] ||\n        browserField['./'] ||\n        browserField['.'];\n\n      if (typeof browserEntrypoint === 'string') {\n        return browserEntrypoint;\n      }\n    }\n  }\n\n  // If browser object is set but no relevant entrypoint is found, fall back to \"main\".\n  return manifest.main;\n}\n\n/**\n * Given an ExportMapEntry find the entry point, resolving recursively.\n */\nexport function findExportMapEntry(\n  exportMapEntry?: ExportMapEntry,\n  conditions?: string[],\n): string | undefined {\n  // If this is a string or undefined we can skip checking for conditions\n  if (typeof exportMapEntry === 'string' || typeof exportMapEntry === 'undefined') {\n    return exportMapEntry;\n  }\n\n  let entry = exportMapEntry;\n  if (conditions) {\n    for (let condition of conditions) {\n      if (entry[condition]) {\n        entry = entry[condition];\n      }\n    }\n  }\n\n  return (\n    findExportMapEntry(entry?.browser) ||\n    findExportMapEntry(entry?.import) ||\n    findExportMapEntry(entry?.default) ||\n    findExportMapEntry(entry?.require) ||\n    undefined\n  );\n}\n\ntype ResolveEntrypointOptions = {\n  cwd: string;\n  packageLookupFields: string[];\n};\n\n/**\n * Resolve a \"webDependencies\" input value to the correct absolute file location.\n * Supports both npm package names, and file paths relative to the node_modules directory.\n * Follows logic similar to Node's resolution logic, but using a package.json's ESM \"module\"\n * field instead of the CJS \"main\" field.\n */\nexport function resolveEntrypoint(\n  dep: string,\n  {cwd, packageLookupFields}: ResolveEntrypointOptions,\n): string {\n  // We first need to check for an export map in the package.json. If one exists, resolve to it.\n  const [packageName, packageEntrypoint] = parsePackageImportSpecifier(dep);\n  const [packageManifestLoc, packageManifest] = resolveDependencyManifest(packageName, cwd);\n\n  if (packageManifestLoc && packageManifest && typeof packageManifest.exports !== 'undefined') {\n    const exportField = (packageManifest as PackageManifestWithExports).exports;\n\n    // If this is a non-main entry point\n    if (packageEntrypoint) {\n      const normalizedMap = explodeExportMap(exportField, {\n        cwd: path.dirname(packageManifestLoc),\n      });\n      const mapValue = normalizedMap && Reflect.get(normalizedMap, './' + packageEntrypoint);\n      if (typeof mapValue !== 'string') {\n        let helpfulHint =\n          normalizedMap && getMissingEntrypointHint(packageEntrypoint, normalizedMap);\n        throw new Error(\n          `Package \"${packageName}\" exists but package.json \"exports\" does not include entry for \"./${packageEntrypoint}\".` +\n            (helpfulHint ? `\\n${helpfulHint}` : ''),\n        );\n      }\n      return path.join(packageManifestLoc, '..', mapValue);\n    } else {\n      const exportMapEntry = exportField['.'] || exportField;\n      const mapValue = findExportMapEntry(exportMapEntry);\n\n      if (mapValue) {\n        return path.join(packageManifestLoc, '..', mapValue);\n      }\n    }\n  }\n\n  // if, no export map and dep points directly to a file within a package, return that reference.\n  if (builtinModules.indexOf(dep) === -1 && !validatePackageName(dep).validForNewPackages) {\n    return realpathSync.native(\n      resolve.sync(dep, {basedir: cwd, extensions: ['.js', '.mjs', '.ts', '.jsx', '.tsx']}),\n    );\n  }\n\n  // Otherwise, resolve directly to the dep specifier. Note that this supports both\n  // \"package-name\" & \"package-name/some/path\" where \"package-name/some/path/package.json\"\n  // exists at that lower path, that must be used to resolve. In that case, export\n  // maps should not be supported.\n  const [depManifestLoc, depManifest] = resolveDependencyManifest(dep, cwd);\n\n  if (!depManifest) {\n    try {\n      const maybeLoc = realpathSync.native(resolve.sync(dep, {basedir: cwd}));\n      return maybeLoc;\n    } catch {\n      // Oh well, was worth a try\n    }\n  }\n\n  if (!depManifestLoc || !depManifest) {\n    if (path.extname(dep) === '.css') {\n      const parts = dep.split('/');\n      let npmName = parts.shift();\n      if (npmName && npmName.startsWith('@')) npmName += '/' + parts.shift();\n      throw new Error(\n        `Module \"${dep}\" not found.\n    If you‘re trying to import a CSS file from your project, try \"./${dep}\".\n    If you‘re trying to import an NPM package, try running \\`npm install ${npmName}\\` and re-running Snowpack.`,\n      );\n    }\n    throw new Error(\n      `Package \"${dep}\" not found. Have you installed it? ${depManifestLoc ? depManifestLoc : ''}`,\n    );\n  }\n\n  let foundEntrypoint = findManifestEntry(depManifest, dep, {\n    packageName,\n    packageLookupFields,\n  });\n\n  // Sometimes packages don't give an entrypoint, assuming you'll fall back to \"index.js\".\n  if (!foundEntrypoint) {\n    for (let possibleEntrypoint of ['index.js', 'index.json']) {\n      try {\n        return realpathSync.native(\n          resolve.sync(path.join(depManifestLoc || '', '..', possibleEntrypoint)),\n        );\n      } catch {}\n    }\n\n    // Couldn't find any entrypoints so throwing\n    throw new Error(\n      `Unable to find any entrypoint for \"${dep}\". It could be a typo, or this package might not have a main entrypoint.`,\n    );\n  }\n  if (typeof foundEntrypoint !== 'string') {\n    throw new Error(`\"${dep}\" has unexpected entrypoint: ${JSON.stringify(foundEntrypoint)}.`);\n  }\n\n  const finalPath = path.join(depManifestLoc || '', '..', foundEntrypoint);\n  try {\n    return realpathSync.native(resolve.sync(finalPath));\n  } catch {\n    throw new Error(`We resolved \"${dep}\" to ${finalPath}, but the file does not exist on disk.`);\n  }\n}\n\nconst picoMatchGlobalOptions = Object.freeze({\n  capture: true,\n  noglobstar: true,\n});\n\nfunction* forEachExportEntry(\n  exportField: ExportField,\n): Generator<[string, ExportMapEntry], any, undefined> {\n  const simpleExportMap = findExportMapEntry(exportField);\n\n  // Handle case where export map is a string, or if there‘s only one file in the entire export map\n  if (simpleExportMap) {\n    yield ['.', simpleExportMap];\n\n    return undefined;\n  }\n\n  for (const [key, val] of Object.entries(exportField)) {\n    // skip invalid entries\n    if (!key.startsWith('.')) {\n      continue;\n    }\n\n    yield [key, val];\n  }\n}\n\nfunction* forEachWildcardEntry(\n  key: string,\n  value: string,\n  cwd: string,\n): Generator<[string, string], any, undefined> {\n  // Creates a regex from a pattern like ./src/extras/*\n  let expr = picomatch.makeRe(value, picoMatchGlobalOptions);\n\n  // The directory, ie ./src/extras\n  let valueDirectoryName = path.dirname(value);\n  let valueDirectoryFullPath = path.join(cwd, valueDirectoryName);\n\n  if (existsSync(valueDirectoryFullPath)) {\n    let filesInDirectory = readdirSync(valueDirectoryFullPath).filter(\n      (filepath) => statSync(path.join(valueDirectoryFullPath, filepath)).isFile(), // ignore directories\n    );\n\n    for (let filename of filesInDirectory) {\n      // Create a relative path for this file to match against the regex\n      // ex, ./src/extras/one.js\n      let relativeFilePath = path.join(valueDirectoryName, filename);\n      let match = expr.exec(relativeFilePath);\n\n      if (match && match[1]) {\n        let [matchingPath, matchGroup] = match;\n        let normalizedKey = key.replace('*', matchGroup);\n\n        // Normalized to posix paths, like ./src/extras/one.js\n        let normalizedFilePath =\n          '.' + path.posix.sep + matchingPath.split(path.sep).join(path.posix.sep);\n\n        // Yield out a non-wildcard match, for ex.\n        // ['./src/extras/one', './src/extras/one.js']\n\n        yield [normalizedKey, normalizedFilePath];\n      }\n    }\n  }\n}\n\nfunction* forEachExportEntryExploded(\n  exportField: ExportField,\n  cwd: string,\n): Generator<[string, unknown], any, undefined> {\n  for (const [key, val] of forEachExportEntry(exportField)) {\n    // Deprecated but we still want to support this.\n    // https://nodejs.org/api/packages.html#packages_subpath_folder_mappings\n    if (key.endsWith('/')) {\n      const keyValue = findExportMapEntry(val);\n\n      if (typeof keyValue !== 'string') {\n        continue;\n      }\n\n      // There isn't a clear use-case for this, so we are assuming it's not needed for now.\n      if (key === './') {\n        continue;\n      }\n\n      yield* forEachWildcardEntry(key + '*', keyValue + '*', cwd);\n\n      continue;\n    }\n\n    // Wildcards https://nodejs.org/api/packages.html#packages_subpath_patterns\n    if (key.includes('*')) {\n      const keyValue = findExportMapEntry(val);\n\n      if (typeof keyValue !== 'string') {\n        continue;\n      }\n      yield* forEachWildcardEntry(key, keyValue, cwd);\n\n      continue;\n    }\n\n    yield [key, val];\n  }\n}\n\n/**\n * Given an export map and all of the crazy variations, condense down to a key/value map of string keys to string values.\n */\nexport function explodeExportMap(\n  exportField: ExportField | undefined,\n  {cwd}: {cwd: string},\n): Record<string, string> | undefined {\n  if (!exportField) {\n    return;\n  }\n  const cleanExportMap: Record<string, string> = {};\n\n  for (const [key, val] of forEachExportEntryExploded(exportField, cwd)) {\n    // If entry is an array, assume that we can always support the first value\n    const firstVal = Array.isArray(val) ? val[0] : val;\n    // Support these entries, in this order.\n    const cleanValue = findExportMapEntry(firstVal);\n    if (typeof cleanValue !== 'string') {\n      continue;\n    }\n    cleanExportMap[key] = cleanValue;\n  }\n\n  if (Object.keys(cleanExportMap).length === 0) {\n    return;\n  }\n\n  return cleanExportMap;\n}\n"
  },
  {
    "path": "esinstall/src/index.ts",
    "content": "import rollupPluginCommonjs, {RollupCommonJSOptions} from '@rollup/plugin-commonjs';\nimport rollupPluginJson from '@rollup/plugin-json';\nimport rollupPluginNodeResolve from '@rollup/plugin-node-resolve';\nimport {init as initESModuleLexer} from 'es-module-lexer';\nimport fs from 'fs';\nimport * as colors from 'kleur/colors';\nimport mkdirp from 'mkdirp';\nimport path from 'path';\nimport rimraf from 'rimraf';\nimport {InputOptions, OutputOptions, Plugin as RollupPlugin, rollup, RollupError} from 'rollup';\nimport rollupPluginNodePolyfills from 'rollup-plugin-polyfill-node';\nimport rollupPluginReplace from '@rollup/plugin-replace';\nimport {rollupPluginAlias} from './rollup-plugins/rollup-plugin-alias';\nimport {rollupPluginCatchFetch} from './rollup-plugins/rollup-plugin-catch-fetch';\nimport {rollupPluginCatchUnresolved} from './rollup-plugins/rollup-plugin-catch-unresolved';\nimport {rollupPluginCss} from './rollup-plugins/rollup-plugin-css';\nimport {rollupPluginNodeProcessPolyfill} from './rollup-plugins/rollup-plugin-node-process-polyfill';\nimport {rollupPluginDependencyStats} from './rollup-plugins/rollup-plugin-stats';\nimport {rollupPluginStripSourceMapping} from './rollup-plugins/rollup-plugin-strip-source-mapping';\nimport {rollupPluginWrapInstallTargets} from './rollup-plugins/rollup-plugin-wrap-install-targets';\nimport {\n  AbstractLogger,\n  DependencyStatsOutput,\n  EnvVarReplacements,\n  ImportMap,\n  InstallTarget,\n} from './types';\nimport {\n  createInstallTarget,\n  findMatchingAliasEntry,\n  getWebDependencyName,\n  getWebDependencyType,\n  isJavaScript,\n  MISSING_PLUGIN_SUGGESTIONS,\n  sanitizePackageName,\n  writeLockfile,\n} from './util';\nimport {resolveEntrypoint, MAIN_FIELDS} from './entrypoints';\n\nexport * from './types';\nexport {\n  findExportMapEntry,\n  findManifestEntry,\n  resolveEntrypoint,\n  explodeExportMap,\n} from './entrypoints';\nexport {resolveDependencyManifest} from './util';\nexport {printStats} from './stats';\n\ntype DependencyLoc = {\n  type: 'BUNDLE' | 'ASSET' | 'DTS';\n  loc: string;\n};\n\nfunction isImportOfPackage(importUrl: string, packageName: string) {\n  return packageName === importUrl || importUrl.startsWith(packageName + '/');\n}\n\n/**\n * Resolve a \"webDependencies\" input value to the correct absolute file location.\n * Supports both npm package names, and file paths relative to the node_modules directory.\n * Follows logic similar to Node's resolution logic, but using a package.json's ESM \"module\"\n * field instead of the CJS \"main\" field.\n */\nfunction resolveWebDependency(\n  dep: string,\n  resolveOptions: {cwd: string; packageLookupFields: string[]},\n): DependencyLoc {\n  const loc = resolveEntrypoint(dep, resolveOptions);\n  return {\n    loc,\n    type: getWebDependencyType(loc),\n  };\n}\n\nfunction generateEnvObject(userEnv: EnvVarReplacements): Object {\n  return {\n    NODE_ENV: userEnv.NODE_ENV || process.env.NODE_ENV || 'production',\n    ...Object.keys(userEnv).reduce((acc, key) => {\n      const value = userEnv[key];\n      acc[key] = value === true ? process.env[key] : value;\n      return acc;\n    }, {}),\n  };\n}\n\nfunction generateReplacements(env: Object): {[key: string]: string} {\n  return Object.keys(env).reduce(\n    (acc, key) => {\n      acc[`process.env.${key}`] = JSON.stringify(env[key]);\n      return acc;\n    },\n    {\n      // Other find & replacements:\n    },\n  );\n}\n\ninterface InstallOptions {\n  cwd: string;\n  stats: boolean;\n  alias: Record<string, string>;\n  importMap?: ImportMap;\n  logger: AbstractLogger;\n  verbose?: boolean;\n  dest: string;\n  env: EnvVarReplacements;\n  treeshake?: boolean;\n  polyfillNode: boolean;\n  sourcemap?: boolean | 'inline';\n  external: string[];\n  externalEsm: boolean | string[] | ((imp: string) => boolean);\n  packageLookupFields: string[];\n  packageExportLookupFields: string[];\n  // @deprecated No longer needed, all packages now have the highest fidelity named export support possible\n  namedExports: string[];\n  rollup: {\n    context?: string;\n    plugins?: RollupPlugin[]; // for simplicity, only Rollup plugins are supported for now\n    dedupe?: string[];\n  };\n}\n\ntype PublicInstallOptions = Partial<InstallOptions>;\nexport {PublicInstallOptions as InstallOptions};\nexport type InstallResult = {importMap: ImportMap; stats: DependencyStatsOutput | null};\n\nconst FAILED_INSTALL_MESSAGE = (message?: string) =>\n  !message ? 'Install failed.' : `Install failed ${message}.`;\n\nfunction setOptionDefaults(_options: PublicInstallOptions): InstallOptions {\n  if ((_options as any).lockfile) {\n    throw new Error('[esinstall@1.0.0] option `lockfile` was renamed to `importMap`.');\n  }\n  if ((_options as any).sourceMap) {\n    throw new Error('[esinstall@1.0.0] option `sourceMap` was renamed to `sourcemap`.');\n  }\n  if ((_options as any).externalPackage) {\n    throw new Error('[esinstall@1.0.0] option `externalPackage` was renamed to `external`.');\n  }\n  if ((_options as any).externalPackageEsm) {\n    throw new Error('[esinstall@1.0.0] option `externalPackageEsm` was renamed to `externalEsm`.');\n  }\n  const options = {\n    cwd: process.cwd(),\n    alias: {},\n    logger: {\n      debug: () => {}, // silence debug messages by default\n      log: console.log,\n      warn: console.warn,\n      error: console.error,\n    },\n    // TODO: Make this default to false in a v2.0 release\n    stats: true,\n    dest: 'web_modules',\n    external: [] as string[],\n    externalEsm: [] as string[],\n    polyfillNode: false,\n    packageLookupFields: [],\n    packageExportLookupFields: [],\n    env: {},\n    namedExports: [],\n    rollup: {\n      plugins: [],\n      dedupe: [],\n    },\n    ..._options,\n  };\n  options.dest = path.resolve(options.cwd, options.dest);\n  return options;\n}\n\nexport async function install(\n  _installTargets: (InstallTarget | string)[],\n  _options: PublicInstallOptions = {},\n): Promise<InstallResult> {\n  const {\n    cwd,\n    alias: installAlias,\n    importMap: _importMap,\n    logger,\n    dest: destLoc,\n    external,\n    externalEsm,\n    sourcemap,\n    env: userEnv,\n    stats,\n    rollup: userDefinedRollup,\n    treeshake: isTreeshake,\n    polyfillNode,\n    packageLookupFields,\n    packageExportLookupFields,\n  } = setOptionDefaults(_options);\n  const env = generateEnvObject(userEnv);\n\n  const installTargets: InstallTarget[] = _installTargets.map((t) =>\n    typeof t === 'string' ? createInstallTarget(t) : t,\n  );\n\n  // TODO: warn if import from  \"firebase\", since that includes so many Node-specific files\n\n  const allInstallSpecifiers = new Set(\n    installTargets\n      .filter(\n        (dep) => !external.some((packageName) => isImportOfPackage(dep.specifier, packageName)),\n      )\n      .map((dep) => dep.specifier)\n      .map((specifier) => {\n        const aliasEntry = findMatchingAliasEntry(installAlias, specifier);\n        return aliasEntry && aliasEntry.type === 'package' ? aliasEntry.to : specifier;\n      })\n      .map((specifier) => specifier.replace(/(\\/|\\\\)+$/, '')) // remove trailing slash from end of specifier (easier for Node to resolve)\n      .sort((a, b) => a.localeCompare(b, undefined, {numeric: true})),\n  );\n  const installEntrypoints: {[targetName: string]: string} = {};\n  const assetEntrypoints: {[targetName: string]: string} = {};\n  const importMap: ImportMap = {imports: {}};\n  let dependencyStats: DependencyStatsOutput | null = null;\n  const skipFailures = false;\n\n  for (const installSpecifier of allInstallSpecifiers) {\n    let targetName = getWebDependencyName(installSpecifier);\n    let proxiedName = sanitizePackageName(targetName); // sometimes we need to sanitize webModule names, as in the case of tippy.js -> tippyjs\n    if (_importMap) {\n      if (_importMap.imports[installSpecifier]) {\n        installEntrypoints[targetName] = _importMap.imports[installSpecifier];\n        if (!path.extname(installSpecifier) || isJavaScript(installSpecifier)) {\n          importMap.imports[installSpecifier] = `./${proxiedName}.js`;\n        } else {\n          importMap.imports[installSpecifier] = `./${proxiedName}`;\n        }\n        continue;\n      }\n      const findFolderImportEntry = Object.entries(_importMap.imports).find(([entry]) => {\n        return entry.endsWith('/') && installSpecifier.startsWith(entry);\n      });\n      if (findFolderImportEntry) {\n        installEntrypoints[targetName] =\n          findFolderImportEntry[1] + targetName.substr(findFolderImportEntry[0].length);\n        if (!path.extname(installSpecifier) || isJavaScript(installSpecifier)) {\n          importMap.imports[installSpecifier] = `./${proxiedName}.js`;\n        } else {\n          importMap.imports[installSpecifier] = `./${proxiedName}`;\n        }\n        continue;\n      }\n    }\n\n    try {\n      const resolvedResult = resolveWebDependency(installSpecifier, {\n        cwd,\n        packageLookupFields,\n      });\n      if (resolvedResult.type === 'BUNDLE') {\n        installEntrypoints[targetName] = resolvedResult.loc;\n        importMap.imports[installSpecifier] = `./${proxiedName}.js`;\n        Object.entries(installAlias)\n          .filter(([, value]) => value === installSpecifier)\n          .forEach(([key]) => {\n            importMap.imports[key] = `./${targetName}.js`;\n          });\n      } else if (resolvedResult.type === 'ASSET') {\n        // add extension if missing\n        const isMissingExt = path.extname(resolvedResult.loc) && !path.extname(proxiedName);\n        if (isMissingExt) {\n          const ext = path.basename(resolvedResult.loc).replace(/[^.]+/, '');\n          targetName += ext;\n          proxiedName += ext;\n        }\n        assetEntrypoints[targetName] = resolvedResult.loc;\n        importMap.imports[installSpecifier] = `./${proxiedName}`;\n      } else if (resolvedResult.type === 'DTS') {\n        // This is fine! Skip type-only packages\n        logger.debug(`[${installSpecifier}] target points to a TS-only package.`);\n      }\n    } catch (err) {\n      if (skipFailures) {\n        continue;\n      }\n      throw err;\n    }\n  }\n  if (Object.keys(installEntrypoints).length === 0 && Object.keys(assetEntrypoints).length === 0) {\n    throw new Error(`No ESM dependencies found!\n${colors.dim(\n  `  At least one dependency must have an ESM \"module\" entrypoint. You can find modern, web-ready packages at ${colors.underline(\n    'https://www.skypack.dev',\n  )}`,\n)}`);\n  }\n\n  await initESModuleLexer;\n  let isFatalWarningFound = false;\n  const inputOptions: InputOptions = {\n    input: installEntrypoints,\n    context: userDefinedRollup.context,\n    external: (id) => external.some((packageName) => isImportOfPackage(id, packageName)),\n    treeshake: {moduleSideEffects: true},\n    plugins: [\n      rollupPluginAlias({\n        entries: [\n          // Apply all aliases\n          ...Object.entries(installAlias).map(([key, val]) => ({\n            find: key,\n            replacement: val,\n            exact: false,\n          })),\n          // Make sure that internal imports also honor any resolved installEntrypoints\n          ...Object.entries(installEntrypoints).map(([key, val]) => ({\n            find: key,\n            replacement: val,\n            exact: true,\n          })),\n        ],\n      }),\n      rollupPluginCatchFetch(),\n      rollupPluginNodeResolve({\n        mainFields: [...packageLookupFields, ...MAIN_FIELDS],\n        extensions: ['.mjs', '.cjs', '.js', '.json'], // Default: [ '.mjs', '.js', '.json', '.node' ]\n        // whether to prefer built-in modules (e.g. `fs`, `path`) or local ones with the same names\n        preferBuiltins: true, // Default: true\n        dedupe: userDefinedRollup.dedupe || [],\n        // @ts-ignore: Added in v11+ of this plugin\n        exportConditions: packageExportLookupFields,\n      }),\n      rollupPluginJson({\n        preferConst: true,\n        indent: '  ',\n        compact: false,\n        namedExports: true,\n      }),\n      rollupPluginCss(),\n      rollupPluginReplace({\n        preventAssignment: true,\n        values: generateReplacements(env),\n      }),\n      rollupPluginCommonjs({\n        extensions: ['.js', '.cjs'],\n        esmExternals: Array.isArray(externalEsm)\n          ? (id) => externalEsm.some((packageName) => isImportOfPackage(id, packageName))\n          : externalEsm,\n        requireReturnsDefault: 'auto',\n      } as RollupCommonJSOptions),\n      rollupPluginWrapInstallTargets(!!isTreeshake, installTargets, logger),\n      stats && rollupPluginDependencyStats((info) => (dependencyStats = info)),\n      rollupPluginNodeProcessPolyfill(env),\n      polyfillNode && rollupPluginNodePolyfills(),\n      ...(userDefinedRollup.plugins || []), // load user-defined plugins last\n      rollupPluginCatchUnresolved(),\n      rollupPluginStripSourceMapping(),\n    ].filter(Boolean) as Plugin[],\n    onwarn(warning) {\n      // Log \"unresolved\" import warnings as an error, causing Snowpack to fail at the end.\n      if (\n        warning.code === 'PLUGIN_WARNING' &&\n        warning.plugin === 'snowpack:rollup-plugin-catch-unresolved'\n      ) {\n        isFatalWarningFound = true;\n        // Display posix-style on all environments, mainly to help with CI :)\n        if (warning.id) {\n          logger.error(`${warning.id}\\n   ${warning.message}`);\n        } else {\n          logger.error(\n            `${warning.message}. See https://www.snowpack.dev/reference/common-error-details`,\n          );\n        }\n        return;\n      }\n      const {loc, message} = warning;\n      const logMessage = loc ? `${loc.file}:${loc.line}:${loc.column} ${message}` : message;\n      // These warnings are usually harmless in packages, so don't show them by default.\n      if (\n        warning.code === 'CIRCULAR_DEPENDENCY' ||\n        warning.code === 'NAMESPACE_CONFLICT' ||\n        warning.code === 'THIS_IS_UNDEFINED' ||\n        warning.code === 'EMPTY_BUNDLE' ||\n        warning.code === 'UNUSED_EXTERNAL_IMPORT'\n      ) {\n        logger.debug(logMessage);\n      } else {\n        logger.warn(logMessage);\n      }\n    },\n  };\n  const outputOptions: OutputOptions = {\n    dir: destLoc,\n    format: 'esm',\n    sourcemap,\n    exports: 'named',\n    entryFileNames: (chunk) => {\n      const targetName = getWebDependencyName(chunk.name);\n      const proxiedName = sanitizePackageName(targetName);\n      return `${proxiedName}.js`;\n    },\n    chunkFileNames: 'common/[name]-[hash].js',\n  };\n\n  rimraf.sync(destLoc);\n  if (Object.keys(installEntrypoints).length > 0) {\n    try {\n      logger.debug(process.cwd());\n      logger.debug(`running installer with options: ${JSON.stringify(inputOptions)}`);\n      const packageBundle = await rollup(inputOptions);\n      logger.debug(`installing npm packages: ${Object.keys(installEntrypoints).join(', ')}`);\n      if (isFatalWarningFound) {\n        // We don't know exactly which package failed because it happened in rollup\n        // but users need all the information we *do know* in order to debug\n        const packageName =\n          Object.keys(installEntrypoints).length === 1\n            ? `for ${Object.keys(installEntrypoints)[0]}`\n            : `for one of ${Object.keys(installEntrypoints).join(', ')}`;\n        throw new Error(FAILED_INSTALL_MESSAGE(packageName));\n      }\n      logger.debug(`writing install results to disk`);\n      await packageBundle.write(outputOptions);\n    } catch (_err) {\n      logger.debug(`FAILURE: ${_err}`);\n      const err: RollupError = _err;\n\n      if (err.code === 'MISSING_EXPORT') {\n        let [exportSpecifier, tail] = err.message.split(' is not exported by ');\n        exportSpecifier = exportSpecifier.slice(1, -1);\n        const specifier = tail.split('imported by ')[1];\n        let modName;\n        for (const [key, value] of Object.entries(installEntrypoints)) {\n          if (value === specifier) {\n            modName = key;\n            break;\n          }\n        }\n        throw new Error(\n          `Module \"${modName}\" has no exported member \"${exportSpecifier}\". Did you mean to use \"import ${exportSpecifier} from '${modName}'\" instead?`,\n        );\n      }\n\n      const errFilePath = err.loc?.file || err.id;\n      if (!errFilePath) {\n        throw err;\n      }\n      // NOTE: Rollup will fail instantly on most errors. Therefore, we can\n      // only report one error at a time. `err.watchFiles` also exists, but\n      // for now `err.loc.file` and `err.id` have all the info that we need.\n      const failedExtension = path.extname(errFilePath);\n      const suggestion = MISSING_PLUGIN_SUGGESTIONS[failedExtension] || err.message;\n      // Display posix-style on all environments, mainly to help with CI :)\n      const fileName = path.relative(cwd, errFilePath).replace(/\\\\/g, '/');\n      logger.error(`Failed to load ${colors.bold(fileName)}\\n  ${suggestion}`);\n      throw new Error(FAILED_INSTALL_MESSAGE());\n    }\n  }\n\n  mkdirp.sync(destLoc);\n  await writeLockfile(path.join(destLoc, 'import-map.json'), importMap);\n  for (const [assetName, assetLoc] of Object.entries(assetEntrypoints)) {\n    const assetDest = `${destLoc}/${sanitizePackageName(assetName)}`;\n    mkdirp.sync(path.dirname(assetDest));\n    fs.copyFileSync(assetLoc, assetDest);\n  }\n\n  return {\n    importMap,\n    stats: dependencyStats,\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/generateProcessPolyfill.ts",
    "content": "/*\n(The MIT License)\n\nCopyright (c) 2013 Roman Shtylman <shtylman@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n/*\nTHIS IS A MODIFIED VERSION OF https://github.com/calvinmetcalf/node-process-es6\nORIGIANL ADDED IN COMMIT 6304406e065f356aeaa623a878d02be419b316d8 (good to know for diffing) \n*/\n\nexport function generateProcessPolyfill(env) {\n  return `/* SNOWPACK PROCESS POLYFILL (based on https://github.com/calvinmetcalf/node-process-es6) */\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\nvar cachedSetTimeout = defaultSetTimout;\nvar cachedClearTimeout = defaultClearTimeout;\nvar globalContext;\nif (typeof window !== 'undefined') {\n    globalContext = window;\n} else if (typeof self !== 'undefined') {\n    globalContext = self;\n} else {\n    globalContext = {};\n}\nif (typeof globalContext.setTimeout === 'function') {\n    cachedSetTimeout = setTimeout;\n}\nif (typeof globalContext.clearTimeout === 'function') {\n    cachedClearTimeout = clearTimeout;\n}\n\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\nfunction nextTick(fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nvar title = 'browser';\nvar platform = 'browser';\nvar browser = true;\nvar env = {};\nvar argv = [];\nvar version = ''; // empty string to avoid regexp issues\nvar versions = {};\nvar release = {};\nvar config = {};\n\nfunction noop() {}\n\nvar on = noop;\nvar addListener = noop;\nvar once = noop;\nvar off = noop;\nvar removeListener = noop;\nvar removeAllListeners = noop;\nvar emit = noop;\n\nfunction binding(name) {\n    throw new Error('process.binding is not supported');\n}\n\nfunction cwd () { return '/' }\nfunction chdir (dir) {\n    throw new Error('process.chdir is not supported');\n}function umask() { return 0; }\n\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = globalContext.performance || {};\nvar performanceNow =\n  performance.now        ||\n  performance.mozNow     ||\n  performance.msNow      ||\n  performance.oNow       ||\n  performance.webkitNow  ||\n  function(){ return (new Date()).getTime() };\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp){\n  var clocktime = performanceNow.call(performance)*1e-3;\n  var seconds = Math.floor(clocktime);\n  var nanoseconds = Math.floor((clocktime%1)*1e9);\n  if (previousTimestamp) {\n    seconds = seconds - previousTimestamp[0];\n    nanoseconds = nanoseconds - previousTimestamp[1];\n    if (nanoseconds<0) {\n      seconds--;\n      nanoseconds += 1e9;\n    }\n  }\n  return [seconds,nanoseconds]\n}\n\nvar startTime = new Date();\nfunction uptime() {\n  var currentTime = new Date();\n  var dif = currentTime - startTime;\n  return dif / 1000;\n}\n\nexport default {\n  nextTick: nextTick,\n  title: title,\n  browser: browser,\n  env: ${JSON.stringify(env)},\n  argv: argv,\n  version: version,\n  versions: versions,\n  on: on,\n  addListener: addListener,\n  once: once,\n  off: off,\n  removeListener: removeListener,\n  removeAllListeners: removeAllListeners,\n  emit: emit,\n  binding: binding,\n  cwd: cwd,\n  chdir: chdir,\n  umask: umask,\n  hrtime: hrtime,\n  platform: platform,\n  release: release,\n  config: config,\n  uptime: uptime\n};\n\nexport { addListener, argv, binding, browser, chdir, config, cwd, emit, env, hrtime, nextTick, off, on, once, platform, release, removeAllListeners, removeListener, title, umask, uptime, version, versions };\n`;\n}\n\nexport default generateProcessPolyfill;\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-alias.ts",
    "content": "/**\nThis plugin was forked from the https://github.com/rollup/plugins/tree/master/packages/alias package:\n\nThe MIT License (MIT)\n\nCopyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n*/\n\nimport {platform} from 'os';\nimport slash from 'slash';\nimport type {PartialResolvedId, Plugin} from 'rollup';\n\nconst VOLUME = /^([A-Z]:)/i;\nconst IS_WINDOWS = platform() === 'win32';\nconst noop = () => null;\n\nfunction matches(alias: Alias, importee: string) {\n  if (alias.find instanceof RegExp) {\n    return alias.find.test(importee);\n  }\n  if (importee.length < alias.find.length) {\n    return false;\n  }\n  if (importee === alias.find) {\n    return true;\n  }\n  if (alias.exact) {\n    return false;\n  }\n  const importeeStartsWithKey = importee.indexOf(alias.find) === 0;\n  const importeeHasSlashAfterKey = importee.substring(alias.find.length)[0] === '/';\n  return importeeStartsWithKey && importeeHasSlashAfterKey;\n}\n\nfunction normalizeId(id: string): string;\nfunction normalizeId(id: string | undefined): string | undefined;\nfunction normalizeId(id: string | undefined) {\n  if (typeof id === 'string' && (IS_WINDOWS || VOLUME.test(id))) {\n    return slash(id.replace(VOLUME, ''));\n  }\n  return id;\n}\n\ninterface Alias {\n  find: string | RegExp;\n  replacement: string;\n  exact: boolean;\n}\n\nfunction getEntries({entries}): readonly Alias[] {\n  if (!entries) {\n    return [];\n  }\n  return entries;\n}\n\nexport function rollupPluginAlias(options: {entries: Alias[]}): Plugin {\n  const entries = getEntries(options);\n\n  if (entries.length === 0) {\n    return {\n      name: 'alias',\n      resolveId: noop,\n    };\n  }\n\n  return {\n    name: 'alias',\n    resolveId(importee, importer) {\n      const importeeId = normalizeId(importee);\n      const importerId = normalizeId(importer);\n\n      // First match is supposed to be the correct one\n      const matchedEntry = entries.find((entry) => matches(entry, importeeId));\n      if (!matchedEntry || !importerId) {\n        return null;\n      }\n\n      const updatedId = normalizeId(\n        importeeId.replace(matchedEntry.find, matchedEntry.replacement),\n      );\n\n      return this.resolve(updatedId, importer, {skipSelf: true}).then((resolved) => {\n        let finalResult: PartialResolvedId | null = resolved;\n        if (!finalResult) {\n          finalResult = {id: updatedId};\n        }\n        return finalResult;\n      });\n    },\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-catch-fetch.ts",
    "content": "import path from 'path';\nimport {Plugin} from 'rollup';\n\nconst FETCH_POLYFILL = `\n// native patch for: node-fetch, whatwg-fetch\n// ref: https://github.com/tc39/proposal-global\nvar getGlobal = function () {\n  if (typeof self !== 'undefined') { return self; }\n  if (typeof window !== 'undefined') { return window; }\n  if (typeof global !== 'undefined') { return global; }\n  throw new Error('unable to locate global object');\n}\nvar global = getGlobal();\nexport default global.fetch.bind(global);\nexport const Headers = global.Headers;\nexport const Request = global.Request;\nexport const Response = global.Response;\n`;\n\n/**\n * rollup-plugin-catch-fetch\n *\n * How it works: NPM packages will sometimes contain Node.js-specific polyfills\n * for the native browser Fetch API. Since this makes no sense in an ESM web\n * project, we can replace these expensive polyfills with native references to\n * the fetch API.\n *\n * This still allows you to polyfill fetch in older browsers, if you desire.\n */\nfunction isNodeFetch(id: string): boolean {\n  return (\n    id === 'node-fetch' ||\n    id === 'whatwg-fetch' ||\n    id.includes(path.join('node_modules', 'node-fetch')) || // note: sometimes Snowpack has found the entry file already\n    id.includes(path.join('node_modules', 'whatwg-fetch'))\n  );\n}\n\nexport function rollupPluginCatchFetch(): Plugin {\n  return {\n    name: 'snowpack:fetch-handler',\n    resolveId(id) {\n      return isNodeFetch(id) ? id : null;\n    },\n    load(id) {\n      return isNodeFetch(id) ? FETCH_POLYFILL : null;\n    },\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-catch-unresolved.ts",
    "content": "import builtinModules from 'builtin-modules';\nimport {Plugin} from 'rollup';\n\n/**\n * rollup-plugin-catch-unresolved\n *\n * Catch any unresolved imports to give proper warnings (Rollup default is to ignore).\n */\nexport function rollupPluginCatchUnresolved(): Plugin {\n  return {\n    name: 'snowpack:rollup-plugin-catch-unresolved',\n    resolveId(id, importer) {\n      // Ignore remote http/https imports\n      if (id.startsWith('http://') || id.startsWith('https://')) {\n        return false;\n      }\n      if (builtinModules.indexOf(id) !== -1) {\n        this.warn({\n          id: importer,\n          message: `Module \"${id}\" (Node.js built-in) is not available in the browser. Run Snowpack with --polyfill-node to fix.`,\n        });\n      } else if (id.startsWith('./') || id.startsWith('../')) {\n        this.warn({\n          id: importer,\n          message: `Import \"${id}\" could not be resolved from file.`,\n        });\n      } else {\n        this.warn({\n          id: importer,\n          message: `Module \"${id}\" could not be resolved by Snowpack (Is it installed?).`,\n        });\n      }\n      return false;\n    },\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-css.ts",
    "content": "import {Plugin} from 'rollup';\n\nfunction getInjectorCode(name: string, code: string) {\n  return `\n/** SNOWPACK INJECT STYLE: ${name} */\nfunction __snowpack__injectStyle(css) {\n  const headEl = document.head || document.getElementsByTagName('head')[0];\n  const styleEl = document.createElement('style');\n  styleEl.type = 'text/css';\n  if (styleEl.styleSheet) {\n    styleEl.styleSheet.cssText = css;\n  } else {\n    styleEl.appendChild(document.createTextNode(css));\n  }\n  headEl.appendChild(styleEl);\n}\n__snowpack__injectStyle(${JSON.stringify(code)});\\n`;\n}\n\n/**\n * rollup-plugin-css\n *\n * Support installing any imported CSS into your dependencies. This isn't strictly valid\n * ESM code, but it is popular in the npm ecosystem & web development ecosystems. It also\n * solves a problem that is difficult to solve otherwise (referencing CSS from JS) so for\n * those reasons we have added default support for importing CSS into Snowpack v2.\n */\nexport function rollupPluginCss() {\n  return {\n    name: 'snowpack:rollup-plugin-css',\n    async transform(code: string, id: string) {\n      if (!id.endsWith('.css')) {\n        return null;\n      }\n      const humanReadableName = id.replace(/.*node_modules[\\/\\\\]/, '').replace(/[\\/\\\\]/g, '/');\n      return getInjectorCode(humanReadableName, code);\n    },\n  } as Plugin;\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-node-process-polyfill.ts",
    "content": "import inject from '@rollup/plugin-inject';\nimport {Plugin} from 'rollup';\nimport generateProcessPolyfill from './generateProcessPolyfill';\n\nconst PROCESS_MODULE_NAME = 'process';\nexport function rollupPluginNodeProcessPolyfill(env = {}): Plugin {\n  const injectPlugin = inject({\n    process: PROCESS_MODULE_NAME,\n    include: /\\.(cjs|js|jsx|mjs|ts|tsx)$/, // only target JavaScript files\n  });\n\n  return {\n    ...injectPlugin,\n    name: 'snowpack:rollup-plugin-node-process-polyfill',\n    resolveId(source) {\n      if (source === PROCESS_MODULE_NAME) {\n        return PROCESS_MODULE_NAME;\n      }\n\n      return null;\n    },\n    load(id) {\n      if (id === PROCESS_MODULE_NAME) {\n        return {code: generateProcessPolyfill(env), moduleSideEffects: false};\n      }\n\n      return null;\n    },\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-stats.ts",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport {OutputBundle, Plugin} from 'rollup';\nimport zlib from 'zlib';\nimport {DependencyType, DependencyStatsOutput} from '../types';\n\nexport function rollupPluginDependencyStats(\n  cb: (dependencyInfo: DependencyStatsOutput) => void,\n): Plugin {\n  let outputDir: string;\n  let existingFileCache: {[fileName: string]: number} = {};\n  let statsSummary: DependencyStatsOutput = {\n    direct: {},\n    common: {},\n  };\n\n  function buildExistingFileCache(bundle: OutputBundle) {\n    for (let fileName of Object.keys(bundle)) {\n      const filePath = path.join(outputDir, fileName);\n      if (fs.existsSync(filePath)) {\n        const {size} = fs.statSync(filePath);\n        existingFileCache[fileName] = size;\n      }\n    }\n  }\n\n  function compareDependencies(\n    files: {fileName: string; contents: Buffer}[],\n    type: DependencyType,\n  ) {\n    for (let {fileName, contents} of files) {\n      const size = contents.byteLength;\n      statsSummary[type][fileName] = {\n        size: size,\n        gzip: zlib.gzipSync(contents).byteLength,\n        brotli: zlib.brotliCompressSync ? zlib.brotliCompressSync(contents).byteLength : 0,\n      };\n      if (existingFileCache[fileName]) {\n        const delta = (size - existingFileCache[fileName]) / 1000;\n        statsSummary[type][fileName].delta = delta;\n      }\n    }\n  }\n\n  return {\n    name: 'snowpack:rollup-plugin-stats',\n    generateBundle(options, bundle) {\n      outputDir = options.dir!;\n      buildExistingFileCache(bundle);\n    },\n    writeBundle(_, bundle) {\n      const directDependencies: {fileName: string; contents: Buffer}[] = [];\n      const commonDependencies: {fileName: string; contents: Buffer}[] = [];\n      for (const [fileName, assetOrChunk] of Object.entries(bundle)) {\n        const raw = assetOrChunk.type === 'asset' ? assetOrChunk.source : assetOrChunk.code;\n        const contents = Buffer.isBuffer(raw)\n          ? raw\n          : typeof raw === 'string'\n          ? Buffer.from(raw, 'utf8')\n          : Buffer.from(raw);\n        if (fileName.startsWith('common')) {\n          commonDependencies.push({fileName, contents});\n        } else {\n          directDependencies.push({fileName, contents});\n        }\n      }\n      compareDependencies(directDependencies, 'direct');\n      compareDependencies(commonDependencies, 'common');\n      cb(statsSummary);\n    },\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-strip-source-mapping.ts",
    "content": "import {Plugin} from 'rollup';\n\n/**\n * rollup-plugin-strip-source-mapping\n *\n * Remove any lingering source map comments\n */\nexport function rollupPluginStripSourceMapping(): Plugin {\n  return {\n    name: 'snowpack:rollup-plugin-strip-source-mapping',\n    transform: (code) => ({\n      code: code\n        // [a-zA-Z0-9-_\\*?\\.\\/\\&=+%]: valid URL characters (for sourcemaps)\n        .replace(/\\/\\/#\\s*sourceMappingURL=[a-zA-Z0-9-_\\*\\?\\.\\/\\&=+%\\s]+$/gm, ''),\n      map: null,\n    }),\n  };\n}\n"
  },
  {
    "path": "esinstall/src/rollup-plugins/rollup-plugin-wrap-install-targets.ts",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport {Plugin} from 'rollup';\nimport execa from 'execa';\nimport {VM as VM2} from 'vm2';\nimport {AbstractLogger, InstallTarget} from '../types';\nimport {getWebDependencyName, isJavaScript, isRemoteUrl, isTruthy} from '../util';\nimport isValidIdentifier from 'is-valid-identifier';\nimport resolve from 'resolve';\n\n// Use CJS intentionally here! ESM interface is async but CJS is sync, and this file is sync\nconst {parse} = require('cjs-module-lexer');\n\nfunction isValidNamedExport(name: string): boolean {\n  return name !== 'default' && name !== '__esModule' && isValidIdentifier(name);\n}\n\n// Add popular CJS/UMD packages here that use \"synthetic\" named imports in their documentation.\n// Our scanner can statically scan most packages without an opt-in here, but these packages\n// are built oddly, in a way that we can't statically analyze.\nconst TRUSTED_CJS_PACKAGES = ['chai/index.js', 'events/events.js', 'uuid/index.js'];\n\n// These packages are written in such a way that the official CJS scanner succeeds at scanning\n// the file but fails to pick up some exports. Add popular packages here to save everyone a bit\n// of headache.\n// We use the exact file here to match the official package, but not any ESM aliase packages\n// that the user may have installed instead (ex: react-esm).\nconst UNSCANNABLE_CJS_PACKAGES = [\n  'chai/index.js',\n  'events/events.js',\n  'property-expr/index.js',\n  // Note: resolved in v4.x release\n  'react-transition-group/index.js',\n];\n\n/**\n * rollup-plugin-wrap-install-targets\n *\n * How it works:\n * 1. An array of \"install targets\" are passed in, describing all known imports + metadata.\n * 2. If isTreeshake: Known imports are marked for tree-shaking by appending 'snowpack-wrap:' to the input value.\n * 3. If autoDetectPackageExports match: Also mark for wrapping, and use automatic export detection.\n * 4. On load, we return a false virtual file for all \"snowpack-wrap:\" inputs.\n *    a. That virtual file contains only `export ... from 'ACTUAL_FILE_PATH';` exports\n *    b. Rollup uses those exports to drive its tree-shaking algorithm.\n *    c. Rollup uses those exports to inform its \"namedExports\" for Common.js entrypoints.\n */\nexport function rollupPluginWrapInstallTargets(\n  isTreeshake: boolean,\n  installTargets: InstallTarget[],\n  logger: AbstractLogger,\n): Plugin {\n  const installTargetSummaries: {[loc: string]: InstallTarget} = {};\n  const cjsScannedNamedExports = new Map<string, string[]>();\n\n  /**\n   * Attempt #1: Static analysis: Lower Fidelity, but faster.\n   * Do our best job to statically scan a file for named exports. This uses \"cjs-module-lexer\", the\n   * same CJS export scanner that Node.js uses internally. Very fast, but only works on some modules,\n   * depending on how they were build/written/compiled.\n   */\n  function cjsAutoDetectExportsStatic(filename: string, visited = new Set()): string[] | undefined {\n    const isMainEntrypoint = visited.size === 0;\n    // Prevent infinite loops via circular dependencies.\n    if (visited.has(filename)) {\n      return [];\n    } else {\n      visited.add(filename);\n    }\n    const fileContents = fs.readFileSync(filename, 'utf8');\n    try {\n      // Attempt 1 - CJS: Run cjs-module-lexer to statically analyze exports.\n      let {exports, reexports} = parse(fileContents);\n      // If re-exports were detected (`exports.foo = require(...)`) then resolve them here.\n      let resolvedReexports: string[] = [];\n      if (reexports.length > 0) {\n        resolvedReexports = ([] as string[]).concat.apply(\n          [],\n          reexports\n            .map((e) =>\n              cjsAutoDetectExportsStatic(\n                resolve.sync(e, {basedir: path.dirname(filename)}),\n                visited,\n              ),\n            )\n            .filter(isTruthy),\n        );\n      }\n      // If nothing was detected, return undefined.\n      // Otherwise, resolve and flatten all exports into a single array, remove invalid exports.\n      const resolvedExports = Array.from(new Set([...exports, ...resolvedReexports])).filter(\n        isValidNamedExport,\n      );\n      return isMainEntrypoint && resolvedExports.length === 0 ? undefined : resolvedExports;\n    } catch (err) {\n      // Safe to ignore, this is usually due to the file not being CJS.\n      logger.debug(`cjsAutoDetectExportsStatic ${filename}: ${err.message}`);\n    }\n  }\n\n  /**\n   * Attempt #2a - Runtime analysis: More powerful, but slower. (trusted code)\n   * This function spins off a Node.js process to analyze the most accurate set of named imports that this\n   * module supports. If this fails, there's not much else possible that we could do.\n   *\n   * We consider this \"trusted\" because it will actually run the package code in Node.js on your machine.\n   * Since this is code that you are intentionally bundling into your application, we consider this fine\n   * for most users and equivilent to the current security story of Node.js/npm. But, if you are operating\n   * a service that runs esinstall on arbitrary code, you should set `process.env.ESINSTALL_UNTRUSTED_ENVIRONMENT`\n   * so that this is skipped.\n   */\n  function cjsAutoDetectExportsRuntimeTrusted(normalizedFileName: string): string[] | undefined {\n    // Skip if set to not trust package code (besides a few popular, always-trusted packages).\n    if (\n      process.env.ESINSTALL_UNTRUSTED_ENVIRONMENT &&\n      !TRUSTED_CJS_PACKAGES.includes(normalizedFileName)\n    ) {\n      return undefined;\n    }\n    try {\n      const {stdout} = execa.sync(\n        `node`,\n        ['-p', `JSON.stringify(Object.keys(require('${normalizedFileName}')))`],\n        {\n          cwd: __dirname,\n          extendEnv: false,\n        },\n      );\n      const exportsResult = JSON.parse(stdout).filter(isValidNamedExport);\n      logger.debug(`cjsAutoDetectExportsRuntime success ${normalizedFileName}: ${exportsResult}`);\n      return exportsResult;\n    } catch (err) {\n      logger.debug(`cjsAutoDetectExportsRuntime error ${normalizedFileName}: ${err.message}`);\n    }\n  }\n\n  /**\n   * Attempt #2b - Sandboxed runtime analysis: More powerful, but slower.\n   * This will only work on UMD and very simple CJS files (require not supported).\n   * Uses VM2 to run safely sandbox untrusted code (no access no Node.js primitives, just JS).\n   * If nothing was detected, return undefined.\n   */\n  function cjsAutoDetectExportsRuntimeUntrusted(filename: string): string[] | undefined {\n    try {\n      const fileContents = fs.readFileSync(filename, 'utf8');\n      const vm = new VM2({wasm: false, fixAsync: false});\n      const exportsResult = Object.keys(\n        vm.run('const exports={}; const module={exports}; ' + fileContents + ';; module.exports;'),\n      );\n      logger.debug(`cjsAutoDetectExportsRuntimeUntrusted success ${filename}: ${exportsResult}`);\n      return exports.filter((identifier) => isValidIdentifier(identifier));\n    } catch (err) {\n      logger.debug(`cjsAutoDetectExportsRuntimeUntrusted error ${filename}: ${err.message}`);\n    }\n  }\n  return {\n    name: 'snowpack:wrap-install-targets',\n    // Mark some inputs for tree-shaking.\n    buildStart(inputOptions) {\n      const input = inputOptions.input as {[entryAlias: string]: string};\n      for (const [key, val] of Object.entries(input)) {\n        if (isRemoteUrl(val)) {\n          continue;\n        }\n        if (!isJavaScript(val)) {\n          continue;\n        }\n        const allInstallTargets = installTargets.filter(\n          (imp) => getWebDependencyName(imp.specifier) === key,\n        );\n        const installTargetSummary = allInstallTargets.reduce((summary, imp) => {\n          summary.all = summary.all || imp.all;\n          summary.default = summary.default || imp.default || imp.all;\n          summary.namespace = summary.namespace || imp.namespace || imp.all;\n          summary.named = [...(summary.named || []), ...imp.named];\n          return summary;\n        }, {} as any);\n        installTargetSummaries[val] = installTargetSummary;\n        const normalizedFileLoc = val.split(path.win32.sep).join(path.posix.sep);\n        const knownBadPackage = UNSCANNABLE_CJS_PACKAGES.some((p) =>\n          normalizedFileLoc.includes(`node_modules/${p}${p.endsWith('.js') ? '' : '/'}`),\n        );\n        const cjsExports =\n          // If we can trust the static analyzer, run that first.\n          (!knownBadPackage && cjsAutoDetectExportsStatic(val)) ||\n          // Otherwise, run our more powerful, runtime analysis.\n          // Attempted trusted first (won't run in untrusted environments).\n          cjsAutoDetectExportsRuntimeTrusted(normalizedFileLoc) ||\n          cjsAutoDetectExportsRuntimeUntrusted(normalizedFileLoc);\n        if (cjsExports && cjsExports.length > 0) {\n          cjsScannedNamedExports.set(normalizedFileLoc, cjsExports);\n          input[key] = `snowpack-wrap:${val}`;\n        }\n        if (isTreeshake && !installTargetSummary.all) {\n          input[key] = `snowpack-wrap:${val}`;\n        }\n      }\n    },\n    resolveId(source) {\n      if (source.startsWith('snowpack-wrap:')) {\n        return source;\n      }\n      return null;\n    },\n    load(id) {\n      if (!id.startsWith('snowpack-wrap:')) {\n        return null;\n      }\n      const fileLoc = id.substring('snowpack-wrap:'.length);\n      // Reduce all install targets into a single \"summarized\" install target.\n      const installTargetSummary = installTargetSummaries[fileLoc];\n      let uniqueNamedExports = Array.from(new Set(installTargetSummary.named));\n      const normalizedFileLoc = fileLoc.split(path.win32.sep).join(path.posix.sep);\n      const scannedNamedExports = cjsScannedNamedExports.get(normalizedFileLoc);\n      if (scannedNamedExports && (!isTreeshake || installTargetSummary.namespace)) {\n        uniqueNamedExports = scannedNamedExports || [];\n        installTargetSummary.default = true;\n      }\n      const result = `\n        ${installTargetSummary.namespace ? `export * from '${normalizedFileLoc}';` : ''}\n        ${\n          installTargetSummary.default\n            ? `import __pika_web_default_export_for_treeshaking__ from '${normalizedFileLoc}'; export default __pika_web_default_export_for_treeshaking__;`\n            : ''\n        }\n        ${`export {${uniqueNamedExports.join(',')}} from '${normalizedFileLoc}';`}\n      `;\n      return result;\n    },\n  };\n}\n"
  },
  {
    "path": "esinstall/src/stats.ts",
    "content": "import * as colors from 'kleur/colors';\nimport {DependencyStats, DependencyStatsOutput} from './types';\n\n/** The minimum width, in characters, of each size column */\nconst SIZE_COLUMN_WIDTH = 11;\n\n/** Generic Object.entries() alphabetical sort by keys. */\nfunction entriesSort([filenameA]: [string, any], [filenameB]: [string, any]) {\n  return filenameA.localeCompare(filenameB);\n}\n\n/** Pretty-prints number of bytes as \"XXX KB\" */\nfunction formatSize(size) {\n  let kb = Math.round((size / 1000) * 100) / 100;\n  if (kb >= 1000) {\n    kb = Math.floor(kb);\n  }\n  let color;\n  if (kb < 15) {\n    color = 'green';\n  } else if (kb < 30) {\n    color = 'yellow';\n  } else {\n    color = 'red';\n  }\n  return colors[color](`${kb} KB`.padEnd(SIZE_COLUMN_WIDTH));\n}\n\nfunction formatDelta(delta) {\n  const kb = Math.round(delta * 100) / 100;\n  const color = delta > 0 ? 'red' : 'green';\n  return colors[color](`Δ ${delta > 0 ? '+' : ''}${kb} KB`);\n}\n\nfunction formatFileInfo(\n  filename: string,\n  stats: DependencyStats,\n  padEnd: number,\n  isLastFile: boolean,\n): string {\n  const lineGlyph = colors.dim(isLastFile ? '└─' : '├─');\n  const lineName = filename.padEnd(padEnd);\n  const fileStat = formatSize(stats.size);\n  const gzipStat = formatSize(stats.gzip);\n  const brotliStat = formatSize(stats.brotli);\n  const lineStat = fileStat + gzipStat + brotliStat;\n  let lineDelta = '';\n  if (stats.delta) {\n    lineDelta = colors.dim('[') + formatDelta(stats.delta) + colors.dim(']');\n  }\n  // Trim trailing whitespace (can mess with formatting), but keep indentation.\n  return `    ` + `${lineGlyph} ${lineName} ${lineStat} ${lineDelta}`.trim();\n}\n\nfunction formatFiles(files: [string, DependencyStats][], padEnd: number) {\n  const strippedFiles = files.map(([filename, stats]) => [\n    filename.replace(/^common\\//, ''),\n    stats,\n  ]) as [string, DependencyStats][];\n  return strippedFiles\n    .map(([filename, stats], index) =>\n      formatFileInfo(filename, stats, padEnd, index >= files.length - 1),\n    )\n    .join('\\n');\n}\n\nexport function printStats(dependencyStats: DependencyStatsOutput): string {\n  let output = '';\n  const {direct, common} = dependencyStats;\n  const allDirect = Object.entries(direct).sort(entriesSort);\n  const allCommon = Object.entries(common).sort(entriesSort);\n  const maxFileNameLength =\n    [...allCommon, ...allDirect].reduce(\n      (max, [filename]) => Math.max(filename.length, max),\n      'web_modules/'.length,\n    ) + 1;\n  output +=\n    `  ⦿ ${colors.bold('web_modules/'.padEnd(maxFileNameLength + 4))}` +\n    colors.bold(colors.underline('size'.padEnd(SIZE_COLUMN_WIDTH - 2))) +\n    '  ' +\n    colors.bold(colors.underline('gzip'.padEnd(SIZE_COLUMN_WIDTH - 2))) +\n    '  ' +\n    colors.bold(colors.underline('brotli'.padEnd(SIZE_COLUMN_WIDTH - 2))) +\n    `\\n`;\n  output += `${formatFiles(allDirect, maxFileNameLength)}\\n`;\n  if (Object.values(common).length > 0) {\n    output += `  ⦿ ${colors.bold('web_modules/common/ (Shared)')}\\n`;\n    output += `${formatFiles(allCommon, maxFileNameLength)}`;\n  }\n  return `\\n${output}\\n`;\n}\n"
  },
  {
    "path": "esinstall/src/types.ts",
    "content": "export type DeepPartial<T> = {\n  [P in keyof T]?: T[P] extends Array<infer U>\n    ? Array<DeepPartial<U>>\n    : T[P] extends ReadonlyArray<infer U>\n    ? ReadonlyArray<DeepPartial<U>>\n    : DeepPartial<T[P]>;\n};\n\nexport type EnvVarReplacements = Record<string, string | number | true>;\n\nexport interface ImportMap {\n  imports: {[packageName: string]: string};\n}\n\nexport interface AbstractLogger {\n  debug: (...args: any[]) => void;\n  log: (...args: any[]) => void;\n  warn: (...args: any[]) => void;\n  error: (...args: any[]) => void;\n}\n\n/**\n * An install target represents information about a dependency to install.\n * The specifier is the key pointing to the dependency, either as a package\n * name or as an actual file path within node_modules. All other properties\n * are metadata about what is actually being imported.\n */\nexport type InstallTarget = {\n  specifier: string;\n  all: boolean;\n  default: boolean;\n  namespace: boolean;\n  named: string[];\n};\n\nexport type DependencyStats = {\n  size: number;\n  gzip: number;\n  brotli?: number;\n  delta?: number;\n};\n\nexport type DependencyType = 'direct' | 'common';\n\nexport type DependencyStatsMap = {\n  [filePath: string]: DependencyStats;\n};\n\nexport type DependencyStatsOutput = Record<DependencyType, DependencyStatsMap>;\n\nexport type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; // same as Pino\nexport type LoggerEvent = 'debug' | 'info' | 'warn' | 'error';\nexport interface LoggerOptions {\n  /** (optional) change name at beginning of line */\n  name?: string;\n}\n\n// TODO this is incomplete and could be an array.\nexport type ExportMapEntry =\n  | string\n  | {\n      browser?: ExportMapEntry;\n      import?: ExportMapEntry;\n      default?: ExportMapEntry;\n      require?: ExportMapEntry;\n    };\n\nexport type ExportMap = Record<string, ExportMapEntry>;\nexport type ExportField = string | ExportMap;\n\n//\n/**\n * https://github.com/defunctzombie/package-browser-field-spec\n * \"browser\": \"main.js\",\n * \"browser\": { \"./\": \"main.js\" }\n * \"browser\": { \"./foo\": false } // don't include in bundle\n */\nexport type BrowserField = string | Record<string, string | boolean>;\n\n// This is the package.json, with fields we care about\nexport type PackageManifest = {\n  name: string;\n  version: string;\n  main?: string; // This is optional, actually\n  module?: string;\n  exports?: ExportField;\n  browser?: BrowserField;\n  types?: string;\n  typings?: string;\n};\n\nexport type PackageManifestWithExports = PackageManifest & {\n  exports: ExportMap;\n};\n"
  },
  {
    "path": "esinstall/src/util.ts",
    "content": "import {promises as fs, realpathSync} from 'fs';\nimport path from 'path';\nimport validatePackageName from 'validate-npm-package-name';\nimport {InstallTarget, ImportMap, PackageManifest} from './types';\nimport resolve from 'resolve';\n\n// We need to use eval here to prevent Rollup from detecting this use of `require()`\nexport const NATIVE_REQUIRE = eval('require');\n\nexport async function writeLockfile(loc: string, importMap: ImportMap): Promise<void> {\n  const sortedImportMap: ImportMap = {imports: {}};\n  for (const key of Object.keys(importMap.imports).sort()) {\n    sortedImportMap.imports[key] = importMap.imports[key];\n  }\n  return fs.writeFile(loc, JSON.stringify(sortedImportMap, undefined, 2), {encoding: 'utf8'});\n}\n\nexport function isRemoteUrl(val: string): boolean {\n  return /\\w+\\:\\/\\//.test(val) || val.startsWith('//');\n}\n\nexport function isTruthy<T>(item: T | false | null | undefined): item is T {\n  return Boolean(item);\n}\n\n/** Get the package name + an entrypoint within that package (if given). */\nexport function parsePackageImportSpecifier(imp: string): [string, string | null] {\n  const impParts = imp.split('/');\n  if (imp.startsWith('@')) {\n    const [scope, name, ...rest] = impParts;\n    return [`${scope}/${name}`, rest.join('/') || null];\n  }\n  const [name, ...rest] = impParts;\n  return [name, rest.join('/') || null];\n}\n\n/**\n * Given a package name, look for that package's package.json manifest.\n * Return both the manifest location (if believed to exist) and the\n * manifest itself (if found).\n *\n * NOTE: You used to be able to require() a package.json file directly,\n * but now with export map support in Node v13 that's no longer possible.\n */\nexport function resolveDependencyManifest(\n  dep: string,\n  cwd: string,\n): [string | null, PackageManifest | null] {\n  try {\n    // resolve doesn't care about export map rules, so should find a package.json\n    // if one does exist.\n    const pkgPth = resolve.sync(`${dep}/package.json`, {\n      basedir: cwd,\n    });\n\n    const depManifest = realpathSync.native(pkgPth);\n    return [depManifest, NATIVE_REQUIRE(depManifest)];\n  } catch {\n    // This shouldn't ever happen if the package does exist.\n    return [null, null];\n  }\n}\n\n/**\n * If Rollup erred parsing a particular file, show suggestions based on its\n * file extension (note: lowercase is fine).\n */\nexport const MISSING_PLUGIN_SUGGESTIONS: {[ext: string]: string} = {\n  '.svelte':\n    'Try installing rollup-plugin-svelte and adding it to Snowpack (https://www.snowpack.dev/tutorials/svelte)',\n  '.vue':\n    'Try installing rollup-plugin-vue and adding it to Snowpack (https://www.snowpack.dev/guides/vue)',\n};\n\n/**\n * For the given import specifier, return an alias entry if one is matched.\n */\nexport function findMatchingAliasEntry(\n  alias: Record<string, string>,\n  spec: string,\n): {from: string; to: string; type: 'package' | 'path'} | undefined {\n  // Only match bare module specifiers. relative and absolute imports should not match\n  if (\n    spec === '.' ||\n    spec === '..' ||\n    spec.startsWith('./') ||\n    spec.startsWith('../') ||\n    spec.startsWith('/') ||\n    spec.startsWith('http://') ||\n    spec.startsWith('https://')\n  ) {\n    return undefined;\n  }\n\n  for (const [from, to] of Object.entries(alias)) {\n    let foundType: 'package' | 'path' = isPackageAliasEntry(to) ? 'package' : 'path';\n    const isExactMatch = spec === removeTrailingSlash(from);\n    const isDeepMatch = spec.startsWith(addTrailingSlash(from));\n    if (isExactMatch || isDeepMatch) {\n      return {\n        from,\n        to,\n        type: foundType,\n      };\n    }\n  }\n}\n\n/**\n * For the given import specifier, return an alias entry if one is matched.\n */\nexport function isPackageAliasEntry(val: string): boolean {\n  return !path.isAbsolute(val);\n}\n\n/** Get full extensions of files */\nexport function getExt(fileName: string) {\n  return {\n    /** base extension (e.g. `.js`) */\n    baseExt: path.extname(fileName).toLocaleLowerCase(),\n    /** full extension, if applicable (e.g. `.proxy.js`) */\n    expandedExt: path.basename(fileName).replace(/[^.]+/, '').toLocaleLowerCase(),\n  };\n}\n\n/**\n * Sanitizes npm packages that end in .js (e.g `tippy.js` -> `tippyjs`).\n * This is necessary because Snowpack can’t create both a file and directory\n * that end in .js.\n */\nexport function sanitizePackageName(filepath: string): string {\n  const dirs = filepath.split('/');\n  const file = dirs.pop() as string;\n  return [...dirs.map((path) => path.replace(/\\.js$/i, 'js')), file].join('/');\n}\n\n/**\n * Formats the snowpack dependency name from a \"webDependencies\" input value:\n * 2. Remove any \".js\"/\".mjs\" extension (will be added automatically by Rollup)\n */\nexport function getWebDependencyName(dep: string): string {\n  return validatePackageName(dep).validForNewPackages\n    ? dep.replace(/\\.js$/i, 'js') // if this is a top-level package ending in .js, replace with js (e.g. tippy.js -> tippyjs)\n    : dep.replace(/\\.m?js$/i, ''); // otherwise simply strip the extension (Rollup will resolve it)\n}\n\n/** Add / to beginning of string (but don’t double-up) */\nexport function addLeadingSlash(path: string) {\n  return path.replace(/^\\/?/, '/');\n}\n\n/** Add / to the end of string (but don’t double-up) */\nexport function addTrailingSlash(path: string) {\n  return path.replace(/\\/?$/, '/');\n}\n\n/** Remove \\ and / from beginning of string */\nexport function removeLeadingSlash(path: string) {\n  return path.replace(/^[/\\\\]+/, '');\n}\n\n/** Remove \\ and / from end of string */\nexport function removeTrailingSlash(path: string) {\n  return path.replace(/[/\\\\]+$/, '');\n}\n\nexport function createInstallTarget(specifier: string, all = true): InstallTarget {\n  return {\n    specifier,\n    all,\n    default: false,\n    namespace: false,\n    named: [],\n  };\n}\n\nexport function isJavaScript(pathname: string): boolean {\n  const ext = path.extname(pathname).toLowerCase();\n  return ext === '.js' || ext === '.mjs' || ext === '.cjs';\n}\n\n/**\n * Detect the web dependency \"type\" as either JS or ASSET:\n *   - BUNDLE: Install and bundle this file with Rollup engine.\n *   - ASSET: Copy this file directly.\n */\nconst bundleTypeExtensions = new Set(['.svelte', '.vue', '.astro']);\n\nexport function getWebDependencyType(pathname: string): 'ASSET' | 'BUNDLE' | 'DTS' {\n  const ext = path.extname(pathname).toLowerCase();\n  // JavaScript should always be bundled.\n  if (isJavaScript(pathname)) {\n    return 'BUNDLE';\n  }\n  // Svelte & Vue (& Astro) should always be bundled because we want to show the missing plugin\n  // error if a Svelte or Vue or Astro file is the install target. Without this, the .svelte/.vue\n  // file would be treated like an asset and sent to the web as-is.\n  if (bundleTypeExtensions.has(ext)) {\n    return 'BUNDLE';\n  }\n\n  // TypeScript typings\n  if (pathname.endsWith('.d.ts')) {\n    return 'DTS';\n  }\n\n  // All other files should be treated as assets (copied over directly).\n  return 'ASSET';\n}\n"
  },
  {
    "path": "esinstall/tsconfig.json",
    "content": "{\n  \"include\": [\"src\"],\n  \"compilerOptions\": {\n    \"outDir\": \"lib\",\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"moduleResolution\": \"node\",\n    \"declaration\": true,\n    \"esModuleInterop\": true,\n    \"strict\": true,\n    \"sourceMap\": true,\n    \"noImplicitAny\": false,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"skipLibCheck\": true\n  }\n}\n"
  },
  {
    "path": "examples/.gitignore",
    "content": "yarn.lock\n"
  },
  {
    "path": "examples/https-ssl-certificates/README.md",
    "content": "---\nlayout: ../../main.njk\ntitle: SSL Certificates\n---\n\n```\nnpm start -- --secure\n```\n\nSnowpack provides an easy way to use a local HTTPS server during development through the use of the `--secure` flag.\n\nWhen enabled, Snowpack will create an HTTPS server with HTTP2 support enabled using either:\n\n  - (default) the `snowpack.key` and `snowpack.crt` file in the root directory of your site\n  - (if provided) the TLS certificate and private key files at the paths specified in `devOptions.secure.cert` and `devOptions.secure.key` in the Snowpack configuration.\n\n## Generating SSL Certificates\n\nYou can automatically generate credentials for your project via either:\n\n- [devcert (no install required)](https://github.com/davewasmer/devcert-cli): `npx devcert-cli generate localhost`\n- [mkcert (install required)](https://github.com/FiloSottile/mkcert): `mkcert -install && mkcert -key-file snowpack.key -cert-file snowpack.crt localhost`\n\nIn most situations you should add personally generated certificate files (`snowpack.key` and `snowpack.crt`) to your `.gitignore` file.\n"
  },
  {
    "path": "examples/https-ssl-certificates/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <title>Snowpack Example: HTTPS Local Devleopment</title>\n    <style>\n        body {\n            font-family: sans-serif;\n        }\n        code {\n            background: #0003;\n            padding: 4px 8px;\n            border-radius: 4px;\n        }\n    </style>\n\n  </head>\n  <body>\n    <em>Example: SSL Certificates</em>\n    <h1>This site is using... <code id=\"protocol-text\"></code></h1>\n    <script type=\"module\">\n        document.getElementById('protocol-text').innerText = window.location.protocol.replace(':', '');\n    </script>\n  </body>\n</html>"
  },
  {
    "path": "examples/https-ssl-certificates/package.json",
    "content": "{\n  \"dependencies\": {\n    \"snowpack\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "examples/https-ssl-certificates/snowpack.config.js",
    "content": "// Snowpack Configuration File\n// See all supported options: https://www.snowpack.dev/reference/configuration\n\n/** @type {import(\"snowpack\").SnowpackUserConfig } */\nmodule.exports = {\n  mount: {\n    /* ... */\n  },\n  plugins: [\n    /* ... */\n  ],\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "examples/react-global-imports/README.md",
    "content": "---\nlayout: ../../main.njk\ntitle: React + babel-plugin-import-global\n---\n\n_Based on [app-template-react](../../create-snowpack-app/app-template-react)_\n\nExample of using Snowpack in conjuction with [babel-plugin-import-global][babel-plugin-import-global]. This is useful when you need to need to inject an import statement at the top of every file, such as React:\n\n```jsx\n// \"import React from 'react'\" no longer needed!\nfunction MyComponent() {\n  // …\n}\n\nexport default MyComponent;\n```\n\nTo recreate this setup, follow 2 steps:\n\n1. Create a [babel.config.js](./babel.config.js) file in the root of the project. Copy the settings shown.\n2. Install [@snowpack/plugin-babel][snowpack-babel] and add it to [snowpack.config.mjs](./snowpack.config.js)\n\n### ⚠️ Caveat\n\nWhen you use [@snowpack/plugin-babel][snowpack-babel], you miss out on the faster builds that come from Snowpack‘s default JS builder, [esbuild][esbuild] (we don‘t run both together to avoid conflict). However, if you skip Babel, you will have to manually place `import` statements yourself at the top of every file.\n\nWe‘d recommend being explicit and manually managing every `import` statement yourself. You can simplify your setup, speed up your builds, and you might see benefits from being explicit. In order to do this, simply use our [React starter template][app-template-react]. No setup required.\n\nBut if you‘ve weighed the tradeoffs and decide that a slower build is worth it to get global import functionality, then start from the example here.\n\n[app-template-react]: https://github.com/withastro/snowpack/create-snowpack-app/app-template-react\n[babel-plugin-import-global]: https://www.npmjs.com/package/babel-plugin-import-global\n[esbuild]: https://esbuild.github.io/\n[snowpack-babel]: https://github.com/withastro/snowpack/plugins/plugin-babel\n"
  },
  {
    "path": "examples/react-global-imports/babel.config.js",
    "content": "module.exports = {\n  presets: ['@babel/preset-react'],\n  plugins: [\n    [\n      'import-globals',\n      {\n        React: 'react',\n        Component: {moduleName: 'react', exportName: 'Component'},\n        PropTypes: {moduleName: 'react', exportName: 'PropTypes'},\n        ReactDOM: 'react-dom',\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "examples/react-global-imports/package.json",
    "content": "{\n  \"name\": \"@snowpack/example-react-global-imports\",\n  \"version\": \"0.0.1\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\"\n  },\n  \"dependencies\": {\n    \"react\": \"^17.0.0\",\n    \"react-dom\": \"^17.0.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/preset-react\": \"^7.12.7\",\n    \"@snowpack/plugin-babel\": \"^2.1.4\",\n    \"@snowpack/plugin-dotenv\": \"^2.0.4\",\n    \"@snowpack/plugin-react-refresh\": \"^2.3.7\",\n    \"babel-plugin-import-globals\": \"^2.0.0\",\n    \"snowpack\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "examples/react-global-imports/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "examples/react-global-imports/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "examples/react-global-imports/snowpack.config.js",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nmodule.exports = {\n  mount: {\n    public: '/',\n    src: '/dist',\n  },\n  plugins: ['@snowpack/plugin-babel', '@snowpack/plugin-react-refresh', '@snowpack/plugin-dotenv'],\n  packageOptions: {\n    knownEntrypoints: ['react', 'react-dom'],\n  }\n};\n"
  },
  {
    "path": "examples/react-global-imports/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n"
  },
  {
    "path": "examples/react-global-imports/src/App.jsx",
    "content": "import {useState, useEffect} from 'react';\nimport logo from './logo.svg';\nimport './App.css';\n\nfunction App() {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Create the counter (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.jsx</code> and save to reload.\n        </p>\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n        <p>\n          <a\n            className=\"App-link\"\n            href=\"https://reactjs.org\"\n            target=\"_blank\"\n            rel=\"noopener noreferrer\"\n          >\n            Learn React\n          </a>\n        </p>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "examples/react-global-imports/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "examples/react-global-imports/src/index.jsx",
    "content": "import App from './App.jsx';\nimport './index.css';\n\nReactDOM.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n  document.getElementById('root'),\n);\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n}\n"
  },
  {
    "path": "examples/react-loadable-components/README.md",
    "content": "---\nlayout: ../../main.njk\ntitle: React + Loadable Components\n---\n\n_Based on [app-template-react](../../create-snowpack-app/app-template-react)_\n\nYou can lazy load React components in Snowpack when needed with React‘s builtin `React.lazy` ([docs][react-lazy]):\n\n```jsx\nimport React, {useState, useEffect, Suspense} from 'react';\n\nconst Async = React.lazy(() => import('./Async'));\n\nfunction Component() {\n  return (\n    <div>\n      <Suspense fallback={<div>Loading...</div>}>\n        <Async />\n      </Suspense>\n    </div>\n  );\n}\n```\n\nThis works out-of-the-box in Snowpack, with no configuration needed!\n\n### Learn more\n\n- [`React.lazy` documentation on reactjs.org][react-lazy]\n\n[react-lazy]: https://reactjs.org/docs/code-splitting.html#reactlazy\n"
  },
  {
    "path": "examples/react-loadable-components/package.json",
    "content": "{\n  \"name\": \"@snowpack/example-react-loadable-components\",\n  \"version\": \"0.0.1\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\"\n  },\n  \"dependencies\": {\n    \"react\": \"^17.0.0\",\n    \"react-dom\": \"^17.0.0\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-dotenv\": \"^2.0.4\",\n    \"@snowpack/plugin-react-refresh\": \"^2.3.7\",\n    \"snowpack\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "examples/react-loadable-components/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "examples/react-loadable-components/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "examples/react-loadable-components/snowpack.config.js",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nmodule.exports = {\n  mount: {\n    public: '/',\n    src: '/dist',\n  },\n  plugins: ['@snowpack/plugin-react-refresh', '@snowpack/plugin-dotenv'],\n};\n"
  },
  {
    "path": "examples/react-loadable-components/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n"
  },
  {
    "path": "examples/react-loadable-components/src/App.jsx",
    "content": "import React, {useState, useEffect, Suspense} from 'react';\nimport logo from './logo.svg';\nimport './App.css';\n\nconst Async = React.lazy(() => import('./Async'));\n\nfunction App() {\n  // Create the count state.\n  const [count, setCount] = useState(0);\n  // Create the counter (+1 every second).\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1000);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  // Return the App component.\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.jsx</code> and save to reload.\n        </p>\n        <p>\n          Page has been open for <code>{count}</code> seconds.\n        </p>\n        <p>\n          <a\n            className=\"App-link\"\n            href=\"https://reactjs.org\"\n            target=\"_blank\"\n            rel=\"noopener noreferrer\"\n          >\n            Learn React\n          </a>\n        </p>\n        <Suspense fallback={<div>Loading...</div>}>\n          <Async />\n        </Suspense>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "examples/react-loadable-components/src/Async.jsx",
    "content": "import React from 'react';\n\nfunction Async() {\n  return <div style={{backgroundColor: 'yellow', color: 'black'}}>I‘m an Async Component!</div>;\n}\n\nexport default Async;\n"
  },
  {
    "path": "examples/react-loadable-components/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "examples/react-loadable-components/src/index.jsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App.jsx';\nimport './index.css';\n\nReactDOM.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n  document.getElementById('root'),\n);\n\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (import.meta.hot) {\n  import.meta.hot.accept();\n}\n"
  },
  {
    "path": "examples/tailwind/README.md",
    "content": "---\nlayout: ../../main.njk\ntitle: Tailwind\n---\n\n### Learn more\n\n- [Tailwind docs on Snowpack][tailwind]\n\n[tailwind]: https://www.snowpack.dev/guides/tailwind-css/\n"
  },
  {
    "path": "examples/tailwind/package.json",
    "content": "{\n  \"name\": \"@snowpack/example-react-loadable-components\",\n  \"version\": \"0.0.1\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"build\": \"snowpack build\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-postcss\": \"^1.3.0\",\n    \"postcss\": \"^8.3.5\",\n    \"snowpack\": \"^3.4.0\",\n    \"tailwindcss\": \"^2.1.2\"\n  }\n}\n"
  },
  {
    "path": "examples/tailwind/postcss.config.js",
    "content": "module.exports = {\n  plugins: {\n    tailwindcss: {},\n    // other plugins can go here, such as autoprefixer\n  },\n};\n"
  },
  {
    "path": "examples/tailwind/public/global.css",
    "content": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"
  },
  {
    "path": "examples/tailwind/public/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Tailwind Example</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/global.css\" />\n  </head>\n  <body>\n    <figure class=\"md:flebg-gray-100 rounded-xl p-8\">\n      <img\n        class=\"w-32 h-32 rounded-full mx-auto\"\n        src=\"https://images.unsplash.com/photo-1621415346777-188c7f9d9727?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=256&h=256&q=75\"\n        alt=\"\"\n        width=\"384\"\n        height=\"512\"\n      />\n      <div class=\"pt-6 space-y-4\">\n        <blockquote>\n          <p class=\"text-lg font-semibold\">\n            “Tailwind CSS is the only framework that I've seen scale on large teams. It’s easy to\n            customize, adapts to any design, and the build size is tiny.”\n          </p>\n        </blockquote>\n        <figcaption class=\"font-medium\">\n          <div class=\"text-green-600\">Sarah Dayan</div>\n          <div class=\"text-gray-500\">Staff Engineer, Algolia</div>\n        </figcaption>\n      </div>\n    </figure>\n  </body>\n</html>\n"
  },
  {
    "path": "examples/tailwind/snowpack.config.mjs",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nexport default {\n  mount: {\n    public: '/',\n    src: '/_dist',\n  },\n  devOptions: {\n    tailwindConfig: './tailwind.config.js',\n  },\n  plugins: ['@snowpack/plugin-postcss'],\n};\n"
  },
  {
    "path": "examples/tailwind/tailwind.config.js",
    "content": "module.exports = {\n  mode: 'jit',\n  purge: ['./public/**/*.html', './src/**/*.{js,jsx,ts,tsx,vue}'],\n  // specify other options here\n};\n"
  },
  {
    "path": "jest.config.js",
    "content": "module.exports = {\n  modulePathIgnorePatterns: [\n    '<rootDir>/create-snowpack-app/app-template-', // don’t run tests intended as user examples\n    '<rootDir>/examples', // don’t run any tests in examples\n    '<rootDir>/test/create-snowpack-app/test-install', // don’t run tests inside our mock create-snowpack-app install\n    '<rootDir>/www', // docs has its own tests\n  ],\n  globalSetup: '<rootDir>/jest.setup.js',\n  testEnvironment: 'node',\n};\n"
  },
  {
    "path": "jest.setup.js",
    "content": "module.exports = async () => {\n    // enable NO_COLOR mode for Jest\n    process.env.NO_COLOR = true; \n    // Clear the temp directory\n    const path = require('path');\n    const rimraf = require('rimraf');\n    const fs = require('fs');\n    rimraf.sync(path.join(__dirname, 'test', '__temp__'));\n    fs.mkdirSync(path.join(__dirname, 'test', '__temp__'));\n};"
  },
  {
    "path": "lerna.json",
    "content": "{\n  \"version\": \"independent\",\n  \"packages\": [\"snowpack\", \"skypack\", \"esinstall\", \"create-snowpack-app/*\", \"plugins/*\"],\n  \"npmClient\": \"yarn\",\n  \"useWorkspaces\": true\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"root\",\n  \"private\": true,\n  \"scripts\": {\n    \"bootstrap\": \"lerna bootstrap\",\n    \"build\": \"lerna run build --scope=esinstall --scope=snowpack --scope=skypack\",\n    \"build:watch\": \"lerna run build:watch --parallel --scope=esinstall --scope=snowpack --scope=skypack\",\n    \"build:docs\": \"cd www && yarn build\",\n    \"publish\": \"npm run build && lerna publish --no-private\",\n    \"lint\": \"lerna run lint --parallel --scope=esinstall --scope=snowpack --scope=skypack\",\n    \"format\": \"prettier --write '{snowpack,skypack,esinstall}/src/**/*.{ts,js,json}'  '{scripts,test,plugins,create-snowpack-app}/**/*.{ts,js,json}' '{.dependabot,.github,www,docs}/**/*.{md,yml,js}'\",\n    \"test\": \"jest --testPathIgnorePatterns=/test-dev/ --test-timeout=30000\",\n    \"test:dev\": \"jest /test-dev/ --test-timeout=30000\",\n    \"test:docs\": \"cd www && yarn && yarn test --passWithNoTests\"\n  },\n  \"workspaces\": [\n    \"esinstall\",\n    \"esm-runtime\",\n    \"snowpack\",\n    \"skypack\",\n    \"create-snowpack-app/*\",\n    \"plugins/*\",\n    \"test/build/*\",\n    \"test/esinstall/*\"\n  ],\n  \"devDependencies\": {\n    \"@changesets/cli\": \"^2.16.0\",\n    \"@rollup/plugin-alias\": \"^3.0.1\",\n    \"@skypack/package-check\": \"^0.2.0\",\n    \"@types/babel__traverse\": \"^7.0.7\",\n    \"@types/cacache\": \"^12.0.1\",\n    \"@types/compressible\": \"^2.0.0\",\n    \"@types/css-modules-loader-core\": \"^1.1.0\",\n    \"@types/detect-port\": \"^1.3.0\",\n    \"@types/es-module-lexer\": \"^0.3.0\",\n    \"@types/etag\": \"^1.8.0\",\n    \"@types/http-proxy\": \"^1.17.4\",\n    \"@types/mime-types\": \"^2.1.0\",\n    \"@types/mkdirp\": \"^1.0.0\",\n    \"@types/node\": \"^14.14.14\",\n    \"@types/rimraf\": \"^3.0.0\",\n    \"@types/signal-exit\": \"^3.0.0\",\n    \"@types/validate-npm-package-name\": \"^3.0.0\",\n    \"@types/ws\": \"^7.2.4\",\n    \"cheerio\": \"^1.0.0-rc.10\",\n    \"cross-env\": \"^7.0.2\",\n    \"cssnano\": \"^5.0.6\",\n    \"dedent\": \"^0.7.0\",\n    \"execa\": \"^5.1.1\",\n    \"httpie\": \"^1.1.2\",\n    \"jest\": \"^27.0.5\",\n    \"jest-specific-snapshot\": \"^4.0.0\",\n    \"lerna\": \"^3.22.1\",\n    \"prettier\": \"^2.3.1\",\n    \"strip-ansi\": \"^6.0.0\",\n    \"typescript\": \"^4.3.4\"\n  },\n  \"prettier\": {\n    \"singleQuote\": true,\n    \"trailingComma\": \"all\",\n    \"bracketSpacing\": false,\n    \"printWidth\": 100\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-babel/CHANGELOG.md",
    "content": "# @snowpack/plugin-babel\n\n## 2.1.7\n\n### Patch Changes\n\n- b34b011a: update babel plugin to support process.env packages\n- ecd6ce07: Fix undefined accessor errors using @snowpack/plugin-babel with snowpack 3.1.x (#3000) <Christian Gaetano>\n- 48ced185: Update plugin-babel readme (#2574) <Ben Scott>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-babel)._\n"
  },
  {
    "path": "plugins/plugin-babel/README.md",
    "content": "# @snowpack/plugin-babel\n\nUse Babel to build your files from source. Automatically inherits from your local project `.babelrc` or `babel.config.json` files.\n\n```\nnpm install --save-dev @snowpack/plugin-babel\n```\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-babel',\n      {\n        input: ['.js', '.mjs', '.jsx', '.ts', '.tsx'], // (optional) specify files for Babel to transform\n        transformOptions: {\n          // babel transform options\n        },\n      },\n    ],\n  ],\n};\n```\n\n#### Plugin Options\n\n| Name               | Type       | Description                                                                                                                                                |\n| :----------------- | :--------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `input`            | `string[]` | (optional) By default, Babel scans & transfoms these extensions: `['.js', '.mjs', '.jsx', '.ts', '.tsx']`. Modify this array if you’d like to change this. |\n| `transformOptions` | `object`   | (optional) See [https://babeljs.io/docs/en/options](https://babeljs.io/docs/en/options)                                                                    |\n"
  },
  {
    "path": "plugins/plugin-babel/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-babel\",\n  \"version\": \"2.1.7\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-babel#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-babel\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.14.0\",\n    \"workerpool\": \"^6.0.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "plugins/plugin-babel/plugin.js",
    "content": "const workerpool = require('workerpool');\nlet worker, pool;\n\nmodule.exports = function plugin(snowpackConfig, options = {}) {\n  // options validation\n  if (options) {\n    if (typeof options !== 'object') throw new Error(`options isn’t an object. Please see README.`);\n    if (options.input && !Array.isArray(options.input))\n      throw new Error(\n        `options.input must be an array (e.g. ['.js', '.mjs', '.jsx', '.ts', '.tsx'])`,\n      );\n    if (options.input && !options.input.length)\n      throw new Error(`options.input must specify at least one filetype`);\n  }\n\n  return {\n    name: '@snowpack/plugin-babel',\n    resolve: {\n      input: options.input || ['.js', '.mjs', '.jsx', '.ts', '.tsx'],\n      output: ['.js'], // always export JS\n    },\n    async load({filePath, isPackage}) {\n      if (!filePath) {\n        return;\n      }\n      pool = pool || workerpool.pool(require.resolve('./worker.js'));\n      worker = worker || (await pool.proxy());\n      let encodedResult = await worker.transformFileAsync(filePath, {\n        caller: {\n          name: '@snowpack/plugin-babel',\n          supportsStaticESM: true,\n          supportsDynamicImport: true,\n          supportsTopLevelAwait: true,\n          supportsExportNamespaceFrom: true,\n        },\n        cwd: snowpackConfig.root || process.cwd(),\n        ast: false,\n        compact: false,\n        sourceMaps: snowpackConfig.buildOptions.sourcemap || snowpackConfig.buildOptions.sourceMaps,\n        ...(options.transformOptions || {}),\n      });\n      let {code, map} = JSON.parse(encodedResult);\n\n      if (code) {\n        // Some Babel plugins assume process.env exists, but Snowpack\n        // uses import.meta.env instead. Handle this here since it\n        // seems to be pretty common.\n        // See: https://www.pika.dev/npm/snowpack/discuss/496\n        if (!isPackage) {\n          code = code.replace(/process\\.env/g, 'import.meta.env');\n        }\n      }\n      return {\n        '.js': {\n          code,\n          map,\n        },\n      };\n    },\n    cleanup() {\n      pool && pool.terminate();\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-babel/test/plugin-babel.test.js",
    "content": "const plugin = require('../plugin.js');\n\njest.mock('@babel/core');\nconst babel = require('@babel/core');\nbabel.transformFileAsync = jest.fn(() => Promise.resolve({code: 'code', map: 'map'}));\n\n/** jest mock above in worker will not work */\njest.mock('workerpool');\nconst workerpool = require('workerpool');\nworkerpool.pool = jest.fn((path) => ({\n  proxy: jest.fn(() =>\n    Promise.resolve({\n      transformFileAsync: (...args) => babel.transformFileAsync(...args).then(JSON.stringify),\n    }),\n  ),\n}));\n\nbeforeEach(() => {\n  babel.transformFileAsync.mockClear();\n});\n\ndescribe('plugin-babel', () => {\n  test('no options', async () => {\n    const p = plugin(\n      {\n        buildOptions: {},\n      },\n      {},\n    );\n    expect(p).toMatchInlineSnapshot(`\n      Object {\n        \"cleanup\": [Function],\n        \"load\": [Function],\n        \"name\": \"@snowpack/plugin-babel\",\n        \"resolve\": Object {\n          \"input\": Array [\n            \".js\",\n            \".mjs\",\n            \".jsx\",\n            \".ts\",\n            \".tsx\",\n          ],\n          \"output\": Array [\n            \".js\",\n          ],\n        },\n      }\n    `);\n    const result = await p.load({\n      filePath: 'test.js',\n    });\n    const [filePath, options] = babel.transformFileAsync.mock.calls[0];\n    expect(filePath).toMatchInlineSnapshot(`\"test.js\"`);\n    expect(options).toMatchObject({\n      cwd: process.cwd(),\n      ast: false,\n      compact: false,\n      sourceMaps: undefined,\n    });\n    expect(result).toMatchInlineSnapshot(`\n      Object {\n        \".js\": Object {\n          \"code\": \"code\",\n          \"map\": \"map\",\n        },\n      }\n    `);\n  });\n\n  describe('input option', () => {\n    test('input option must be an array has at least 1 value', () => {\n      expect(() =>\n        plugin(\n          {\n            buildOptions: {},\n          },\n          {\n            input: '.js',\n          },\n        ),\n      ).toThrowErrorMatchingInlineSnapshot(\n        `\"options.input must be an array (e.g. ['.js', '.mjs', '.jsx', '.ts', '.tsx'])\"`,\n      );\n      expect(() =>\n        plugin(\n          {\n            buildOptions: {},\n          },\n          {\n            input: [],\n          },\n        ),\n      ).toThrowErrorMatchingInlineSnapshot(`\"options.input must specify at least one filetype\"`);\n    });\n    test('input option will overwrite the default resolve config', () => {\n      expect(\n        plugin(\n          {\n            buildOptions: {},\n          },\n          {\n            input: ['.js'],\n          },\n        ).resolve,\n      ).toMatchInlineSnapshot(`\n        Object {\n          \"input\": Array [\n            \".js\",\n          ],\n          \"output\": Array [\n            \".js\",\n          ],\n        }\n      `);\n    });\n  });\n  test('has transformOptions', async () => {\n    const transformOptions = {\n      ast: true,\n      plugins: ['jsx'],\n    };\n    const p = plugin(\n      {buildOptions: {}},\n      {\n        transformOptions,\n      },\n    );\n    await p.load({\n      filePath: 'test.js',\n    });\n    const [filePath, options] = babel.transformFileAsync.mock.calls[0];\n    expect(options).toMatchObject({\n      cwd: process.cwd(),\n      ast: false,\n      compact: false,\n      sourceMaps: undefined,\n      ...transformOptions,\n    });\n  });\n  test('sourceMaps option will be overwritten', async () => {\n    const transformOptions = {\n      sourceMaps: 'inline',\n    };\n    const p = plugin(\n      {\n        buildOptions: {\n          sourceMaps: false,\n        },\n      },\n      {\n        transformOptions,\n      },\n    );\n    await p.load({\n      filePath: 'test.js',\n    });\n    const [filePath, options] = babel.transformFileAsync.mock.calls[0];\n    expect(options).toMatchObject({\n      cwd: process.cwd(),\n      ast: false,\n      compact: false,\n      ...transformOptions,\n    });\n  });\n  test('process.env will be converted for source files', async () => {\n    // Modify transformFileAsync mock to include a dummy `process.env`\n    babel.transformFileAsync = jest.fn(() =>\n      Promise.resolve({code: 'code [process.env.test]', map: 'map'}),\n    );\n    const p = plugin({\n      buildOptions: {},\n    });\n    const result = await p.load({\n      filePath: 'test.js',\n      isPackage: false, // testing a source file\n    });\n    // Expect process.env to be converted to import.meta.env\n    expect(result).toMatchInlineSnapshot(`\n      Object {\n        \".js\": Object {\n          \"code\": \"code [import.meta.env.test]\",\n          \"map\": \"map\",\n        },\n      }\n    `);\n  });\n  test('process.env will not be touched for package files', async () => {\n    // Modify transformFileAsync mock to include a dummy `process.env`\n    babel.transformFileAsync = jest.fn(() =>\n      Promise.resolve({code: 'code [process.env.test]', map: 'map'}),\n    );\n    const p = plugin({\n      buildOptions: {},\n    });\n    const result = await p.load({\n      filePath: 'test.js',\n      isPackage: true, // testing a package file\n    });\n    // Expect output to include import.meta.env default snippet\n    expect(result).toMatchInlineSnapshot(`\n      Object {\n        \".js\": Object {\n          \"code\": \"code [process.env.test]\",\n          \"map\": \"map\",\n        },\n      }\n    `);\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-babel/worker.js",
    "content": "const workerpool = require('workerpool');\nconst babel = require('@babel/core');\n\nasync function transformFileAsync(path, options) {\n  const {code, map} = await babel.transformFileAsync(path, options);\n  return JSON.stringify({code, map});\n}\n\n// create a worker and register public functions\nworkerpool.worker({\n  transformFileAsync,\n});\n"
  },
  {
    "path": "plugins/plugin-build-script/README.md",
    "content": "# @snowpack/plugin-build-script\n\nA Snowpack plugin to build files in your application using any CLI tool. This plugin passes matching files as input to a custom CLI command and returns the output response as the build result. This is useful for connecting a custom CLI or when no Snowpack plugin exists for a favorite build tool.\n\nNote: All Snowpack < v2.6 `build:*` scripts now use this plugin behind the scenes.\n\nUsage:\n\n```bash\nnpm install @snowpack/plugin-build-script\n```\n\nThen add the plugin to your Snowpack config:\n\n```js\n// snowpack.config.mjs\n\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        input: ['.tsx'], // files to watch\n        output: ['.tsx'], // files to export\n        cmd: 'babel --filename $FILE', // cmd to run\n      },\n    ],\n  ],\n};\n```\n\n## Plugin Options\n\n| Name     |    Type    | Description                                                                 |\n| :------- | :--------: | :-------------------------------------------------------------------------- |\n| `input`  | `string[]` | Array of extensions to watch for.                                           |\n| `output` | `string[]` | Array of extensions this plugin will output.                                |\n| `cmd`    |  `string`  | Command to run on every file matching `input`. Accepts the `$FILE` env var. |\n"
  },
  {
    "path": "plugins/plugin-build-script/package.json",
    "content": "{\n  \"version\": \"2.1.0\",\n  \"name\": \"@snowpack/plugin-build-script\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-build-script#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-build-script\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"execa\": \"^5.1.1\",\n    \"npm-run-path\": \"^4.0.1\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-build-script/plugin.js",
    "content": "const execa = require('execa');\nconst npmRunPath = require('npm-run-path');\nconst {promises: fs} = require('fs');\n\nfunction buildScriptPlugin(snowpackConfig, {input, output, cmd}) {\n  if (output.length !== 1) {\n    throw new Error('Requires one output.');\n  }\n  return {\n    name: `build:${cmd.split(' ')[0]}`,\n    resolve: {\n      input: input,\n      output: output,\n    },\n    async load({filePath}) {\n      const cmdWithFile = cmd.replace('$FILE', filePath);\n      const contents = await fs.readFile(filePath, 'utf-8');\n      const {stdout, stderr, exitCode} = await execa.command(cmdWithFile, {\n        env: npmRunPath.env(),\n        extendEnv: true,\n        shell: true,\n        windowsHide: false,\n        input: contents,\n        cwd: snowpackConfig.root || process.cwd(),\n      });\n      // If the command failed, fail the plugin as well.\n      if (exitCode !== 0) {\n        throw new Error(stderr || stdout);\n      }\n      // If the plugin outputs to stderr, show it to the user.\n      if (stderr) {\n        console.warn(stderr);\n      }\n      return {[output[0]]: stdout};\n    },\n  };\n}\n\nmodule.exports = buildScriptPlugin;\n"
  },
  {
    "path": "plugins/plugin-build-script/test/plugin.test.js",
    "content": "const fs = require('fs').promises;\nconst execa = require('execa');\n\nconst plugin = require('../plugin');\n\ndescribe('@snowpack/plugin-build-script', () => {\n  beforeEach(() => {\n    const execaResult = {\n      stdout: 'stdout',\n      stderr: '',\n      exitCode: 0,\n      // Execa is weird, and returns a promise that also has other properties. Fake that here.\n      catch: () => {\n        return execaResult;\n      },\n    };\n    execa.command = jest.fn().mockName('execa.command').mockReturnValue(execaResult);\n    fs.readFile = jest.fn().mockResolvedValue('content');\n  });\n  test(`README example`, async () => {\n    const {load} = plugin(\n      {},\n      {\n        input: ['.tsx'], // files to watch\n        output: ['.tsx'], // files to export\n        cmd: 'babel --filename $FILE', // cmd to run\n      },\n    );\n\n    const result = await load({\n      filePath: 'path/to/file.tsx',\n    });\n\n    expect(execa.command.mock.calls.length).toEqual(1);\n    expect(execa.command.mock.calls[0][0]).toEqual('babel --filename path/to/file.tsx');\n    expect(result).toStrictEqual({'.tsx': 'stdout'});\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-dotenv/CHANGELOG.md",
    "content": "# @snowpack/plugin-dotenv\n\n## 2.2.0\n\n### Minor Changes\n\n- cf1bd442: Added an option to disable dotenv-expand functionality\n\n## 2.1.0\n\n### Minor Changes\n\n- 38031e7e: Add options to plugin-dotenv (#2917) <dishuostec>\n\n### Patch Changes\n\n- ad8de420: [ci] yarn format <drwpow>\n- ae4c04bd: Updated link; reference page had moved (#2646) <ericrinaldo>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-dotenv)._\n"
  },
  {
    "path": "plugins/plugin-dotenv/README.md",
    "content": "# @snowpack/plugin-dotenv\n\nUse [dotenv](https://github.com/motdotla/dotenv) to load environment variables from your project `.env` files. See Snowpack's [Environment Variables](https://www.snowpack.dev/reference/environment-variables) documentation to learn more.\n\n```\nnpm install --save-dev @snowpack/plugin-dotenv\n```\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: ['@snowpack/plugin-dotenv'],\n};\n```\n\n```\n# .env\nSNOWPACK_PUBLIC_ENABLE_FEATURE=true\n```\n\n**NOTE:** Snowpack requires the `SNOWPACK_PUBLIC_` prefix to recognize environment variables. This is to prevent accidental exposure of keys and secrets.\n\n#### What is Supported?\n\n- [dotenv-expand](https://github.com/motdotla/dotenv-expand)\n- `.env.NODE_ENV.local`\n- `.env.local`\n- `.env.NODE_ENV`\n- `.env`\n\n#### Plugin Options\n\n| Name     | Type      | Description                                                                                        |\n| :------- | :-------- | :------------------------------------------------------------------------------------------------- |\n| `dir`    | `string`  | (optional) Where to find `.env` files. Default is your current working directory (`process.cwd()`) |\n| `expand` | `boolean` | (optional) Enable `dotenv-expand` support. Default is `true`                                       |\n"
  },
  {
    "path": "plugins/plugin-dotenv/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-dotenv\",\n  \"version\": \"2.2.0\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-dotenv#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-dotenv\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"dotenv\": \"^8.2.0\",\n    \"dotenv-expand\": \"^5.1.0\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-dotenv/plugin.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nmodule.exports = function plugin(snowpackConfig, options) {\n  const NODE_ENV = process.env.NODE_ENV;\n\n  // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use\n  const dotenvFiles = [\n    NODE_ENV && `.env.${NODE_ENV}.local`,\n    // Don't include `.env.local` for `test` environment\n    // since normally you expect tests to produce the same\n    // results for everyone\n    NODE_ENV !== 'test' && `.env.local`,\n    NODE_ENV && `.env.${NODE_ENV}`,\n    '.env',\n  ].filter(Boolean);\n\n  const dir = options && options.dir ? options.dir.toString() : '.';\n  const expand = options && options.expand !== undefined ? options.expand : true;\n  // Load environment variables from .env* files. Suppress warnings using silent\n  // if this file is missing. dotenv will never modify any environment variables\n  // that have already been set.  Variable expansion is supported in .env files.\n  // https://github.com/motdotla/dotenv\n  // https://github.com/motdotla/dotenv-expand\n  dotenvFiles.forEach((dotenvFile) => {\n    dotenvFile = path.resolve(process.cwd(), dir, dotenvFile);\n\n    if (fs.existsSync(dotenvFile)) {\n      const dotenv = require('dotenv').config({\n        path: dotenvFile,\n      });\n\n      if (expand) require('dotenv-expand')(dotenv);\n    }\n  });\n\n  return {\n    name: '@snowpack/plugin-dotenv',\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-dotenv/test/__snapshots__/plugin.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`NODE_ENV= development 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"DEVELOPMENT\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"DEVELOPMENT_LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`NODE_ENV= production 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"PRODUCTION\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"PRODUCTION_LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`NODE_ENV= test 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"ENV\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"TEST\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"ENV\",\n  \"__DOTENV_TEST\": \"TEST\",\n  \"__DOTENV_TEST_LOCAL\": \"TEST_LOCAL\",\n}\n`;\n\nexports[`NODE_ENV= undefined 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with dir NODE_ENV= development 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"DEVELOPMENT\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"DEVELOPMENT_LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with dir NODE_ENV= production 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"PRODUCTION\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"PRODUCTION_LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with dir NODE_ENV= test 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"ENV\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_LOCAL\": \"TEST\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"ENV\",\n  \"__DOTENV_TEST\": \"TEST\",\n  \"__DOTENV_TEST_LOCAL\": \"TEST_LOCAL\",\n}\n`;\n\nexports[`with dir NODE_ENV= undefined 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with expand explicitly off development 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"DEVELOPMENT\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"DEVELOPMENT_LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"\\${__DOTENV_PRESET}\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with expand explicitly off production 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"\\${__DOTENV_PRESET}\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"PRODUCTION\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"PRODUCTION_LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with expand explicitly off test 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"ENV\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"\\${__DOTENV_PRESET}\",\n  \"__DOTENV_LOCAL\": \"TEST\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"ENV\",\n  \"__DOTENV_TEST\": \"TEST\",\n  \"__DOTENV_TEST_LOCAL\": \"TEST_LOCAL\",\n}\n`;\n\nexports[`with expand explicitly off undefined 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"\\${__DOTENV_PRESET}\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with expand explicitly on development 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"DEVELOPMENT\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"DEVELOPMENT_LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with expand explicitly on production 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"PRODUCTION\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"PRODUCTION_LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n\nexports[`with expand explicitly on test 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"ENV\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"TEST\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"ENV\",\n  \"__DOTENV_TEST\": \"TEST\",\n  \"__DOTENV_TEST_LOCAL\": \"TEST_LOCAL\",\n}\n`;\n\nexports[`with expand explicitly on undefined 1`] = `\nObject {\n  \"__DOTENV_DEVELOPMENT\": \"ENV\",\n  \"__DOTENV_DEVELOPMENT_LOCAL\": \"LOCAL\",\n  \"__DOTENV_ENV\": \"ENV\",\n  \"__DOTENV_EXPAND\": \"PRESET\",\n  \"__DOTENV_LOCAL\": \"LOCAL\",\n  \"__DOTENV_PRESET\": \"PRESET\",\n  \"__DOTENV_PRODUCTION\": \"ENV\",\n  \"__DOTENV_PRODUCTION_LOCAL\": \"LOCAL\",\n  \"__DOTENV_TEST\": \"ENV\",\n  \"__DOTENV_TEST_LOCAL\": \"LOCAL\",\n}\n`;\n"
  },
  {
    "path": "plugins/plugin-dotenv/test/execPlugin.js",
    "content": "const dotenvPlugin = require('../plugin');\nconst params = JSON.parse(process.argv[2]);\n\ndotenvPlugin(null, params);\n\nconst testEnvs = Object.keys(process.env)\n  .filter((key) => key.startsWith('__DOTENV_'))\n  .reduce((ret, curr) => {\n    ret[curr] = process.env[curr];\n    return ret;\n  }, {});\n\nconsole.log(JSON.stringify(testEnvs));\n"
  },
  {
    "path": "plugins/plugin-dotenv/test/plugin.test.js",
    "content": "const path = require('path');\nconst execa = require('execa');\n\nconst execPluginFilePath = require.resolve('./execPlugin');\nconst testWorkDirectory = path.join(__dirname, 'env');\n\nfunction execPlugin(nodeEnv, params = null) {\n  const {stdout} = execa.sync('node', [execPluginFilePath, JSON.stringify(params)], {\n    cwd: testWorkDirectory,\n    env: {NODE_ENV: nodeEnv},\n  });\n  return JSON.parse(stdout);\n}\n\nbeforeEach(() => {\n  // test that pre-exiting environment variables are not overwritten\n  process.env.__DOTENV_PRESET = 'PRESET';\n});\n\nconst NODE_ENV_LIST = [undefined, 'development', 'test', 'production'];\ndescribe('NODE_ENV=', () => {\n  NODE_ENV_LIST.forEach((nodeEnv) => {\n    test(`${nodeEnv}`, () => {\n      expect(execPlugin(nodeEnv)).toMatchSnapshot();\n    });\n  });\n});\n\ndescribe('with dir NODE_ENV=', () => {\n  NODE_ENV_LIST.forEach((nodeEnv) => {\n    test(`${nodeEnv}`, () => {\n      expect(execPlugin(nodeEnv, {dir: 'subdir'})).toMatchSnapshot();\n    });\n  });\n});\n\ndescribe('with expand explicitly off', () => {\n  NODE_ENV_LIST.forEach((nodeEnv) => {\n    test(`${nodeEnv}`, () => {\n      expect(execPlugin(nodeEnv, {expand: false})).toMatchSnapshot();\n    });\n  });\n});\n\ndescribe('with expand explicitly on', () => {\n  NODE_ENV_LIST.forEach((nodeEnv) => {\n    test(`${nodeEnv}`, () => {\n      expect(execPlugin(nodeEnv, {expand: true})).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-optimize/CHANGELOG.md",
    "content": "# @snowpack/plugin-optimize\n\n## 0.2.13\n\n### Patch Changes\n\n- 63f0d8d7: add mkdirp to plugin-optimize\n- a65023e2: [ci] yarn format\n\n## 0.2.12\n\n### Patch Changes\n\n- 3eca3476: [ci] yarn format\n- 916b18a0: mark plugin-optimize as no longer private\n\n## 0.2.11\n\n### Patch Changes\n\n- 03bba7e6: update post\n- ee9e90e7: skip plugin optimize tests\n- d45e91ca: Fix deprecated option causing tests to fail (#2258) <David Bailey>\n- c0735b36: fix: deprecated config in @snowpack/plugin-optimize (#2251) <Fabian Krutsch>\n- 9515ef50: make optimize plugin private\n- 1c2a2094: update lockfile\n- e2c2d5f4: final cleanup, tests passing\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-optimize)._\n"
  },
  {
    "path": "plugins/plugin-optimize/README.md",
    "content": "# @snowpack/plugin-optimize\n\nOptimize your unbundled Snowpack app:\n\n- ✅ Minify HTML\n- ✅ Minify CSS\n- ✅ Minify JS\n- ✅ Transpile JS\n- ✅ [Preload JS Modules][https://developers.google.com/web/updates/2017/12/modulepreload]\n\n### Usage\n\nFrom a terminal, run the following:\n\n```\nnpm install --save-dev @snowpack/plugin-optimize\n```\n\nThen add this plugin to your Snowpack config:\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-optimize',\n      {\n        /* see options below */\n      },\n    ],\n  ],\n};\n```\n\n### Plugin Options\n\n| Name                 |       Type        | Description                                                                                                                                                                                                                                                    |\n| :------------------- | :---------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `minifyJS`           |     `boolean`     | Enable JS minification (default: `true`)                                                                                                                                                                                                                       |\n| `minifyCSS`          |     `boolean`     | Enable CSS minification (default: `true`)                                                                                                                                                                                                                      |\n| `minifyHTML`         |     `boolean`     | Enable HTML minification (default: `true`)                                                                                                                                                                                                                     |\n| `preloadModules`     |     `boolean`     | Experimental: Add deep, optimized [`<link rel=\"modulepreload\">`](https://developers.google.com/web/updates/2017/12/modulepreload) tags into your HTML. (default: `false`)                                                                                      |\n| `preloadCSS`         |     `boolean`     | Experimental: Eliminate `.css.proxy.js` files and combine imported CSS into one file for better network performance (default: `false`)                                                                                                                         |\n| `preloadCSSFileName` |     `string`      | If preloading CSS, change the name of the generated CSS file. Used only in conjunction with `preloadCSS: true` (default: `/imported-styles.css`)                                                                                                               |\n| `target`             | `string,string[]` | The language target(s) to transpile to. This can be a single string (ex: \"es2018\") or an array of strings (ex: [\"chrome58\",\"firefox57\"]). If undefined, no transpilation will be done. See [esbuild documentation](https://github.com/evanw/esbuild) for more. |\n"
  },
  {
    "path": "plugins/plugin-optimize/lib/css.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {parse} = require('es-module-lexer');\nconst csso = require('csso');\n\n/** Early-exit function that determines, given a set of JS files, if CSS is being imported */\nfunction hasCSSImport(files) {\n  for (const file of files) {\n    const code = fs.readFileSync(file, 'utf-8');\n    const [imports] = parse(code);\n    for (const {s, e} of imports.filter(({d}) => d === -1)) {\n      const spec = code.substring(s, e);\n      if (spec.endsWith('.css.proxy.js')) return true; // exit as soon as we find one\n    }\n  }\n  return false;\n}\nexports.hasCSSImport = hasCSSImport;\n\n/**\n * Scans JS for CSS imports, and embeds only what’s needed\n *\n * import 'global.css'                       -> (removed; loaded in HTML)\n * import url from 'global.css'              -> const url = 'global.css'\n * import {foo, bar} from 'local.module.css' -> const {foo, bar} = 'local.module.css'\n */\nfunction transformCSSProxy(file, originalCode) {\n  const filePath = path.dirname(file);\n  let code = originalCode;\n\n  const getProxyImports = (code) =>\n    parse(code)[0]\n      .filter(({d}) => d === -1) // discard dynamic imports (> -1) and import.meta (-2)\n      .filter(({s, e}) => code.substring(s, e).endsWith('.css.proxy.js')); // only accept .css.proxy.js files\n\n  // iterate through proxy imports\n  let proxyImports = getProxyImports(code);\n  while (proxyImports.length) {\n    const {s, e, ss, se} = proxyImports[0]; // only transform one at a time, because every transformation requires re-parsing (unless you created an ellaborate mechanism to keep track of character counts but IMO parsing is simpler/cheaper)\n\n    const originalImport = code.substring(s, e);\n    const importedFile = originalImport.replace(/\\.proxy\\.js$/, '');\n    const importNamed = code\n      .substring(ss, se)\n      .replace(code.substring(s - 1, e + 1), '') // remove import\n      .replace(/^import\\s+/, '') // remove keyword\n      .replace(/\\s*from.*$/, '') // remove other keyword\n      .replace(/\\*\\s+as\\s+/, '') // sanitize star imports\n      .trim();\n\n    // transform JS\n    if (!importNamed) {\n      // option 1: no transforms needed\n      code = code.replace(new RegExp(`${code.substring(ss, se)};?\\n?`), '');\n    } else {\n      if (importedFile.endsWith('.module.css')) {\n        // option 2: transform css modules\n        const proxyCode = fs.readFileSync(path.resolve(filePath, originalImport), 'utf-8');\n        const matches = proxyCode.match(/^let json\\s*=\\s*(\\{[^\\}]+\\})/m);\n        if (matches) {\n          code = code.replace(\n            new RegExp(`${code.substring(ss, se).replace(/\\*/g, '\\\\*')};?`),\n            `const ${importNamed.replace(/\\*\\s+as\\s+/, '')} = ${matches[1]};`,\n          );\n        }\n      } else {\n        // option 3: transfrom normal css\n        code = code.replace(\n          new RegExp(`${code.substring(ss, se)};?`),\n          `const ${importNamed} = '${importedFile}';`,\n        );\n      }\n    }\n\n    proxyImports = getProxyImports(code); // re-parse code, continuing until all are transformed\n  }\n\n  return code;\n}\nexports.transformCSSProxy = transformCSSProxy;\n\n/** Build CSS File */\nfunction buildImportCSS(manifest, minifyCSS) {\n  // gather list of imported CSS files\n  const allCSSFiles = new Set();\n  for (const f in manifest) {\n    manifest[f].js.forEach((js) => {\n      if (!js.endsWith('.css.proxy.js')) return;\n      const isCSSModule = js.endsWith('.module.css.proxy.js');\n      allCSSFiles.add(isCSSModule ? js : js.replace(/\\.proxy\\.js$/, ''));\n    });\n  }\n\n  // read + concat\n  let code = '';\n  allCSSFiles.forEach((file) => {\n    const contents = fs.readFileSync(file, 'utf-8');\n\n    if (file.endsWith('.module.css.proxy.js')) {\n      // css modules\n      const matches = contents.match(/^export let code = *(.*)$/m);\n      if (matches && matches[1])\n        code +=\n          '\\n' +\n          matches[1]\n            .trim()\n            .replace(/^('|\")/, '')\n            .replace(/('|\");?$/, '');\n    } else {\n      // normal css\n      code += '\\n' + contents;\n      fs.unlinkSync(file); // after we‘ve scanned a CSS file, remove it (so it‘s not double-loaded)\n    }\n  });\n\n  // sanitize JSON values\n  const css = code.replace(/\\\\n/g, '\\n').replace(/\\\\\"/g, '\"');\n\n  // minify\n  return minifyCSS ? csso.minify(css).css : css;\n}\nexports.buildImportCSS = buildImportCSS;\n"
  },
  {
    "path": "plugins/plugin-optimize/lib/html.js",
    "content": "/**\n * Logic for optimizing .html files (note: this will )\n */\nconst fs = require('fs');\nconst path = require('path');\nconst hypertag = require('hypertag');\nconst {injectHTML} = require('node-inject-html');\nconst {projectURL, isRemoteModule} = require('../util');\nconst {scanJS} = require('./js');\n\n/** Scan HTML for static imports */\nasync function scanHTML(htmlFiles, buildDirectory) {\n  const importList = {};\n  await Promise.all(\n    htmlFiles.map(async (htmlFile) => {\n      // TODO: add debug in plugins?\n      // log(`scanning ${projectURL(file, buildDirectory)} for imports`, 'debug');\n\n      const allCSSImports = new Set(); // all CSS imports for this HTML file\n      const allJSImports = new Set(); // all JS imports for this HTML file\n      const entry = new Set(); // keep track of HTML entry files\n\n      const code = await fs.promises.readFile(htmlFile, 'utf-8');\n\n      // <link>\n      hypertag(code, 'link').forEach((link) => {\n        if (!link.href) return;\n        if (isRemoteModule(link.href)) {\n          allCSSImports.add(link.href);\n        } else {\n          const resolvedCSS =\n            link.href[0] === '/'\n              ? path.join(buildDirectory, link.href)\n              : path.join(path.dirname(htmlFile), link.href);\n          allCSSImports.add(resolvedCSS);\n        }\n      });\n\n      // <script>\n      hypertag(code, 'script').forEach((script) => {\n        if (!script.src) return;\n        if (isRemoteModule(script.src)) {\n          allJSImports.add(script.src);\n        } else {\n          const resolvedJS =\n            script.src[0] === '/'\n              ? path.join(buildDirectory, script.src)\n              : path.join(path.dirname(htmlFile), script.src);\n          allJSImports.add(resolvedJS);\n          entry.add(resolvedJS);\n        }\n      });\n\n      // traverse all JS for other static imports (scannedFiles keeps track of files so we never redo work)\n      const scannedFiles = new Set();\n      allJSImports.forEach((jsFile) => {\n        scanJS({\n          file: jsFile,\n          rootDir: buildDirectory,\n          scannedFiles,\n          importList: allJSImports,\n        }).forEach((i) => allJSImports.add(i));\n      });\n\n      // return\n      importList[htmlFile] = {\n        entry: Array.from(entry),\n        css: Array.from(allCSSImports),\n        js: Array.from(allJSImports),\n      };\n    }),\n  );\n  return importList;\n}\nexports.scanHTML = scanHTML;\n\n/** Given a set of HTML files, trace the imported JS */\nfunction preloadJS({code, file, preloadCSS, rootDir}) {\n  const originalEntries = new Set(); // original entry files in HTML\n  const allModules = new Set(); // all modules required by this HTML file\n\n  // 1. scan HTML for <script> tags\n  hypertag(code, 'script').forEach((script) => {\n    if (!script.type || script.type !== 'module' || !script.src) return;\n    const resolvedJS =\n      script.src[0] === '/'\n        ? path.join(rootDir, script.src)\n        : path.join(path.dirname(file), script.src);\n    originalEntries.add(resolvedJS);\n  });\n\n  // 2. scan entries for additional imports\n  const scannedFiles = new Set(); // keep track of files scanned so we don’t get stuck in a circular dependency\n  originalEntries.forEach((entry) => {\n    scanJS({\n      file: entry,\n      rootDir,\n      scannedFiles,\n      importList: allModules,\n    }).forEach((file) => allModules.add(file));\n  });\n\n  // 3. add module preload to HTML (https://developers.google.com/web/updates/2017/12/modulepreload)\n  const resolvedModules = [...allModules]\n    .filter((m) => !originalEntries.has(m)) // don’t double-up preloading scripts that were already in the HTML\n    .filter((m) => (preloadCSS ? !m.endsWith('.css.proxy.js') : true)) // if preloading CSS, don’t preload .css.proxy.js\n    .map((src) => projectURL(src, rootDir));\n  if (!resolvedModules.length) return code; // don’t add useless whitespace\n  resolvedModules.sort((a, b) => a.localeCompare(b));\n\n  // 4. return HTML with preloads added\n  return injectHTML(code, {\n    headEnd:\n      `<!-- [@snowpack/plugin-optimize] Add modulepreload to improve unbundled load performance (More info: https://developers.google.com/web/updates/2017/12/modulepreload) -->\\n` +\n      resolvedModules.map((src) => `    <link rel=\"modulepreload\" href=\"${src}\" />`).join('\\n') +\n      '\\n',\n    bodyEnd:\n      `<!-- [@snowpack/plugin-optimize] modulepreload fallback for browsers that do not support it yet -->\\n    ` +\n      resolvedModules.map((src) => `<script type=\"module\" src=\"${src}\"></script>`).join('') +\n      '\\n',\n  });\n}\nexports.preloadJS = preloadJS;\n"
  },
  {
    "path": "plugins/plugin-optimize/lib/js.js",
    "content": "/**\n * Functions for dealing with parsing/transforming JS\n */\nconst fs = require('fs');\nconst path = require('path');\nconst {parse} = require('es-module-lexer');\nconst colors = require('kleur/colors');\nconst {log, projectURL, isRemoteModule} = require('../util');\n\n/** Recursively scan JS for static imports */\nfunction scanJS({file, rootDir, scannedFiles, importList}) {\n  try {\n    // 1. scan file for static imports\n    scannedFiles.add(file); // keep track of scanned files so we never redo work\n    importList.add(file); // make sure import is marked\n    if (isRemoteModule(file)) {\n      // don’t scan remote modules\n      return importList;\n    }\n\n    let code = fs.readFileSync(file, 'utf-8');\n    const [imports] = parse(code);\n    imports\n      .filter(({d}) => d === -1) // this is where we discard dynamic imports (> -1) and import.meta (-2)\n      .forEach(({s, e}) => {\n        const specifier = code.substring(s, e);\n        if (isRemoteModule(specifier)) {\n          importList.add(specifier);\n          scannedFiles.add(specifier); // don’t scan remote modules\n        } else {\n          importList.add(\n            specifier.startsWith('/')\n              ? path.join(rootDir, file)\n              : path.resolve(path.dirname(file), specifier),\n          );\n        }\n      });\n\n    // 2. recursively scan imports not yet scanned\n    [...importList]\n      .filter((fileLoc) => !scannedFiles.has(fileLoc)) // prevent infinite loop\n      .forEach((fileLoc) => {\n        scanJS({file: fileLoc, rootDir, scannedFiles, importList}).forEach((newImport) => {\n          importList.add(newImport);\n        });\n      });\n\n    return importList;\n  } catch (err) {\n    log(colors.yellow(` could not locate \"${projectURL(file, rootDir)}\"`), 'warn');\n    return importList;\n  }\n}\nexports.scanJS = scanJS;\n"
  },
  {
    "path": "plugins/plugin-optimize/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-optimize\",\n  \"version\": \"0.2.13\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-optimize#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-optimize\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"csso\": \"^4.1.0\",\n    \"es-module-lexer\": \"^0.3.25\",\n    \"esbuild\": \"^0.9.3\",\n    \"glob\": \"^7.1.6\",\n    \"html-minifier\": \"^4.0.0\",\n    \"hypertag\": \"^0.0.3\",\n    \"mkdirp\": \"^1.0.4\",\n    \"kleur\": \"^4.1.3\",\n    \"node-inject-html\": \"^0.0.5\",\n    \"object.fromentries\": \"^2.0.2\",\n    \"p-queue\": \"^6.6.1\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-optimize/plugin.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst glob = require('glob');\nconst {minify: minifyHtml} = require('html-minifier');\nconst csso = require('csso');\nconst esbuild = require('esbuild');\nconst {init} = require('es-module-lexer');\nconst mkdirp = require('mkdirp');\nconst PQueue = require('p-queue').default;\nconst {injectHTML} = require('node-inject-html');\nconst {buildImportCSS, transformCSSProxy} = require('./lib/css');\nconst {scanHTML, preloadJS} = require('./lib/html');\nconst {formatManifest, log} = require('./util');\n\n/**\n * Default optimizer for Snawpack, unless another one is given\n */\nexports.default = function plugin(config, userDefinedOptions) {\n  const options = {\n    minifyJS: true,\n    minifyHTML: true,\n    minifyCSS: true,\n    preloadCSS: false,\n    preloadCSSFileName: '/imported-styles.css',\n    preloadModules: false,\n    ...(userDefinedOptions || {}),\n  };\n\n  const CONCURRENT_WORKERS = require('os').cpus().length;\n\n  async function optimizeFile({file, preloadCSS, target, rootDir}) {\n    const baseExt = path.extname(file).toLowerCase();\n\n    // TODO: add debug in plugins?\n    // log(`optimizing ${projectURL(file, rootDir)}…`, 'debug');\n\n    // optimize based on extension. if it’s not here, leave as-is\n    switch (baseExt) {\n      case '.css': {\n        const shouldOptimize = options.minifyCSS;\n        if (!shouldOptimize) return;\n\n        // minify\n        let code = fs.readFileSync(file, 'utf-8');\n        code = csso.minify(code).css;\n        fs.writeFileSync(file, code, 'utf-8');\n        break;\n      }\n      case '.js':\n      case '.mjs': {\n        const shouldOptimize = options.preloadCSS || options.minifyJS;\n        if (!shouldOptimize) return;\n\n        let code = fs.readFileSync(file, 'utf-8');\n\n        // embed CSS\n        if (preloadCSS) {\n          code = transformCSSProxy(file, code);\n        }\n\n        // minify if enabled\n        if (options.minifyJS) {\n          const minified = await esbuild.transform(code, {\n            minify: true,\n            charset: 'utf8',\n            target,\n          });\n          code = minified.code;\n          fs.writeFileSync(file, code);\n        }\n\n        fs.writeFileSync(file, code);\n        break;\n      }\n      case '.html': {\n        const shouldOptimize = options.preloadCSS || options.preloadModules || options.minifyHTML;\n        if (!shouldOptimize) return;\n\n        let code = fs.readFileSync(file, 'utf-8');\n\n        // preload CSS\n        if (preloadCSS) {\n          code = injectHTML(code, {\n            headEnd: `<link rel=\"stylesheet\" href=\"${options.preloadCSSFileName}\" />\\n`,\n          });\n        }\n\n        // preload JS\n        if (options.preloadModules) {\n          code = preloadJS({code, file, preloadCSS, rootDir});\n        }\n\n        // minify\n        if (options.minifyHTML) {\n          code = minifyHtml(code, {\n            collapseWhitespace: true,\n            keepClosingSlash: true,\n            removeComments: true,\n          });\n        }\n\n        fs.writeFileSync(file, code, 'utf-8');\n        break;\n      }\n    }\n  }\n\n  return {\n    name: '@snowpack/plugin-optimize',\n    async optimize({buildDirectory}) {\n      // 0. setup\n      await init;\n      let generatedFiles = {};\n\n      // 1. index files\n      const allFiles = glob\n        .sync('**/*', {\n          cwd: buildDirectory,\n          ignore: [`${config.buildOptions.metaUrlPath}/*`],\n          nodir: true,\n        })\n        .map((file) => path.join(buildDirectory, file)); // resolve to root dir\n\n      // 2. scan imports\n      const manifest = await scanHTML(\n        allFiles.filter((f) => path.extname(f) === '.html'),\n        buildDirectory,\n      );\n      let preloadCSS = false; // only bother preloading CSS if option is enabled AND there are .css.proxy.js files\n      if (options.preloadCSS) {\n        for (f in manifest) {\n          if (\n            manifest[f].js &&\n            manifest[f].js.findIndex((js) => js.endsWith('.css.proxy.js')) !== -1\n          ) {\n            preloadCSS = true;\n            break;\n          }\n        }\n      }\n\n      // 3. optimize all files in parallel\n      const parallelWorkQueue = new PQueue({concurrency: CONCURRENT_WORKERS});\n      allFiles\n        .filter(\n          (file) => (preloadCSS ? !file.endsWith('.css.proxy.js') : true), // if preloading CSS, don’t optimize .css.proxy.js files\n        )\n        .forEach((file) => {\n          parallelWorkQueue.add(() =>\n            optimizeFile({\n              file,\n              preloadCSS,\n              rootDir: buildDirectory,\n              target: options.target,\n            }).catch((err) => {\n              log(`Error: ${file} ${err.toString()}`, 'error');\n            }),\n          );\n        });\n      await parallelWorkQueue.onIdle();\n\n      // 5. build CSS file\n      if (preloadCSS) {\n        const combinedCSS = buildImportCSS(manifest, options.minifyCSS);\n        const outputCSS = path.join(buildDirectory, options.preloadCSSFileName);\n        await mkdirp(path.dirname(outputCSS));\n        fs.writeFileSync(outputCSS, combinedCSS, 'utf-8');\n        generatedFiles.preloadedCSS = outputCSS;\n      }\n\n      // 6. write manifest\n      fs.writeFileSync(\n        path.join(buildDirectory, config.buildOptions.metaUrlPath, 'optimize-manifest.json'),\n        JSON.stringify(\n          formatManifest({manifest, buildDirectory, generatedFiles, preloadCSS}),\n          undefined,\n          2, // prettify\n        ),\n        'utf-8',\n      );\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-optimize/test/plugin.test.js",
    "content": "const path = require('path');\nconst fs = require('fs');\n\nconst plugin = require('../plugin').default;\nconst {getSnowpackPluginOutputSnapshotSerializer} = require('./serializer');\n\ndescribe.skip('@snowpack/plugin-optimize', () => {\n  beforeEach(() => {\n    expect.addSnapshotSerializer(getSnowpackPluginOutputSnapshotSerializer(__dirname));\n\n    const originalWriteFileSync = fs.writeFileSync;\n    fs.writeFileSync = jest\n      .fn()\n      .mockName('fs.writeFileSync')\n      .mockImplementation((path, ...args) => {\n        if (path.startsWith(__dirname)) return;\n\n        // write files outside of the current folder\n        originalWriteFileSync(path, ...args);\n      });\n\n    console.log = jest.fn().mockName('console.log');\n  });\n\n  it('minimal - no options', async () => {\n    const pluginInstance = plugin({\n      buildOptions: {metaUrlPath: '_snowpack'},\n    });\n\n    await pluginInstance.optimize({\n      buildDirectory: path.resolve(__dirname, 'stubs/minimal/'),\n    });\n\n    expect(fs.writeFileSync).toMatchSnapshot('fs.writeFileSync');\n    expect(console.log).toMatchSnapshot('console.log');\n  });\n\n  it('minimal - no minification', async () => {\n    const pluginInstance = plugin(\n      {\n        buildOptions: {metaUrlPath: '_snowpack'},\n      },\n      {\n        minifyJS: false,\n        minifyCSS: false,\n        minifyHTML: false,\n      },\n    );\n\n    await pluginInstance.optimize({\n      buildDirectory: path.resolve(__dirname, 'stubs/minimal/'),\n    });\n\n    expect(fs.writeFileSync).toMatchSnapshot('fs.writeFileSync');\n    expect(console.log).toMatchSnapshot('console.log');\n  });\n\n  it('no HTML minification, with preloadModules', async () => {\n    const pluginInstance = plugin(\n      {\n        buildOptions: {metaUrlPath: '_snowpack'},\n      },\n      {\n        minifyHTML: false,\n        preloadModules: true,\n      },\n    );\n\n    await pluginInstance.optimize({\n      buildDirectory: path.resolve(__dirname, 'stubs/minimal/'),\n    });\n\n    expect(fs.writeFileSync).toMatchSnapshot('fs.writeFileSync');\n    expect(console.log).toMatchSnapshot('console.log');\n  });\n\n  it('minimal - target', async () => {\n    const pluginInstance = plugin(\n      {\n        buildOptions: {metaUrlPath: '_snowpack'},\n      },\n      {\n        target: ['es2018'],\n      },\n    );\n\n    await pluginInstance.optimize({\n      buildDirectory: path.resolve(__dirname, 'stubs/minimal'),\n    });\n\n    expect(fs.writeFileSync).toMatchSnapshot('fs.writeFileSync');\n    expect(console.log).toMatchSnapshot('console.log');\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-optimize/test/serializer.js",
    "content": "module.exports = {\n  getSnowpackPluginOutputSnapshotSerializer,\n};\n\nconst {format} = require('util');\n\nconst strpAnsi = require('strip-ansi');\n\n/**\n * Serializer of written files as well as console.log output.\n *\n * Both file contents and log output is normalized to account for differences\n * in UNIX and Windows systems.\n *\n * @param string basePath all files written outside this path will be ignored (usually set to __dirname)\n */\nfunction getSnowpackPluginOutputSnapshotSerializer(basePath) {\n  return {\n    serialize(value) {\n      if (value.getMockName() === 'console.log') {\n        return value.mock.calls\n          .map(toSingleArgument)\n          .map(toNoralizedByteSize)\n          .map(removeColors)\n          .join('\\n');\n      }\n\n      const calls = value.mock.calls\n        .filter(isLocal)\n        .map(toPathAndStringContent.bind(null, basePath));\n      return calls\n        .sort((a, b) => {\n          return a[0] < b[0] ? -1 : 1;\n        })\n        .map(([path, content]) => {\n          return `FILE: ${path}\\n${content}`;\n        })\n        .join(\n          '\\n\\n--------------------------------------------------------------------------------\\n\\n',\n        );\n    },\n\n    test(value) {\n      return value && value.mock;\n    },\n  };\n}\n\nfunction toPathAndStringContent(basePath, [path, content]) {\n  const shortPath = path.replace(basePath, '').substr(1);\n  // unix-ify folder separators for Windows\n  const normalizedPath = shortPath.replace(/\\\\/g, '/');\n  // unix-ify new lines\n  const normalizedContent = content.toString().replace(/(\\\\r\\\\n)/g, '\\\\n');\n  return [normalizedPath, normalizedContent];\n}\n\nfunction toSingleArgument([output, ...args]) {\n  return format(output, ...args);\n}\nfunction toNoralizedByteSize(output) {\n  return output.replace(/(\\s{2,})\\d+ bytes/g, '$1XXX bytes');\n}\n\nfunction removeColors(output) {\n  return strpAnsi(output);\n}\n\nfunction isLocal(call) {\n  return call[0].startsWith(__dirname);\n}\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/do-not-preload-1.js",
    "content": "console.error('Error: this file in a comment shouldn’t be preloaded');\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/do-not-preload-2.js",
    "content": "console.error('Error: this entry file shouldn’t be preloaded, either (it’s already in the entry)');\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/do-not-preload-3.js",
    "content": "console.error('Error: this lazy-loaded file should not be preloaded (then it’s not lazy-loaded)');\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/esm_example.js",
    "content": "export default function esm_example() {\n  console.log('example');\n  return 1;\n}\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Minimal test</title>\n    <link rel=\"stylesheet\" href=\"style.css\" />\n  </head>\n  <body>\n    <script type=\"module\" src=\"index.js\"></script>\n    <!-- <script type=\"module\" src=\"./do-not-preload-1.js\"></script> -->\n    <script type=\"module\" src=\"./do-not-preload-2.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/index.js",
    "content": "import esm_example from './esm_example.js';\nimport supportTarget from './target-es2018.js';\nimport('./do-not-preload-3.js');\n\n(() => {\n  function n(o) {\n    console.log(o);\n  }\n  n('test', supportTarget());\n})();\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/package.json",
    "content": "{\n  \"name\": \"plugin-webpack-test-minimal\",\n  \"main\": \"src/index.js\"\n}\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/style.css",
    "content": "body {\n  border: 1px solid #ffffff;\n  margin: 1px 1px 1px 1px;\n}\n"
  },
  {
    "path": "plugins/plugin-optimize/test/stubs/minimal/target-es2018.js",
    "content": "export default function testTarget() {\n  // es2020 - Optional Chaining & Nullish coalescing Operator\n  const foo = {\n    bar: 'bar',\n  };\n  const bar = null;\n  console.log(foo?.bar, bar ?? 100);\n  return true;\n}\n"
  },
  {
    "path": "plugins/plugin-optimize/util.js",
    "content": "/**\n * Copy/paste from Snowpack utils, at least until there’s some common import\n */\nconst path = require('path');\nconst colors = require('kleur/colors');\nconst fromEntries = require('object.fromentries');\n\n// Node 10 shim\nif (!Object.fromEntries) fromEntries.shim();\n\n/** log somethin */\nfunction log(msg, level = 'log') {\n  console[level](`${colors.dim('[@snowpack/plugin-optimize]')} ${msg}`);\n}\nexports.log = log;\n\n/** determine if remote package or not */\nfunction isRemoteModule(specifier) {\n  return (\n    specifier.startsWith('//') ||\n    specifier.startsWith('http://') ||\n    specifier.startsWith('https://')\n  );\n}\nexports.isRemoteModule = isRemoteModule;\n\n/** URL relative */\nfunction projectURL(url, buildDirectory) {\n  return path.relative(buildDirectory, url).replace(/\\\\/g, '/').replace(/^\\/?/, '/');\n}\nexports.projectURL = projectURL;\n\n/** Remove \\ and / from beginning of string */\nfunction removeLeadingSlash(path) {\n  return path.replace(/^[/\\\\]+/, '');\n}\nexports.removeLeadingSlash = removeLeadingSlash;\n\n/** Build Import */\nfunction formatManifest({manifest, buildDirectory, generatedFiles, preloadCSS}) {\n  const format = (url) => (isRemoteModule(url) ? url : projectURL(url, buildDirectory));\n\n  const sorted = Object.entries(manifest).map(([k, v]) => {\n    const entry = v.entry.map(format);\n    const css = v.css.map(format);\n    const js = v.js\n      .filter((f) => (preloadCSS && !f.endsWith('.css.proxy.js')) || true) // if preloading CSS, omit .css.proxy.js files\n      .map(format);\n    entry.sort((a, b) => a.localeCompare(b));\n    css.sort((a, b) => a.localeCompare(b));\n    js.sort((a, b) => a.localeCompare(b));\n    return [format(k), {entry, css, js}];\n  });\n  sorted.sort((a, b) => a[0].localeCompare(b[0]));\n\n  return {\n    imports: Object.fromEntries(sorted),\n    generated: Object.fromEntries(Object.entries(generatedFiles).map(([k, v]) => [k, format(v)])),\n  };\n}\nexports.formatManifest = formatManifest;\n"
  },
  {
    "path": "plugins/plugin-postcss/CHANGELOG.md",
    "content": "# @snowpack/plugin-postcss\n\n## 1.4.3\n\n### Patch Changes\n\n- 8cdad981: [ci] yarn format <matthewp>\n- f9fc09a8: Provide the 'from' filename when processing postcss (#3493) <Matthew Phillips>\n\n## 1.4.2\n\n### Patch Changes\n\n- a6b3b71f: Allow srcPath fallback for older versions of Snowpack (#3484) <Drew Powers>\n- 33cd5648: Pass real filepath to transform plugins (#3483) <Drew Powers>\n- b87534b2: Remove postcss-cli from plugin-postcss docs (#3412) <Adam Burgess>\n\n## 1.4.1\n\n### Patch Changes\n\n- bc56243c: [PostCSS] Support `glob` property in `dir-dependency` messages (#3404) <Brad Cornes>\n\n## 1.4.0\n\n### Minor Changes\n\n- 4f9da737: Feat: Allow dynamic config in @snowpack/plugin-postcss (#3344) <Drew Powers>\n\n### Patch Changes\n\n- 1823b35f: Chore: update docs to refer to snowpack.config.mjs (#3341) <Drew Powers>\n\n## 1.3.0\n\n### Minor Changes\n\n- b5bd57f8: Add support for PostCSS dependency messages (#3309) <Brad Cornes>\n\n## 1.2.2\n\n### Patch Changes\n\n- 56c5a231: fix typo in changelog\n- 40f02cf4: reorder changelog entries\n\n## 1.2.1\n\n### Patch Changes\n\n- 8ac85f6d: postcss: add filepath to id\n\n## 1.2.0 [2021-03-16]\n\n- 21461ce5: Update @snowpack/plugin-postcss API (#2854) <Drew Powers>\n- 68a66d4e: plugin-postcss: Use API and threadpool instead of CLI. (#2165) <Josh Wilson>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-postcss)._\n"
  },
  {
    "path": "plugins/plugin-postcss/README.md",
    "content": "# @snowpack/plugin-postcss\n\nRuns [PostCSS](https://github.com/postcss/postcss) on all `.css` files, including ones generated from Sass, Vue, and Svelte.\n\n### Usage\n\nInstall @snowpack/plugin-postcss, PostCSS, and your PostCSS plugins (not shown):\n\n```\nnpm install --save-dev @snowpack/plugin-postcss postcss\n```\n\nThen add this plugin to your Snowpack config:\n\n```diff\n// snowpack.config.mjs\nexport default {\n+  plugins: ['@snowpack/plugin-postcss'],\n};\n```\n\nLastly, add a `postcss.config.js` file. By default, @snowpack/plugin-postcss looks for this in the root directory of your project, but you can customize this with the `config` option.\n\n```js\nmodule.exports = {\n  plugins: [\n    // Replace below with your plugins\n    require('cssnano'),\n    require('postcss-preset-env')\n  ],\n};\n```\n\n### Plugin Options\n\n| Name     |        Type        | Description                                                                       |\n| :------- | :----------------: | :-------------------------------------------------------------------------------- |\n| `input`  |     `string[]`     | File extensions to transform (default: `['.css']`)                                |\n| `config` | `string \\| object` | (optional) Pass in a PostCSS config object or path to your PostCSS config on disk |\n"
  },
  {
    "path": "plugins/plugin-postcss/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-postcss\",\n  \"version\": \"1.4.3\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-postcss#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-postcss\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"minimatch\": \"^3.0.4\",\n    \"normalize-path\": \"^3.0.0\",\n    \"postcss-load-config\": \"^3.0.1\",\n    \"workerpool\": \"^6.1.2\"\n  },\n  \"devDependencies\": {\n    \"postcss\": \"^8.3.5\"\n  },\n  \"peerDependencies\": {\n    \"postcss\": \"*\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-postcss/plugin.js",
    "content": "'use strict';\n\nconst path = require('path');\nconst workerpool = require('workerpool');\nconst minimatch = require('minimatch');\nconst normalizePath = require('normalize-path');\n\nmodule.exports = function postcssPlugin(snowpackConfig, options) {\n  // options validation\n  if (options) {\n    if (typeof options !== 'object' || Array.isArray(options))\n      throw new Error('options isn’t an object. Please see README.');\n    if (\n      (options.config && typeof options !== 'string' && typeof options !== 'object') ||\n      Array.isArray(options)\n    )\n      throw new Error('options.config must be a config object or a path to a PostCSS config file.');\n  }\n\n  let worker, pool;\n\n  const dependencies = new Map();\n\n  return {\n    name: '@snowpack/postcss-transform',\n    async transform({id, srcPath, fileExt, contents}) {\n      let {input = ['.css'], config} = options;\n\n      if (!input.includes(fileExt) || !contents) return;\n\n      if (config && typeof config === 'string') {\n        config = path.resolve(config);\n      }\n\n      pool = pool || workerpool.pool(require.resolve('./worker.js'));\n      worker = worker || (await pool.proxy());\n\n      const encodedResult = await worker.transformAsync(contents, {\n        config,\n        filepath: srcPath || id, // note: srcPath will be undefined in snowpack@3.6.1 and older\n        cwd: snowpackConfig.root || process.cwd(),\n        map:\n          snowpackConfig.buildOptions && snowpackConfig.buildOptions.sourceMaps\n            ? {\n                prev: false,\n                annotation: false,\n                inline: false,\n              }\n            : false,\n      });\n      const {css, map, messages} = JSON.parse(encodedResult);\n\n      const patterns = new Set();\n      for (const message of messages) {\n        if (message.type === 'dependency') {\n          patterns.add(normalizePath(message.file));\n        } else if (message.type === 'dir-dependency') {\n          patterns.add(normalizePath(`${message.dir}/${message.glob || '**/*'}`));\n        }\n      }\n      dependencies.set(id, patterns);\n\n      return {\n        code: css, // old API (keep)\n        contents: css, // new API\n        map,\n      };\n    },\n    onChange({filePath}) {\n      const normalizedFilePath = normalizePath(filePath);\n      eachId: for (const [id, patterns] of dependencies) {\n        for (const pattern of patterns) {\n          if (minimatch(normalizedFilePath, pattern)) {\n            this.markChanged(id);\n            continue eachId;\n          }\n        }\n      }\n    },\n    cleanup() {\n      pool && pool.terminate();\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-postcss/test/fixtures/from/from.css",
    "content": "@from(.foo) {\n\n}"
  },
  {
    "path": "plugins/plugin-postcss/test/fixtures/from/postcss.config.js",
    "content": "function pluginFrom() {\n  return {\n    postcssPlugin: 'plugin-from',\n    AtRule(node, {result, Declaration}) {\n      node.replaceWith(new Declaration({prop: 'content', value: `\"${result.opts.from}\"`}));\n    },\n  };\n}\n\npluginFrom.postcss = true;\n\nmodule.exports = {\n  plugins: [pluginFrom],\n};\n"
  },
  {
    "path": "plugins/plugin-postcss/test/fixtures/from/style.css",
    "content": "body {\n  background: #fff;\n}\n\n#root {\n  width: 480px;\n  margin: auto;\n  padding: 16px;\n  box-sizing: border-box;\n}\n\n.content {\n  color: blue;\n}\n\n\n"
  },
  {
    "path": "plugins/plugin-postcss/test/fixtures/postcss.config.js",
    "content": "module.exports = {\n  plugins: [\n    require('cssnano')({\n      preset: 'default',\n    }),\n  ],\n};\n"
  },
  {
    "path": "plugins/plugin-postcss/test/fixtures/style.css",
    "content": "body {\n  background: #fff;\n}\n\n#root {\n  box-sizing: border-box;\n  margin: auto;\n  padding: 16px;\n  width: 480px;\n}\n\n.content {\n  color: blue;\n}\n"
  },
  {
    "path": "plugins/plugin-postcss/test/plugin.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst plugin = require('../plugin.js');\n\nconst cssPath = path.join(__dirname, 'fixtures', 'style.css');\nconst minCssPath = path.join(__dirname, 'fixtures', 'style.min.css');\nconst cssContent = fs.readFileSync(cssPath, 'utf8');\nconst minCssContent = fs.readFileSync(minCssPath, 'utf8');\n\ndescribe('@snowpack/plugin-postcss', () => {\n  test('loads postcss config with no options', async () => {\n    const pluginInstance = plugin({root: path.join(__dirname, 'fixtures')}, {});\n    const transformCSSResults = await pluginInstance.transform({\n      id: cssPath,\n      fileExt: path.extname(cssPath),\n      contents: cssContent,\n    });\n    expect(transformCSSResults.code).toBe(minCssContent); // TODO: remove this?\n    expect(transformCSSResults.contents).toBe(minCssContent);\n    expect(transformCSSResults.map).toBe(undefined);\n    await pluginInstance.cleanup();\n  });\n\n  test('accepts a path to a config file', async () => {\n    const pluginInstance = plugin(\n      {},\n      {config: path.join(__dirname, 'fixtures', 'postcss.config.js')},\n    );\n    const transformCSSResults = await pluginInstance.transform({\n      id: cssPath,\n      fileExt: path.extname(cssPath),\n      contents: cssContent,\n    });\n    expect(transformCSSResults.code).toBe(minCssContent); // TODO: remove this?\n    expect(transformCSSResults.contents).toBe(minCssContent);\n    expect(transformCSSResults.map).toBe(undefined);\n    await pluginInstance.cleanup();\n  });\n\n  test('produces source maps with sourceMaps: true', async () => {\n    const pluginInstance = plugin(\n      {root: path.join(__dirname, 'fixtures'), buildOptions: {sourceMaps: true}},\n      {},\n    );\n    const transformCSSResults = await pluginInstance.transform({\n      id: cssPath,\n      fileExt: path.extname(cssPath),\n      contents: cssContent,\n    });\n    expect(transformCSSResults.code).toBe(minCssContent); // TODO: remove this?\n    expect(transformCSSResults.contents).toBe(minCssContent);\n    expect(transformCSSResults.map).toEqual(\n      // a raw source map object\n      expect.objectContaining({\n        version: expect.any(Number),\n        mappings: expect.any(String),\n      }),\n    );\n    await pluginInstance.cleanup();\n  });\n\n  test('bails with empty input array', async () => {\n    const pluginInstance = plugin({root: path.join(__dirname, 'fixtures')}, {input: []});\n    const transformCSSResults = await pluginInstance.transform({\n      id: cssPath,\n      fileExt: path.extname(cssPath),\n      contents: cssContent,\n    });\n    expect(transformCSSResults).toBeFalsy();\n    await pluginInstance.cleanup();\n  });\n\n  test('allows dynamic config', async () => {\n    // important: make sure to NOT set {root:} here so it doesn’t automatically pick up fixtures/postcss.config.js\n    const pluginInstance = plugin({}, {config: {plugins: {cssnano: {}}}});\n    const transformCSSResults = await pluginInstance.transform({\n      id: cssPath,\n      fileExt: path.extname(cssPath),\n      contents: cssContent,\n    });\n    expect(transformCSSResults.code).toBe(minCssContent); // TODO: remove this?\n    expect(transformCSSResults.contents).toBe(minCssContent);\n    expect(transformCSSResults.map).toBe(undefined);\n    await pluginInstance.cleanup();\n  });\n\n  test('the correct \"from\" is provided', async () => {\n    const pluginInstance = plugin(\n      {root: path.join(__dirname, 'fixtures', 'from')},\n      {\n        config: path.join(__dirname, 'fixtures', 'from', 'postcss.config.js'),\n      },\n    );\n\n    const cssPath = path.join(__dirname, 'fixtures', 'from', 'style.css');\n    const cssContent = fs.readFileSync(cssPath, 'utf8');\n    let transformCSSResults = await pluginInstance.transform({\n      id: cssPath,\n      fileExt: path.extname(cssPath),\n      contents: cssContent,\n    });\n\n    const fromCssPath = path.join(__dirname, 'fixtures', 'from', 'from.css');\n    const fromCssContent = fs.readFileSync(fromCssPath, 'utf8');\n    transformCSSResults = await pluginInstance.transform({\n      id: fromCssPath,\n      fileExt: path.extname(fromCssPath),\n      contents: fromCssContent,\n    });\n    expect(transformCSSResults.code).toEqual(expect.stringContaining('from.css'));\n\n    await pluginInstance.cleanup();\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-postcss/worker.js",
    "content": "'use strict';\n\nconst workerpool = require('workerpool');\nconst postcss = require('postcss');\nconst postcssrc = require('postcss-load-config');\nconst loadPlugins = require('postcss-load-config/src/plugins.js');\nconst loadOptions = require('postcss-load-config/src/options.js');\n\nconst processMap = new Map();\n\nasync function transformAsync(css, {filepath, config, cwd, map}) {\n  let process = null;\n  const key = config + '-' + cwd;\n\n  // Initialize processor. `config`, `cwd` won't change until Snowpack is restarted\n  if (!processMap.has(key)) {\n    let plugins = [];\n    let options = {};\n    if (typeof config === 'object') {\n      plugins = loadPlugins(config);\n      options = loadOptions(config);\n    } else {\n      const rc = await postcssrc({}, config || cwd);\n      plugins = rc.plugins;\n      options = rc.options;\n    }\n    const processor = postcss(plugins);\n    process = (css, filepath, map) => processor.process(css, {...options, from: filepath, map});\n    processMap.set(key, process);\n  }\n  process = processMap.get(key);\n\n  const result = await process(css, filepath, map);\n  return JSON.stringify({css: result.css, map: result.map, messages: result.messages});\n}\n\n// create a worker and register public functions\nworkerpool.worker({\n  transformAsync,\n});\n"
  },
  {
    "path": "plugins/plugin-react-refresh/CHANGELOG.md",
    "content": "# @snowpack/plugin-react-refresh\n\n## 2.5.0\n\n### Minor Changes\n\n- 1b33af55: plugin-react-refresh: add custom babel config option (#2943) <Maximilian Fellner>\n\n## 2.4.2\n\n### Patch Changes\n\n- 857d73cb: [ci] yarn format\n- ceb516d0: [plugin-react-refresh] Solve the problem with MobX observer() HOC (#3058) <yuhongda>\n- 56c5a231: fix typo in changelog\n- a82cb6b1: Revert \"[plugin-react-refresh] Solve the problem with MobX observer() HOC (#3015)\"\n- b07d815b: [ci] yarn format\n- 6e4bb7fe: [plugin-react-refresh] Solve the problem with MobX observer() HOC (#3015) <yuhongda>\n\n## 2.4.1\n\n### Patch Changes\n\n- bea1c56c: Simplify. cleanup, enhance snowpack internals (#2707)\n- ca16821f: Parse multiline <body> tags (#2406) <Nahuel Greco>\n- 353da2cb: [ci] yarn format\n- f6b30dea: Disable react-refresh during ssr. (#2376) <Chris Thomas>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-react-refresh)._\n"
  },
  {
    "path": "plugins/plugin-react-refresh/README.md",
    "content": "# @snowpack/plugin-react-refresh\n\nTransforms JavaScript files containing React components automatically to enable React Fast Refresh via Snowpack's HMR API.\n\n```\nnpm install --save-dev @snowpack/plugin-react-refresh\n```\n\n## Setup\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    '@snowpack/plugin-react-refresh',\n    {\n      /* options: see below */\n    },\n  ],\n};\n```\n\n## Plugin Options\n\n| Name    |         Type          | Description                                                                                                                                                                                                                                                                             |\n| :------ | :-------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `babel` | `boolean` or `object` | By default, this plugin uses Babel to add Fast-Refresh code to eligible JS files. If you want to configure & run this yourself, set `\"babel\": false\"`. Alternatively, you can pass a custom Babel configuration object to enhance or override the defaults. Most users won't need this. |\n\n## How it Works\n\nThis plugin will automatically inject HMR event handlers into any file containing a React component.\n\nIn most applications, you'll still want some top-level `import.meta.hot` handling code in your application for any non-React file updates. In our Create Snowpack App templates, this would be the HMR handling snippet found in `src/index.js`.\n"
  },
  {
    "path": "plugins/plugin-react-refresh/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-react-refresh\",\n  \"version\": \"2.5.0\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-react-refresh#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-react-refresh\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.14.0\",\n    \"@babel/plugin-syntax-class-properties\": \"^7.10.0\",\n    \"react-refresh\": \"^0.9.0\"\n  },\n  \"peerDependencies\": {\n    \"react\": \">=16.9.0\",\n    \"react-dom\": \">=16.9.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "plugins/plugin-react-refresh/plugin.js",
    "content": "/**\n * @snowpack/plugin-react-refresh (Fast Refresh)\n * Based on details provided by:\n * - https://github.com/facebook/react/issues/16604#issuecomment-528663101\n * - https://github.com/vitejs/vite-plugin-react (see LICENSE)\n */\n\nconst fs = require('fs');\n\nconst reactRefreshLoc = require.resolve('react-refresh/cjs/react-refresh-runtime.development.js');\nconst reactRefreshCode = fs\n  .readFileSync(reactRefreshLoc, {encoding: 'utf-8'})\n  .replace(`process.env.NODE_ENV`, JSON.stringify('development'));\n\nfunction transformHtml(contents) {\n  return contents.replace(/(<body.*?>)/s, function (match, p1) {\n    return `${p1}\n<script>\n  function debounce(e,t){let u;return()=>{clearTimeout(u),u=setTimeout(e,t)}}\n  {\n    const exports = {};\n    ${reactRefreshCode}\n    exports.performReactRefresh = debounce(exports.performReactRefresh, 30);\n    window.$RefreshRuntime$ = exports;\n    window.$RefreshRuntime$.injectIntoGlobalHook(window);\n    window.$RefreshReg$ = () => {};\n    window.$RefreshSig$ = () => (type) => type;\n  }\n</script>`;\n  });\n}\n\nconst babel = require('@babel/core');\nconst IS_FAST_REFRESH_ENABLED = /\\$RefreshReg\\$\\(/;\nasync function transformJs(contents, id, cwd, babelConfig) {\n  let fastRefreshEnhancedCode;\n\n  if (babelConfig === false) {\n    fastRefreshEnhancedCode = contents;\n  } else if (IS_FAST_REFRESH_ENABLED.test(contents)) {\n    // Warn in case someone has a bad setup, and to help older users upgrade.\n    console.warn(\n      `[@snowpack/plugin-react-refresh] ${id}\\n\"react-refresh/babel\" plugin no longer needed in your babel config, safe to remove.`,\n    );\n    fastRefreshEnhancedCode = contents;\n  } else {\n    const {plugins = [], ...restConfig} = babelConfig instanceof Object ? babelConfig : {};\n    const {code} = await babel.transformAsync(contents, {\n      cwd,\n      filename: id,\n      ast: false,\n      compact: false,\n      sourceMaps: false,\n      configFile: false,\n      babelrc: false,\n      plugins: [\n        [require('react-refresh/babel'), {skipEnvCheck: true}],\n        require('@babel/plugin-syntax-class-properties'),\n        ...plugins,\n      ],\n      ...restConfig,\n    });\n    fastRefreshEnhancedCode = code;\n  }\n\n  // If fast refresh markup wasn't added, just return the original content.\n  if (!fastRefreshEnhancedCode || !IS_FAST_REFRESH_ENABLED.test(fastRefreshEnhancedCode)) {\n    return contents;\n  }\n\n  return `\n/** React Refresh: Setup **/\nif (import.meta.hot) {\n  if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {\n    console.warn('@snowpack/plugin-react-refresh: HTML setup script not run. React Fast Refresh only works when Snowpack serves your HTML routes. You may want to remove this plugin.');\n  } else {\n    var prevRefreshReg = window.$RefreshReg$;\n    var prevRefreshSig = window.$RefreshSig$;\n    window.$RefreshReg$ = (type, id) => {\n      window.$RefreshRuntime$.register(type, ${JSON.stringify(id)} + \" \" + id);\n    }\n    window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;\n  }\n}\n\n${fastRefreshEnhancedCode}\n\n/** React Refresh: Connect **/\nif (import.meta.hot) {\n  window.$RefreshReg$ = prevRefreshReg\n  window.$RefreshSig$ = prevRefreshSig\n  import.meta.hot.accept(() => {\n    window.$RefreshRuntime$.performReactRefresh()\n  });\n}`;\n}\n\nmodule.exports = function reactRefreshTransform(snowpackConfig, {babel}) {\n  return {\n    name: '@snowpack/plugin-react-refresh',\n    transform({contents, fileExt, id, isDev, isHmrEnabled, isSSR}) {\n      // Use long-form \"=== false\" to handle older Snowpack versions\n      if (isHmrEnabled === false) {\n        return;\n      }\n      if (!isDev) {\n        return;\n      }\n\n      // While server-side rendering, the fast-refresh code is not needed.\n      if (fileExt === '.js' && !isSSR) {\n        return transformJs(contents, id, snowpackConfig.root || process.cwd(), babel);\n      }\n      if (fileExt === '.html') {\n        return transformHtml(contents);\n      }\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-react-refresh/test/__snapshots__/plugin.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`@snowpack/plugin-react-refresh don't transform when disabled: html 1`] = `undefined`;\n\nexports[`@snowpack/plugin-react-refresh don't transform when disabled: js 1`] = `undefined`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html when babel is disabled: html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n  </head>\n  <body>\n<script>\n  function debounce(e,t){let u;return()=>{clearTimeout(u),u=setTimeout(e,t)}}\n  {\n    const exports = {};\n    /** @license React v0.9.0\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (\\\\\"development\\\\\" !== \\\\\"production\\\\\") {\n  (function() {\n'use strict';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nvar REACT_FRAGMENT_TYPE = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n  var symbolFor = Symbol.for;\n  REACT_ELEMENT_TYPE = symbolFor('react.element');\n  REACT_PORTAL_TYPE = symbolFor('react.portal');\n  REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n  REACT_PROFILER_TYPE = symbolFor('react.profiler');\n  REACT_PROVIDER_TYPE = symbolFor('react.provider');\n  REACT_CONTEXT_TYPE = symbolFor('react.context');\n  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n  REACT_MEMO_TYPE = symbolFor('react.memo');\n  REACT_LAZY_TYPE = symbolFor('react.lazy');\n  REACT_BLOCK_TYPE = symbolFor('react.block');\n  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n  REACT_SCOPE_TYPE = symbolFor('react.scope');\n  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n  if (signature.fullKey !== null) {\n    return signature.fullKey;\n  }\n\n  var fullKey = signature.ownKey;\n  var hooks;\n\n  try {\n    hooks = signature.getCustomHooks();\n  } catch (err) {\n    // This can happen in an edge case, e.g. if expression like Foo.useSomething\n    // depends on Foo which is lazily initialized during rendering.\n    // In that case just assume we'll have to remount.\n    signature.forceReset = true;\n    signature.fullKey = fullKey;\n    return fullKey;\n  }\n\n  for (var i = 0; i < hooks.length; i++) {\n    var hook = hooks[i];\n\n    if (typeof hook !== 'function') {\n      // Something's wrong. Assume we need to remount.\n      signature.forceReset = true;\n      signature.fullKey = fullKey;\n      return fullKey;\n    }\n\n    var nestedHookSignature = allSignaturesByType.get(hook);\n\n    if (nestedHookSignature === undefined) {\n      // No signature means Hook wasn't in the source code, e.g. in a library.\n      // We'll skip it because we can assume it won't change during this session.\n      continue;\n    }\n\n    var nestedHookKey = computeFullKey(nestedHookSignature);\n\n    if (nestedHookSignature.forceReset) {\n      signature.forceReset = true;\n    }\n\n    fullKey += '\\\\\\\\n---\\\\\\\\n' + nestedHookKey;\n  }\n\n  signature.fullKey = fullKey;\n  return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n  var prevSignature = allSignaturesByType.get(prevType);\n  var nextSignature = allSignaturesByType.get(nextType);\n\n  if (prevSignature === undefined && nextSignature === undefined) {\n    return true;\n  }\n\n  if (prevSignature === undefined || nextSignature === undefined) {\n    return false;\n  }\n\n  if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n    return false;\n  }\n\n  if (nextSignature.forceReset) {\n    return false;\n  }\n\n  return true;\n}\n\nfunction isReactClass(type) {\n  return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n  if (isReactClass(prevType) || isReactClass(nextType)) {\n    return false;\n  }\n\n  if (haveEqualSignatures(prevType, nextType)) {\n    return true;\n  }\n\n  return false;\n}\n\nfunction resolveFamily(type) {\n  // Only check updated types to keep lookups fast.\n  return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n  var clone = new Map();\n  map.forEach(function (value, key) {\n    clone.set(key, value);\n  });\n  return clone;\n}\n\nfunction cloneSet(set) {\n  var clone = new Set();\n  set.forEach(function (value) {\n    clone.add(value);\n  });\n  return clone;\n}\n\nfunction performReactRefresh() {\n\n  if (pendingUpdates.length === 0) {\n    return null;\n  }\n\n  if (isPerformingRefresh) {\n    return null;\n  }\n\n  isPerformingRefresh = true;\n\n  try {\n    var staleFamilies = new Set();\n    var updatedFamilies = new Set();\n    var updates = pendingUpdates;\n    pendingUpdates = [];\n    updates.forEach(function (_ref) {\n      var family = _ref[0],\n          nextType = _ref[1];\n      // Now that we got a real edit, we can create associations\n      // that will be read by the React reconciler.\n      var prevType = family.current;\n      updatedFamiliesByType.set(prevType, family);\n      updatedFamiliesByType.set(nextType, family);\n      family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n      if (canPreserveStateBetween(prevType, nextType)) {\n        updatedFamilies.add(family);\n      } else {\n        staleFamilies.add(family);\n      }\n    }); // TODO: rename these fields to something more meaningful.\n\n    var update = {\n      updatedFamilies: updatedFamilies,\n      // Families that will re-render preserving state\n      staleFamilies: staleFamilies // Families that will be remounted\n\n    };\n    helpersByRendererID.forEach(function (helpers) {\n      // Even if there are no roots, set the handler on first update.\n      // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n      helpers.setRefreshHandler(resolveFamily);\n    });\n    var didError = false;\n    var firstError = null; // We snapshot maps and sets that are mutated during commits.\n    // If we don't do this, there is a risk they will be mutated while\n    // we iterate over them. For example, trying to recover a failed root\n    // may cause another root to be added to the failed list -- an infinite loop.\n\n    var failedRootsSnapshot = cloneSet(failedRoots);\n    var mountedRootsSnapshot = cloneSet(mountedRoots);\n    var helpersByRootSnapshot = cloneMap(helpersByRoot);\n    failedRootsSnapshot.forEach(function (root) {\n      var helpers = helpersByRootSnapshot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      if (!failedRoots.has(root)) {// No longer failed.\n      }\n\n      if (rootElements === null) {\n        return;\n      }\n\n      if (!rootElements.has(root)) {\n        return;\n      }\n\n      var element = rootElements.get(root);\n\n      try {\n        helpers.scheduleRoot(root, element);\n      } catch (err) {\n        if (!didError) {\n          didError = true;\n          firstError = err;\n        } // Keep trying other roots.\n\n      }\n    });\n    mountedRootsSnapshot.forEach(function (root) {\n      var helpers = helpersByRootSnapshot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      if (!mountedRoots.has(root)) {// No longer mounted.\n      }\n\n      try {\n        helpers.scheduleRefresh(root, update);\n      } catch (err) {\n        if (!didError) {\n          didError = true;\n          firstError = err;\n        } // Keep trying other roots.\n\n      }\n    });\n\n    if (didError) {\n      throw firstError;\n    }\n\n    return update;\n  } finally {\n    isPerformingRefresh = false;\n  }\n}\nfunction register(type, id) {\n  {\n    if (type === null) {\n      return;\n    }\n\n    if (typeof type !== 'function' && typeof type !== 'object') {\n      return;\n    } // This can happen in an edge case, e.g. if we register\n    // return value of a HOC but it returns a cached component.\n    // Ignore anything but the first registration for each type.\n\n\n    if (allFamiliesByType.has(type)) {\n      return;\n    } // Create family or remember to update it.\n    // None of this bookkeeping affects reconciliation\n    // until the first performReactRefresh() call above.\n\n\n    var family = allFamiliesByID.get(id);\n\n    if (family === undefined) {\n      family = {\n        current: type\n      };\n      allFamiliesByID.set(id, family);\n    } else {\n      pendingUpdates.push([family, type]);\n    }\n\n    allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n    if (typeof type === 'object' && type !== null) {\n      switch (type.$$typeof) {\n        case REACT_FORWARD_REF_TYPE:\n          register(type.render, id + '$render');\n          break;\n\n        case REACT_MEMO_TYPE:\n          register(type.type, id + '$type');\n          break;\n      }\n    }\n  }\n}\nfunction setSignature(type, key) {\n  var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n  var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n  {\n    allSignaturesByType.set(type, {\n      forceReset: forceReset,\n      ownKey: key,\n      fullKey: null,\n      getCustomHooks: getCustomHooks || function () {\n        return [];\n      }\n    });\n  }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n  {\n    var signature = allSignaturesByType.get(type);\n\n    if (signature !== undefined) {\n      computeFullKey(signature);\n    }\n  }\n}\nfunction getFamilyByID(id) {\n  {\n    return allFamiliesByID.get(id);\n  }\n}\nfunction getFamilyByType(type) {\n  {\n    return allFamiliesByType.get(type);\n  }\n}\nfunction findAffectedHostInstances(families) {\n  {\n    var affectedInstances = new Set();\n    mountedRoots.forEach(function (root) {\n      var helpers = helpersByRoot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n      instancesForRoot.forEach(function (inst) {\n        affectedInstances.add(inst);\n      });\n    });\n    return affectedInstances;\n  }\n}\nfunction injectIntoGlobalHook(globalObject) {\n  {\n    // For React Native, the global hook will be set up by require('react-devtools-core').\n    // That code will run before us. So we need to monkeypatch functions on existing hook.\n    // For React Web, the global hook will be set up by the extension.\n    // This will also run before us.\n    var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n    if (hook === undefined) {\n      // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n      // Note that in this case it's important that renderer code runs *after* this method call.\n      // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n      var nextID = 0;\n      globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n        renderers: new Map(),\n        supportsFiber: true,\n        inject: function (injected) {\n          return nextID++;\n        },\n        onScheduleFiberRoot: function (id, root, children) {},\n        onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n        onCommitFiberUnmount: function () {}\n      };\n    } // Here, we just want to get a reference to scheduleRefresh.\n\n\n    var oldInject = hook.inject;\n\n    hook.inject = function (injected) {\n      var id = oldInject.apply(this, arguments);\n\n      if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n        // This version supports React Refresh.\n        helpersByRendererID.set(id, injected);\n      }\n\n      return id;\n    }; // Do the same for any already injected roots.\n    // This is useful if ReactDOM has already been initialized.\n    // https://github.com/facebook/react/issues/17626\n\n\n    hook.renderers.forEach(function (injected, id) {\n      if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n        // This version supports React Refresh.\n        helpersByRendererID.set(id, injected);\n      }\n    }); // We also want to track currently mounted roots.\n\n    var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n    var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n    hook.onScheduleFiberRoot = function (id, root, children) {\n      if (!isPerformingRefresh) {\n        // If it was intentionally scheduled, don't attempt to restore.\n        // This includes intentionally scheduled unmounts.\n        failedRoots.delete(root);\n\n        if (rootElements !== null) {\n          rootElements.set(root, children);\n        }\n      }\n\n      return oldOnScheduleFiberRoot.apply(this, arguments);\n    };\n\n    hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n      var helpers = helpersByRendererID.get(id);\n\n      if (helpers === undefined) {\n        return;\n      }\n\n      helpersByRoot.set(root, helpers);\n      var current = root.current;\n      var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n      // This logic is copy-pasted from similar logic in the DevTools backend.\n      // If this breaks with some refactoring, you'll want to update DevTools too.\n\n      if (alternate !== null) {\n        var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null;\n        var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n        if (!wasMounted && isMounted) {\n          // Mount a new root.\n          mountedRoots.add(root);\n          failedRoots.delete(root);\n        } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n          // Unmount an existing root.\n          mountedRoots.delete(root);\n\n          if (didError) {\n            // We'll remount it on future edits.\n            failedRoots.add(root);\n          } else {\n            helpersByRoot.delete(root);\n          }\n        } else if (!wasMounted && !isMounted) {\n          if (didError) {\n            // We'll remount it on future edits.\n            failedRoots.add(root);\n          }\n        }\n      } else {\n        // Mount a new root.\n        mountedRoots.add(root);\n      }\n\n      return oldOnCommitFiberRoot.apply(this, arguments);\n    };\n  }\n}\nfunction hasUnrecoverableErrors() {\n  // TODO: delete this after removing dependency in RN.\n  return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n  {\n    return mountedRoots.size;\n  }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n//   const [foo, setFoo] = useState(0);\n//   const value = useCustomHook();\n//   _s(); /* Second call triggers collecting the custom Hook list.\n//          * This doesn't happen during the module evaluation because we\n//          * don't want to change the module order with inline requires.\n//          * Next calls are noops. */\n//   return <h1>Hi</h1>;\n// }\n//\n// /* First call specifies the signature: */\n// _s(\n//   Hello,\n//   'useState{[foo, setFoo]}(0)',\n//   () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n  {\n    // We'll fill in the signature in two steps.\n    // First, we'll know the signature itself. This happens outside the component.\n    // Then, we'll know the references to custom Hooks. This happens inside the component.\n    // After that, the returned function will be a fast path no-op.\n    var status = 'needsSignature';\n    var savedType;\n    var hasCustomHooks;\n    return function (type, key, forceReset, getCustomHooks) {\n      switch (status) {\n        case 'needsSignature':\n          if (type !== undefined) {\n            // If we received an argument, this is the initial registration call.\n            savedType = type;\n            hasCustomHooks = typeof getCustomHooks === 'function';\n            setSignature(type, key, forceReset, getCustomHooks); // The next call we expect is from inside a function, to fill in the custom Hooks.\n\n            status = 'needsCustomHooks';\n          }\n\n          break;\n\n        case 'needsCustomHooks':\n          if (hasCustomHooks) {\n            collectCustomHooksForSignature(savedType);\n          }\n\n          status = 'resolved';\n          break;\n      }\n\n      return type;\n    };\n  }\n}\nfunction isLikelyComponentType(type) {\n  {\n    switch (typeof type) {\n      case 'function':\n        {\n          // First, deal with classes.\n          if (type.prototype != null) {\n            if (type.prototype.isReactComponent) {\n              // React class.\n              return true;\n            }\n\n            var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n            if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n              // This looks like a class.\n              return false;\n            } // eslint-disable-next-line no-proto\n\n\n            if (type.prototype.__proto__ !== Object.prototype) {\n              // It has a superclass.\n              return false;\n            } // Pass through.\n            // This looks like a regular function with empty prototype.\n\n          } // For plain functions and arrows, use name as a heuristic.\n\n\n          var name = type.name || type.displayName;\n          return typeof name === 'string' && /^[A-Z]/.test(name);\n        }\n\n      case 'object':\n        {\n          if (type != null) {\n            switch (type.$$typeof) {\n              case REACT_FORWARD_REF_TYPE:\n              case REACT_MEMO_TYPE:\n                // Definitely React components.\n                return true;\n\n              default:\n                return false;\n            }\n          }\n\n          return false;\n        }\n\n      default:\n        {\n          return false;\n        }\n    }\n  }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n  })();\n}\n\n    exports.performReactRefresh = debounce(exports.performReactRefresh, 30);\n    window.$RefreshRuntime$ = exports;\n    window.$RefreshRuntime$.injectIntoGlobalHook(window);\n    window.$RefreshReg$ = () => {};\n    window.$RefreshSig$ = () => (type) => type;\n  }\n</script>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n  </body>\n</html>\"\n`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html when babel is disabled: js 1`] = `\n\"import React from 'react';\nfunction App() {\n  return /* @__PURE__ */ React.createElement('div', null, 'React App');\n}\nexport default App;\n\"\n`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html when hmr is disabled: html 1`] = `undefined`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html when hmr is disabled: js 1`] = `undefined`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html when running in SSR: html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n  </head>\n  <body>\n<script>\n  function debounce(e,t){let u;return()=>{clearTimeout(u),u=setTimeout(e,t)}}\n  {\n    const exports = {};\n    /** @license React v0.9.0\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (\\\\\"development\\\\\" !== \\\\\"production\\\\\") {\n  (function() {\n'use strict';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nvar REACT_FRAGMENT_TYPE = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n  var symbolFor = Symbol.for;\n  REACT_ELEMENT_TYPE = symbolFor('react.element');\n  REACT_PORTAL_TYPE = symbolFor('react.portal');\n  REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n  REACT_PROFILER_TYPE = symbolFor('react.profiler');\n  REACT_PROVIDER_TYPE = symbolFor('react.provider');\n  REACT_CONTEXT_TYPE = symbolFor('react.context');\n  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n  REACT_MEMO_TYPE = symbolFor('react.memo');\n  REACT_LAZY_TYPE = symbolFor('react.lazy');\n  REACT_BLOCK_TYPE = symbolFor('react.block');\n  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n  REACT_SCOPE_TYPE = symbolFor('react.scope');\n  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n  if (signature.fullKey !== null) {\n    return signature.fullKey;\n  }\n\n  var fullKey = signature.ownKey;\n  var hooks;\n\n  try {\n    hooks = signature.getCustomHooks();\n  } catch (err) {\n    // This can happen in an edge case, e.g. if expression like Foo.useSomething\n    // depends on Foo which is lazily initialized during rendering.\n    // In that case just assume we'll have to remount.\n    signature.forceReset = true;\n    signature.fullKey = fullKey;\n    return fullKey;\n  }\n\n  for (var i = 0; i < hooks.length; i++) {\n    var hook = hooks[i];\n\n    if (typeof hook !== 'function') {\n      // Something's wrong. Assume we need to remount.\n      signature.forceReset = true;\n      signature.fullKey = fullKey;\n      return fullKey;\n    }\n\n    var nestedHookSignature = allSignaturesByType.get(hook);\n\n    if (nestedHookSignature === undefined) {\n      // No signature means Hook wasn't in the source code, e.g. in a library.\n      // We'll skip it because we can assume it won't change during this session.\n      continue;\n    }\n\n    var nestedHookKey = computeFullKey(nestedHookSignature);\n\n    if (nestedHookSignature.forceReset) {\n      signature.forceReset = true;\n    }\n\n    fullKey += '\\\\\\\\n---\\\\\\\\n' + nestedHookKey;\n  }\n\n  signature.fullKey = fullKey;\n  return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n  var prevSignature = allSignaturesByType.get(prevType);\n  var nextSignature = allSignaturesByType.get(nextType);\n\n  if (prevSignature === undefined && nextSignature === undefined) {\n    return true;\n  }\n\n  if (prevSignature === undefined || nextSignature === undefined) {\n    return false;\n  }\n\n  if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n    return false;\n  }\n\n  if (nextSignature.forceReset) {\n    return false;\n  }\n\n  return true;\n}\n\nfunction isReactClass(type) {\n  return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n  if (isReactClass(prevType) || isReactClass(nextType)) {\n    return false;\n  }\n\n  if (haveEqualSignatures(prevType, nextType)) {\n    return true;\n  }\n\n  return false;\n}\n\nfunction resolveFamily(type) {\n  // Only check updated types to keep lookups fast.\n  return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n  var clone = new Map();\n  map.forEach(function (value, key) {\n    clone.set(key, value);\n  });\n  return clone;\n}\n\nfunction cloneSet(set) {\n  var clone = new Set();\n  set.forEach(function (value) {\n    clone.add(value);\n  });\n  return clone;\n}\n\nfunction performReactRefresh() {\n\n  if (pendingUpdates.length === 0) {\n    return null;\n  }\n\n  if (isPerformingRefresh) {\n    return null;\n  }\n\n  isPerformingRefresh = true;\n\n  try {\n    var staleFamilies = new Set();\n    var updatedFamilies = new Set();\n    var updates = pendingUpdates;\n    pendingUpdates = [];\n    updates.forEach(function (_ref) {\n      var family = _ref[0],\n          nextType = _ref[1];\n      // Now that we got a real edit, we can create associations\n      // that will be read by the React reconciler.\n      var prevType = family.current;\n      updatedFamiliesByType.set(prevType, family);\n      updatedFamiliesByType.set(nextType, family);\n      family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n      if (canPreserveStateBetween(prevType, nextType)) {\n        updatedFamilies.add(family);\n      } else {\n        staleFamilies.add(family);\n      }\n    }); // TODO: rename these fields to something more meaningful.\n\n    var update = {\n      updatedFamilies: updatedFamilies,\n      // Families that will re-render preserving state\n      staleFamilies: staleFamilies // Families that will be remounted\n\n    };\n    helpersByRendererID.forEach(function (helpers) {\n      // Even if there are no roots, set the handler on first update.\n      // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n      helpers.setRefreshHandler(resolveFamily);\n    });\n    var didError = false;\n    var firstError = null; // We snapshot maps and sets that are mutated during commits.\n    // If we don't do this, there is a risk they will be mutated while\n    // we iterate over them. For example, trying to recover a failed root\n    // may cause another root to be added to the failed list -- an infinite loop.\n\n    var failedRootsSnapshot = cloneSet(failedRoots);\n    var mountedRootsSnapshot = cloneSet(mountedRoots);\n    var helpersByRootSnapshot = cloneMap(helpersByRoot);\n    failedRootsSnapshot.forEach(function (root) {\n      var helpers = helpersByRootSnapshot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      if (!failedRoots.has(root)) {// No longer failed.\n      }\n\n      if (rootElements === null) {\n        return;\n      }\n\n      if (!rootElements.has(root)) {\n        return;\n      }\n\n      var element = rootElements.get(root);\n\n      try {\n        helpers.scheduleRoot(root, element);\n      } catch (err) {\n        if (!didError) {\n          didError = true;\n          firstError = err;\n        } // Keep trying other roots.\n\n      }\n    });\n    mountedRootsSnapshot.forEach(function (root) {\n      var helpers = helpersByRootSnapshot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      if (!mountedRoots.has(root)) {// No longer mounted.\n      }\n\n      try {\n        helpers.scheduleRefresh(root, update);\n      } catch (err) {\n        if (!didError) {\n          didError = true;\n          firstError = err;\n        } // Keep trying other roots.\n\n      }\n    });\n\n    if (didError) {\n      throw firstError;\n    }\n\n    return update;\n  } finally {\n    isPerformingRefresh = false;\n  }\n}\nfunction register(type, id) {\n  {\n    if (type === null) {\n      return;\n    }\n\n    if (typeof type !== 'function' && typeof type !== 'object') {\n      return;\n    } // This can happen in an edge case, e.g. if we register\n    // return value of a HOC but it returns a cached component.\n    // Ignore anything but the first registration for each type.\n\n\n    if (allFamiliesByType.has(type)) {\n      return;\n    } // Create family or remember to update it.\n    // None of this bookkeeping affects reconciliation\n    // until the first performReactRefresh() call above.\n\n\n    var family = allFamiliesByID.get(id);\n\n    if (family === undefined) {\n      family = {\n        current: type\n      };\n      allFamiliesByID.set(id, family);\n    } else {\n      pendingUpdates.push([family, type]);\n    }\n\n    allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n    if (typeof type === 'object' && type !== null) {\n      switch (type.$$typeof) {\n        case REACT_FORWARD_REF_TYPE:\n          register(type.render, id + '$render');\n          break;\n\n        case REACT_MEMO_TYPE:\n          register(type.type, id + '$type');\n          break;\n      }\n    }\n  }\n}\nfunction setSignature(type, key) {\n  var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n  var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n  {\n    allSignaturesByType.set(type, {\n      forceReset: forceReset,\n      ownKey: key,\n      fullKey: null,\n      getCustomHooks: getCustomHooks || function () {\n        return [];\n      }\n    });\n  }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n  {\n    var signature = allSignaturesByType.get(type);\n\n    if (signature !== undefined) {\n      computeFullKey(signature);\n    }\n  }\n}\nfunction getFamilyByID(id) {\n  {\n    return allFamiliesByID.get(id);\n  }\n}\nfunction getFamilyByType(type) {\n  {\n    return allFamiliesByType.get(type);\n  }\n}\nfunction findAffectedHostInstances(families) {\n  {\n    var affectedInstances = new Set();\n    mountedRoots.forEach(function (root) {\n      var helpers = helpersByRoot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n      instancesForRoot.forEach(function (inst) {\n        affectedInstances.add(inst);\n      });\n    });\n    return affectedInstances;\n  }\n}\nfunction injectIntoGlobalHook(globalObject) {\n  {\n    // For React Native, the global hook will be set up by require('react-devtools-core').\n    // That code will run before us. So we need to monkeypatch functions on existing hook.\n    // For React Web, the global hook will be set up by the extension.\n    // This will also run before us.\n    var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n    if (hook === undefined) {\n      // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n      // Note that in this case it's important that renderer code runs *after* this method call.\n      // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n      var nextID = 0;\n      globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n        renderers: new Map(),\n        supportsFiber: true,\n        inject: function (injected) {\n          return nextID++;\n        },\n        onScheduleFiberRoot: function (id, root, children) {},\n        onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n        onCommitFiberUnmount: function () {}\n      };\n    } // Here, we just want to get a reference to scheduleRefresh.\n\n\n    var oldInject = hook.inject;\n\n    hook.inject = function (injected) {\n      var id = oldInject.apply(this, arguments);\n\n      if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n        // This version supports React Refresh.\n        helpersByRendererID.set(id, injected);\n      }\n\n      return id;\n    }; // Do the same for any already injected roots.\n    // This is useful if ReactDOM has already been initialized.\n    // https://github.com/facebook/react/issues/17626\n\n\n    hook.renderers.forEach(function (injected, id) {\n      if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n        // This version supports React Refresh.\n        helpersByRendererID.set(id, injected);\n      }\n    }); // We also want to track currently mounted roots.\n\n    var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n    var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n    hook.onScheduleFiberRoot = function (id, root, children) {\n      if (!isPerformingRefresh) {\n        // If it was intentionally scheduled, don't attempt to restore.\n        // This includes intentionally scheduled unmounts.\n        failedRoots.delete(root);\n\n        if (rootElements !== null) {\n          rootElements.set(root, children);\n        }\n      }\n\n      return oldOnScheduleFiberRoot.apply(this, arguments);\n    };\n\n    hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n      var helpers = helpersByRendererID.get(id);\n\n      if (helpers === undefined) {\n        return;\n      }\n\n      helpersByRoot.set(root, helpers);\n      var current = root.current;\n      var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n      // This logic is copy-pasted from similar logic in the DevTools backend.\n      // If this breaks with some refactoring, you'll want to update DevTools too.\n\n      if (alternate !== null) {\n        var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null;\n        var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n        if (!wasMounted && isMounted) {\n          // Mount a new root.\n          mountedRoots.add(root);\n          failedRoots.delete(root);\n        } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n          // Unmount an existing root.\n          mountedRoots.delete(root);\n\n          if (didError) {\n            // We'll remount it on future edits.\n            failedRoots.add(root);\n          } else {\n            helpersByRoot.delete(root);\n          }\n        } else if (!wasMounted && !isMounted) {\n          if (didError) {\n            // We'll remount it on future edits.\n            failedRoots.add(root);\n          }\n        }\n      } else {\n        // Mount a new root.\n        mountedRoots.add(root);\n      }\n\n      return oldOnCommitFiberRoot.apply(this, arguments);\n    };\n  }\n}\nfunction hasUnrecoverableErrors() {\n  // TODO: delete this after removing dependency in RN.\n  return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n  {\n    return mountedRoots.size;\n  }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n//   const [foo, setFoo] = useState(0);\n//   const value = useCustomHook();\n//   _s(); /* Second call triggers collecting the custom Hook list.\n//          * This doesn't happen during the module evaluation because we\n//          * don't want to change the module order with inline requires.\n//          * Next calls are noops. */\n//   return <h1>Hi</h1>;\n// }\n//\n// /* First call specifies the signature: */\n// _s(\n//   Hello,\n//   'useState{[foo, setFoo]}(0)',\n//   () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n  {\n    // We'll fill in the signature in two steps.\n    // First, we'll know the signature itself. This happens outside the component.\n    // Then, we'll know the references to custom Hooks. This happens inside the component.\n    // After that, the returned function will be a fast path no-op.\n    var status = 'needsSignature';\n    var savedType;\n    var hasCustomHooks;\n    return function (type, key, forceReset, getCustomHooks) {\n      switch (status) {\n        case 'needsSignature':\n          if (type !== undefined) {\n            // If we received an argument, this is the initial registration call.\n            savedType = type;\n            hasCustomHooks = typeof getCustomHooks === 'function';\n            setSignature(type, key, forceReset, getCustomHooks); // The next call we expect is from inside a function, to fill in the custom Hooks.\n\n            status = 'needsCustomHooks';\n          }\n\n          break;\n\n        case 'needsCustomHooks':\n          if (hasCustomHooks) {\n            collectCustomHooksForSignature(savedType);\n          }\n\n          status = 'resolved';\n          break;\n      }\n\n      return type;\n    };\n  }\n}\nfunction isLikelyComponentType(type) {\n  {\n    switch (typeof type) {\n      case 'function':\n        {\n          // First, deal with classes.\n          if (type.prototype != null) {\n            if (type.prototype.isReactComponent) {\n              // React class.\n              return true;\n            }\n\n            var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n            if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n              // This looks like a class.\n              return false;\n            } // eslint-disable-next-line no-proto\n\n\n            if (type.prototype.__proto__ !== Object.prototype) {\n              // It has a superclass.\n              return false;\n            } // Pass through.\n            // This looks like a regular function with empty prototype.\n\n          } // For plain functions and arrows, use name as a heuristic.\n\n\n          var name = type.name || type.displayName;\n          return typeof name === 'string' && /^[A-Z]/.test(name);\n        }\n\n      case 'object':\n        {\n          if (type != null) {\n            switch (type.$$typeof) {\n              case REACT_FORWARD_REF_TYPE:\n              case REACT_MEMO_TYPE:\n                // Definitely React components.\n                return true;\n\n              default:\n                return false;\n            }\n          }\n\n          return false;\n        }\n\n      default:\n        {\n          return false;\n        }\n    }\n  }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n  })();\n}\n\n    exports.performReactRefresh = debounce(exports.performReactRefresh, 30);\n    window.$RefreshRuntime$ = exports;\n    window.$RefreshRuntime$.injectIntoGlobalHook(window);\n    window.$RefreshReg$ = () => {};\n    window.$RefreshSig$ = () => (type) => type;\n  }\n</script>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n  </body>\n</html>\"\n`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html when running in SSR: js 1`] = `undefined`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html: html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n  </head>\n  <body>\n<script>\n  function debounce(e,t){let u;return()=>{clearTimeout(u),u=setTimeout(e,t)}}\n  {\n    const exports = {};\n    /** @license React v0.9.0\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (\\\\\"development\\\\\" !== \\\\\"production\\\\\") {\n  (function() {\n'use strict';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nvar REACT_FRAGMENT_TYPE = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n  var symbolFor = Symbol.for;\n  REACT_ELEMENT_TYPE = symbolFor('react.element');\n  REACT_PORTAL_TYPE = symbolFor('react.portal');\n  REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n  REACT_PROFILER_TYPE = symbolFor('react.profiler');\n  REACT_PROVIDER_TYPE = symbolFor('react.provider');\n  REACT_CONTEXT_TYPE = symbolFor('react.context');\n  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n  REACT_MEMO_TYPE = symbolFor('react.memo');\n  REACT_LAZY_TYPE = symbolFor('react.lazy');\n  REACT_BLOCK_TYPE = symbolFor('react.block');\n  REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n  REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n  REACT_SCOPE_TYPE = symbolFor('react.scope');\n  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n  if (signature.fullKey !== null) {\n    return signature.fullKey;\n  }\n\n  var fullKey = signature.ownKey;\n  var hooks;\n\n  try {\n    hooks = signature.getCustomHooks();\n  } catch (err) {\n    // This can happen in an edge case, e.g. if expression like Foo.useSomething\n    // depends on Foo which is lazily initialized during rendering.\n    // In that case just assume we'll have to remount.\n    signature.forceReset = true;\n    signature.fullKey = fullKey;\n    return fullKey;\n  }\n\n  for (var i = 0; i < hooks.length; i++) {\n    var hook = hooks[i];\n\n    if (typeof hook !== 'function') {\n      // Something's wrong. Assume we need to remount.\n      signature.forceReset = true;\n      signature.fullKey = fullKey;\n      return fullKey;\n    }\n\n    var nestedHookSignature = allSignaturesByType.get(hook);\n\n    if (nestedHookSignature === undefined) {\n      // No signature means Hook wasn't in the source code, e.g. in a library.\n      // We'll skip it because we can assume it won't change during this session.\n      continue;\n    }\n\n    var nestedHookKey = computeFullKey(nestedHookSignature);\n\n    if (nestedHookSignature.forceReset) {\n      signature.forceReset = true;\n    }\n\n    fullKey += '\\\\\\\\n---\\\\\\\\n' + nestedHookKey;\n  }\n\n  signature.fullKey = fullKey;\n  return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n  var prevSignature = allSignaturesByType.get(prevType);\n  var nextSignature = allSignaturesByType.get(nextType);\n\n  if (prevSignature === undefined && nextSignature === undefined) {\n    return true;\n  }\n\n  if (prevSignature === undefined || nextSignature === undefined) {\n    return false;\n  }\n\n  if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n    return false;\n  }\n\n  if (nextSignature.forceReset) {\n    return false;\n  }\n\n  return true;\n}\n\nfunction isReactClass(type) {\n  return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n  if (isReactClass(prevType) || isReactClass(nextType)) {\n    return false;\n  }\n\n  if (haveEqualSignatures(prevType, nextType)) {\n    return true;\n  }\n\n  return false;\n}\n\nfunction resolveFamily(type) {\n  // Only check updated types to keep lookups fast.\n  return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n  var clone = new Map();\n  map.forEach(function (value, key) {\n    clone.set(key, value);\n  });\n  return clone;\n}\n\nfunction cloneSet(set) {\n  var clone = new Set();\n  set.forEach(function (value) {\n    clone.add(value);\n  });\n  return clone;\n}\n\nfunction performReactRefresh() {\n\n  if (pendingUpdates.length === 0) {\n    return null;\n  }\n\n  if (isPerformingRefresh) {\n    return null;\n  }\n\n  isPerformingRefresh = true;\n\n  try {\n    var staleFamilies = new Set();\n    var updatedFamilies = new Set();\n    var updates = pendingUpdates;\n    pendingUpdates = [];\n    updates.forEach(function (_ref) {\n      var family = _ref[0],\n          nextType = _ref[1];\n      // Now that we got a real edit, we can create associations\n      // that will be read by the React reconciler.\n      var prevType = family.current;\n      updatedFamiliesByType.set(prevType, family);\n      updatedFamiliesByType.set(nextType, family);\n      family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n      if (canPreserveStateBetween(prevType, nextType)) {\n        updatedFamilies.add(family);\n      } else {\n        staleFamilies.add(family);\n      }\n    }); // TODO: rename these fields to something more meaningful.\n\n    var update = {\n      updatedFamilies: updatedFamilies,\n      // Families that will re-render preserving state\n      staleFamilies: staleFamilies // Families that will be remounted\n\n    };\n    helpersByRendererID.forEach(function (helpers) {\n      // Even if there are no roots, set the handler on first update.\n      // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n      helpers.setRefreshHandler(resolveFamily);\n    });\n    var didError = false;\n    var firstError = null; // We snapshot maps and sets that are mutated during commits.\n    // If we don't do this, there is a risk they will be mutated while\n    // we iterate over them. For example, trying to recover a failed root\n    // may cause another root to be added to the failed list -- an infinite loop.\n\n    var failedRootsSnapshot = cloneSet(failedRoots);\n    var mountedRootsSnapshot = cloneSet(mountedRoots);\n    var helpersByRootSnapshot = cloneMap(helpersByRoot);\n    failedRootsSnapshot.forEach(function (root) {\n      var helpers = helpersByRootSnapshot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      if (!failedRoots.has(root)) {// No longer failed.\n      }\n\n      if (rootElements === null) {\n        return;\n      }\n\n      if (!rootElements.has(root)) {\n        return;\n      }\n\n      var element = rootElements.get(root);\n\n      try {\n        helpers.scheduleRoot(root, element);\n      } catch (err) {\n        if (!didError) {\n          didError = true;\n          firstError = err;\n        } // Keep trying other roots.\n\n      }\n    });\n    mountedRootsSnapshot.forEach(function (root) {\n      var helpers = helpersByRootSnapshot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      if (!mountedRoots.has(root)) {// No longer mounted.\n      }\n\n      try {\n        helpers.scheduleRefresh(root, update);\n      } catch (err) {\n        if (!didError) {\n          didError = true;\n          firstError = err;\n        } // Keep trying other roots.\n\n      }\n    });\n\n    if (didError) {\n      throw firstError;\n    }\n\n    return update;\n  } finally {\n    isPerformingRefresh = false;\n  }\n}\nfunction register(type, id) {\n  {\n    if (type === null) {\n      return;\n    }\n\n    if (typeof type !== 'function' && typeof type !== 'object') {\n      return;\n    } // This can happen in an edge case, e.g. if we register\n    // return value of a HOC but it returns a cached component.\n    // Ignore anything but the first registration for each type.\n\n\n    if (allFamiliesByType.has(type)) {\n      return;\n    } // Create family or remember to update it.\n    // None of this bookkeeping affects reconciliation\n    // until the first performReactRefresh() call above.\n\n\n    var family = allFamiliesByID.get(id);\n\n    if (family === undefined) {\n      family = {\n        current: type\n      };\n      allFamiliesByID.set(id, family);\n    } else {\n      pendingUpdates.push([family, type]);\n    }\n\n    allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n    if (typeof type === 'object' && type !== null) {\n      switch (type.$$typeof) {\n        case REACT_FORWARD_REF_TYPE:\n          register(type.render, id + '$render');\n          break;\n\n        case REACT_MEMO_TYPE:\n          register(type.type, id + '$type');\n          break;\n      }\n    }\n  }\n}\nfunction setSignature(type, key) {\n  var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n  var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n  {\n    allSignaturesByType.set(type, {\n      forceReset: forceReset,\n      ownKey: key,\n      fullKey: null,\n      getCustomHooks: getCustomHooks || function () {\n        return [];\n      }\n    });\n  }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n  {\n    var signature = allSignaturesByType.get(type);\n\n    if (signature !== undefined) {\n      computeFullKey(signature);\n    }\n  }\n}\nfunction getFamilyByID(id) {\n  {\n    return allFamiliesByID.get(id);\n  }\n}\nfunction getFamilyByType(type) {\n  {\n    return allFamiliesByType.get(type);\n  }\n}\nfunction findAffectedHostInstances(families) {\n  {\n    var affectedInstances = new Set();\n    mountedRoots.forEach(function (root) {\n      var helpers = helpersByRoot.get(root);\n\n      if (helpers === undefined) {\n        throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n      }\n\n      var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n      instancesForRoot.forEach(function (inst) {\n        affectedInstances.add(inst);\n      });\n    });\n    return affectedInstances;\n  }\n}\nfunction injectIntoGlobalHook(globalObject) {\n  {\n    // For React Native, the global hook will be set up by require('react-devtools-core').\n    // That code will run before us. So we need to monkeypatch functions on existing hook.\n    // For React Web, the global hook will be set up by the extension.\n    // This will also run before us.\n    var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n    if (hook === undefined) {\n      // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n      // Note that in this case it's important that renderer code runs *after* this method call.\n      // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n      var nextID = 0;\n      globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n        renderers: new Map(),\n        supportsFiber: true,\n        inject: function (injected) {\n          return nextID++;\n        },\n        onScheduleFiberRoot: function (id, root, children) {},\n        onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n        onCommitFiberUnmount: function () {}\n      };\n    } // Here, we just want to get a reference to scheduleRefresh.\n\n\n    var oldInject = hook.inject;\n\n    hook.inject = function (injected) {\n      var id = oldInject.apply(this, arguments);\n\n      if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n        // This version supports React Refresh.\n        helpersByRendererID.set(id, injected);\n      }\n\n      return id;\n    }; // Do the same for any already injected roots.\n    // This is useful if ReactDOM has already been initialized.\n    // https://github.com/facebook/react/issues/17626\n\n\n    hook.renderers.forEach(function (injected, id) {\n      if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n        // This version supports React Refresh.\n        helpersByRendererID.set(id, injected);\n      }\n    }); // We also want to track currently mounted roots.\n\n    var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n    var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n    hook.onScheduleFiberRoot = function (id, root, children) {\n      if (!isPerformingRefresh) {\n        // If it was intentionally scheduled, don't attempt to restore.\n        // This includes intentionally scheduled unmounts.\n        failedRoots.delete(root);\n\n        if (rootElements !== null) {\n          rootElements.set(root, children);\n        }\n      }\n\n      return oldOnScheduleFiberRoot.apply(this, arguments);\n    };\n\n    hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n      var helpers = helpersByRendererID.get(id);\n\n      if (helpers === undefined) {\n        return;\n      }\n\n      helpersByRoot.set(root, helpers);\n      var current = root.current;\n      var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n      // This logic is copy-pasted from similar logic in the DevTools backend.\n      // If this breaks with some refactoring, you'll want to update DevTools too.\n\n      if (alternate !== null) {\n        var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null;\n        var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n        if (!wasMounted && isMounted) {\n          // Mount a new root.\n          mountedRoots.add(root);\n          failedRoots.delete(root);\n        } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n          // Unmount an existing root.\n          mountedRoots.delete(root);\n\n          if (didError) {\n            // We'll remount it on future edits.\n            failedRoots.add(root);\n          } else {\n            helpersByRoot.delete(root);\n          }\n        } else if (!wasMounted && !isMounted) {\n          if (didError) {\n            // We'll remount it on future edits.\n            failedRoots.add(root);\n          }\n        }\n      } else {\n        // Mount a new root.\n        mountedRoots.add(root);\n      }\n\n      return oldOnCommitFiberRoot.apply(this, arguments);\n    };\n  }\n}\nfunction hasUnrecoverableErrors() {\n  // TODO: delete this after removing dependency in RN.\n  return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n  {\n    return mountedRoots.size;\n  }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n//   const [foo, setFoo] = useState(0);\n//   const value = useCustomHook();\n//   _s(); /* Second call triggers collecting the custom Hook list.\n//          * This doesn't happen during the module evaluation because we\n//          * don't want to change the module order with inline requires.\n//          * Next calls are noops. */\n//   return <h1>Hi</h1>;\n// }\n//\n// /* First call specifies the signature: */\n// _s(\n//   Hello,\n//   'useState{[foo, setFoo]}(0)',\n//   () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n  {\n    // We'll fill in the signature in two steps.\n    // First, we'll know the signature itself. This happens outside the component.\n    // Then, we'll know the references to custom Hooks. This happens inside the component.\n    // After that, the returned function will be a fast path no-op.\n    var status = 'needsSignature';\n    var savedType;\n    var hasCustomHooks;\n    return function (type, key, forceReset, getCustomHooks) {\n      switch (status) {\n        case 'needsSignature':\n          if (type !== undefined) {\n            // If we received an argument, this is the initial registration call.\n            savedType = type;\n            hasCustomHooks = typeof getCustomHooks === 'function';\n            setSignature(type, key, forceReset, getCustomHooks); // The next call we expect is from inside a function, to fill in the custom Hooks.\n\n            status = 'needsCustomHooks';\n          }\n\n          break;\n\n        case 'needsCustomHooks':\n          if (hasCustomHooks) {\n            collectCustomHooksForSignature(savedType);\n          }\n\n          status = 'resolved';\n          break;\n      }\n\n      return type;\n    };\n  }\n}\nfunction isLikelyComponentType(type) {\n  {\n    switch (typeof type) {\n      case 'function':\n        {\n          // First, deal with classes.\n          if (type.prototype != null) {\n            if (type.prototype.isReactComponent) {\n              // React class.\n              return true;\n            }\n\n            var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n            if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n              // This looks like a class.\n              return false;\n            } // eslint-disable-next-line no-proto\n\n\n            if (type.prototype.__proto__ !== Object.prototype) {\n              // It has a superclass.\n              return false;\n            } // Pass through.\n            // This looks like a regular function with empty prototype.\n\n          } // For plain functions and arrows, use name as a heuristic.\n\n\n          var name = type.name || type.displayName;\n          return typeof name === 'string' && /^[A-Z]/.test(name);\n        }\n\n      case 'object':\n        {\n          if (type != null) {\n            switch (type.$$typeof) {\n              case REACT_FORWARD_REF_TYPE:\n              case REACT_MEMO_TYPE:\n                // Definitely React components.\n                return true;\n\n              default:\n                return false;\n            }\n          }\n\n          return false;\n        }\n\n      default:\n        {\n          return false;\n        }\n    }\n  }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n  })();\n}\n\n    exports.performReactRefresh = debounce(exports.performReactRefresh, 30);\n    window.$RefreshRuntime$ = exports;\n    window.$RefreshRuntime$.injectIntoGlobalHook(window);\n    window.$RefreshReg$ = () => {};\n    window.$RefreshSig$ = () => (type) => type;\n  }\n</script>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n  </body>\n</html>\"\n`;\n\nexports[`@snowpack/plugin-react-refresh transform js and html: js 1`] = `\n\"\n/** React Refresh: Setup **/\nif (import.meta.hot) {\n  if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {\n    console.warn('@snowpack/plugin-react-refresh: HTML setup script not run. React Fast Refresh only works when Snowpack serves your HTML routes. You may want to remove this plugin.');\n  } else {\n    var prevRefreshReg = window.$RefreshReg$;\n    var prevRefreshSig = window.$RefreshSig$;\n    window.$RefreshReg$ = (type, id) => {\n      window.$RefreshRuntime$.register(type, \\\\\"stub.js\\\\\" + \\\\\" \\\\\" + id);\n    }\n    window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;\n  }\n}\n\nimport React from 'react';\n\nfunction App() {\n  return /* @__PURE__ */React.createElement('div', null, 'React App');\n}\n\n_c = App;\nexport default App;\n\nvar _c;\n\n$RefreshReg$(_c, \\\\\"App\\\\\");\n\n/** React Refresh: Connect **/\nif (import.meta.hot) {\n  window.$RefreshReg$ = prevRefreshReg\n  window.$RefreshSig$ = prevRefreshSig\n  import.meta.hot.accept(() => {\n    window.$RefreshRuntime$.performReactRefresh()\n  });\n}\"\n`;\n"
  },
  {
    "path": "plugins/plugin-react-refresh/test/plugin.test.js",
    "content": "mockBabel();\nconst path = require('path');\nconst fs = require('fs');\nconst pluginReactRefresh = require('../plugin');\n\nconst htmlFilePath = path.resolve(__dirname, './stubs/stub.html');\nconst htmlFileContent = fs.readFileSync(htmlFilePath, {\n  encoding: 'utf-8',\n});\nconst htmlTransformOptions = {\n  contents: htmlFileContent,\n  fileExt: '.html',\n  id: 'stub.html',\n  isDev: true,\n  isHmrEnabled: true,\n  isSSR: false,\n};\nconst jsFilePath = path.resolve(__dirname, './stubs/stub.js');\nconst jsFileContent = fs.readFileSync(jsFilePath, {\n  encoding: 'utf-8',\n});\nconst jsTransformOptions = {\n  contents: jsFileContent,\n  fileExt: '.js',\n  id: 'stub.js',\n  isDev: true,\n  isHmrEnabled: true,\n  isSSR: false,\n};\n\nfunction mockBabel() {\n  jest.mock('@babel/core');\n  const babel = require('@babel/core');\n  babel.transformAsync = jest\n    .fn()\n    .mockName('babel.transformAsync')\n    .mockImplementation(async (contents, options, ...args) => {\n      options.plugins = (options.plugins || []).map((plugin) => {\n        if (Array.isArray(plugin)) {\n          if (plugin[1]) {\n            plugin[1].skipEnvCheck = true;\n          }\n          return plugin;\n        }\n        // Fix: React Refresh Babel transform should only be enabled in development environment.\n        // Instead, the environment is: \"test\".\n        // If you want to override this check, pass {skipEnvCheck: true} as plugin options.\n        return [plugin, {skipEnvCheck: true}];\n      });\n\n      // Stop `jest.requireActual('@babel/core').transformAsync()` from requiring mocked babel function\n      jest.unmock('@babel/core');\n      const ret = await jest\n        .requireActual('@babel/core')\n        .transformAsync(contents, options, ...args);\n      mockBabel();\n\n      return ret;\n    });\n}\n\nasync function testPluginInstance(pluginInstance, overrides = {}) {\n  const pluginTransform = pluginInstance.transform;\n  expect(await pluginTransform({...htmlTransformOptions, ...overrides})).toMatchSnapshot('html');\n  expect(await pluginTransform({...jsTransformOptions, ...overrides})).toMatchSnapshot('js');\n}\n\nafterEach(() => {\n  jest.restoreAllMocks();\n});\n\ndescribe('@snowpack/plugin-react-refresh', () => {\n  test('transform js and html', async () => {\n    const pluginInstance = pluginReactRefresh({}, {babel: true});\n    await testPluginInstance(pluginInstance);\n  });\n  test(\"don't transform when disabled\", async () => {\n    const pluginInstance = pluginReactRefresh({}, {babel: true});\n    await testPluginInstance(pluginInstance, {isDev: false});\n  });\n  test('transform js and html when hmr is disabled', async () => {\n    const pluginInstance = pluginReactRefresh({}, {babel: true});\n    await testPluginInstance(pluginInstance, {isHmrEnabled: false});\n  });\n\n  test('transform js and html when running in SSR', async () => {\n    const pluginInstance = pluginReactRefresh({}, {babel: true});\n    await testPluginInstance(pluginInstance, {isSSR: true});\n  });\n\n  test('transform js and html when babel is disabled', async () => {\n    const pluginInstance = pluginReactRefresh(\n      {\n        devOptions: {\n          hmr: true,\n        },\n      },\n      {babel: false},\n    );\n    await testPluginInstance(pluginInstance);\n  });\n\n  test('include custom babel config', async () => {\n    const babel = require('@babel/core');\n    const mockTransformAsync = jest.fn(() => Promise.resolve({code: ''}));\n    jest.spyOn(babel, 'transformAsync').mockImplementation(mockTransformAsync);\n\n    const babelConfig = {\n      compact: true,\n      plugins: ['@babel/plugin-syntax-top-level-await'],\n    };\n    const pluginInstance = pluginReactRefresh({}, {babel: babelConfig});\n    await pluginInstance.transform({...jsTransformOptions});\n\n    expect(mockTransformAsync).toHaveBeenCalledTimes(1);\n    expect(mockTransformAsync.mock.calls[0][1]).toHaveProperty('compact', true);\n    expect(mockTransformAsync.mock.calls[0][1].plugins).toContain(\n      '@babel/plugin-syntax-top-level-await',\n    );\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-react-refresh/test/stubs/stub.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/dist/index.js\"></script>\n  </body>\n</html>"
  },
  {
    "path": "plugins/plugin-react-refresh/test/stubs/stub.js",
    "content": "import React from 'react';\nfunction App() {\n  return /* @__PURE__ */ React.createElement('div', null, 'React App');\n}\nexport default App;\n"
  },
  {
    "path": "plugins/plugin-run-script/README.md",
    "content": "# @snowpack/plugin-run-script\n\nRun any CLI command as a part of Snowpack’s dev server and production build. Useful for languages not supported by [Snowpack plugins](https://www.snowpack.dev/plugins). This replaces the old `run:*` scripts in your Snowpack config.\n\nUsage:\n\n```bash\nnpm i @snowpack/plugin-run-script\n```\n\nThen add the plugin to your Snowpack config:\n\n```js\n// snowpack.config.mjs\n\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-run-script',\n      {\n        cmd: 'sass src/css:public/css --no-source-map', // production build command\n        watch: 'sass --watch src/css:public/css --no-source-map', // (optional) dev server command\n      },\n    ],\n  ],\n};\n```\n\nSupply any CLI command in `cmd`. Note that this is the same as running the command yourself in your project root folder (i.e. you can reference any global packages as well as npm script).\n\n## Plugin Options\n\n| Name     | Type                      | Description                                                                 |\n| :------- | :------------------------ | :-------------------------------------------------------------------------- |\n| `cmd`    | `string`                  | The CLI command to run. Note that this will run **before** Snowpack builds. |\n| `name`   | `string`                  | (optional) Set name of console output, default is program name.             |\n| `watch`  | `string`                  | (optional) A watch command to run during the dev server.                    |\n| `output` | `\"stream\" or \"dashboard\"` | (optional) Set how the output should be recorded during dev.                |\n"
  },
  {
    "path": "plugins/plugin-run-script/package.json",
    "content": "{\n  \"version\": \"2.3.0\",\n  \"name\": \"@snowpack/plugin-run-script\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-run-script#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-run-script\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"execa\": \"^5.1.1\",\n    \"npm-run-path\": \"^4.0.1\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-run-script/plugin.js",
    "content": "const execa = require('execa');\nconst npmRunPath = require('npm-run-path');\n\nconst CLEAR_SEQUENCES = ['\\x1Bc', '\\x1B[2J\\x1B[0;0f'];\n\nfunction runScriptPlugin(snowpackConfig, {name, cmd, watch, output}) {\n  const [cmdProgram] = cmd.split(' ');\n  const watchCmd = watch && watch.replace('$1', cmd);\n\n  return {\n    name: name || cmdProgram,\n    async run({isDev, log}) {\n      const workerPromise = execa.command(isDev ? watchCmd || cmd : cmd, {\n        env: npmRunPath.env(),\n        extendEnv: true,\n        shell: true,\n        windowsHide: false,\n        cwd: snowpackConfig.root || process.cwd(),\n      });\n      const {stdout, stderr} = workerPromise;\n      function dataListener(chunk) {\n        let stdOutput = chunk.toString();\n        if (output === 'stream') {\n          log('CONSOLE_INFO', {msg: stdOutput});\n          return;\n        }\n        if (CLEAR_SEQUENCES.some((s) => stdOutput.includes(s))) {\n          log('WORKER_RESET', {});\n          for (let s of CLEAR_SEQUENCES) {\n            stdOutput = stdOutput.replace(s, '');\n          }\n        }\n        if (cmdProgram === 'tsc') {\n          const errorMatch = stdOutput.match(/Found (\\d+) error/);\n          if (errorMatch) {\n            if (errorMatch[1] === '0') {\n              stdOutput = stdOutput.trim();\n            }\n          }\n        }\n        log('WORKER_MSG', {level: 'log', msg: stdOutput});\n      }\n      stdout && stdout.on('data', dataListener);\n      stderr && stderr.on('data', dataListener);\n      return workerPromise;\n    },\n  };\n}\n\nmodule.exports = runScriptPlugin;\n"
  },
  {
    "path": "plugins/plugin-run-script/test/plugin.test.js",
    "content": "const plugin = require('../plugin.js');\nconst {EventEmitter} = require('events');\n\njest.mock('execa');\nconst execa = require('execa');\n\ndescribe('plugin-run-script', () => {\n  const DEFAULT_OPTIONS = {\n    cmd: 'CMD',\n    watch: '$1 --additional-test-watch-options',\n  };\n  let execaResult, execaFn;\n\n  beforeEach(() => {\n    execa.command.mockClear();\n    execaResult = {\n      stderr: new EventEmitter(),\n      stdout: new EventEmitter(),\n      // Execa is weird, and returns a promise that also has other properties. Fake that here.\n      catch: () => {\n        return execaResult;\n      },\n    };\n    execaFn = jest.fn().mockName('execa.command').mockReturnValue(execaResult);\n    execa.command = execaFn;\n  });\n\n  test('returns the execa command promise', async () => {\n    const p = plugin({}, DEFAULT_OPTIONS);\n    const result = await p.run({isDev: false, log: jest.fn});\n    expect(result).toEqual(execaResult);\n  });\n  test('calls the given \"cmd\" command when isDev=false', async () => {\n    const p = plugin({}, {cmd: 'CMD'});\n    await p.run({isDev: false, log: jest.fn});\n    expect(execaFn.mock.calls[0][0]).toMatch('CMD');\n  });\n  test('calls the given \"watch\" command when isDev=true', async () => {\n    const p = plugin({}, {cmd: 'CMD', watch: '$1 --additional-test-watch-options'});\n    await p.run({isDev: true, log: jest.fn});\n    expect(execaFn.mock.calls[0][0]).toMatch('CMD --additional-test-watch-options');\n  });\n  test('handles command output in \"stream\" mode', async () => {\n    const logFn = jest.fn();\n    const p = plugin({}, {...DEFAULT_OPTIONS, output: 'stream'});\n    await p.run({isDev: false, log: logFn});\n    execaResult.stdout.emit('data', Buffer.from('STDOUT_TEST_MESSAGE'));\n    execaResult.stderr.emit('data', Buffer.from('STDERR_TEST_MESSAGE'));\n    expect(logFn.mock.calls).toEqual([\n      ['CONSOLE_INFO', {msg: 'STDOUT_TEST_MESSAGE'}],\n      ['CONSOLE_INFO', {msg: 'STDERR_TEST_MESSAGE'}],\n    ]);\n  });\n  test('handles command output in \"dashboard\" mode', async () => {\n    const logFn = jest.fn();\n    const p = plugin({}, {...DEFAULT_OPTIONS, output: 'dashboard'});\n    await p.run({isDev: false, log: logFn});\n    execaResult.stdout.emit('data', Buffer.from('STDOUT_TEST_MESSAGE'));\n    execaResult.stderr.emit('data', Buffer.from('STDERR_TEST_MESSAGE'));\n    expect(logFn.mock.calls).toEqual([\n      ['WORKER_MSG', {level: 'log', msg: 'STDOUT_TEST_MESSAGE'}],\n      ['WORKER_MSG', {level: 'log', msg: 'STDERR_TEST_MESSAGE'}],\n    ]);\n  });\n  test('handles clear character output in \"dashboard\" mode', async () => {\n    const logFn = jest.fn();\n    const p = plugin({}, {...DEFAULT_OPTIONS, output: 'dashboard'});\n    await p.run({isDev: false, log: logFn});\n    execaResult.stderr.emit('data', Buffer.from('\\u001bcTEST_CLEAR_MESSAGE'));\n    execaResult.stderr.emit('data', Buffer.from('\\x1BcTEST_CLEAR_MESSAGE'));\n    expect(logFn.mock.calls).toEqual([\n      ['WORKER_RESET', {}],\n      ['WORKER_MSG', {level: 'log', msg: 'TEST_CLEAR_MESSAGE'}],\n      ['WORKER_RESET', {}],\n      ['WORKER_MSG', {level: 'log', msg: 'TEST_CLEAR_MESSAGE'}],\n    ]);\n  });\n  test('modify plugin name when specify name', async () => {\n    const p = plugin({}, {...DEFAULT_OPTIONS, output: 'dashboard', name: 'test'});\n    expect(p.name).toBe('test');\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-sass/CHANGELOG.md",
    "content": "# @snowpack/plugin-sass\n\n## 1.4.0\n\n### Minor Changes\n\n- c71a3888: Improve @snowpack/plugin-sass resolution (#2964) <Drew Powers>\n\n## 1.3.1\n\n### Patch Changes\n\n- 85377715: fix wrong argument to parseCompilerOption(array[]) (#2547) <Danzo7>\n- edef1986: Fix Sass partial changes not triggering recompiles in Dev (#2792) <Mark Miller>\n- b0c6b5a0: [ci] yarn format <matthewp>\n- 549c3ca5: Properly find npm install sass when running outside of snowpack project (#2812) <Matthew Phillips>\n- 397f06e6: SASS plugin, fix default argument Array check (#2670) <Leon Montealegre>\n- 123f2c96: add loadPath support via compilerOptions instead of includePaths\n- cbfe71d2: [ci] yarn format\n- 6c56f4bd: add includePaths option to plugin-sass (#2443) <Danzo7>\n- 3b4b1a06: add warning if compilerOptions is used\n- f94f5a55: [ci] yarn format\n- b702f698: more testing cleanup\n- 7b38b486: get tests passing\n- 71bb73b5: [ci] yarn format\n- 48d8b9c7: skip failing windows sass test\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-sass)._\n"
  },
  {
    "path": "plugins/plugin-sass/README.md",
    "content": "# @snowpack/plugin-sass\n\nThis plugin adds [Sass](https://sass-lang.com/) support to any Snowpack project. With this plugin, you can import any `*.scss` or `*.sass` Sass file from JavaScript and have it compile to CSS.\n\nThis plugin also adds support for `.module.scss` Sass Modules. [Learn more.](https://www.snowpack.dev/reference/supported-files)\n\n#### A Note on Sass Implementations\n\nSass is interesting in that multiple compilers are available: [sass](https://www.npmjs.com/package/sass) (written in Dart) & [node-sass](https://www.npmjs.com/package/node-sass) (written in JavaScript). Both packages run on Node.js and both are popular on npm. However, [node-sass is now considered deprecated](https://github.com/sass/node-sass/issues/2952).\n\n**This plugin was designed to work with the `sass` package.** `sass` is automatically installed with this plugin as a direct dependency, so no extra effort is required on your part.\n\n## Usage\n\n```bash\nnpm i @snowpack/plugin-sass\n```\n\nThen add the plugin to your Snowpack config:\n\n```js\n// snowpack.config.mjs\n\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-sass',\n      {\n        /* see options below */\n      },\n    ],\n  ],\n};\n```\n\n## Plugin Options\n\n| Name                |   Type    | Description                                                                                                                                                                                                                                                                              |\n| :------------------ | :-------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `native`            | `boolean` | If `true`, the plugin will ignore the npm version of sass installed locally for the native Sass CLI [installed separately](https://sass-lang.com/install). This involves extra setup, but the result can be [up to 9× faster.](https://stackoverflow.com/a/56422541) (default: `false`). |\n| `compilerOptions.*` | `object`  | Pass [Sass options][sass-options] directly to the Sass compiler (see `compilerOptions`).                                                                                                                                                                                                 |\n\n### `compilerOptions`\n\nThese options are camelCased equivalents of the [Sass CLI Options][sass-options]. The options listed here are safe for use. The other flags not listed here may cause issues or conflicts with Snowpack and/or other plugins; use at your discretion.\n\n| Name             |              Type              | Description                                                                                             |\n| :--------------- | :----------------------------: | :------------------------------------------------------------------------------------------------------ |\n| `loadPath`       |       `string, string[]`       | Add directories to Sass's load path, to support looking up and loading partials (etc.) by name.         |\n| `style`          | `'expanded'` \\| `'compressed'` | The output style. Specify `'compressed'` to enable Sass’ built-in minification (default: `'expanded'`). |\n| `sourceMap`      |           `boolean`            | Enable / disable source maps (default: `true`).                                                         |\n| `sourceMapUrls`  |  `'relative'` \\| `'absolute'`  | How to link from source maps to source files (default: `'relative'`).                                   |\n| `embedSources`   |           `boolean`            | Embed source file contents in source maps (default: `false`).                                           |\n| `embedSourceMap` |           `boolean`            | Embed source map contents in CSS (default: `false`).                                                    |\n| `charset`        |           `boolean`            | Emit a `@charset` or BOM for CSS with non-ASCII characters. (default: `true`).                          |\n| `update`         |           `boolean`            | Compile only out-of-date stylesheets (default: `false`).                                                |\n\n[sass-options]: https://sass-lang.com/documentation/cli/dart-sass#options\n"
  },
  {
    "path": "plugins/plugin-sass/package.json",
    "content": "{\n  \"version\": \"1.4.0\",\n  \"name\": \"@snowpack/plugin-sass\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-sass#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-sass\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"execa\": \"^5.1.1\",\n    \"find-up\": \"^5.0.0\",\n    \"npm-run-path\": \"^4.0.1\",\n    \"sass\": \"^1.3.0\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-sass/plugin.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst execa = require('execa');\nconst npmRunPath = require('npm-run-path');\nconst findUp = require('find-up');\n\nconst IMPORT_REGEX = /\\@(use|import|forward)\\s*['\"](.*?)['\"]/g;\nconst PARTIAL_REGEX = /([\\/\\\\])_(.+)(?![\\/\\\\])/;\n\nfunction stripFileExtension(filename) {\n  return filename.split('.').slice(0, -1).join('.');\n}\n\nfunction findChildPartials(pathName, fileName, fileExt) {\n  const dirPath = path.parse(pathName).dir;\n\n  // Prepend a \"_\" to signify a partial.\n  if (!fileName.startsWith('_')) {\n    fileName = '_' + fileName;\n  }\n\n  // Add on the file extension if it is not already used.\n  if (!fileName.endsWith('.scss') || !fileName.endsWith('.sass')) {\n    fileName += fileExt;\n  }\n\n  const filePath = path.resolve(dirPath, fileName);\n\n  let contents = '';\n  try {\n    contents = fs.readFileSync(filePath, 'utf8');\n  } catch (err) {}\n\n  return contents;\n}\n\nfunction scanSassImports(fileContents, filePath, fileExt, partials = new Set()) {\n  // TODO: Replace with matchAll once Node v10 is out of TLS.\n  // const allMatches = [...result.matchAll(new RegExp(HTML_JS_REGEX))];\n  const allMatches = [];\n  let match;\n  const regex = new RegExp(IMPORT_REGEX);\n  while ((match = regex.exec(fileContents))) {\n    allMatches.push(match);\n  }\n  // return all imports, resolved to true files on disk.\n  allMatches\n    .map((match) => match[2])\n    .filter((s) => s.trim())\n    // Avoid node packages and core sass libraries.\n    .filter((s) => !s.includes('node_modules') && !s.includes('sass:'))\n    .forEach((fileName) => {\n      let pathName = path.resolve(path.dirname(filePath), fileName);\n\n      if (partials.has(pathName)) {\n        return;\n      }\n\n      // Add this partial to the main list being passed to avoid duplicates.\n      partials.add(pathName);\n\n      // If it is a directory then look for an _index file.\n      try {\n        if (fs.lstatSync(pathName).isDirectory()) {\n          fileName = 'index';\n          pathName += '/' + fileName;\n        }\n      } catch (err) {}\n\n      // Recursively find any child partials that have not already been added.\n      const partialsContent = findChildPartials(pathName, fileName, fileExt);\n      if (partialsContent) {\n        const childPartials = scanSassImports(partialsContent, pathName, fileExt, partials);\n        partials.add(...childPartials);\n      }\n    });\n\n  return partials;\n}\n\nmodule.exports = function sassPlugin(snowpackConfig, {native, compilerOptions = {}} = {}) {\n  const {root} = snowpackConfig || {};\n\n  /** A map of partially resolved imports to the files that imported them. */\n  const importedByMap = new Map();\n\n  function addImportsToMap(filePath, sassImport) {\n    const importedBy = importedByMap.get(sassImport);\n    if (importedBy) {\n      importedBy.add(filePath);\n    } else {\n      importedByMap.set(sassImport, new Set([filePath]));\n    }\n  }\n\n  return {\n    name: '@snowpack/plugin-sass',\n    resolve: {\n      input: ['.scss', '.sass'],\n      output: ['.css'],\n    },\n    /**\n     * If any files imported the given file path, mark them as changed.\n     * @private\n     */\n    _markImportersAsChanged(filePath) {\n      if (importedByMap.has(filePath)) {\n        const importedBy = importedByMap.get(filePath);\n        importedByMap.delete(filePath);\n        for (const importerFilePath of importedBy) {\n          this.markChanged(importerFilePath);\n        }\n      }\n    },\n    /**\n     * When a file changes, also mark it's importers as changed.\n     * Note that Sass has very lax matching of imports -> files.\n     * Follow these rules to find a match: https://sass-lang.com/documentation/at-rules/use\n     */\n    onChange({filePath}) {\n      const filePathNoExt = stripFileExtension(filePath);\n      // check exact: \"_index.scss\" (/a/b/c/foo/_index.scss)\n      this._markImportersAsChanged(filePath);\n      // check no ext: \"_index\" (/a/b/c/foo/_index)\n      this._markImportersAsChanged(filePathNoExt);\n      // check no underscore: \"index.scss\" (/a/b/c/foo/index.scss)\n      this._markImportersAsChanged(filePath.replace(PARTIAL_REGEX, '$1$2'));\n      // check no ext, no underscore: \"index\" (/a/b/c/foo/index)\n      this._markImportersAsChanged(filePathNoExt.replace(PARTIAL_REGEX, '$1$2'));\n      // check folder import: \"foo\" (/a/b/c/foo)\n      if (filePathNoExt.endsWith('_index')) {\n        const folderPathNoIndex = filePathNoExt.substring(0, filePathNoExt.length - 7);\n        this._markImportersAsChanged(folderPathNoIndex);\n      }\n    },\n    /** Load the Sass file and compile it to CSS. */\n    async load({filePath, isDev}) {\n      const fileExt = path.extname(filePath);\n      const contents = fs.readFileSync(filePath, 'utf8');\n\n      // Sass partials should never be loaded directly, return nothing to ignore.\n      if (path.basename(filePath).startsWith('_')) {\n        return;\n      }\n\n      // During development, we need to track changes to Sass dependencies.\n      if (isDev) {\n        const sassImports = scanSassImports(contents, filePath, fileExt);\n        [...sassImports].forEach((imp) => addImportsToMap(filePath, imp));\n      }\n\n      const args = ['--stdin'];\n\n      // If file is `.sass`, use YAML-style. Otherwise, use default.\n      if (fileExt === '.sass') {\n        args.push('--indented');\n      }\n\n      // keep track of load paths later\n      const loadPaths = new Set([path.dirname(filePath)]);\n      const DEFAULT_LOAD_PATHS = new Set([root, process.cwd()]);\n      const nodeModulesPath = await findUp('node_modules', {\n        type: 'directory',\n        cwd: root || __dirname,\n      });\n      if (nodeModulesPath) DEFAULT_LOAD_PATHS.add(nodeModulesPath);\n\n      // Pass in user-defined options\n      function parseCompilerOption([flag, value]) {\n        let flagName = flag.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`); // convert camelCase to kebab-case\n        switch (typeof value) {\n          case 'boolean': {\n            args.push(`--${value === false ? 'no-' : ''}${flagName}`);\n            break;\n          }\n          case 'string':\n          case 'number': {\n            if (flagName === 'loadPath') {\n              loadPaths.add(value); // don’t add these until default load paths are collected\n            } else {\n              args.push(`--${flagName}=${value}`);\n            }\n            break;\n          }\n          default: {\n            if (Array.isArray(value)) {\n              for (const val of value) {\n                parseCompilerOption([flag, val]);\n              }\n              break;\n            }\n            throw new Error(\n              `compilerOptions[${flag}] value not supported. Must be string, number, or boolean.`,\n            );\n          }\n        }\n      }\n      Object.entries(compilerOptions).forEach(parseCompilerOption);\n\n      // --load-path\n      for (const dir of loadPaths) {\n        args.push(`--load-path=${dir}`); // load user-specified loadPaths first\n      }\n      for (const dir of DEFAULT_LOAD_PATHS) {\n        if (!loadPaths.has(dir)) {\n          args.push(`--load-path=${dir}`); // then add default loadPaths (only if different)\n        }\n      }\n\n      // Build the file.\n      const execaOptions = {\n        input: contents,\n        // Adds the PATH param to the command so it can find local sass\n        env: native ? undefined : npmRunPath.env(),\n        extendEnv: native ? true : false,\n      };\n\n      // If not using native them specify the project root so execa finds the right sass binary.\n      if (!native && root) {\n        // Prefer the node_modules/.bin\n        execaOptions.preferLocal = true;\n\n        // Specifies the local directory (which contains a .bin with sass)\n        execaOptions.localDir = root;\n      }\n\n      const {stdout, stderr} = await execa('sass', args, execaOptions);\n      // Handle the output.\n      if (stderr) throw new Error(stderr);\n      if (stdout) return stdout;\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-sass/test/__snapshots__/plugin.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`plugin-sass returns the compiled Sass result: App.sass 1`] = `\n\".child {\n  text-align: left;\n}\n\nbody {\n  font-family: Helvetica, sans-serif;\n}\n\n.App {\n  text-align: center;\n  background: #333;\n}\"\n`;\n\nexports[`plugin-sass returns the compiled Sass result: App.scss 1`] = `\n\"body {\n  font-family: Helvetica, sans-serif;\n}\n\n.App {\n  text-align: center;\n  background: #333;\n}\"\n`;\n"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/bad/bad.scss",
    "content": "awegagwagawingawignTHISISBADCODE"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/sass/App.sass",
    "content": "@use 'base'\n@use 'folder'\n\nbody\n    font-family: folder.$font-stack\n\n.App\n  text-align: center\n  background: base.$primary-color\n"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/sass/_base.sass",
    "content": "// _base.scss\n$primary-color: #333\n"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/sass/folder/_child-partial.sass",
    "content": ".child\n  text-align: left\n"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/sass/folder/_index.sass",
    "content": "// folder/_index.sass\n@use 'child-partial'\n\n$font-stack: Helvetica, sans-serif\n"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/scss/App.scss",
    "content": "@use 'base';\n@use 'folder';\n\n\nbody {\n  font-family: folder.$font-stack;\n}\n\n.App {\n  text-align: center;\n  background: base.$primary-color;\n}"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/scss/_base.scss",
    "content": "// _base.scss\n$primary-color: #333;\n"
  },
  {
    "path": "plugins/plugin-sass/test/fixtures/scss/folder/_index.scss",
    "content": "// folder/_index.scss\n$font-stack:    Helvetica, sans-serif;\n"
  },
  {
    "path": "plugins/plugin-sass/test/plugin-mocked.test.js",
    "content": "/**\n * This test requires mocks which could disrupt other tests\n */\nconst path = require('path');\nconst mockExeca = jest.fn().mockImplementation(() => Promise.resolve({stdout: '', stderr: ''}));\njest.mock('execa', () => (cmd, args) => mockExeca(cmd, args));\nconst plugin = require('../plugin');\n\nconst MOCK_CONFIG = null;\nconst MOCK_LOAD = {filePath: path.join(__dirname, 'fixtures', 'scss', 'App.scss'), isDev: false};\n\nconst tests = [\n  {name: 'no options', given: {}, expect: []},\n  {\n    name: 'string option',\n    given: {compilerOptions: {style: 'compressed'}},\n    expect: [`--style=compressed`],\n  },\n  {\n    name: 'boolean option',\n    given: {compilerOptions: {sourceMaps: false}},\n    expect: [`--no-source-maps`],\n  },\n  {\n    name: 'combination',\n    given: {compilerOptions: {style: 'compressed', sourceMaps: true}},\n    expect: [`--style=compressed`, `--source-maps`],\n  },\n];\n\ndescribe('plugin-sass', () => {\n  afterEach(() => {\n    mockExeca.mockClear(); // clear calls between each test\n  });\n\n  tests.forEach((t) => {\n    it(t.name, async () => {\n      const {load} = plugin(MOCK_CONFIG, t.given);\n      await load(MOCK_LOAD);\n      // Note: this test assumes execa is only used once in the entire plugin.\n      // If execa needs to be used for another purpose, you can filter calls by 'sass' 1st param here\n      t.expect.forEach((arg) => {\n        expect(mockExeca.mock.calls[0][1]).toContain(arg);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-sass/test/plugin.test.js",
    "content": "const plugin = require('../plugin.js');\nconst path = require('path');\n\nconst pathToSassApp = path.join(__dirname, 'fixtures/sass/App.sass');\nconst pathToSassBase = path.join(__dirname, 'fixtures/sass/_base.sass');\nconst pathToSassIndex = path.join(__dirname, 'fixtures/sass/folder/_index.sass');\nconst pathToSassChild = path.join(__dirname, 'fixtures/sass/folder/_child-partial.sass');\nconst pathToScssApp = path.join(__dirname, 'fixtures/scss/App.scss');\nconst pathToBadCode = path.join(__dirname, 'fixtures/bad/bad.scss');\n\ndescribe('plugin-sass', () => {\n  test('returns the compiled Sass result', async () => {\n    const p = plugin(null, {});\n    const sassResult = await p.load({filePath: pathToSassApp, isDev: false});\n    expect(sassResult).toMatchSnapshot('App.sass');\n    const scssResult = await p.load({filePath: pathToScssApp, isDev: true});\n    expect(scssResult).toMatchSnapshot('App.scss');\n  });\n\n  test('returns undefined when a sass partial is loaded directly', async () => {\n    const p = plugin(null, {});\n    const devResult = await p.load({filePath: pathToSassBase, isDev: false});\n    expect(devResult).toEqual(undefined);\n    const prodResult = await p.load({filePath: pathToSassBase, isDev: true});\n    expect(prodResult).toEqual(undefined);\n  });\n\n  test('throws an error when stderr output is returned', async () => {\n    const p = plugin(null, {});\n    await expect(p.load({filePath: pathToBadCode, isDev: false})).rejects.toThrow(\n      'Command failed with exit code',\n    );\n  });\n\n  test('marks a dependant as changed when an imported changes and isDev=true', async () => {\n    const p = plugin(null, {});\n    p.markChanged = jest.fn();\n    await p.load({filePath: pathToSassApp, isDev: true});\n    expect(p.markChanged.mock.calls).toEqual([]);\n    p.onChange({filePath: pathToSassApp});\n    expect(p.markChanged.mock.calls).toEqual([]);\n    p.onChange({filePath: pathToSassBase});\n    expect(p.markChanged.mock.calls).toEqual([[pathToSassApp]]);\n    p.markChanged.mockClear();\n    p.onChange({filePath: pathToSassIndex});\n    expect(p.markChanged.mock.calls).toEqual([[pathToSassApp]]);\n    p.markChanged.mockClear();\n    p.onChange({filePath: pathToSassChild});\n    expect(p.markChanged.mock.calls).toEqual([[pathToSassApp]]);\n  });\n\n  test('does not track dependant changes when isDev=false', async () => {\n    const p = plugin(null, {});\n    p.markChanged = jest.fn();\n    await p.load({filePath: pathToSassApp, isDev: false});\n    p.onChange({filePath: pathToSassApp});\n    p.onChange({filePath: pathToSassBase});\n    expect(p.markChanged.mock.calls).toEqual([]);\n  });\n\n  test('uses native sass CLI when native option = true', async () => {\n    const p = plugin(null, {native: true});\n    process.env.PATH = '';\n    await expect(p.load({filePath: pathToSassApp, isDev: false})).rejects.toThrow(\n      /(EPIPE|ENOENT|'sass' is not recognized as an internal or external command)/,\n    );\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-svelte/CHANGELOG.md",
    "content": "# @snowpack/plugin-svelte\n\n## 3.7.0\n\n### Minor Changes\n\n- d9956f73: add explicit \"mode\" config (#3135)\n- 4403595e: Sourcemaps (#3271) <Luke Jackson>\n\n### Patch Changes\n\n- c9d2835c: chore: Update Node versions in GitHub CI (#3238) <Drew Powers>\n\n## 3.6.1\n\n### Patch Changes\n\n- 56c5a231: fix typo in changelog\n- 40f02cf4: reorder changelog entries\n- 0694c5d3: [plugin-svelte] upgrade svelte-hmr to 0.13.2, fix remote source support (#2909) <rixo>\n\n## 3.6.0\n\n### Minor Changes\n\n- c27d7f48: feat(plugin-svelte): track preprocess dependencies <pngwn>\n\n### Patch Changes\n\n- 5bf28731: fix bad svelte test\n- 4332623d: [ci] yarn format\n- 9ec250c4: fix merge conflicts\n- bea1c56c: Simplify. cleanup, enhance snowpack internals (#2707)\n- 49b29f97: [ci] yarn format\n\n## 3.5.2\n\n### Patch Changes\n\n- b5b0590f: [ci] yarn format\n\n* ## 3.5.1\n\n### Patch Changes\n\n- 628e58a4: svelte plugin: make configurable hmrOptions\n- a8471965: [ci] yarn format\n- 9b465b6f: add backwards compat for the svelte plugin\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-svelte)._\n"
  },
  {
    "path": "plugins/plugin-svelte/README.md",
    "content": "# @snowpack/plugin-svelte\n\nUse the [Svelte compiler](https://svelte.dev/docs#Compile_time) to build your `.svelte` files from source. Supports TypeScript and Sass out-of-the-box via [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess).\n\n```\nnpm install --save-dev @snowpack/plugin-svelte\n```\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-svelte',\n      {\n        /* see optional “Plugin Options” below */\n      },\n    ],\n  ],\n};\n```\n\n## Plugin Options\n\nBy default, this plugin will look for a `svelte.config.js` file in your project directory to load `preprocess` and `compilerOptions` configuration from. However, you can also customize Svelte directly via the plugin options below.\n\n| Name              |                                  Type                                  | Description                                                                                                                                                                                                                                                                                                                                                            |\n| :---------------- | :--------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `configFilePath`  |                                `string`                                | Relative path to a Svelte config file. Defaults to load `svelte.config.js` from the current project root directory.                                                                                                                                                                                                                                                    |\n| `input`           |                               `string[]`                               | Array of file extensions to process. Uses `svelte.config.js` `extensions` if available. Defaults to `['.svelte']`.                                                                                                                                                                                                                                                     |\n| `preprocess`      | [svelte.preprocess options](https://svelte.dev/docs#svelte_preprocess) | Configure the Svelte pre-processor. If this option is given, the config file `preprocess` option will be ignored. If any `preprocess` option is set to `false`, preprocessing will be skipped entirely regardless of file content. If no `preprocess` option is given, this plugin defaults to use [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess). |\n| `compilerOptions` |    [svelte.compile options](https://svelte.dev/docs#svelte_compile)    | Configure the Svelte compiler.If this option is given, the config file `preprocess` option will be ignored.                                                                                                                                                                                                                                                            |\n| `hmrOptions`      |    [svelte-hmr options](https://github.com/rixo/svelte-hmr#options)    | Configure HMR & \"fast refresh\" behavior for Svelte.                                                                                                                                                                                                                                                                                                                    |\n"
  },
  {
    "path": "plugins/plugin-svelte/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-svelte\",\n  \"version\": \"3.7.0\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-svelte#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-svelte\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"peerDependencies\": {\n    \"svelte\": \"^3.21.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\",\n  \"dependencies\": {\n    \"rollup-plugin-svelte\": \"^7.0.0\",\n    \"svelte-hmr\": \"^0.13.2\",\n    \"svelte-preprocess\": \"^4.7.2\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-svelte/plugin.js",
    "content": "const svelte = require('svelte/compiler');\nconst svelteRollupPlugin = require('rollup-plugin-svelte');\nconst fs = require('fs');\nconst path = require('path');\nconst {createMakeHot} = require('svelte-hmr');\n\nconst inlineSourcemap = (code, map) =>\n  code +\n  '\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,' +\n  new Buffer(map.toString()).toString('base64');\n\nmodule.exports = function plugin(snowpackConfig, pluginOptions = {}) {\n  const isDev = snowpackConfig.mode !== 'production';\n  const useSourceMaps =\n    snowpackConfig.buildOptions.sourcemap || snowpackConfig.buildOptions.sourceMaps;\n  // Old Snowpack versions wouldn't build dependencies. Starting in v3.1, Snowpack's build pipeline\n  // is run on all files, including npm package files. The rollup plugin is no longer needed.\n  const importedByMap = new Map();\n  const needsRollupPlugin = typeof snowpackConfig.buildOptions.resolveProxyImports === 'undefined';\n\n  // Support importing Svelte files when you install dependencies.\n  const packageOptions = snowpackConfig.packageOptions || snowpackConfig.installOptions;\n  if (packageOptions.source === 'local') {\n    if (needsRollupPlugin) {\n      packageOptions.rollup = packageOptions.rollup || {};\n      packageOptions.rollup.plugins = packageOptions.rollup.plugins || [];\n      packageOptions.rollup.plugins.push(\n        svelteRollupPlugin({\n          include: /\\.svelte$/,\n          compilerOptions: {dev: isDev},\n          // Snowpack wraps JS-imported CSS in a JS wrapper, so use\n          // Svelte's own first-class `emitCss: false` here.\n          // TODO: Remove once Snowpack adds first-class CSS import support in deps.\n          emitCss: false,\n        }),\n      );\n    }\n    // Support importing sharable Svelte components.\n    packageOptions.packageLookupFields.push('svelte');\n  }\n\n  if (\n    pluginOptions.generate !== undefined ||\n    pluginOptions.dev !== undefined ||\n    pluginOptions.hydratable !== undefined ||\n    pluginOptions.css !== undefined ||\n    pluginOptions.preserveComments !== undefined ||\n    pluginOptions.preserveWhitespace !== undefined ||\n    pluginOptions.sveltePath !== undefined\n  ) {\n    throw new Error(\n      `[plugin-svelte] Svelte.compile options moved to new config value: {compilerOptions: {...}}`,\n    );\n  }\n\n  if (pluginOptions.compileOptions !== undefined) {\n    throw new Error(\n      `[plugin-svelte] Could not recognize \"compileOptions\". Did you mean \"compilerOptions\"?`,\n    );\n  }\n  if (pluginOptions.input && !Array.isArray(pluginOptions.input)) {\n    throw new Error(`[plugin-svelte] Option \"input\" must be an array (e.g. ['.svelte', '.svx'])`);\n  }\n  if (pluginOptions.input && pluginOptions.input.length === 0) {\n    throw new Error(`[plugin-svelte] Option \"input\" must specify at least one filetype`);\n  }\n  let configFilePath = path.resolve(\n    snowpackConfig.root || process.cwd(),\n    pluginOptions.configFilePath || 'svelte.config.js',\n  );\n  let compilerOptions = pluginOptions.compilerOptions;\n  let preprocessOptions = pluginOptions.preprocess;\n  let resolveInputOption = pluginOptions.input;\n  const hmrOptions = pluginOptions.hmrOptions;\n\n  if (fs.existsSync(configFilePath)) {\n    const configFileConfig = require(configFilePath);\n    preprocessOptions =\n      preprocessOptions !== undefined ? preprocessOptions : configFileConfig.preprocess;\n    compilerOptions =\n      compilerOptions !== undefined ? compilerOptions : configFileConfig.compilerOptions;\n    resolveInputOption =\n      resolveInputOption !== undefined ? resolveInputOption : configFileConfig.extensions;\n  } else {\n    //user svelte.config.js is optional and should not error if not configured\n    if (pluginOptions.configFilePath) {\n      throw new Error(`[plugin-svelte] failed to find Svelte config file: \"${configFilePath}\"`);\n    }\n  }\n\n  if (preprocessOptions === undefined) {\n    preprocessOptions = require('svelte-preprocess')();\n  }\n\n  function addImportsToMap(filePath, imp) {\n    const importedBy = importedByMap.get(imp);\n    if (importedBy) {\n      importedBy.add(filePath);\n    } else {\n      importedByMap.set(imp, new Set([filePath]));\n    }\n  }\n\n  let makeHot = (...args) => {\n    makeHot = createMakeHot({\n      walk: svelte.walk,\n      absoluteImports: false,\n      versionNonAbsoluteImports: packageOptions.source === 'remote',\n    });\n    return makeHot(...args);\n  };\n\n  return {\n    name: '@snowpack/plugin-svelte',\n    resolve: {\n      input: resolveInputOption || ['.svelte'],\n      output: ['.js', '.css'],\n    },\n    knownEntrypoints: [\n      'svelte/internal',\n      'svelte-hmr/runtime/hot-api-esm.js',\n      'svelte-hmr/runtime/proxy-adapter-dom.js',\n    ],\n\n    /**\n     * If any files imported the given file path, mark them as changed.\n     * @private\n     */\n    _markImportersAsChanged(filePath) {\n      if (importedByMap.has(filePath)) {\n        const importedBy = importedByMap.get(filePath);\n        importedByMap.delete(filePath);\n        for (const importerFilePath of importedBy) {\n          this.markChanged(importerFilePath);\n        }\n      }\n    },\n\n    /**\n     * When a file changes, also mark it's importers as changed.\n     * svelte.preprocess returns a list of preprocess deps - https://svelte.dev/docs#svelte_preprocess\n     */\n    onChange({filePath}) {\n      this._markImportersAsChanged(filePath);\n    },\n\n    async load({filePath, isHmrEnabled, isSSR, isPackage}) {\n      let dependencies = [];\n      let codeToCompile = await fs.promises.readFile(filePath, 'utf-8');\n      // PRE-PROCESS\n      if (preprocessOptions !== false) {\n        ({code: codeToCompile, dependencies} = await svelte.preprocess(\n          codeToCompile,\n          preprocessOptions,\n          {\n            filename: filePath,\n          },\n        ));\n      }\n\n      // in dev mode, track preprocess dependencies\n      if (isDev && dependencies && dependencies.length) {\n        dependencies.forEach((imp) => addImportsToMap(filePath, imp));\n      }\n\n      const finalCompileOptions = {\n        generate: isSSR ? 'ssr' : 'dom',\n        css: isPackage ? true : false,\n        ...compilerOptions, // Note(drew) should take precedence over generate above\n        dev: isHmrEnabled || isDev,\n        outputFilename: filePath,\n        filename: filePath,\n      };\n\n      const compiled = svelte.compile(codeToCompile, finalCompileOptions);\n      const {js, css} = compiled;\n\n      if (useSourceMaps) {\n        js.code = inlineSourcemap(js.code, js.map);\n      }\n\n      const output = {\n        '.js': {\n          code: js.code,\n          map: useSourceMaps ? js.map : undefined,\n        },\n      };\n\n      if (isHmrEnabled && !isSSR) {\n        output['.js'].code = makeHot({\n          id: filePath,\n          compiledCode: js.code,\n          hotOptions: {\n            preserveLocalState: true,\n            injectCss: true,\n            ...hmrOptions,\n            absoluteImports: false,\n            noOverlay: true,\n          },\n          compiled,\n          originalCode: codeToCompile,\n          compileOptions: finalCompileOptions,\n        });\n      }\n\n      if (!finalCompileOptions.css && css && css.code) {\n        output['.css'] = {\n          code: css.code,\n          map: useSourceMaps ? css.map : undefined,\n        };\n      }\n      return output;\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-svelte/test/Button.svelte",
    "content": "<style lang=\"scss\">\n  button {\n    color: rgb(blue, 0.7);\n    font-size: 16px;\n  }\n</style>\n\n<button>I’m a button!</button>\n"
  },
  {
    "path": "plugins/plugin-svelte/test/custom-config.js",
    "content": "module.exports = {\n  preprocess: {\n    __test: 'custom-config.js::preprocess',\n  },\n  compilerOptions: {\n    __test: 'custom-config.js',\n  },\n};\n"
  },
  {
    "path": "plugins/plugin-svelte/test/plugin.test.js",
    "content": "const path = require('path');\n\nconst mockCompiler = jest.fn().mockImplementation((code) => ({js: {code}}));\nconst mockPreprocessor = jest.fn().mockImplementation((code) => code);\nconst mockPreprocessorWithDeps = jest.fn().mockImplementation((code) => ({\n  code,\n  dependencies: ['path/to/file.stylus', 'path/to/file2.stylus'],\n}));\n\nlet DEFAULT_CONFIG;\nconst mockComponent = path.join(__dirname, 'Button.svelte');\n\nbeforeEach(() => {\n  DEFAULT_CONFIG = {\n    buildOptions: {sourceMaps: false},\n    packageOptions: {\n      source: 'local',\n      rollup: {plugins: []},\n      packageLookupFields: [],\n    },\n  };\n});\n\nafterEach(() => {\n  mockCompiler.mockClear();\n  mockPreprocessor.mockClear();\n  mockPreprocessorWithDeps.mockClear();\n});\n\ndescribe('@snowpack/plugin-svelte (mocked)', () => {\n  jest.mock('svelte/compiler', () => ({compile: mockCompiler, preprocess: mockPreprocessor})); // important: mock before import\n  const plugin = require('../plugin');\n\n  // TODO: safe to remove?\n  afterEach(() => {\n    mockCompiler.mockClear();\n    mockPreprocessor.mockClear();\n  });\n\n  afterAll(() => jest.resetModules());\n\n  it('logs error if config options set but finds no file', async () => {\n    expect(() => {\n      plugin(DEFAULT_CONFIG, {\n        configFilePath: './plugins/plugin-svelte/this-file-does-not-exist.js',\n      });\n    }).toThrow(/failed to find Svelte config file/);\n  });\n\n  it('logs error if compileOptions is used instead of compilerOptions', async () => {\n    expect(() => {\n      plugin(DEFAULT_CONFIG, {\n        compileOptions: {__test: 'ignore'},\n      });\n    }).toThrow(\n      `[plugin-svelte] Could not recognize \"compileOptions\". Did you mean \"compilerOptions\"?`,\n    );\n  });\n\n  it('logs error if old style config format is used', async () => {\n    const badOptionCheck = /Svelte\\.compile options moved to new config value/;\n    expect(() =>\n      plugin(DEFAULT_CONFIG, {\n        css: false,\n      }),\n    ).toThrow(badOptionCheck);\n    expect(() =>\n      plugin(DEFAULT_CONFIG, {\n        generate: 'dom',\n      }),\n    ).toThrow(badOptionCheck);\n  });\n\n  it('logs error if resolve input is invalid', async () => {\n    expect(() => {\n      plugin(DEFAULT_CONFIG, {\n        input: '.svelte',\n      });\n    }).toThrow(`[plugin-svelte] Option \"input\" must be an array (e.g. ['.svelte', '.svx'])`);\n    expect(() => {\n      plugin(DEFAULT_CONFIG, {\n        input: [],\n      });\n    }).toThrow(`[plugin-svelte] Option \"input\" must specify at least one filetype`);\n  });\n\n  it('passes compilerOptions to compiler', async () => {\n    const compilerOptions = {\n      __test: 'compilerOptions',\n    };\n    const sveltePlugin = plugin(DEFAULT_CONFIG, {compilerOptions});\n    await sveltePlugin.load({filePath: mockComponent});\n    expect(mockCompiler.mock.calls[0][1]).toEqual({\n      __test: 'compilerOptions',\n      css: false,\n      dev: true,\n      filename: mockComponent,\n      generate: 'dom',\n      outputFilename: mockComponent,\n    });\n  });\n\n  it('passes preprocess options to compiler', async () => {\n    const preprocess = {__test: 'preprocess'};\n    const sveltePlugin = plugin(DEFAULT_CONFIG, {preprocess});\n    await sveltePlugin.load({filePath: mockComponent});\n    expect(mockPreprocessor.mock.calls[0][1]).toEqual(preprocess);\n  });\n\n  // For our users we load from the current working directory, but in jest that doesn't make sense\n  it.skip('load config from a default svelte config file', async () => {\n    const sveltePlugin = plugin(DEFAULT_CONFIG, {});\n    await sveltePlugin.load({filePath: mockComponent});\n    expect(mockCompiler.mock.calls[0][1]).toEqual({__test: 'svelte.config.js'});\n    expect(mockPreprocessor.mock.calls[0][1]).toEqual({__test: 'svelte.config.js::preprocess'});\n  });\n\n  it('load config from a custom svelte config file', async () => {\n    const sveltePlugin = plugin(DEFAULT_CONFIG, {\n      configFilePath: './plugins/plugin-svelte/test/custom-config.js',\n    });\n    await sveltePlugin.load({filePath: mockComponent});\n    expect(mockCompiler.mock.calls[0][1]).toEqual({\n      __test: 'custom-config.js',\n      css: false,\n      dev: true,\n      filename: mockComponent,\n      generate: 'dom',\n      outputFilename: mockComponent,\n    });\n    expect(mockPreprocessor.mock.calls[0][1]).toEqual({__test: 'custom-config.js::preprocess'});\n  });\n\n  it('resolves custom file extensions', async () => {\n    expect(\n      plugin(DEFAULT_CONFIG, {\n        input: ['.svelte', '.svx'],\n      }).resolve.input,\n    ).toMatchInlineSnapshot(`\n      Array [\n        \".svelte\",\n        \".svx\",\n      ]\n    `);\n    expect(\n      plugin(DEFAULT_CONFIG, {\n        input: ['.svx'],\n      }).resolve.input,\n    ).toMatchInlineSnapshot(`\n      Array [\n        \".svx\",\n      ]\n    `);\n  });\n  it('supports importing svelte components', async () => {\n    const config = {...DEFAULT_CONFIG};\n    plugin(config, {});\n    expect(config.packageOptions.packageLookupFields).toEqual(['svelte']);\n    config.packageOptions.packageLookupFields = ['module'];\n    plugin(config, {});\n    expect(config.packageOptions.packageLookupFields).toEqual(['module', 'svelte']);\n  });\n});\n\ndescribe('@snowpack/plugin-svelte (preprocessor deps)', () => {\n  let plugin;\n\n  beforeAll(() => {\n    jest.mock('svelte/compiler', () => ({\n      compile: mockCompiler,\n      preprocess: mockPreprocessorWithDeps,\n    })); // important: mock before import\n    plugin = require('../plugin');\n  });\n\n  afterAll(() => jest.resetModules());\n\n  it('marks a file as changed when a preprocess dependency changes', async () => {\n    const preprocess = {__test: 'preprocess'};\n    const p = plugin(DEFAULT_CONFIG, {preprocess});\n    p.markChanged = jest.fn();\n    await p.load({filePath: mockComponent});\n    p.onChange({filePath: 'path/to/file.stylus'});\n    p.onChange({filePath: 'path/to/file2.stylus'});\n\n    expect(p.markChanged).toHaveBeenCalledTimes(2);\n    expect(p.markChanged.mock.calls[0][0]).toBe(mockComponent);\n    expect(p.markChanged.mock.calls[1][0]).toBe(mockComponent);\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-svelte/test/svelte.config.js",
    "content": "module.exports = {\n  preprocess: {\n    __test: 'svelte.config.js::preprocess',\n  },\n  compilerOptions: {\n    __test: 'svelte.config.js',\n  },\n};\n"
  },
  {
    "path": "plugins/plugin-typescript/CHANGELOG.md",
    "content": "# @snowpack/plugin-typescript\n\n## 1.2.1\n\n### Patch Changes\n\n- f8f32551: [ci] yarn format\n- 6b105339: add esinstall missing import hint (#2299)\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-typescript)._\n"
  },
  {
    "path": "plugins/plugin-typescript/README.md",
    "content": "# @snowpack/plugin-typescript\n\nThis plugin adds TypeScript type checking to any Snowpack project.\n\nWhen developing or building your site with Snowpack, this plugin will run TypeScript's `tsc` CLI in your project and pipe the output through Snowpack. Works with all version of TypeScript, as long as TypeScript is installed separately in your project.\n\n## Usage\n\n```bash\nnpm i @snowpack/plugin-typescript typescript\n```\n\nThen add the plugin to your Snowpack config:\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: ['@snowpack/plugin-typescript'],\n};\n```\n\n## Plugin Options\n\n| Name   |   Type   | Description                                                                                                                                                                               |\n| :----- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `tsc`  | `string` | Optional custom tsc command. For example, you can use TypeScript compiler by specifying: `tsc: \"tsc\"`.                                                                                    |\n| `args` | `string` | Optional arguments to pass to the `tsc` CLI. For example, you can configure a custom project directory (with a custom `tsconfig.json` file) using `args: \"--project ./your/custom/path\"`. |\n\n## A Note on Yarn v2 (PnP)\n\nTypeScript does not yet support PnP natively. The workaround is to replace the loading of the TypeScript plugin in `snowpack.config.mjs` with a call to [pnpify](https://yarnpkg.com/advanced/pnpify).\n\n```js\n// See https://github.com/microsoft/TypeScript/issues/28289\n// More info: https://medium.com/swlh/getting-started-with-yarn-2-and-typescript-43321a3acdee\nplugins: [['@snowpack/plugin-typescript', {tsc: 'yarn pnpify tsc'}]];\n```\n"
  },
  {
    "path": "plugins/plugin-typescript/package.json",
    "content": "{\n  \"version\": \"1.2.1\",\n  \"name\": \"@snowpack/plugin-typescript\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-typescript#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-typescript\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"peerDependencies\": {\n    \"typescript\": \"*\"\n  },\n  \"dependencies\": {\n    \"execa\": \"^5.1.1\",\n    \"npm-run-path\": \"^4.0.1\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-typescript/plugin.js",
    "content": "const execa = require('execa');\nconst npmRunPath = require('npm-run-path');\n\nfunction typescriptPlugin(snowpackConfig, {tsc, args} = {}) {\n  return {\n    name: '@snowpack/plugin-typescript',\n    async run({isDev, log}) {\n      const workerPromise = execa.command(\n        `${tsc ? tsc : 'tsc'} ${args ? args : ''} --noEmit ${isDev ? '--watch' : ''}`,\n        {\n          env: npmRunPath.env(),\n          extendEnv: true,\n          windowsHide: false,\n          cwd: snowpackConfig.root || process.cwd(),\n        },\n      );\n      const {stdout, stderr} = workerPromise;\n      function dataListener(chunk) {\n        let stdOutput = chunk.toString();\n        // In --watch mode, handle the \"clear\" character\n        if (stdOutput.includes('\\u001bc') || stdOutput.includes('\\x1Bc')) {\n          log('WORKER_RESET', {});\n          stdOutput = stdOutput.replace(/\\x1Bc/, '').replace(/\\u001bc/, '');\n        }\n        log('WORKER_MSG', {msg: stdOutput});\n      }\n      stdout && stdout.on('data', dataListener);\n      stderr && stderr.on('data', dataListener);\n      return workerPromise.catch((err) => {\n        if (/ENOENT/.test(err.message)) {\n          log('WORKER_MSG', {\n            msg: 'WARN: \"tsc\" run failed. Is typescript installed in your project?',\n          });\n        }\n        throw err;\n      });\n    },\n  };\n}\n\nmodule.exports = typescriptPlugin;\n"
  },
  {
    "path": "plugins/plugin-typescript/test/plugin.test.js",
    "content": "const plugin = require('../plugin.js');\nconst {EventEmitter} = require('events');\n\njest.mock('execa');\nconst execa = require('execa');\n\ndescribe('plugin-typescript', () => {\n  let execaResult, execaFn;\n\n  beforeEach(() => {\n    execa.command.mockClear();\n    execaResult = {\n      stderr: new EventEmitter(),\n      stdout: new EventEmitter(),\n      // Execa is weird, and returns a promise that also has other properties. Fake that here.\n      catch: () => {\n        return execaResult;\n      },\n    };\n    execaFn = jest.fn().mockName('execa.command').mockReturnValue(execaResult);\n    execa.command = execaFn;\n  });\n\n  test('returns the execa command promise', async () => {\n    const p = plugin({});\n    const result = await p.run({isDev: false, log: jest.fn});\n    expect(result).toEqual(execaResult);\n  });\n  test('calls \"tsc\" correctly when isDev=false', async () => {\n    const p = plugin({});\n    await p.run({isDev: false, log: jest.fn});\n    expect(execaFn.mock.calls[0][0]).toContain('--noEmit');\n    expect(execaFn.mock.calls[0][0]).not.toContain('--watch');\n  });\n  test('calls \"tsc --watch\" when isDev=true', async () => {\n    const p = plugin({});\n    await p.run({isDev: true, log: jest.fn});\n    expect(execaFn.mock.calls[0][0]).toContain('--noEmit');\n    expect(execaFn.mock.calls[0][0]).toContain('--watch');\n  });\n  test('calls \"tsc\" correctly with args', async () => {\n    const p = plugin({}, {args: '--foo bar'});\n    await p.run({isDev: false, log: jest.fn});\n    expect(execaFn.mock.calls[0][0]).toContain('--foo bar');\n  });\n  test('calls custom tsc command correctly with args', async () => {\n    const p = plugin({}, {tsc: 'echo', args: 'Echo message'});\n    await p.run({isDev: false, log: jest.fn});\n    expect(execaFn.mock.calls[0][0]).toContain('Echo message');\n  });\n  test('handles tsc output', async () => {\n    const logFn = jest.fn();\n    const p = plugin({});\n    await p.run({isDev: false, log: logFn});\n    execaResult.stdout.emit('data', Buffer.from('STDOUT_TEST_MESSAGE'));\n    execaResult.stderr.emit('data', Buffer.from('STDERR_TEST_MESSAGE'));\n    expect(logFn.mock.calls).toEqual([\n      ['WORKER_MSG', {msg: 'STDOUT_TEST_MESSAGE'}],\n      ['WORKER_MSG', {msg: 'STDERR_TEST_MESSAGE'}],\n    ]);\n  });\n  test('handles tsc clear character messages', async () => {\n    const logFn = jest.fn();\n    const p = plugin({});\n    await p.run({isDev: false, log: logFn});\n    execaResult.stderr.emit('data', Buffer.from('\\u001bcTEST_CLEAR_MESSAGE'));\n    execaResult.stderr.emit('data', Buffer.from('\\x1BcTEST_CLEAR_MESSAGE'));\n    expect(logFn.mock.calls).toEqual([\n      ['WORKER_RESET', {}],\n      ['WORKER_MSG', {msg: 'TEST_CLEAR_MESSAGE'}],\n      ['WORKER_RESET', {}],\n      ['WORKER_MSG', {msg: 'TEST_CLEAR_MESSAGE'}],\n    ]);\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-vue/CHANGELOG.md",
    "content": "# @snowpack/plugin-vue\n\n## 2.6.2\n\n### Patch Changes\n\n- 7cf0e10d: [#3427] Add scopeId to exported components (#3481) <Kevin Ennis>\n\n## 2.6.1\n\n### Patch Changes\n\n- 52a09b7d: Set the `preventAssignment` option in the vue plugin (#3422) <Matthew Phillips>\n\n## 2.6.0\n\n### Minor Changes\n\n- 12410984: Enable proper tree-shaking of Vue's ESM bundler (#3382) <Nate Moore>\n\n### Patch Changes\n\n- 1823b35f: Chore: update docs to refer to snowpack.config.mjs (#3341) <Drew Powers>\n\n## 2.5.0\n\n### Minor Changes\n\n- 4403595e: Sourcemaps (#3271) <Luke Jackson>\n\n## 2.4.0\n\n### Minor Changes\n\n- 5d6ee1f3: Enable CSS Module support in Vue SSR (#3072) <Drew Powers>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-vue)._\n"
  },
  {
    "path": "plugins/plugin-vue/README.md",
    "content": "# @snowpack/plugin-vue\n\nUse the [Vue 3 compiler](https://www.npmjs.com/package/@vue/compiler-sfc) to build your `.vue` SFC files from source.\n\n```\nnpm install --save-dev @snowpack/plugin-vue\n```\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    '@snowpack/plugin-vue',\n    {\n      /* see optional “Plugin Options” below */\n    },\n  ],\n};\n```\n\n## Plugin Options\n\nYou may customize Vue's bundler behavior using the following plugin options.\n\n| Name           |   Type    | Description                                                                                          |\n| :------------- | :-------: | :--------------------------------------------------------------------------------------------------- |\n| `optionsApi`   | `boolean` | Enable/disable [Options API](https://v3.vuejs.org/api/options-api.html) support. Defaults to `true`. |\n| `prodDevtools` | `boolean` | Enable/disable devtools support in production. Defaults to `false`.                                  |\n"
  },
  {
    "path": "plugins/plugin-vue/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-vue\",\n  \"version\": \"2.6.2\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-vue#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-vue\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"@rollup/plugin-replace\": \"^2.4.2\",\n    \"@vue/compiler-sfc\": \"^3.0.10\",\n    \"hash-sum\": \"^2.0.0\"\n  },\n  \"devDependencies\": {\n    \"vue\": \"*\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "plugins/plugin-vue/plugin-tsx-jsx.js",
    "content": "const fs = require('fs');\nconst scriptCompilers = require('./src/script-compilers');\n\nmodule.exports = function plugin(snowpackConfig, pluginOptions) {\n  return {\n    name: '@snowpack/plugin-vue-tsx-jsx',\n    resolve: {\n      input: ['.tsx', '.jsx'],\n      output: ['.js'],\n    },\n    async load({filePath, fileExt}) {\n      const content = fs.readFileSync(filePath, 'utf-8');\n      const lang = fileExt.slice(fileExt.lastIndexOf('.') + 1);\n      const result = scriptCompilers.esbuildCompile(content, lang);\n      return result;\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-vue/plugin.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst hashsum = require('hash-sum');\nconst compiler = require('@vue/compiler-sfc');\nconst scriptCompilers = require('./src/script-compilers');\nconst replace = require('@rollup/plugin-replace');\n\nconst inlineSourcemap = (code, map) =>\n  code +\n  '\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,' +\n  new Buffer(map.toString()).toString('base64');\n\n/** Friendly error display */\nfunction displayError({contents, filePath, error}) {\n  const pad = (number, pad) => `${Array.from(new Array(pad + 1)).join(' ')}${number}`;\n\n  let output = [`${error.toString()}`, `[${filePath}]`];\n  if (error.loc) {\n    output[1] += ` Line ${error.loc.start.line}, Column ${error.loc.start.column}`;\n    const lineNo = (number) =>\n      ' ' +\n      pad(number, (error.loc.end.line + 1).toString().length - number.toString().length) +\n      ' | ';\n    output.push('');\n    const allLines = ['', ...contents.split('\\n')];\n    let currentLine = error.loc.start.line;\n    output.push(lineNo(currentLine - 1) + allLines[currentLine - 1]);\n    while (currentLine <= error.loc.end.line) {\n      output.push(lineNo(currentLine) + allLines[currentLine]);\n      currentLine++;\n    }\n    output.push(\n      Array.from(new Array(error.loc.start.column + lineNo(currentLine - 1).length)).join(' ') +\n        '^',\n    );\n    output.push(lineNo(currentLine) + allLines[currentLine]);\n  }\n  return output.join('\\n');\n}\n\nmodule.exports = function plugin(snowpackConfig, pluginOptions = {}) {\n  // Enable proper tree-shaking for Vue's ESM bundler\n  // See http://link.vuejs.org/feature-flags\n  const packageOptions = snowpackConfig.packageOptions || snowpackConfig.installOptions;\n  if (packageOptions && packageOptions.source === 'local') {\n    packageOptions.rollup = packageOptions.rollup || {};\n    packageOptions.rollup.plugins = packageOptions.rollup.plugins || [];\n    const {optionsApi = true, prodDevtools = false} = pluginOptions;\n    packageOptions.rollup.plugins.push(\n      replace({\n        preventAssignment: false,\n        values: {\n          __VUE_OPTIONS_API__: JSON.stringify(optionsApi),\n          __VUE_PROD_DEVTOOLS__: JSON.stringify(prodDevtools),\n        },\n      }),\n    );\n  }\n  return {\n    name: '@snowpack/plugin-vue',\n    resolve: {\n      input: ['.vue'],\n      output: ['.js', '.css'],\n    },\n    async load({filePath, isSSR}) {\n      const {sourcemap, sourceMaps} = snowpackConfig.buildOptions;\n\n      const id = hashsum(filePath);\n      const contents = fs.readFileSync(filePath, 'utf-8');\n      const {descriptor, errors} = compiler.parse(contents, {filename: filePath});\n\n      // display errors\n      if (errors && errors.length > 0) {\n        throw new Error(displayError({error: errors[0], contents, filePath}));\n      }\n\n      const output = {\n        '.js': {code: '', map: ''},\n        '.css': {code: '', map: ''},\n      };\n\n      if (descriptor.script) {\n        const scriptLang = descriptor.script.lang;\n        let scriptContent = descriptor.script.content;\n        if (['jsx', 'ts', 'tsx'].includes(scriptLang)) {\n          scriptContent = scriptCompilers.esbuildCompile(scriptContent, scriptLang);\n        }\n        if (['js', 'ts'].includes(scriptLang) || !scriptLang) {\n          scriptContent = scriptContent.replace(`export default`, 'const defaultExport =');\n        }\n        output['.js'].code += scriptContent;\n      } else {\n        output['.js'].code += `const defaultExport = {};\\n`;\n      }\n\n      let hasCssModules = false;\n      const cssModules = {};\n\n      await Promise.all(\n        descriptor.styles.map(async (stylePart) => {\n          // note: compileStyleAsync is required for SSR + CSS Modules\n          const css = await compiler.compileStyleAsync({\n            filename: path.relative(snowpackConfig.root || process.cwd(), filePath),\n            source: stylePart.content,\n            id: `data-v-${id}`,\n            scoped: stylePart.scoped != null,\n            modules: stylePart.module != null,\n            ssr: isSSR,\n            preprocessLang: stylePart.lang,\n            // preprocessCustomRequire: (id: string) => require(resolve(root, id))\n            // TODO load postcss config if present\n          });\n\n          // gather CSS Module names\n          if (stylePart.module) {\n            hasCssModules = true;\n            for (const [k, v] of Object.entries(css.modules)) {\n              if (cssModules[k]) console.warn(`CSS Module name reused: ${k}`);\n              cssModules[k] = v;\n            }\n          }\n\n          if (css.errors && css.errors.length > 0) {\n            console.error(JSON.stringify(css.errors));\n          }\n          output['.css'].code += css.code;\n          if ((sourcemap || sourceMaps) && css.map) output['.css'].map += JSON.stringify(css.map);\n        }),\n      );\n\n      if (descriptor.template) {\n        const scoped = descriptor.styles.some((s) => s.scoped);\n\n        const js = compiler.compileTemplate({\n          id,\n          filename: path.relative(snowpackConfig.root || process.cwd(), filePath),\n          source: descriptor.template.content,\n          ssr: isSSR,\n          ssrCssVars: [],\n          preprocessLang: descriptor.template.lang,\n          compilerOptions: {\n            scopeId: scoped ? `data-v-${id}` : null,\n          },\n        });\n        if (js.errors && js.errors.length > 0) {\n          console.error(JSON.stringify(js.errors));\n        }\n\n        const renderFn = isSSR ? `ssrRender` : `render`;\n\n        if (output['.js'].code) output['.js'].code += '\\n';\n        output['.js'].code += `${js.code.replace(/;?$/, ';')}`; // add trailing semicolon if missing (helps with some SSR cases)\n        output['.js'].code += `\\n\\ndefaultExport.${renderFn} = ${renderFn};`;\n\n        if (scoped) {\n          output['.js'].code += `\\n\\ndefaultExport.__scopeId = \"data-v-${id}\";`;\n        }\n\n        // inject CSS Module styles, if needed\n        if (hasCssModules) {\n          // Note: this injection code is inspired by the official vue-loader for webpack and plays nicely with Vue.\n          // But adjustments were needed to work with Snowpack.\n          // See https://github.com/vuejs/vue-loader/blob/master/lib/codegen/styleInjection.js#L51\n          const styleInjectionCode = `  const cssModules = ${JSON.stringify(cssModules)};\n  Object.defineProperty(_ctx, '$style', {\n    configurable: true,\n    get: function() {\n      return cssModules;\n    }\n  })\\n`;\n          output['.js'].code = output['.js'].code.replace(\n            new RegExp(`(function ${renderFn}\\\\([^\\n]+)`),\n            `$1\\n${styleInjectionCode}`,\n          );\n        }\n        output['.js'].code += `\\n\\nexport default defaultExport;`;\n\n        if ((sourcemap || sourceMaps) && js.map) {\n          output['.js'].code = inlineSourcemap(output['.js'].code, JSON.stringify(js.map));\n          output['.js'].map += JSON.stringify(js.map);\n        }\n      }\n\n      // clean up\n      if (!output['.js'].code) delete output['.js'];\n      if (!output['.css'].code) delete output['.css'];\n\n      return output;\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-vue/src/script-compilers.js",
    "content": "/*\n\nThis license applies to parts of this file originating from the\nhttps://github.com/vitejs/vite repository:\n\nMIT License\n\nCopyright (c) 2019-present, Yuxi (Evan) You\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nconst esbuild = require('esbuild');\n\nconst codeSnippetH = `import { Fragment } from 'vue';`;\n\n// https://github.com/vitejs/vite/blob/master/src/client/vueJsxCompat.ts\nconst codeSnippetVueJsxCompat = `import {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}`;\n\n/**\n * @param {string} content\n * @param {'jsx' | 'ts' | 'tsx'} lang\n */\nconst esbuildCompile = (content, lang) => {\n  let result = '';\n  if (['jsx', 'tsx'].includes(lang)) {\n    result += `${codeSnippetH}\\n`;\n    result += `${codeSnippetVueJsxCompat}\\n`;\n  }\n  const {code} = esbuild.transformSync(content, {\n    loader: lang,\n    jsxFactory: 'jsx',\n    jsxFragment: 'Fragment',\n  });\n  result += `\\n${code.trim()}\\n`;\n  return result.trim();\n};\n\nmodule.exports = {\n  esbuildCompile,\n};\n"
  },
  {
    "path": "plugins/plugin-vue/test/__snapshots__/plugin-tsx-jsx.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`plugin with jsx 1`] = `\n\"import { Fragment } from 'vue';\nimport {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}\n\nimport {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"JsxContent\\\\\",\n  setup() {\n    return () => /* @__PURE__ */ jsx(Fragment, null, /* @__PURE__ */ jsx(\\\\\"h1\\\\\", null, \\\\\"JsxContent\\\\\"));\n  }\n});\"\n`;\n\nexports[`plugin with tsx 1`] = `\n\"import { Fragment } from 'vue';\nimport {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}\n\nimport {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"TsxContent\\\\\",\n  setup() {\n    const name = \\\\\"TsxContent\\\\\";\n    return () => /* @__PURE__ */ jsx(Fragment, null, /* @__PURE__ */ jsx(\\\\\"h1\\\\\", null, \\\\\"TsxContent\\\\\"));\n  }\n});\"\n`;\n"
  },
  {
    "path": "plugins/plugin-vue/test/__snapshots__/plugin-vue-ts-tsx-jsx.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`plugin vue with jsx 1`] = `\nObject {\n  \".js\": Object {\n    \"code\": \"import { Fragment } from 'vue';\nimport {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}\n\nimport {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"VueContentJsx\\\\\",\n  setup() {\n    return () => /* @__PURE__ */ jsx(Fragment, null, /* @__PURE__ */ jsx(\\\\\"h1\\\\\", null, \\\\\"VueContentJsx\\\\\"));\n  }\n});\",\n    \"map\": \"\",\n  },\n}\n`;\n\nexports[`plugin vue with ts 1`] = `\nObject {\n  \".js\": Object {\n    \"code\": \"import {defineComponent} from \\\\\"vue\\\\\";\nconst defaultExport = defineComponent({\n  name: \\\\\"VueContentTs\\\\\",\n  setup() {\n    const name = \\\\\"VueContentTs\\\\\";\n  }\n});\nimport { openBlock as _openBlock, createBlock as _createBlock } from \\\\\"vue\\\\\"\n\nexport function render(_ctx, _cache) {\n  return (_openBlock(), _createBlock(\\\\\"h1\\\\\", null, \\\\\"Vue Content Ts\\\\\"))\n};\n\ndefaultExport.render = render;\n\nexport default defaultExport;\",\n    \"map\": \"\",\n  },\n}\n`;\n\nexports[`plugin vue with tsx 1`] = `\nObject {\n  \".js\": Object {\n    \"code\": \"import { Fragment } from 'vue';\nimport {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}\n\nimport {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"VueContentTsx\\\\\",\n  setup() {\n    const name = \\\\\"VueContentTsx\\\\\";\n    return () => /* @__PURE__ */ jsx(Fragment, null, /* @__PURE__ */ jsx(\\\\\"h1\\\\\", null, \\\\\"VueContentTsx\\\\\"));\n  }\n});\",\n    \"map\": \"\",\n  },\n}\n`;\n"
  },
  {
    "path": "plugins/plugin-vue/test/__snapshots__/plugin.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`plugin base 1`] = `\nObject {\n  \".css\": Object {\n    \"code\": \"\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\nfrom {\n    transform: scale(1);\n}\nto {\n    transform: scale(1.06);\n}\n}\n\",\n    \"map\": \"\",\n  },\n  \".js\": Object {\n    \"code\": \"\nconst defaultExport = {\n  data() {\n    return {\n      message: \\\\\"Learn Vue\\\\\"\n    };\n  }\n};\n\nimport { createVNode as _createVNode, createTextVNode as _createTextVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createBlock as _createBlock } from \\\\\"vue\\\\\"\n\nconst _hoisted_1 = { class: \\\\\"App\\\\\" }\nconst _hoisted_2 = { class: \\\\\"App-header\\\\\" }\nconst _hoisted_3 = /*#__PURE__*/_createVNode(\\\\\"img\\\\\", {\n  src: \\\\\"/logo.svg\\\\\",\n  class: \\\\\"App-logo\\\\\",\n  alt: \\\\\"logo\\\\\"\n}, null, -1 /* HOISTED */)\nconst _hoisted_4 = /*#__PURE__*/_createVNode(\\\\\"p\\\\\", null, [\n  /*#__PURE__*/_createTextVNode(\\\\\" Edit \\\\\"),\n  /*#__PURE__*/_createVNode(\\\\\"code\\\\\", null, \\\\\"src/App.vue\\\\\"),\n  /*#__PURE__*/_createTextVNode(\\\\\" and save to reload. \\\\\")\n], -1 /* HOISTED */)\nconst _hoisted_5 = {\n  class: \\\\\"App-link\\\\\",\n  href: \\\\\"https://vuejs.org\\\\\",\n  target: \\\\\"_blank\\\\\",\n  rel: \\\\\"noopener noreferrer\\\\\"\n}\n\nexport function render(_ctx, _cache) {\n  return (_openBlock(), _createBlock(\\\\\"div\\\\\", _hoisted_1, [\n    _createVNode(\\\\\"header\\\\\", _hoisted_2, [\n      _hoisted_3,\n      _hoisted_4,\n      _createVNode(\\\\\"a\\\\\", _hoisted_5, _toDisplayString(_ctx.message), 1 /* TEXT */)\n    ])\n  ]))\n};\n\ndefaultExport.render = render;\n\nexport default defaultExport;\",\n    \"map\": \"\",\n  },\n}\n`;\n\nexports[`plugin base only tpl 1`] = `\nObject {\n  \".js\": Object {\n    \"code\": \"const defaultExport = {};\n\nimport { openBlock as _openBlock, createBlock as _createBlock } from \\\\\"vue\\\\\"\n\nexport function render(_ctx, _cache) {\n  return (_openBlock(), _createBlock(\\\\\"h1\\\\\", null, \\\\\"Vue Content Only Tpl\\\\\"))\n};\n\ndefaultExport.render = render;\n\nexport default defaultExport;\",\n    \"map\": \"\",\n  },\n}\n`;\n\nexports[`plugin base style scoped 1`] = `\nObject {\n  \".css\": Object {\n    \"code\": \"\nh1[data-v-XXXXXXXX] {\n  color: red;\n}\n\",\n    \"map\": \"\",\n  },\n  \".js\": Object {\n    \"code\": \"\nconst defaultExport = {};\n\nimport { openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from \\\\\"vue\\\\\"\nconst _withId = /*#__PURE__*/_withScopeId(\\\\\"data-v-XXXXXXXX\\\\\")\n\nexport const render = /*#__PURE__*/_withId((_ctx, _cache) => {\n  return (_openBlock(), _createBlock(\\\\\"h1\\\\\", null, \\\\\"Vue Content Style Scoped\\\\\"))\n});\n\ndefaultExport.render = render;\n\ndefaultExport.__scopeId = \\\\\"data-v-XXXXXXXX\\\\\";\n\nexport default defaultExport;\",\n    \"map\": \"\",\n  },\n}\n`;\n\nexports[`plugin base with sourceMap 1`] = `\nObject {\n  \".css\": Object {\n    \"code\": \"\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\nfrom {\n    transform: scale(1);\n}\nto {\n    transform: scale(1.06);\n}\n}\n\",\n    \"map\": \"\",\n  },\n  \".js\": Object {\n    \"code\": \"\nconst defaultExport = {\n  data() {\n    return {\n      message: \\\\\"Learn Vue\\\\\"\n    };\n  }\n};\n\nimport { createVNode as _createVNode, createTextVNode as _createTextVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createBlock as _createBlock } from \\\\\"vue\\\\\"\n\nconst _hoisted_1 = { class: \\\\\"App\\\\\" }\nconst _hoisted_2 = { class: \\\\\"App-header\\\\\" }\nconst _hoisted_3 = /*#__PURE__*/_createVNode(\\\\\"img\\\\\", {\n  src: \\\\\"/logo.svg\\\\\",\n  class: \\\\\"App-logo\\\\\",\n  alt: \\\\\"logo\\\\\"\n}, null, -1 /* HOISTED */)\nconst _hoisted_4 = /*#__PURE__*/_createVNode(\\\\\"p\\\\\", null, [\n  /*#__PURE__*/_createTextVNode(\\\\\" Edit \\\\\"),\n  /*#__PURE__*/_createVNode(\\\\\"code\\\\\", null, \\\\\"src/App.vue\\\\\"),\n  /*#__PURE__*/_createTextVNode(\\\\\" and save to reload. \\\\\")\n], -1 /* HOISTED */)\nconst _hoisted_5 = {\n  class: \\\\\"App-link\\\\\",\n  href: \\\\\"https://vuejs.org\\\\\",\n  target: \\\\\"_blank\\\\\",\n  rel: \\\\\"noopener noreferrer\\\\\"\n}\n\nexport function render(_ctx, _cache) {\n  return (_openBlock(), _createBlock(\\\\\"div\\\\\", _hoisted_1, [\n    _createVNode(\\\\\"header\\\\\", _hoisted_2, [\n      _hoisted_3,\n      _hoisted_4,\n      _createVNode(\\\\\"a\\\\\", _hoisted_5, _toDisplayString(_ctx.message), 1 /* TEXT */)\n    ])\n  ]))\n};\n\ndefaultExport.render = render;\n\nexport default defaultExport;\",\n    \"map\": \"\",\n  },\n}\n`;\n"
  },
  {
    "path": "plugins/plugin-vue/test/__snapshots__/script-compilers.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`esbuildCompile jsx 1`] = `\n\"import { Fragment } from 'vue';\nimport {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}\n\nimport {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"JsxContent\\\\\",\n  setup() {\n    return () => /* @__PURE__ */ jsx(Fragment, null, /* @__PURE__ */ jsx(\\\\\"h1\\\\\", null, \\\\\"JsxContent\\\\\"));\n  }\n});\"\n`;\n\nexports[`esbuildCompile ts 1`] = `\n\"import {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"TsContent\\\\\",\n  setup() {\n    const name = \\\\\"TsContent\\\\\";\n  }\n});\"\n`;\n\nexports[`esbuildCompile tsx 1`] = `\n\"import { Fragment } from 'vue';\nimport {createVNode, isVNode} from 'vue';\nconst slice = Array.prototype.slice;\nexport function jsx(tag, props = null, children = null) {\n  if (arguments.length > 3 || isVNode(children)) {\n    children = slice.call(arguments, 2);\n  }\n  return createVNode(tag, props, children);\n}\n\nimport {defineComponent} from \\\\\"vue\\\\\";\nexport default defineComponent({\n  name: \\\\\"TsxContent\\\\\",\n  setup() {\n    const name = \\\\\"TsxContent\\\\\";\n    return () => /* @__PURE__ */ jsx(Fragment, null, /* @__PURE__ */ jsx(\\\\\"h1\\\\\", null, \\\\\"TsxContent\\\\\"));\n  }\n});\"\n`;\n"
  },
  {
    "path": "plugins/plugin-vue/test/plugin-tsx-jsx.test.js",
    "content": "const path = require('path');\nconst pluginTsxJsx = require('../plugin-tsx-jsx.js');\n\ntest('plugin with tsx', async () => {\n  const pluginInstance = pluginTsxJsx({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/TsxContent.tsx');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n    fileExt: '.tsx',\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('plugin with jsx', async () => {\n  const pluginInstance = pluginTsxJsx({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/JsxContent.jsx');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n    fileExt: '.jsx',\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/plugin-vue-ts-tsx-jsx.test.js",
    "content": "const path = require('path');\nconst plugin = require('../plugin');\n\ntest('plugin vue with ts', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContentTs.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('plugin vue with tsx', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContentTsx.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('plugin vue with jsx', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContentJsx.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/plugin.test.js",
    "content": "const path = require('path');\nconst plugin = require('../plugin');\n\ntest('plugin base', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: false,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContent.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('plugin base with sourceMap', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContent.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('plugin base only tpl', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContentOnlyTpl.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('plugin base style scoped', async () => {\n  const pluginInstance = plugin({\n    buildOptions: {\n      sourceMap: true,\n    },\n  });\n  const pluginLoad = pluginInstance.load;\n  const codeFilePath = path.resolve(__dirname, './stubs/VueContentStyleScoped.vue');\n  const resultContent = await pluginLoad({\n    filePath: codeFilePath,\n  });\n  ['.css', '.js'].forEach((key) => {\n    const code = resultContent[key].code;\n    resultContent[key].code = code.replace(/data-v-[a-z0-9]+/g, 'data-v-XXXXXXXX');\n  });\n  expect(resultContent).toMatchSnapshot();\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/script-compilers.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst scriptCompilers = require('../src/script-compilers');\n\ntest('esbuildCompile ts', () => {\n  const {esbuildCompile} = scriptCompilers;\n  const codeContent = fs.readFileSync(path.resolve(__dirname, './stubs/TsContent.ts')).toString();\n  const resultContent = esbuildCompile(codeContent, 'ts');\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('esbuildCompile tsx', () => {\n  const {esbuildCompile} = scriptCompilers;\n  const codeContent = fs.readFileSync(path.resolve(__dirname, './stubs/TsxContent.tsx')).toString();\n  const resultContent = esbuildCompile(codeContent, 'tsx');\n  expect(resultContent).toMatchSnapshot();\n});\n\ntest('esbuildCompile jsx', () => {\n  const {esbuildCompile} = scriptCompilers;\n  const codeContent = fs.readFileSync(path.resolve(__dirname, './stubs/JsxContent.jsx')).toString();\n  const resultContent = esbuildCompile(codeContent, 'jsx');\n  expect(resultContent).toMatchSnapshot();\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/JsxContent.jsx",
    "content": "import {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'JsxContent',\n  setup() {\n    return () => (\n      <>\n        <h1>JsxContent</h1>\n      </>\n    );\n  },\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/TsContent.ts",
    "content": "import {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'TsContent',\n  setup() {\n    const name: string = 'TsContent';\n  },\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/TsxContent.tsx",
    "content": "import {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'TsxContent',\n  setup() {\n    const name: string = 'TsxContent';\n    return () => (\n      <>\n        <h1>TsxContent</h1>\n      </>\n    );\n  },\n});\n"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/VueContent.vue",
    "content": "<template>\n  <div class=\"App\">\n    <header class=\"App-header\">\n      <img src=\"/logo.svg\" class=\"App-logo\" alt=\"logo\" />\n      <p>\n        Edit\n        <code>src/App.vue</code> and save to reload.\n      </p>\n      <a\n        class=\"App-link\"\n        href=\"https://vuejs.org\"\n        target=\"_blank\"\n        rel=\"noopener noreferrer\"\n      >{{ message }}</a>\n    </header>\n  </div>\n</template>\n\n<script>\nexport default {\n  data() {\n    return {\n      message: \"Learn Vue\"\n    };\n  }\n};\n</script>\n\n<style>\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\n</style>\n"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/VueContentJsx.vue",
    "content": "<script lang=\"jsx\">\nimport {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'VueContentJsx',\n  setup() {\n    return () => (\n      <>\n        <h1>VueContentJsx</h1>\n      </>\n    );\n  },\n});\n</script>"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/VueContentOnlyTpl.vue",
    "content": "<template>\n  <h1>Vue Content Only Tpl</h1>\n</template>"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/VueContentStyleScoped.vue",
    "content": "<template>\n  <h1>Vue Content Style Scoped</h1>\n</template>\n\n<script>\nexport default {};\n</script>\n\n<style lang=\"css\" scoped>\nh1 {\n  color: red;\n}\n</style>"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/VueContentTs.vue",
    "content": "<template>\n  <h1>Vue Content Ts</h1>\n</template>\n\n<script lang=\"ts\">\nimport {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'VueContentTs',\n  setup() {\n    const name: string = 'VueContentTs';\n  },\n});\n</script>"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/VueContentTsx.vue",
    "content": "<script lang=\"tsx\">\nimport {defineComponent} from 'vue';\n\nexport default defineComponent({\n  name: 'VueContentTsx',\n  setup() {\n    const name: string = 'VueContentTsx';\n    return () => (\n      <>\n        <h1>VueContentTsx</h1>\n      </>\n    );\n  },\n});\n</script>"
  },
  {
    "path": "plugins/plugin-vue/test/stubs/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"jsx\": \"preserve\",\n    \"jsxFactory\": \"h\",\n    \"jsxFragmentFactory\": \"Fragment\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-webpack/.gitignore",
    "content": "test/stubs/*_ignore/\n"
  },
  {
    "path": "plugins/plugin-webpack/CHANGELOG.md",
    "content": "# @snowpack/plugin-webpack\n\n## 3.0.0\n\n### Major Changes\n\n- c57b57a0: upgraded plugin-webpack to webpack 5 (#3154) <mcha>\n\n### Patch Changes\n\n- e93e5379: [ci] yarn format <drwpow>\n- 75c99b2f: use Webpack's output.path for emitted HTML (#3255) <Adam Lovatt>\n- 1823b35f: Chore: update docs to refer to snowpack.config.mjs (#3341) <Drew Powers>\n- 19b236df: [ci] yarn format <drwpow>\n- e9e8fb70: avoid conflicting JS entries when parsing HTML for Webpack (#3247) <Adam Lovatt>\n- e1bb3b89: [ci] yarn format <drwpow>\n- 9712f979: fix Webpack error formatting (#3256) <Adam Lovatt>\n- b0a1f206: Remove TSX components from app-template-vue-typescript (#3236) <Drew Powers>\n- 9091b598: [ci] yarn format <drwpow>\n- 9eb50368: update deps (#2928)\n- 56c5a231: fix typo in changelog\n\n## 2.3.1\n\n## Patch Changes\n\n- f154a879: Refactor plugin-webpack tests (#2517) <Francisco Sousa>\n- 41c29f25: [ci] yarn format\n- 83616faa: Keep original HTML attributes on script tags (#2498) <Francisco Sousa>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/plugin-webpack)._\n"
  },
  {
    "path": "plugins/plugin-webpack/README.md",
    "content": "# @snowpack/plugin-webpack\n\nUse Webpack to bundle your Snowpack project for production when you run `snowpack build`.\n\nSee our [build pipeline](https://www.snowpack.dev/concepts/build-pipeline) docs for more information.\n\n### Install\n\n```\nnpm install --save-dev @snowpack/plugin-webpack\n```\n\nThen add `@snowpack/plugin-webpack` to `snowpack.config.mjs`:\n\n```js\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-webpack',\n      {\n        /* see \"Plugin Options\" below */\n      },\n    ],\n  ],\n};\n```\n\nOnce added to the configuration, `@snowpack/plugin-webpack` will run automatically on `snowpack build`.\n\n### Plugin Options\n\n- `sourceMap: boolean` - Enable sourcemaps in the bundled output.\n- `outputPattern: {css: string, js: string, assets: string}` - Set the URL for your final bundled files. This is where they will be written to disk in the `build/` directory. See Webpack's [`output.filename`](https://webpack.js.org/configuration/output/#outputfilename) documentation for examples of valid values.\n- `extendConfig: (config: WebpackConfig) => WebpackConfig` - extend your webpack config, see below.\n- `manifest: boolean | string` - Enable generating a manifest file. The default value is `false`, the default file name is `./asset-manifest.json` if setting manifest to `true`. The relative path is resolved from the output directory.\n- `htmlMinifierOptions: boolean | object` - [See below](#minify-html).\n- `failOnWarnings: boolean` - Does fail the build when Webpack emits warnings. The default value is `false`.\n\n#### Extending The Default Webpack Config\n\nThe `extendConfig` option is a function that you can provide to configure the default webpack config. If you provide this function, the plugin will pass its return value to `webpack.compile()`. Use this to make changes, add plugins, configure loaders, etc.\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-webpack',\n      {\n        extendConfig: (config) => {\n          config.plugins.push(/* ... */);\n          return config;\n        },\n      },\n    ],\n  ],\n};\n```\n\n#### Minify HTML\n\nWith `htmlMinifierOptions` you can either disable the minification entirely or provide your own [options](https://github.com/kangax/html-minifier#options-quick-reference).\n\n```js\n// snowpack.config.mjs\nexport default {\n  plugins: [\n    [\n      '@snowpack/plugin-webpack',\n      {\n        htmlMinifierOptions: false, // disabled entirely,\n      },\n    ],\n  ],\n};\n```\n\nThe default options are:\n\n```js\n{\n  collapseWhitespace: true,\n  removeComments: true,\n  removeEmptyAttributes: true,\n  removeRedundantAttributes: true,\n  removeScriptTypeAttributes: true,\n  removeStyleLinkTypeAttributes: true,\n}\n```\n"
  },
  {
    "path": "plugins/plugin-webpack/package.json",
    "content": "{\n  \"name\": \"@snowpack/plugin-webpack\",\n  \"version\": \"3.0.0\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/withastro/snowpack/tree/main/plugins/plugin-webpack#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/plugin-webpack\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.13.16\",\n    \"@babel/preset-env\": \"^7.13.15\",\n    \"babel-loader\": \"^8.1.0\",\n    \"core-js\": \"^3.10.2\",\n    \"css-loader\": \"^5.2.4\",\n    \"css-minimizer-webpack-plugin\": \"^2.0.0\",\n    \"glob\": \"^7.1.6\",\n    \"html-minifier\": \"^4.0.0\",\n    \"jsdom\": \"^16.5.3\",\n    \"mini-css-extract-plugin\": \"^1.4.1\",\n    \"webpack\": \"^5.34.0\",\n    \"webpack-manifest-plugin\": \"^3.1.1\"\n  },\n  \"devDependencies\": {\n    \"fs-extra\": \"^9.1.0\"\n  }\n}\n"
  },
  {
    "path": "plugins/plugin-webpack/plugin.js",
    "content": "const crypto = require('crypto');\nconst fs = require('fs');\nconst glob = require('glob');\nconst path = require('path');\nconst util = require('util');\nconst url = require('url');\nconst webpack = require('webpack');\nconst MiniCssExtractPlugin = require('mini-css-extract-plugin');\nconst CssMinimizerPlugin = require('css-minimizer-webpack-plugin');\nconst {WebpackManifestPlugin} = require('webpack-manifest-plugin');\nconst jsdom = require('jsdom');\nconst {JSDOM} = jsdom;\nconst minify = require('html-minifier').minify;\n\nfunction insertBefore(newNode, existingNode) {\n  existingNode.parentNode.insertBefore(newNode, existingNode);\n}\n\nfunction ensureDirectoryExists(dir) {\n  if (!fs.existsSync(dir)) {\n    fs.mkdirSync(dir, {recursive: true});\n  }\n}\n\nfunction parseHTMLFiles({buildDirectory}) {\n  // Get all html files from the output folder\n  const pattern = buildDirectory + '/**/*.html';\n  const htmlFiles = glob.sync(pattern).map((htmlPath) => path.relative(buildDirectory, htmlPath));\n\n  const doms = {};\n  const jsEntries = {};\n  for (const htmlFile of htmlFiles) {\n    const dom = new JSDOM(fs.readFileSync(path.join(buildDirectory, htmlFile)));\n\n    //Find all local script, use it as the entrypoint\n    const scripts = Array.from(dom.window.document.querySelectorAll('script'))\n      .filter((el) => el.type.trim().toLowerCase() === 'module')\n      .filter((el) => !/^[a-zA-Z]+:\\/\\//.test(el.src));\n\n    for (const el of scripts) {\n      const src = el.src.trim();\n      const parsedPath = path.parse(src);\n\n      // Using path + filename to avoid problems if files have the same name, i.e.\n      // /index.js and /admin/index.js\n      const name = path\n        .join(parsedPath.dir, parsedPath.name)\n        .replace(/\\\\/g, '/')\n        // Paths other than the root will have a leading separator\n        .replace(/^\\//, '');\n\n      if (!(name in jsEntries)) {\n        jsEntries[name] = {\n          path: path.join(buildDirectory, src),\n          occurrences: [],\n        };\n      }\n      jsEntries[name].occurrences.push({script: el, dom});\n    }\n\n    doms[htmlFile] = dom;\n  }\n  return {doms, jsEntries};\n}\n\nfunction emitHTMLFiles({doms, jsEntries, stats, baseUrl, outputDirectory, htmlMinifierOptions}) {\n  const entrypoints = stats.toJson({assets: false, hash: true}).entrypoints;\n\n  //Now that webpack is done, modify the html files to point to the newly compiled resources\n  Object.keys(jsEntries).forEach((name) => {\n    if (entrypoints[name] !== undefined && entrypoints[name]) {\n      const assetFiles = entrypoints[name].assets || [];\n      const jsFiles = assetFiles.filter((d) => d.name.endsWith('.js'));\n      const cssFiles = assetFiles.filter((d) => d.name.endsWith('.css'));\n\n      for (const occurrence of jsEntries[name].occurrences) {\n        const originalScriptEl = occurrence.script;\n        const dom = occurrence.dom;\n        const head = dom.window.document.querySelector('head');\n\n        for (const jsFile of jsFiles) {\n          // Clone node so we keep original attributes, and remove\n          // `type=module` as that is not needed\n          const scriptEl = originalScriptEl.cloneNode();\n          scriptEl.removeAttribute('type');\n          scriptEl.src = url.parse(baseUrl).protocol\n            ? url.resolve(baseUrl, jsFile.name)\n            : path.posix.join(baseUrl, jsFile.name);\n          // insert _before_ so the relative order of these scripts is maintained\n          insertBefore(scriptEl, originalScriptEl);\n        }\n        for (const cssFile of cssFiles) {\n          const linkEl = dom.window.document.createElement('link');\n          linkEl.setAttribute('rel', 'stylesheet');\n          linkEl.href = url.parse(baseUrl).protocol\n            ? url.resolve(baseUrl, cssFile.name)\n            : path.posix.join(baseUrl, cssFile.name);\n          head.append(linkEl);\n        }\n        originalScriptEl.remove();\n      }\n    }\n  });\n\n  //And write our modified html files out to the destination\n  for (const [htmlFile, dom] of Object.entries(doms)) {\n    const html = htmlMinifierOptions\n      ? minify(dom.serialize(), htmlMinifierOptions)\n      : dom.serialize();\n\n    const outputFile = path.join(outputDirectory, htmlFile);\n    // If the user specified a different output, we may not have an existing folder structure\n    ensureDirectoryExists(path.dirname(outputFile));\n    fs.writeFileSync(outputFile, html);\n  }\n}\n\nfunction getSplitChunksConfig({numEntries}) {\n  const isCss = (module) => module.type === `css/mini-extract`;\n  /**\n   * Implements a version of granular chunking, as described at https://web.dev/granular-chunking-nextjs/.\n   */\n  return {\n    chunks: 'all',\n    maxInitialRequests: 25,\n    minSize: 20000,\n    cacheGroups: {\n      default: false,\n      vendors: false,\n      /**\n       * NPM libraries larger than 100KB are pulled into their own chunk\n       *\n       * We use a smaller cutoff than the reference implementation (which does 150KB),\n       * because our babel-loader config compresses whitespace with `compact: true`.\n       */\n      lib: {\n        test(module) {\n          return (\n            !isCss(module) &&\n            module.size() > 100000 &&\n            /_snowpack[/\\\\]pkg[/\\\\]/.test(module.identifier())\n          );\n        },\n        name(module) {\n          /**\n           * Name the chunk based on the filename in /pkg/*.\n           *\n           * E.g. /pkg/moment.js -> lib-moment.HASH.js\n           */\n          const ident = module.libIdent({context: 'dir'});\n          const lastItem = ident\n            .split('/')\n            .reduceRight((item) => item)\n            .replace(/\\.js$/, '');\n          return `lib-${lastItem}`;\n        },\n        priority: 30,\n        minChunks: 1,\n        reuseExistingChunk: true,\n      },\n      // modules used by all entrypoints end up in commons\n      commons: {\n        test(module) {\n          return !isCss(module);\n        },\n        name: 'commons',\n        // don't create a commons chunk until there are 2+ entries\n        minChunks: Math.max(2, numEntries),\n        priority: 20,\n      },\n      // modules used by multiple chunks can be pulled into shared chunks\n      shared: {\n        test(module) {\n          return !isCss(module);\n        },\n        name(module, chunks) {\n          const hash = crypto\n            .createHash(`sha1`)\n            .update(chunks.reduce((acc, chunk) => acc + chunk.name, ``))\n            .digest(`hex`);\n\n          return hash;\n        },\n        priority: 10,\n        minChunks: 2,\n        reuseExistingChunk: true,\n      },\n      // Bundle all css & lazy css into one stylesheet to make sure lazy components do not break\n      styles: {\n        test(module) {\n          return isCss(module);\n        },\n        name: `styles`,\n        priority: 40,\n        enforce: true,\n      },\n    },\n  };\n}\n\nfunction getPresetEnvTargets({browserslist}) {\n  if (Array.isArray(browserslist) || typeof browserslist === 'string') {\n    return browserslist;\n  } else if (typeof browserslist === 'object' && 'production' in browserslist) {\n    return browserslist.production;\n  } else {\n    return '>0.75%, not ie 11, not UCAndroid >0, not OperaMini all';\n  }\n}\n\nmodule.exports = function plugin(config, args = {}) {\n  // Deprecated: args.mode\n  if (args.mode && args.mode !== 'production') {\n    throw new Error('args.mode support has been removed.');\n  }\n  // Validate: args.outputPattern\n  args.outputPattern = args.outputPattern || {};\n  const jsOutputPattern = args.outputPattern.js || 'js/[name].[contenthash].js';\n  const cssOutputPattern = args.outputPattern.css || 'css/[name].[contenthash].css';\n  const assetsOutputPattern = args.outputPattern.assets || 'assets/[name].[contenthash][ext]';\n  if (!jsOutputPattern.endsWith('.js')) {\n    throw new Error('Output Pattern for JS must end in .js');\n  }\n  if (!cssOutputPattern.endsWith('.css')) {\n    throw new Error('Output Pattern for CSS must end in .css');\n  }\n\n  // Default options for HTMLMinifier\n  // https://github.com/kangax/html-minifier#options-quick-reference\n  const defaultHtmlMinifierOptions = {\n    collapseWhitespace: true,\n    removeComments: true,\n    removeEmptyAttributes: true,\n    removeRedundantAttributes: true,\n    removeScriptTypeAttributes: true,\n    removeStyleLinkTypeAttributes: true,\n  };\n\n  const htmlMinifierOptions =\n    args.htmlMinifierOptions === false\n      ? false\n      : Object.assign({}, defaultHtmlMinifierOptions, args.htmlMinifierOptions);\n\n  const manifest =\n    typeof args.manifest === 'string'\n      ? args.manifest\n      : !!args.manifest\n      ? './asset-manifest.json'\n      : undefined;\n\n  // Webpack handles minification for us, so its safe to always\n  // disable Snowpack's default minifier.\n  config.buildOptions.minify = false;\n  // Webpack creates unique file hashes for all generated bundles,\n  // so we clean the build directory before building to remove outdated\n  // build artifacts.\n  config.buildOptions.clean = true;\n\n  return {\n    name: '@snowpack/plugin-webpack',\n    async optimize({buildDirectory, log}) {\n      const buildOptions = config.buildOptions || {};\n      let baseUrl = buildOptions.baseUrl || '/';\n      const tempBuildManifest = JSON.parse(\n        await fs.readFileSync(path.join(config.root || process.cwd(), 'package.json'), {\n          encoding: 'utf-8',\n        }),\n      );\n      const presetEnvTargets = getPresetEnvTargets(tempBuildManifest);\n\n      let extendConfig = (cfg) => cfg;\n      if (typeof args.extendConfig === 'function') {\n        extendConfig = args.extendConfig;\n      } else if (typeof args.extendConfig === 'object') {\n        extendConfig = (cfg) => ({...cfg, ...args.extendConfig});\n      }\n\n      const {doms, jsEntries} = parseHTMLFiles({buildDirectory});\n\n      if (Object.keys(jsEntries).length === 0) {\n        throw new Error(\"Can't bundle without script tag in html\");\n      }\n\n      //Compile files using webpack\n      let webpackConfig = {\n        context: buildDirectory,\n        resolve: {\n          alias: {\n            // TODO: Support a custom config.buildOptions.metaUrlPath\n            '/_snowpack': path.join(buildDirectory, '_snowpack'),\n            '/__snowpack__': path.join(buildDirectory, '__snowpack__'),\n            '/web_modules': path.join(buildDirectory, 'web_modules'),\n          },\n        },\n        module: {\n          rules: [\n            {\n              test: /\\.js$/,\n              exclude: /node_modules/,\n              use: [\n                {\n                  loader: require.resolve('babel-loader'),\n                  options: {\n                    cwd: buildDirectory,\n                    configFile: false,\n                    babelrc: false,\n                    compact: true,\n                    presets: [\n                      [\n                        require.resolve('@babel/preset-env'),\n                        {\n                          targets: presetEnvTargets,\n                          bugfixes: true,\n                          modules: false,\n                          useBuiltIns: 'usage',\n                          corejs: 3,\n                        },\n                      ],\n                    ],\n                  },\n                },\n                {\n                  loader: require.resolve('./plugins/import-meta-fix.js'),\n                },\n                {\n                  loader: require.resolve('./plugins/proxy-import-resolve.js'),\n                },\n              ],\n            },\n            {\n              test: /\\.css$/,\n              exclude: /\\.module\\.css$/,\n              use: [\n                {\n                  loader: MiniCssExtractPlugin.loader,\n                },\n                {\n                  loader: require.resolve('css-loader'),\n                },\n              ],\n            },\n            {\n              test: /\\.module\\.css$/,\n              use: [\n                {\n                  loader: MiniCssExtractPlugin.loader,\n                },\n                {\n                  loader: require.resolve('css-loader'),\n                  options: {\n                    modules: true,\n                  },\n                },\n              ],\n            },\n            {\n              test: /.*/,\n              exclude: [/\\.js?$/, /\\.json?$/, /\\.css$/],\n              // When using old assets loaders (i.e. file-loader/url-loader/raw-loader)\n              // make sure to set 'javascript/auto' flag\n              // https://webpack.js.org/guides/asset-modules/\n              type: 'asset/resource',\n              generator: {\n                filename: assetsOutputPattern,\n              },\n            },\n          ],\n        },\n        mode: 'production',\n        devtool: args.sourceMap ? 'source-map' : undefined,\n        optimization: {\n          // extract webpack runtime to its own chunk: https://webpack.js.org/concepts/manifest/#runtime\n          runtimeChunk: {\n            name: `webpack-runtime`,\n          },\n          splitChunks: getSplitChunksConfig({numEntries: Object.keys(jsEntries).length}),\n          minimizer: [\n            `...`, // extends webpack internal ones (i.e. `terser-webpack-plugin`)\n            new CssMinimizerPlugin({}),\n          ],\n        },\n      };\n      const plugins = [\n        //Extract a css file from imported css files\n        new MiniCssExtractPlugin({\n          filename: cssOutputPattern,\n        }),\n      ];\n      if (manifest) {\n        plugins.push(new WebpackManifestPlugin({fileName: manifest}));\n      }\n\n      let entry = {};\n      for (name in jsEntries) {\n        entry[name] = jsEntries[name].path;\n      }\n      const extendedConfig = extendConfig({\n        ...webpackConfig,\n        plugins,\n        entry,\n        output: {\n          path: buildDirectory,\n          publicPath: baseUrl,\n          filename: jsOutputPattern,\n        },\n      });\n      const compiler = webpack(extendedConfig);\n\n      const stats = await new Promise((resolve, reject) => {\n        compiler.run((err, stats) => {\n          if (err) {\n            reject(err);\n            return;\n          }\n          const info = stats.toJson(extendedConfig.stats);\n          if (stats.hasErrors()) {\n            console.error(\n              'Webpack errors:\\n' + info.errors.map((err) => err.message).join('\\n-----\\n'),\n            );\n            reject(Error(`Webpack failed with ${info.errors} error(s).`));\n            return;\n          }\n          if (stats.hasWarnings()) {\n            console.error(\n              'Webpack warnings:\\n' + info.warnings.map((err) => err.message).join('\\n-----\\n'),\n            );\n            if (args.failOnWarnings) {\n              reject(Error(`Webpack failed with ${info.warnings} warnings(s).`));\n              return;\n            }\n          }\n          resolve(stats);\n        });\n      });\n\n      if (extendedConfig.stats !== 'none') {\n        console.log(\n          stats.toString(\n            extendedConfig.stats\n              ? extendedConfig.stats\n              : {\n                  colors: true,\n                  all: false,\n                  assets: true,\n                },\n          ),\n        );\n      }\n\n      // If the user specified a path, we need to put the HTML there too\n      const outputDirectory = extendedConfig.output.path;\n\n      emitHTMLFiles({\n        doms,\n        jsEntries,\n        stats,\n        baseUrl,\n        outputDirectory,\n        htmlMinifierOptions,\n      });\n    },\n  };\n};\n"
  },
  {
    "path": "plugins/plugin-webpack/plugins/import-meta-fix.js",
    "content": "/**\nMIT License\n\nCopyright (c) 2018 open-wc\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nconst path = require('path');\nconst regex = /import\\.meta/g;\nfunction toBrowserPath(filePath, _path = path) {\n  return filePath.replace(new RegExp(_path.sep === '\\\\' ? '\\\\\\\\' : _path.sep, 'g'), '/');\n}\n\n/**\n * Webpack loader to rewrite `import.meta` in modules.\n *\n * @example\n * return import.meta;\n * // becomes: return ({ url: `${window.location.protocol}//${window.location.host}/relative/path/to/file.js`, env: __SNOWPACK_ENV__ });\n *\n * return import.meta.url;\n * // becomes: return ({ url: `${window.location.protocol}//${window.location.host}/relative/path/to/file.js`m env: __SNOWPACK_ENV__ }).url;\n */\nmodule.exports = function (source) {\n  const relativePath = this.context.substring(\n    this.context.indexOf(this.rootContext) + this.rootContext.length + 1,\n    this.resource.lastIndexOf(path.sep) + 1,\n  );\n\n  const browserPath = toBrowserPath(relativePath);\n\n  const fileName = this.resource.substring(this.resource.lastIndexOf(path.sep) + 1);\n\n  let found = false;\n  let rewrittenSource = source.replace(regex, () => {\n    found = true;\n    return `({ url: getAbsoluteUrl('${browserPath}/${fileName}'), env: __SNOWPACK_ENV__ })`;\n  });\n\n  if (found) {\n    return `\n      function getAbsoluteUrl(relativeUrl) {\n        const publicPath = __webpack_public_path__;\n        let url = '';\n        if (!publicPath || publicPath.indexOf('://') < 0) {\n          url += window.location.protocol + '//' + window.location.host;\n        }\n        if (publicPath) {\n          url += publicPath;\n        } else {\n          url += '/';\n        }\n        return url + relativeUrl;\n      }\n${rewrittenSource}`;\n  } else {\n    return source;\n  }\n};\n"
  },
  {
    "path": "plugins/plugin-webpack/plugins/proxy-import-resolve.js",
    "content": "module.exports = function proxyImportResolver(source) {\n  return source.replace(\n    /(?:import|from)\\s*['\"].*\\.(\\w+)\\.proxy\\.js['\"]/g,\n    (fullMatch, originalExt) => {\n      return fullMatch.replace('.proxy.js', '');\n    },\n  );\n};\n"
  },
  {
    "path": "plugins/plugin-webpack/test/__snapshots__/plugin.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`@snowpack/plugin-webpack minimal - all options: files 1`] = `\nArray [\n  Object {\n    \"content\": \"{\n  \\\\\"index.js\\\\\": \\\\\"/index-826.js\\\\\",\n  \\\\\"webpack-runtime.js\\\\\": \\\\\"/webpack-runtime-658.js\\\\\",\n  \\\\\"styles.css\\\\\": \\\\\"/css/styles.XXXXXXXXXXXXXXXXXXXX.css\\\\\",\n  \\\\\"assets/backpack.svg\\\\\": \\\\\"/assets/backpack.XXXXXXXXXXXXXXXXXXXX.svg\\\\\",\n  \\\\\"index-826.js.map\\\\\": \\\\\"/index-826.js.map\\\\\",\n  \\\\\"webpack-runtime-658.js.map\\\\\": \\\\\"/webpack-runtime-658.js.map\\\\\",\n  \\\\\"styles.css.map\\\\\": \\\\\"/css/styles.XXXXXXXXXXXXXXXXXXXX.css.map\\\\\"\n}\",\n    \"filename\": \"asset-manifest.json\",\n  },\n  Object {\n    \"content\": \"<svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 20 20\\\\\"><path d=\\\\\"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z\\\\\"/></svg>\n\",\n    \"filename\": \"backpack.svg\",\n  },\n  Object {\n    \"content\": \"(self.webpackChunkplugin_webpack_test_minimal=self.webpackChunkplugin_webpack_test_minimal||[]).push([[826],{99:(s,e,t)=>{\\\\\"use strict\\\\\";t(933),console.log(\\\\\"test\\\\\")},933:(s,e,t)=>{\\\\\"use strict\\\\\";s.exports=t.p+\\\\\"assets/backpack.XXXXXXXXXXXXXXXXXXXX.svg\\\\\"}},s=>{\\\\\"use strict\\\\\";s.O(0,[532],(()=>(99,s(s.s=99)))),s.O()}]);\n//# sourceMappingURL=index-826.js.map\",\n    \"filename\": \"index-826.js\",\n  },\n  Object {\n    \"content\": \"{\\\\\"version\\\\\":3,\\\\\"sources\\\\\":[\\\\\"webpack://plugin-webpack-test-minimal/./index.js\\\\\"],\\\\\"names\\\\\":[\\\\\"console\\\\\",\\\\\"log\\\\\"],\\\\\"mappings\\\\\":\\\\\"8IAEAA,QAAQC,IAAI,S\\\\\",\\\\\"file\\\\\":\\\\\"index-826.js\\\\\",\\\\\"sourcesContent\\\\\":[\\\\\"import './styles.css';\\\\\\\\nimport './backpack.svg';\\\\\\\\nconsole.log('test');\\\\\\\\n\\\\\"],\\\\\"sourceRoot\\\\\":\\\\\"\\\\\"}\",\n    \"filename\": \"index-826.js.map\",\n  },\n  Object {\n    \"content\": \"<!DOCTYPE html><html lang=\\\\\"en\\\\\"><head><meta charset=\\\\\"UTF-8\\\\\"><title>Minimal test</title><link rel=\\\\\"stylesheet\\\\\" href=\\\\\"/css/styles.XXXXXXXXXXXXXXXXXXXX.css\\\\\"></head><body><script src=\\\\\"/webpack-runtime-658.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script><script src=\\\\\"/index-826.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script></body></html>\",\n    \"filename\": \"index.html\",\n  },\n  Object {\n    \"content\": \"import './styles.css';\nimport './backpack.svg';\nconsole.log('test');\n\",\n    \"filename\": \"index.js\",\n  },\n  Object {\n    \"content\": \"{\n  \\\\\"name\\\\\": \\\\\"plugin-webpack-test-minimal\\\\\",\n  \\\\\"main\\\\\": \\\\\"src/index.js\\\\\"\n}\n\",\n    \"filename\": \"package.json\",\n  },\n  Object {\n    \"content\": \"body {\n  background-color: skyblue;\n}\n\",\n    \"filename\": \"styles.css\",\n  },\n  Object {\n    \"content\": \"(()=>{\\\\\"use strict\\\\\";var r,e={},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.m=e,r=[],n.O=(e,t,a,l)=>{if(!t){var o=1/0;for(s=0;s<r.length;s++){for(var[t,a,l]=r[s],p=!0,i=0;i<t.length;i++)(!1&l||o>=l)&&Object.keys(n.O).every((r=>n.O[r](t[i])))?t.splice(i--,1):(p=!1,l<o&&(o=l));p&&(r.splice(s--,1),e=a())}return e}l=l||0;for(var s=r.length;s>0&&r[s-1][2]>l;s--)r[s]=r[s-1];r[s]=[t,a,l]},n.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),n.p=\\\\\"/\\\\\",(()=>{var r={658:0,532:0};n.O.j=e=>0===r[e];var e=(e,t)=>{var a,l,[o,p,i]=t,s=0;for(a in p)n.o(p,a)&&(n.m[a]=p[a]);for(i&&i(n),e&&e(t);s<o.length;s++)l=o[s],n.o(r,l)&&r[l]&&r[l][0](),r[o[s]]=0;n.O()},t=self.webpackChunkplugin_webpack_test_minimal=self.webpackChunkplugin_webpack_test_minimal||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))})(),n.O()})();\n//# sourceMappingURL=webpack-runtime-658.js.map\",\n    \"filename\": \"webpack-runtime-658.js\",\n  },\n  Object {\n    \"content\": \"{\\\\\"version\\\\\":3,\\\\\"sources\\\\\":[\\\\\"webpack://plugin-webpack-test-minimal/webpack/runtime/chunk loaded\\\\\",\\\\\"webpack://plugin-webpack-test-minimal/webpack/bootstrap\\\\\",\\\\\"webpack://plugin-webpack-test-minimal/webpack/runtime/hasOwnProperty shorthand\\\\\",\\\\\"webpack://plugin-webpack-test-minimal/webpack/runtime/publicPath\\\\\",\\\\\"webpack://plugin-webpack-test-minimal/webpack/runtime/jsonp chunk loading\\\\\"],\\\\\"names\\\\\":[\\\\\"deferred\\\\\",\\\\\"__webpack_module_cache__\\\\\",\\\\\"__webpack_require__\\\\\",\\\\\"moduleId\\\\\",\\\\\"cachedModule\\\\\",\\\\\"undefined\\\\\",\\\\\"exports\\\\\",\\\\\"module\\\\\",\\\\\"__webpack_modules__\\\\\",\\\\\"m\\\\\",\\\\\"O\\\\\",\\\\\"result\\\\\",\\\\\"chunkIds\\\\\",\\\\\"fn\\\\\",\\\\\"priority\\\\\",\\\\\"notFulfilled\\\\\",\\\\\"Infinity\\\\\",\\\\\"i\\\\\",\\\\\"length\\\\\",\\\\\"fulfilled\\\\\",\\\\\"j\\\\\",\\\\\"Object\\\\\",\\\\\"keys\\\\\",\\\\\"every\\\\\",\\\\\"key\\\\\",\\\\\"splice\\\\\",\\\\\"o\\\\\",\\\\\"obj\\\\\",\\\\\"prop\\\\\",\\\\\"prototype\\\\\",\\\\\"hasOwnProperty\\\\\",\\\\\"call\\\\\",\\\\\"p\\\\\",\\\\\"installedChunks\\\\\",\\\\\"658\\\\\",\\\\\"532\\\\\",\\\\\"chunkId\\\\\",\\\\\"webpackJsonpCallback\\\\\",\\\\\"parentChunkLoadingFunction\\\\\",\\\\\"data\\\\\",\\\\\"moreModules\\\\\",\\\\\"runtime\\\\\",\\\\\"chunkLoadingGlobal\\\\\",\\\\\"self\\\\\",\\\\\"forEach\\\\\",\\\\\"bind\\\\\",\\\\\"push\\\\\"],\\\\\"mappings\\\\\":\\\\\"uBAAIA,E,KCCAC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,QAIfJ,EAAoBO,EAAID,EDzBpBR,EAAW,GACfE,EAAoBQ,EAAI,CAACC,EAAQC,EAAUC,EAAIC,KAC9C,IAAGF,EAAH,CAMA,IAAIG,EAAeC,IACnB,IAASC,EAAI,EAAGA,EAAIjB,EAASkB,OAAQD,IAAK,CAGzC,IAFA,IAAKL,EAAUC,EAAIC,GAAYd,EAASiB,GACpCE,GAAY,EACPC,EAAI,EAAGA,EAAIR,EAASM,OAAQE,MACpB,EAAXN,GAAsBC,GAAgBD,IAAaO,OAAOC,KAAKpB,EAAoBQ,GAAGa,OAAOC,GAAStB,EAAoBQ,EAAEc,GAAKZ,EAASQ,MAC9IR,EAASa,OAAOL,IAAK,IAErBD,GAAY,EACTL,EAAWC,IAAcA,EAAeD,IAG1CK,IACFnB,EAASyB,OAAOR,IAAK,GACrBN,EAASE,KAGX,OAAOF,EAtBNG,EAAWA,GAAY,EACvB,IAAI,IAAIG,EAAIjB,EAASkB,OAAQD,EAAI,GAAKjB,EAASiB,EAAI,GAAG,GAAKH,EAAUG,IAAKjB,EAASiB,GAAKjB,EAASiB,EAAI,GACrGjB,EAASiB,GAAK,CAACL,EAAUC,EAAIC,IEL/BZ,EAAoBwB,EAAI,CAACC,EAAKC,IAAUP,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAKC,GCAlF1B,EAAoB8B,EAAI,I,MCKxB,IAAIC,EAAkB,CACrBC,IAAK,EACLC,IAAK,GAaNjC,EAAoBQ,EAAEU,EAAKgB,GAA0C,IAA7BH,EAAgBG,GAGxD,IAAIC,EAAuB,CAACC,EAA4BC,KACvD,IAGIpC,EAAUiC,GAHTxB,EAAU4B,EAAaC,GAAWF,EAGhBtB,EAAI,EAC3B,IAAId,KAAYqC,EACZtC,EAAoBwB,EAAEc,EAAarC,KACrCD,EAAoBO,EAAEN,GAAYqC,EAAYrC,IAKhD,IAFGsC,GAASA,EAAQvC,GACjBoC,GAA4BA,EAA2BC,GACrDtB,EAAIL,EAASM,OAAQD,IACzBmB,EAAUxB,EAASK,GAChBf,EAAoBwB,EAAEO,EAAiBG,IAAYH,EAAgBG,IACrEH,EAAgBG,GAAS,KAE1BH,EAAgBrB,EAASK,IAAM,EAEhCf,EAAoBQ,KAGjBgC,EAAqBC,KAA8C,wCAAIA,KAA8C,yCAAK,GAC9HD,EAAmBE,QAAQP,EAAqBQ,KAAK,KAAM,IAC3DH,EAAmBI,KAAOT,EAAqBQ,KAAK,KAAMH,EAAmBI,KAAKD,KAAKH,K\\\\\",\\\\\"file\\\\\":\\\\\"webpack-runtime-658.js\\\\\",\\\\\"sourcesContent\\\\\":[\\\\\"var deferred = [];\\\\\\\\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\\\\\\\\n\\\\\\\\tif(chunkIds) {\\\\\\\\n\\\\\\\\t\\\\\\\\tpriority = priority || 0;\\\\\\\\n\\\\\\\\t\\\\\\\\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\\\\\\\\n\\\\\\\\t\\\\\\\\tdeferred[i] = [chunkIds, fn, priority];\\\\\\\\n\\\\\\\\t\\\\\\\\treturn;\\\\\\\\n\\\\\\\\t}\\\\\\\\n\\\\\\\\tvar notFulfilled = Infinity;\\\\\\\\n\\\\\\\\tfor (var i = 0; i < deferred.length; i++) {\\\\\\\\n\\\\\\\\t\\\\\\\\tvar [chunkIds, fn, priority] = deferred[i];\\\\\\\\n\\\\\\\\t\\\\\\\\tvar fulfilled = true;\\\\\\\\n\\\\\\\\t\\\\\\\\tfor (var j = 0; j < chunkIds.length; j++) {\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\tchunkIds.splice(j--, 1);\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t} else {\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\tfulfilled = false;\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\tif(priority < notFulfilled) notFulfilled = priority;\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t}\\\\\\\\n\\\\\\\\t\\\\\\\\t}\\\\\\\\n\\\\\\\\t\\\\\\\\tif(fulfilled) {\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\tdeferred.splice(i--, 1)\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\tresult = fn();\\\\\\\\n\\\\\\\\t\\\\\\\\t}\\\\\\\\n\\\\\\\\t}\\\\\\\\n\\\\\\\\treturn result;\\\\\\\\n};\\\\\",\\\\\"// The module cache\\\\\\\\nvar __webpack_module_cache__ = {};\\\\\\\\n\\\\\\\\n// The require function\\\\\\\\nfunction __webpack_require__(moduleId) {\\\\\\\\n\\\\\\\\t// Check if module is in cache\\\\\\\\n\\\\\\\\tvar cachedModule = __webpack_module_cache__[moduleId];\\\\\\\\n\\\\\\\\tif (cachedModule !== undefined) {\\\\\\\\n\\\\\\\\t\\\\\\\\treturn cachedModule.exports;\\\\\\\\n\\\\\\\\t}\\\\\\\\n\\\\\\\\t// Create a new module (and put it into the cache)\\\\\\\\n\\\\\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\\\\\n\\\\\\\\t\\\\\\\\t// no module.id needed\\\\\\\\n\\\\\\\\t\\\\\\\\t// no module.loaded needed\\\\\\\\n\\\\\\\\t\\\\\\\\texports: {}\\\\\\\\n\\\\\\\\t};\\\\\\\\n\\\\\\\\n\\\\\\\\t// Execute the module function\\\\\\\\n\\\\\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\\\\\n\\\\\\\\n\\\\\\\\t// Return the exports of the module\\\\\\\\n\\\\\\\\treturn module.exports;\\\\\\\\n}\\\\\\\\n\\\\\\\\n// expose the modules object (__webpack_modules__)\\\\\\\\n__webpack_require__.m = __webpack_modules__;\\\\\\\\n\\\\\\\\n\\\\\",\\\\\"__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))\\\\\",\\\\\"__webpack_require__.p = \\\\\\\\\\\\\"/\\\\\\\\\\\\\";\\\\\",\\\\\"// no baseURI\\\\\\\\n\\\\\\\\n// object to store loaded and loading chunks\\\\\\\\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\\\\\\\\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\\\\\\\\nvar installedChunks = {\\\\\\\\n\\\\\\\\t658: 0,\\\\\\\\n\\\\\\\\t532: 0\\\\\\\\n};\\\\\\\\n\\\\\\\\n// no chunk on demand loading\\\\\\\\n\\\\\\\\n// no prefetching\\\\\\\\n\\\\\\\\n// no preloaded\\\\\\\\n\\\\\\\\n// no HMR\\\\\\\\n\\\\\\\\n// no HMR manifest\\\\\\\\n\\\\\\\\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\\\\\\\\n\\\\\\\\n// install a JSONP callback for chunk loading\\\\\\\\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\\\\\\\\n\\\\\\\\tvar [chunkIds, moreModules, runtime] = data;\\\\\\\\n\\\\\\\\t// add \\\\\\\\\\\\\"moreModules\\\\\\\\\\\\\" to the modules object,\\\\\\\\n\\\\\\\\t// then flag all \\\\\\\\\\\\\"chunkIds\\\\\\\\\\\\\" as loaded and fire callback\\\\\\\\n\\\\\\\\tvar moduleId, chunkId, i = 0;\\\\\\\\n\\\\\\\\tfor(moduleId in moreModules) {\\\\\\\\n\\\\\\\\t\\\\\\\\tif(__webpack_require__.o(moreModules, moduleId)) {\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t__webpack_require__.m[moduleId] = moreModules[moduleId];\\\\\\\\n\\\\\\\\t\\\\\\\\t}\\\\\\\\n\\\\\\\\t}\\\\\\\\n\\\\\\\\tif(runtime) runtime(__webpack_require__);\\\\\\\\n\\\\\\\\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\\\\\\\\n\\\\\\\\tfor(;i < chunkIds.length; i++) {\\\\\\\\n\\\\\\\\t\\\\\\\\tchunkId = chunkIds[i];\\\\\\\\n\\\\\\\\t\\\\\\\\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\tinstalledChunks[chunkId][0]();\\\\\\\\n\\\\\\\\t\\\\\\\\t}\\\\\\\\n\\\\\\\\t\\\\\\\\tinstalledChunks[chunkIds[i]] = 0;\\\\\\\\n\\\\\\\\t}\\\\\\\\n\\\\\\\\t__webpack_require__.O();\\\\\\\\n}\\\\\\\\n\\\\\\\\nvar chunkLoadingGlobal = self[\\\\\\\\\\\\\"webpackChunkplugin_webpack_test_minimal\\\\\\\\\\\\\"] = self[\\\\\\\\\\\\\"webpackChunkplugin_webpack_test_minimal\\\\\\\\\\\\\"] || [];\\\\\\\\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\\\\\\\\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\\\\\"],\\\\\"sourceRoot\\\\\":\\\\\"\\\\\"}\",\n    \"filename\": \"webpack-runtime-658.js.map\",\n  },\n]\n`;\n\nexports[`@snowpack/plugin-webpack minimal - no options: files 1`] = `\nArray [\n  Object {\n    \"content\": \"<svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 20 20\\\\\"><path d=\\\\\"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z\\\\\"/></svg>\n\",\n    \"filename\": \"backpack.svg\",\n  },\n  Object {\n    \"content\": \"<!DOCTYPE html><html lang=\\\\\"en\\\\\"><head><meta charset=\\\\\"UTF-8\\\\\"><title>Minimal test</title><link rel=\\\\\"stylesheet\\\\\" href=\\\\\"/css/styles.XXXXXXXXXXXXXXXXXXXX.css\\\\\"></head><body><script src=\\\\\"/js/webpack-runtime.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script><script src=\\\\\"/js/index.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script></body></html>\",\n    \"filename\": \"index.html\",\n  },\n  Object {\n    \"content\": \"import './styles.css';\nimport './backpack.svg';\nconsole.log('test');\n\",\n    \"filename\": \"index.js\",\n  },\n  Object {\n    \"content\": \"{\n  \\\\\"name\\\\\": \\\\\"plugin-webpack-test-minimal\\\\\",\n  \\\\\"main\\\\\": \\\\\"src/index.js\\\\\"\n}\n\",\n    \"filename\": \"package.json\",\n  },\n  Object {\n    \"content\": \"body {\n  background-color: skyblue;\n}\n\",\n    \"filename\": \"styles.css\",\n  },\n]\n`;\n\nexports[`@snowpack/plugin-webpack respect extendedConfig.output.path: files 1`] = `\nArray [\n  Object {\n    \"content\": \"<!DOCTYPE html><html lang=\\\\\"en\\\\\"><head><meta charset=\\\\\"UTF-8\\\\\"><title>Minimal test</title><link rel=\\\\\"stylesheet\\\\\" href=\\\\\"/css/styles.XXXXXXXXXXXXXXXXXXXX.css\\\\\"></head><body><script src=\\\\\"/js/webpack-runtime.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script><script src=\\\\\"/js/index.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script></body></html>\",\n    \"filename\": \"index.html\",\n  },\n]\n`;\n\nexports[`@snowpack/plugin-webpack multiple entrypoints w/ same filename: files 1`] = `\nArray [\n  Object {\n    \"content\": \"<!DOCTYPE html><html lang=\\\\\"en\\\\\"><head><meta charset=\\\\\"UTF-8\\\\\"><title>Multiple entrypoints test - root</title></head><body><script src=\\\\\"/js/webpack-runtime.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script><script src=\\\\\"/js/index.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script></body></html>\",\n    \"filename\": \"index.html\",\n  },\n  Object {\n    \"content\": \"console.log('root test');\n\",\n    \"filename\": \"index.js\",\n  },\n  Object {\n    \"content\": \"{\n  \\\\\"name\\\\\": \\\\\"plugin-webpack-test-minimal\\\\\",\n  \\\\\"main\\\\\": \\\\\"src/index.js\\\\\"\n}\n\",\n    \"filename\": \"package.json\",\n  },\n]\n`;\n\nexports[`@snowpack/plugin-webpack multiple entrypoints w/ same filename: files 2`] = `\nArray [\n  Object {\n    \"content\": \"<!DOCTYPE html><html lang=\\\\\"en\\\\\"><head><meta charset=\\\\\"UTF-8\\\\\"><title>Multiple entrypoints test - /admin</title></head><body><script src=\\\\\"/js/webpack-runtime.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script><script src=\\\\\"/js/admin/index.XXXXXXXXXXXXXXXXXXXX.js\\\\\" async=\\\\\"\\\\\" defer=\\\\\"\\\\\"></script></body></html>\",\n    \"filename\": \"index.html\",\n  },\n  Object {\n    \"content\": \"console.log('admin test');\n\",\n    \"filename\": \"index.js\",\n  },\n]\n`;\n"
  },
  {
    "path": "plugins/plugin-webpack/test/plugin.test.js",
    "content": "const path = require('path');\nconst fs = require('fs-extra');\n\nconst plugin = require('../plugin');\nconst readFilesSync = require('./readFilesSync');\n\nconst STUBS_DIR = path.join(__dirname, 'stubs/minimal/');\nconst IGNORED_STUBS_DIR = path.join(__dirname, 'stubs/minimal_ignore/');\n\nconst MULTIPLE_DIR = path.join(__dirname, 'stubs/multiple-entrypoints/');\nconst IGNORED_MULTIPLE_DIR = path.join(__dirname, 'stubs/multiple-entrypoints_ignore/');\n\ndescribe('@snowpack/plugin-webpack', () => {\n  // Copy over the stub folder to an git-ignored path and mock console.log\n  beforeEach(() => {\n    if (fs.existsSync(IGNORED_STUBS_DIR)) fs.removeSync(IGNORED_STUBS_DIR);\n    fs.copySync(STUBS_DIR, IGNORED_STUBS_DIR);\n\n    if (fs.existsSync(IGNORED_MULTIPLE_DIR)) fs.removeSync(IGNORED_MULTIPLE_DIR);\n    fs.copySync(MULTIPLE_DIR, IGNORED_MULTIPLE_DIR);\n  });\n\n  afterAll(() => {\n    if (fs.existsSync(IGNORED_STUBS_DIR)) fs.removeSync(IGNORED_STUBS_DIR);\n    if (fs.existsSync(IGNORED_MULTIPLE_DIR)) fs.removeSync(IGNORED_MULTIPLE_DIR);\n  });\n\n  it('minimal - no options', async () => {\n    const pluginInstance = plugin({\n      buildOptions: {},\n    });\n\n    await pluginInstance.optimize({\n      buildDirectory: IGNORED_STUBS_DIR,\n    });\n\n    expect(readFilesSync(IGNORED_STUBS_DIR)).toMatchSnapshot('files');\n  });\n\n  it('minimal - all options', async () => {\n    const pluginInstance = plugin(\n      {\n        buildOptions: {},\n      },\n      {\n        sourceMap: true,\n        outputPattern: {\n          js: '[name]-[id].js',\n        },\n        extendConfig: (config) => config,\n        manifest: true,\n        htmlMinifierOptions: true,\n      },\n    );\n\n    await pluginInstance.optimize({\n      buildDirectory: IGNORED_STUBS_DIR,\n    });\n\n    expect(readFilesSync(IGNORED_STUBS_DIR)).toMatchSnapshot('files');\n  });\n\n  it('respect extendedConfig.output.path', async () => {\n    const pluginInstance = plugin(\n      {\n        buildOptions: {},\n      },\n      {\n        extendConfig: (config) => {\n          config.output.path = path.resolve(IGNORED_STUBS_DIR, 'dist');\n\n          return config;\n        },\n      },\n    );\n\n    await pluginInstance.optimize({\n      buildDirectory: IGNORED_STUBS_DIR,\n    });\n\n    expect(readFilesSync(path.join(IGNORED_STUBS_DIR, 'dist'))).toMatchSnapshot('files');\n    expect(fs.existsSync(path.join(IGNORED_STUBS_DIR, 'js'))).toBe(false);\n    expect(fs.existsSync(path.join(IGNORED_STUBS_DIR, 'css'))).toBe(false);\n    expect(fs.existsSync(path.join(IGNORED_STUBS_DIR, 'assets'))).toBe(false);\n  });\n\n  it('multiple entrypoints w/ same filename', async () => {\n    const pluginInstance = plugin({\n      buildOptions: {},\n    });\n\n    await pluginInstance.optimize({\n      buildDirectory: IGNORED_MULTIPLE_DIR,\n    });\n\n    const rootHtml = fs.readFileSync(path.join(IGNORED_MULTIPLE_DIR, 'index.html'), {\n      encoding: 'utf8',\n    });\n    const adminHtml = fs.readFileSync(path.join(IGNORED_MULTIPLE_DIR, 'admin/index.html'), {\n      encoding: 'utf8',\n    });\n\n    const rootScripts = rootHtml.match(/<script src=\"([^>]+)\">/g);\n    const adminScripts = adminHtml.match(/<script src=\"([^>]+)\">/g);\n\n    expect(rootScripts).not.toEqual(expect.arrayContaining(adminScripts));\n\n    expect(readFilesSync(IGNORED_MULTIPLE_DIR)).toMatchSnapshot('files');\n    expect(readFilesSync(path.join(IGNORED_MULTIPLE_DIR, 'admin'))).toMatchSnapshot('files');\n  });\n});\n"
  },
  {
    "path": "plugins/plugin-webpack/test/readFilesSync.js",
    "content": "const path = require('path');\nconst fs = require('fs-extra');\n\nfunction readFilesSync(dir) {\n  return fs\n    .readdirSync(dir)\n    .map((filename) => {\n      const filepath = path.resolve(dir, filename);\n      const stat = fs.statSync(filepath);\n      const isFile = stat.isFile();\n      const content = isFile ? fs.readFileSync(filepath, 'utf-8') : null;\n\n      if (isFile) {\n        return {\n          filename,\n          content: normalizeContent(content),\n        };\n      }\n    })\n    .filter((file) => !!file);\n}\n\nfunction normalizeContent(content) {\n  return content\n    .toString()\n    .replace(/(\\\\r\\\\n)/g, '\\\\n')\n    .replace(/\\.[a-z0-9]{20}\\./g, '.XXXXXXXXXXXXXXXXXXXX.');\n}\n\nmodule.exports = readFilesSync;\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/minimal/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Minimal test</title>\n  </head>\n  <body>\n    <script type=\"module\" src=\"index.js\" async defer></script>\n  </body>\n</html>\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/minimal/index.js",
    "content": "import './styles.css';\nimport './backpack.svg';\nconsole.log('test');\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/minimal/package.json",
    "content": "{\n  \"name\": \"plugin-webpack-test-minimal\",\n  \"main\": \"src/index.js\"\n}\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/minimal/styles.css",
    "content": "body {\n  background-color: skyblue;\n}\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/multiple-entrypoints/admin/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Multiple entrypoints test - /admin</title>\n  </head>\n  <body>\n    <script type=\"module\" src=\"/admin/index.js\" async defer></script>\n  </body>\n</html>\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/multiple-entrypoints/admin/index.js",
    "content": "console.log('admin test');\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/multiple-entrypoints/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Multiple entrypoints test - root</title>\n  </head>\n  <body>\n    <script type=\"module\" src=\"index.js\" async defer></script>\n  </body>\n</html>\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/multiple-entrypoints/index.js",
    "content": "console.log('root test');\n"
  },
  {
    "path": "plugins/plugin-webpack/test/stubs/multiple-entrypoints/package.json",
    "content": "{\n  \"name\": \"plugin-webpack-test-minimal\",\n  \"main\": \"src/index.js\"\n}\n"
  },
  {
    "path": "plugins/web-test-runner-plugin/CHANGELOG.md",
    "content": "# @snowpack/web-test-runner-plugin\n\n## 0.2.2\n\n### Patch Changes\n\n- 50987423: Add \"repository\" and \"homepage\" listings (#2846) <Westbrook Johnson>\n- bea1c56c: Simplify. cleanup, enhance snowpack internals (#2707)\n- a8a30339: [ci] yarn format\n- 25565308: Allow 404s in web-test-runner-plugin (#2546) <Lars den Bakker>\n- 7a79de95: fix bad snowpackconfig reference\n- a65023e2: [ci] yarn format\n\n## 0.2.1\n\n### Patch Changes\n\n- cc36acf2: Update @web/test-runner (#2222) <David Bailey>\n\n_For older releases, check our curated [release update thread](https://github.com/withastro/snowpack/discussions/1183) or the raw [commit history](https://github.com/withastro/snowpack/commits/main/plugins/web-test-runner-plugin)._\n"
  },
  {
    "path": "plugins/web-test-runner-plugin/README.md",
    "content": "# @snowpack/web-test-runner-plugin\n\nA [@web/test-runner](https://modern-web.dev/docs/test-runner/overview/) plugin to test Snowpack-powered projects. This plugin automatically connects to the Snowpack project in the current directory, loads the project configuration, and the uses your already-configured Snowpack build pipeline to build each test file.\n\n## Usage\n\n```\nnpm install @snowpack/web-test-runner-plugin --save-dev\n```\n\n```\n// web-test-runner.config.js\nmodule.exports = {\n  plugins: [require('@snowpack/web-test-runner-plugin')()],\n};\n```\n\n## Options\n\nNone! If you need to configure Snowpack, you can do so in your project `snowpack.config.mjs` file.\n\nLooking for support for some missing option/configuration? Please file an isuse! Your feedback is important.\n"
  },
  {
    "path": "plugins/web-test-runner-plugin/package.json",
    "content": "{\n  \"name\": \"@snowpack/web-test-runner-plugin\",\n  \"version\": \"0.2.2\",\n  \"main\": \"plugin.js\",\n  \"license\": \"MIT\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"plugins/web-test-runner-plugin\"\n  },\n  \"homepage\": \"https://www.snowpack.dev/guides/web-test-runner\",\n  \"peerDependencies\": {\n    \"@web/test-runner\": \">=0.10.0 <1.0.0\",\n    \"snowpack\": \"^3.8.0\"\n  },\n  \"devDependencies\": {\n    \"@web/test-runner\": \">=0.11.0\"\n  },\n  \"gitHead\": \"a01616bb0787d56cd782f94cecf2daa12c7594e4\"\n}\n"
  },
  {
    "path": "plugins/web-test-runner-plugin/plugin.js",
    "content": "const {isTestFilePath} = require('@web/test-runner');\nconst snowpack = require('snowpack');\nconst path = require('path');\n\n/**\n * Checks whether the url is a virtual file served by @web/test-runner.\n * @param {string} url\n */\nfunction isTestRunnerFile(url) {\n  return url.startsWith('/__web-dev-server') || url.startsWith('/__web-test-runner');\n}\n\nmodule.exports = function () {\n  let server, config;\n\n  return {\n    name: 'snowpack-plugin',\n    async serverStart({fileWatcher}) {\n      config = await snowpack.loadConfiguration({\n        mode: 'test',\n        packageOptions: {external: ['/__web-dev-server__web-socket.js']},\n        devOptions: {open: 'none', output: 'stream', hmr: false},\n      });\n      // npm packages should be installed/prepared ahead of time.\n      console.log('[snowpack] starting server...');\n      fileWatcher.add(Object.keys(config.mount));\n      server = await snowpack.startServer({\n        config,\n        lockfile: null,\n      });\n    },\n    async serverStop() {\n      return server.shutdown();\n    },\n    async serve({request}) {\n      if (isTestRunnerFile(request.url)) {\n        return;\n      }\n      const reqPath = request.path;\n      try {\n        const result = await server.loadUrl(reqPath, {isSSR: false});\n        return {body: result.contents, type: result.contentType};\n      } catch {\n        return;\n      }\n    },\n    transformImport({source}) {\n      if (!isTestFilePath(source) || isTestRunnerFile(source)) {\n        return;\n      }\n      // PERF(fks): https://github.com/withastro/snowpack/pull/1259/files#r502963818\n      const reqPath = source.substring(\n        0,\n        source.indexOf('?') === -1 ? undefined : source.indexOf('?'),\n      );\n      const sourcePath = path.join(config.root || process.cwd(), reqPath);\n      try {\n        return snowpack.getUrlForFile(sourcePath, config);\n      } catch {\n        return;\n      }\n    },\n  };\n};\n"
  },
  {
    "path": "scripts/release-all.js",
    "content": "// How to release many packages at once:\n// 1. get a list of what everything is meant to be going out (git diff [LAST RELEASE COMMIT] --stat)\n// 2. create the release-all.js script (get the patch vs. minor vs. major for each package going out. ex: git diff [LAST RELEASE COMMIT] plugins/plugin-svelte)\n// 3. run `yarn build && yarn bundle`\n// 4. run `../release-all.js` (release-all script must be copied outside of the working directory, so that we pass the \"clean working directory\" check)\n\nconst release = require('./release.cjs');\n\nrelease('esinstall', 'latest', true);\nrelease('skypack', 'latest', true);\nrelease('snowpack', 'latest', true);\nrelease('app-template-blank-typescript', 'latest', true);\nrelease('app-template-lit-element', 'latest', true);\nrelease('app-template-preact-typescript', 'latest', true);\nrelease('app-template-react-typescript', 'latest', true);\nrelease('app-template-svelte-typescript', 'latest', true);\nrelease('app-template-vue-typescript', 'latest', true);\nrelease('plugins/plugin-optimize', 'latest', true);\nrelease('plugins/web-test-runner-plugin', 'latest', true);\n"
  },
  {
    "path": "scripts/release.cjs",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst execa = require('execa');\n\nfunction formatDate() {\n  var d = new Date(),\n    month = '' + (d.getMonth() + 1),\n    day = '' + d.getDate(),\n    year = d.getFullYear();\n\n  if (month.length < 2) month = '0' + month;\n  if (day.length < 2) day = '0' + day;\n\n  return [year, month, day].join('-');\n}\n\nmodule.exports = function release(pkgFolder, tag, skipBuild) {\n  console.log(`# release(${pkgFolder}, ${tag})`);\n\n  const root = path.resolve(__dirname, '..');\n  const dir = path.resolve(root, pkgFolder);\n  if (execa.sync('git', ['status', '--porcelain'], {cwd: dir}).stdout) {\n    console.error('working directory not clean!');\n    process.exit(1);\n  }\n\n  if (skipBuild !== true) {\n    console.log('Building...');\n    console.log(execa.sync('yarn', ['run', 'build'], {cwd: root}));\n  }\n\n  console.log('Publishing...');\n  const pkgJsonLoc = path.join(dir, 'package.json');\n  if (!pkgFolder.startsWith('create-snowpack-app/')) {\n    execa.sync('yarn', ['changeset', 'version']);\n  }\n  const {name: pkgName, version: newPkgVersion} = JSON.parse(fs.readFileSync(pkgJsonLoc, 'utf8'));\n  const newPkgTag = `${pkgName}@${newPkgVersion}`;\n\n  console.log(execa.sync('git', ['add', '-A'], {cwd: dir}));\n  console.log(execa.sync('git', ['commit', '--allow-empty', '-m', `[skip ci] ${newPkgTag}`], {cwd: dir}));\n  console.log(execa.sync('git', ['tag', newPkgTag], {cwd: dir}));\n  if (pkgName === 'snowpack')\n    console.log(execa.sync('git', ['tag', `v${newPkgVersion}`], {cwd: dir})); // 'snowpack' only: also tag as vX.X.X (for GitHub releases)\n  console.log(execa.sync('npm', ['publish', '--tag', tag], {cwd: dir}));\n\n  // Only push to github on latest release, since a pre-release will break\n  // yarns ability to link workspaces (ex: ^3.0.0 doesn't match 3.1.0-pre.1).\n  if (tag === 'latest') {\n    console.log(execa.sync('git', ['push', 'origin', 'main'], {cwd: dir}));\n    console.log(execa.sync('git', ['push', '--tags'], {cwd: dir}));\n  }\n};\n"
  },
  {
    "path": "skypack/.gitignore",
    "content": "node_modules\nlib"
  },
  {
    "path": "skypack/.prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\",\n  \"bracketSpacing\": false,\n  \"printWidth\": 100\n}\n"
  },
  {
    "path": "skypack/CHANGELOG.md",
    "content": "# skypack\n\n## 0.3.3\n\n### Patch Changes\n\n- 5e84cdd8: Fixes a ghost dependency on 'tar'\n\n## 0.3.2\n\n### Patch Changes\n\n- b5e49467: update changelogs\n- bf220191: [ci] yarn format\n\n## 0.3.1\n\n### Patch Changes\n\n- 59ee847e: cleanup broken skypack sdk references\n"
  },
  {
    "path": "skypack/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Fred K. Schott\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "skypack/README.md",
    "content": "# Skypack\n\nThis is an experimental SDK for interacting with the Skypack Package CDN. It is not yet ready for public use, and may change without notice. Use at your own risk!\n\nMore documentation will be written as this gets closer to a public release! Until then, you can browse the package code to get a better idea of the interface.\n\n```\nnpm install skypack\n```\n"
  },
  {
    "path": "skypack/index.esm.mjs",
    "content": "import Pkg from './lib/index.js';\n\nexport const rollupPluginSkypack = Pkg.rollupPluginSkypack;\nexport const generateImportMap = Pkg.generateImportMap;\nexport const fetchCDN = Pkg.fetchCDN;\nexport const buildNewPackage = Pkg.buildNewPackage;\nexport const lookupBySpecifier = Pkg.lookupBySpecifier;\nexport const clearCache = Pkg.clearCache;\nexport const SKYPACK_ORIGIN = Pkg.SKYPACK_ORIGIN;\n"
  },
  {
    "path": "skypack/package.json",
    "content": "{\n  \"name\": \"skypack\",\n  \"version\": \"0.3.3\",\n  \"description\": \"The Skypack SDK.\",\n  \"keywords\": [\n    \"skypack\",\n    \"esm\",\n    \"cdn\",\n    \"sdk\"\n  ],\n  \"author\": \"Fred K. Schott <fkschott@gmail.com>\",\n  \"license\": \"MIT\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\",\n    \"directory\": \"skypack\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc --noUnusedLocals false --noUnusedParameters false\",\n    \"build:watch\": \"tsc --watch --noUnusedLocals false --noUnusedParameters false\",\n    \"lint\": \"tsc --noEmit && package-check\"\n  },\n  \"engines\": {\n    \"node\": \">=10.19.0\"\n  },\n  \"main\": \"lib/index.js\",\n  \"types\": \"lib/index.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./index.esm.mjs\",\n      \"require\": \"./lib/index.js\"\n    },\n    \"./package.json\": \"./package.json\"\n  },\n  \"files\": [\n    \"lib\",\n    \"index.bin.js\",\n    \"index.esm.mjs\"\n  ],\n  \"dependencies\": {\n    \"cacache\": \"^15.0.0\",\n    \"cachedir\": \"^2.3.0\",\n    \"esinstall\": \"^1.0.0\",\n    \"etag\": \"^1.8.1\",\n    \"find-up\": \"^5.0.0\",\n    \"got\": \"^11.1.4\",\n    \"kleur\": \"^4.1.0\",\n    \"mkdirp\": \"^1.0.3\",\n    \"p-queue\": \"^6.2.1\",\n    \"rimraf\": \"^3.0.0\",\n    \"rollup\": \"~2.37.1\",\n    \"tar\": \"^6.1.0\",\n    \"validate-npm-package-name\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "skypack/src/index.ts",
    "content": "import mkdirp from 'mkdirp';\nimport cacache from 'cacache';\nimport path from 'path';\nimport tar from 'tar';\nimport fs from 'fs';\nimport url from 'url';\nimport got, {Response} from 'got';\nimport {IncomingHttpHeaders} from 'http';\nimport {ImportMap, RESOURCE_CACHE, HAS_CDN_HASH_REGEX} from './util';\n\nexport {rollupPluginSkypack} from './rollup-plugin-remote-cdn';\nexport const SKYPACK_ORIGIN = 'https://cdn.skypack.dev';\n\nfunction parseRawPackageImport(spec: string): [string, string | null] {\n  const impParts = spec.split('/');\n  if (spec.startsWith('@')) {\n    const [scope, name, ...rest] = impParts;\n    return [`${scope}/${name}`, rest.join('/') || null];\n  }\n  const [name, ...rest] = impParts;\n  return [name, rest.join('/') || null];\n}\n\nexport class SkypackSDK {\n  origin: string;\n\n  constructor(options: {origin?: string} = {}) {\n    this.origin = options.origin || SKYPACK_ORIGIN;\n  }\n\n  async generateImportMap(\n    webDependencies: Record<string, string | null>,\n    inheritFromImportMap?: ImportMap,\n  ): Promise<ImportMap> {\n    const newLockfile: ImportMap = inheritFromImportMap\n      ? {imports: {...inheritFromImportMap.imports}}\n      : {imports: {}};\n    await Promise.all(\n      Object.entries(webDependencies).map(async ([packageName, packageSemver]) => {\n        if (packageSemver === null) {\n          delete newLockfile.imports[packageName];\n          delete newLockfile.imports[packageName + '/'];\n          return;\n        }\n        const lookupResponse = await this.lookupBySpecifier(packageName, packageSemver);\n        if (lookupResponse.error) {\n          throw lookupResponse.error;\n        }\n        if (lookupResponse.pinnedUrl) {\n          let keepGoing = true;\n          const deepPinnedUrlParts = lookupResponse.pinnedUrl.split('/');\n          // TODO: Get ?meta support to get this info via JSON instead of header manipulation\n          deepPinnedUrlParts.shift(); // remove \"\"\n          deepPinnedUrlParts.shift(); // remove \"pin\"\n\n          while (keepGoing) {\n            const investigate = deepPinnedUrlParts.pop()!;\n            if (HAS_CDN_HASH_REGEX.test(investigate)) {\n              keepGoing = false;\n              deepPinnedUrlParts.push(investigate);\n            }\n          }\n          newLockfile.imports[packageName] = this.origin + '/' + deepPinnedUrlParts.join('/');\n          newLockfile.imports[packageName + '/'] =\n            this.origin + '/' + deepPinnedUrlParts.join('/') + '/';\n        }\n      }),\n    );\n    const newLockfileSorted = Object.keys(newLockfile.imports).sort((a, b) => {\n      // We want 'xxx/' to come after 'xxx', so we convert it to a space (the character with the highest sort order)\n      // See: http://support.ecisolutions.com/doc-ddms/help/reportsmenu/ascii_sort_order_chart.htm\n      return a.replace(/\\/$/, ' ').localeCompare(b.replace(/\\/$/, ' '));\n    });\n    return {\n      imports: newLockfileSorted.reduce((prev, k) => {\n        prev[k] = newLockfile.imports[k];\n        return prev;\n      }, {}),\n    };\n  }\n\n  async fetch(\n    resourceUrl: string,\n    userAgent?: string,\n  ): Promise<{\n    body: Buffer;\n    headers: IncomingHttpHeaders;\n    statusCode: number;\n    isCached: boolean;\n    isStale: boolean;\n  }> {\n    if (!resourceUrl.startsWith(this.origin)) {\n      resourceUrl = this.origin + resourceUrl;\n    }\n\n    const cachedResult = await cacache.get(RESOURCE_CACHE, resourceUrl).catch(() => null);\n    if (cachedResult) {\n      const cachedResultMetadata = cachedResult.metadata as ResourceCacheMetadata;\n      const freshUntil = new Date(cachedResult.metadata.freshUntil);\n      if (freshUntil >= new Date()) {\n        return {\n          isCached: true,\n          isStale: false,\n          body: cachedResult.data,\n          headers: cachedResultMetadata.headers,\n          statusCode: cachedResultMetadata.statusCode,\n        };\n      }\n    }\n\n    let freshResult: Response<Buffer>;\n    try {\n      freshResult = await got(resourceUrl, {\n        headers: {'user-agent': userAgent || `skypack/v0.0.1`},\n        throwHttpErrors: false,\n        responseType: 'buffer',\n      });\n    } catch (err) {\n      if (cachedResult) {\n        const cachedResultMetadata = cachedResult.metadata as ResourceCacheMetadata;\n        return {\n          isCached: true,\n          isStale: true,\n          body: cachedResult.data,\n          headers: cachedResultMetadata.headers,\n          statusCode: cachedResultMetadata.statusCode,\n        };\n      }\n      throw err;\n    }\n\n    const cacheUntilMatch = freshResult.headers['cache-control']?.match(/max-age=(\\d+)/);\n    if (cacheUntilMatch) {\n      var freshUntil = new Date();\n      freshUntil.setSeconds(freshUntil.getSeconds() + parseInt(cacheUntilMatch[1]));\n      // no need to await, since we `.catch()` to swallow any errors.\n      cacache\n        .put(RESOURCE_CACHE, resourceUrl, freshResult.body, {\n          metadata: {\n            headers: freshResult.headers,\n            statusCode: freshResult.statusCode,\n            freshUntil: freshUntil.toUTCString(),\n          } as ResourceCacheMetadata,\n        })\n        .catch(() => null);\n    }\n\n    return {\n      body: freshResult.body,\n      headers: freshResult.headers,\n      statusCode: freshResult.statusCode,\n      isCached: false,\n      isStale: false,\n    };\n  }\n\n  async buildNewPackage(\n    spec: string,\n    semverString?: string,\n    userAgent?: string,\n  ): Promise<BuildNewPackageResponse> {\n    const [packageName, packagePath] = parseRawPackageImport(spec);\n    const lookupUrl =\n      `/new/${packageName}` +\n      (semverString ? `@${semverString}` : ``) +\n      (packagePath ? `/${packagePath}` : ``);\n    try {\n      const {statusCode} = await this.fetch(lookupUrl, userAgent);\n      return {\n        error: null,\n        success: statusCode !== 500,\n      };\n    } catch (err) {\n      return {error: err, success: false};\n    }\n  }\n\n  async lookupBySpecifier(\n    spec: string,\n    semverString?: string,\n    qs?: string,\n    userAgent?: string,\n  ): Promise<LookupBySpecifierResponse> {\n    const [packageName, packagePath] = parseRawPackageImport(spec);\n    const lookupUrl =\n      `/${packageName}` +\n      (semverString ? `@${semverString}` : ``) +\n      (packagePath ? `/${packagePath}` : ``) +\n      (qs ? `?${qs}` : ``);\n    try {\n      const {body, statusCode, headers, isCached, isStale} = await this.fetch(lookupUrl, userAgent);\n      if (statusCode !== 200) {\n        return {error: new Error(body.toString())};\n      }\n      return {\n        error: null,\n        body,\n        isCached,\n        isStale,\n        importStatus: headers['x-import-status'] as string,\n        importUrl: headers['x-import-url'] as string,\n        pinnedUrl: headers['x-pinned-url'] as string | undefined,\n        typesUrl: headers['x-typescript-types'] as string | undefined,\n      };\n    } catch (err) {\n      return {error: err};\n    }\n  }\n\n  async installTypes(spec: string, semverString?: string, dir?: string) {\n    dir = dir || path.join(process.cwd(), '.types');\n    const lookupResult = await this.lookupBySpecifier(spec, semverString, 'dts');\n    if (lookupResult.error) {\n      throw lookupResult.error;\n    }\n    if (!lookupResult.typesUrl) {\n      throw new Error(`Skypack CDN: No types found \"${spec}\"`);\n    }\n\n    const typesTarballUrl = lookupResult.typesUrl.replace(/(mode=types.*?)\\/.*/, '$1/all.tgz');\n\n    await mkdirp(dir);\n    const tempDir = await cacache.tmp.mkdir(RESOURCE_CACHE);\n\n    let tarballContents: Buffer;\n    const cachedTarball = await cacache\n      .get(RESOURCE_CACHE, typesTarballUrl)\n      .catch((/* ignore */) => null);\n    if (cachedTarball) {\n      tarballContents = cachedTarball.data;\n    } else {\n      const tarballResponse = await this.fetch(typesTarballUrl);\n      if (tarballResponse.statusCode !== 200) {\n        throw new Error(tarballResponse.body.toString());\n      }\n      tarballContents = tarballResponse.body as any as Buffer;\n      await cacache.put(RESOURCE_CACHE, typesTarballUrl, tarballContents);\n    }\n\n    const typesUrlParts = url.parse(typesTarballUrl).pathname!.split('/');\n    const typesPackageName = url.parse(typesTarballUrl).pathname!.startsWith('/-/@')\n      ? typesUrlParts[2] + '/' + typesUrlParts[3].split('@')[0]\n      : typesUrlParts[2].split('@')[0];\n    const typesPackageTarLoc = path.join(tempDir, `${typesPackageName}.tgz`);\n    if (typesPackageName.includes('/')) {\n      await mkdirp(path.dirname(typesPackageTarLoc));\n    }\n    fs.writeFileSync(typesPackageTarLoc, tarballContents);\n    const typesPackageLoc = path.join(dir, typesPackageName);\n    await mkdirp(typesPackageLoc);\n    await tar.x({\n      file: typesPackageTarLoc,\n      cwd: typesPackageLoc,\n    });\n  }\n}\n\ninterface ResourceCacheMetadata {\n  headers: IncomingHttpHeaders;\n  statusCode: number;\n  freshUntil: string;\n}\n\nexport type BuildNewPackageResponse =\n  | {error: Error; success: false}\n  | {\n      error: null;\n      success: boolean;\n    };\n\nexport type LookupBySpecifierResponse =\n  | {error: Error}\n  | {\n      error: null;\n      body: Buffer;\n      isCached: boolean;\n      isStale: boolean;\n      importStatus: string;\n      importUrl: string;\n      pinnedUrl: string | undefined;\n      typesUrl: string | undefined;\n    };\n\nexport async function clearCache() {\n  return cacache.rm.all(RESOURCE_CACHE);\n}\n"
  },
  {
    "path": "skypack/src/rollup-plugin-remote-cdn.ts",
    "content": "import cacache from 'cacache';\nimport {Plugin, ResolvedId} from 'rollup';\nimport {SkypackSDK} from './index';\nimport {AbstractLogger, HAS_CDN_HASH_REGEX, RESOURCE_CACHE} from './util';\n\n/**\n * rollup-plugin-remote-cdn\n *\n * Load import URLs from a remote CDN, sitting behind a local cache. The local\n * cache acts as a go-between for the resolve & load step: when we get back a\n * successful CDN resolution, we save the file to the local cache and then tell\n * rollup that it's safe to load from the cache in the `load()` hook.\n */\nexport function rollupPluginSkypack({sdk, logger}: {sdk: SkypackSDK; logger: AbstractLogger}) {\n  const CACHED_FILE_ID_PREFIX = 'remote-pkg-cache:';\n\n  return {\n    name: 'snowpack:rollup-plugin-remote-cdn',\n    async resolveId(source: string, importer) {\n      let cacheKey: string;\n      if (source.startsWith(sdk.origin)) {\n        cacheKey = source;\n      } else if (source.startsWith('/-/')) {\n        cacheKey = sdk.origin + source;\n      } else if (source.startsWith('/pin/')) {\n        cacheKey = sdk.origin + source;\n      } else {\n        return null;\n      }\n\n      // If the source path is a CDN path including a hash, it's assumed the\n      // file will never change and it is safe to pull from our local cache\n      // without a network request.\n      logger.debug(`resolve ${cacheKey}`, {name: 'install:remote'});\n      if (HAS_CDN_HASH_REGEX.test(cacheKey)) {\n        const cachedResult = await cacache.get\n          .info(RESOURCE_CACHE, cacheKey)\n          .catch((/* ignore */) => null);\n        if (cachedResult) {\n          return CACHED_FILE_ID_PREFIX + cacheKey;\n        }\n      }\n\n      // Otherwise, make the remote request and cache the file on success.\n      const {statusCode} = await sdk.fetch(cacheKey);\n      if (statusCode === 200) {\n        return CACHED_FILE_ID_PREFIX + cacheKey;\n      }\n\n      // If lookup failed, skip this plugin and resolve the import locally instead.\n      // TODO: Log that this has happened (if some sort of verbose mode is enabled).\n      const packageName = cacheKey\n        .substring(sdk.origin.length)\n        .replace('/-/', '')\n        .replace('/pin/', '')\n        .split('@')[0];\n      return this.resolve(packageName, importer!, {skipSelf: true}).then((resolved) => {\n        let finalResult = resolved;\n        if (!finalResult) {\n          finalResult = {id: packageName} as any as ResolvedId;\n        }\n        return finalResult;\n      });\n    },\n    async load(id: string) {\n      if (!id.startsWith(CACHED_FILE_ID_PREFIX)) {\n        return null;\n      }\n      const cacheKey = id.substring(CACHED_FILE_ID_PREFIX.length);\n      logger.debug(`load ${cacheKey}`, {name: 'install:remote'});\n      const {body} = await sdk.fetch(cacheKey);\n      return body.toString();\n    },\n  } as Plugin;\n}\n"
  },
  {
    "path": "skypack/src/util.ts",
    "content": "import globalCacheDir from 'cachedir';\nimport etag from 'etag';\nimport findUp from 'find-up';\nimport fs from 'fs';\nimport mkdirp from 'mkdirp';\nimport path from 'path';\n\nexport interface AbstractLogger {\n  debug: (...args: any[]) => void;\n  log: (...args: any[]) => void;\n  warn: (...args: any[]) => void;\n  error: (...args: any[]) => void;\n}\nexport interface ImportMap {\n  imports: {[packageName: string]: string};\n}\n\nexport const GLOBAL_CACHE_DIR = globalCacheDir('skypack');\nexport const RESOURCE_CACHE = path.join(GLOBAL_CACHE_DIR, 'pkg-cache-3.0');\nexport const HAS_CDN_HASH_REGEX = /\\-[a-zA-Z0-9]{16,}/;\n\n// A note on cache naming/versioning: We currently version our global caches\n// with the version of the last breaking change. This allows us to re-use the\n// same cache across versions until something in the data structure changes.\n// At that point, bump the version in the cache name to create a new unique\n// cache name.\nexport const BUILD_CACHE = path.join(GLOBAL_CACHE_DIR, 'build-cache-2.7');\n\nconst LOCKFILE_HASH_FILE = '.hash';\n\n// NOTE(fks): Must match empty script elements to work properly.\nexport const HTML_JS_REGEX = /(<script.*?type=\"?module\"?.*?>)(.*?)<\\/script>/gms;\nexport const CSS_REGEX = /@import\\s*['\"](.*)['\"];/gs;\nexport const SVELTE_VUE_REGEX = /(<script[^>]*>)(.*?)<\\/script>/gms;\n\nexport const URL_HAS_PROTOCOL_REGEX = /^(\\w+:)?\\/\\//;\n\nconst UTF8_FORMATS = ['.css', '.html', '.js', '.map', '.mjs', '.json', '.svg', '.txt', '.xml'];\nexport function getEncodingType(ext: string): 'utf-8' | undefined {\n  return UTF8_FORMATS.includes(ext) ? 'utf-8' : undefined;\n}\n\nexport async function readLockfile(cwd: string): Promise<ImportMap | null> {\n  try {\n    var lockfileContents = fs.readFileSync(path.join(cwd, 'snowpack.lock.json'), {\n      encoding: 'utf-8',\n    });\n  } catch (err) {\n    // no lockfile found, ignore and continue\n    return null;\n  }\n  // If this fails, we actually do want to alert the user by throwing\n  return JSON.parse(lockfileContents);\n}\n\nexport async function writeLockfile(loc: string, importMap: ImportMap): Promise<void> {\n  const sortedImportMap: ImportMap = {imports: {}};\n  for (const key of Object.keys(importMap.imports).sort()) {\n    sortedImportMap.imports[key] = importMap.imports[key];\n  }\n  fs.writeFileSync(loc, JSON.stringify(sortedImportMap, undefined, 2), {encoding: 'utf-8'});\n}\n\nexport function isTruthy<T>(item: T | false | null | undefined): item is T {\n  return Boolean(item);\n}\n\n/** Get the package name + an entrypoint within that package (if given). */\nexport function parsePackageImportSpecifier(imp: string): [string, string | null] {\n  const impParts = imp.split('/');\n  if (imp.startsWith('@')) {\n    const [scope, name, ...rest] = impParts;\n    return [`${scope}/${name}`, rest.join('/') || null];\n  }\n  const [name, ...rest] = impParts;\n  return [name, rest.join('/') || null];\n}\n\n/**\n * Given a package name, look for that package's package.json manifest.\n * Return both the manifest location (if believed to exist) and the\n * manifest itself (if found).\n *\n * NOTE: You used to be able to require() a package.json file directly,\n * but now with export map support in Node v13 that's no longer possible.\n */\nexport function resolveDependencyManifest(dep: string, cwd: string): [string | null, any | null] {\n  // Attempt #1: Resolve the dependency manifest normally. This works for most\n  // packages, but fails when the package defines an export map that doesn't\n  // include a package.json. If we detect that to be the reason for failure,\n  // move on to our custom implementation.\n  try {\n    const depManifest = require.resolve(`${dep}/package.json`, {paths: [cwd]});\n    return [depManifest, require(depManifest)];\n  } catch (err) {\n    // if its an export map issue, move on to our manual resolver.\n    if (err.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') {\n      return [null, null];\n    }\n  }\n\n  // Attempt #2: Resolve the dependency manifest manually. This involves resolving\n  // the dep itself to find the entrypoint file, and then haphazardly replacing the\n  // file path within the package with a \"./package.json\" instead. It's not as\n  // thorough as Attempt #1, but it should work well until export maps become more\n  // established & move out of experimental mode.\n  let result = [null, null] as [string | null, any | null];\n  try {\n    const fullPath = require.resolve(dep, {paths: [cwd]});\n    // Strip everything after the package name to get the package root path\n    // NOTE: This find-replace is very gross, replace with something like upath.\n    const searchPath = `${path.sep}node_modules${path.sep}${dep.replace('/', path.sep)}`;\n    const indexOfSearch = fullPath.lastIndexOf(searchPath);\n    if (indexOfSearch >= 0) {\n      const manifestPath =\n        fullPath.substring(0, indexOfSearch + searchPath.length + 1) + 'package.json';\n      result[0] = manifestPath;\n      const manifestStr = fs.readFileSync(manifestPath, {encoding: 'utf-8'});\n      result[1] = JSON.parse(manifestStr);\n    }\n  } catch (err) {\n    // ignore\n  } finally {\n    return result;\n  }\n}\n\n/**\n * If Rollup erred parsing a particular file, show suggestions based on its\n * file extension (note: lowercase is fine).\n */\nexport const MISSING_PLUGIN_SUGGESTIONS: {[ext: string]: string} = {\n  '.svelte':\n    'Try installing rollup-plugin-svelte and adding it to Snowpack (https://www.snowpack.dev/tutorials/svelte)',\n  '.vue':\n    'Try installing rollup-plugin-vue and adding it to Snowpack (https://www.snowpack.dev/guides/vue)',\n};\n\nexport async function checkLockfileHash(dir: string) {\n  const lockfileLoc = await findUp(['package-lock.json', 'yarn.lock']);\n  if (!lockfileLoc) {\n    return true;\n  }\n  const hashLoc = path.join(dir, LOCKFILE_HASH_FILE);\n  const newLockHash = etag(await fs.promises.readFile(lockfileLoc, 'utf-8'));\n  const oldLockHash = await fs.promises.readFile(hashLoc, 'utf-8').catch(() => '');\n  return newLockHash === oldLockHash;\n}\n\nexport async function updateLockfileHash(dir: string) {\n  const lockfileLoc = await findUp(['package-lock.json', 'yarn.lock']);\n  if (!lockfileLoc) {\n    return;\n  }\n  const hashLoc = path.join(dir, LOCKFILE_HASH_FILE);\n  const newLockHash = etag(await fs.promises.readFile(lockfileLoc));\n  await mkdirp(path.dirname(hashLoc));\n  await fs.promises.writeFile(hashLoc, newLockHash);\n}\n\n/**\n * For the given import specifier, return an alias entry if one is matched.\n */\nexport function findMatchingAliasEntry(\n  alias: Record<string, string>,\n  spec: string,\n): {from: string; to: string; type: 'package' | 'path'} | undefined {\n  // Only match bare module specifiers. relative and absolute imports should not match\n  if (\n    spec === '.' ||\n    spec === '..' ||\n    spec.startsWith('./') ||\n    spec.startsWith('../') ||\n    spec.startsWith('/') ||\n    spec.startsWith('http://') ||\n    spec.startsWith('https://')\n  ) {\n    return undefined;\n  }\n\n  for (const [from, to] of Object.entries(alias)) {\n    let foundType: 'package' | 'path' = isPackageAliasEntry(to) ? 'package' : 'path';\n    const isExactMatch = spec === removeTrailingSlash(from);\n    const isDeepMatch = spec.startsWith(addTrailingSlash(from));\n    if (isExactMatch || isDeepMatch) {\n      return {\n        from,\n        to,\n        type: foundType,\n      };\n    }\n  }\n}\n\n/**\n * For the given import specifier, return an alias entry if one is matched.\n */\nexport function isPackageAliasEntry(val: string): boolean {\n  return !path.isAbsolute(val);\n}\n\n/** Get full extensions of files */\nexport function getExt(fileName: string) {\n  return {\n    /** base extension (e.g. `.js`) */\n    baseExt: path.extname(fileName).toLocaleLowerCase(),\n    /** full extension, if applicable (e.g. `.proxy.js`) */\n    expandedExt: path.basename(fileName).replace(/[^.]+/, '').toLocaleLowerCase(),\n  };\n}\n\n/** Replace file extensions */\nexport function replaceExt(fileName: string, oldExt: string, newExt: string): string {\n  const extToReplace = new RegExp(`\\\\${oldExt}$`, 'i');\n  return fileName.replace(extToReplace, newExt);\n}\n\n/**\n * Sanitizes npm packages that end in .js (e.g `tippy.js` -> `tippyjs`).\n * This is necessary because Snowpack can’t create both a file and directory\n * that end in .js.\n */\nexport function sanitizePackageName(filepath: string): string {\n  const dirs = filepath.split('/');\n  const file = dirs.pop() as string;\n  return [...dirs.map((path) => path.replace(/\\.js$/i, 'js')), file].join('/');\n}\n\n// Source Map spec v3: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.lmz475t4mvbx\n\n/** CSS sourceMappingURL */\nexport function cssSourceMappingURL(code: string, sourceMappingURL: string) {\n  return code + `/*# sourceMappingURL=${sourceMappingURL} */`;\n}\n\n/** JS sourceMappingURL */\nexport function jsSourceMappingURL(code: string, sourceMappingURL: string) {\n  return code.replace(/\\n*$/, '') + `\\n//# sourceMappingURL=${sourceMappingURL}\\n`; // strip ending lines & append source map (with linebreaks for safety)\n}\n\nexport function removeLeadingSlash(path: string) {\n  return path.replace(/^[/\\\\]+/, '');\n}\n\nexport function removeTrailingSlash(path: string) {\n  return path.replace(/[/\\\\]+$/, '');\n}\n\nexport function addLeadingSlash(path: string) {\n  return path.replace(/^\\/?/, '/');\n}\n\nexport function addTrailingSlash(path: string) {\n  return path.replace(/\\/?$/, '/');\n}\n"
  },
  {
    "path": "skypack/tsconfig.json",
    "content": "{\n  \"include\": [\"src\"],\n  \"compilerOptions\": {\n    \"outDir\": \"lib\",\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"moduleResolution\": \"node\",\n    \"declaration\": true,\n    \"esModuleInterop\": true,\n    \"strict\": true,\n    \"sourceMap\": true,\n    \"noImplicitAny\": false,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"skipLibCheck\": true\n  }\n}\n"
  },
  {
    "path": "snowpack/.gitignore",
    "content": "lib\nnode_modules\nvendor/generated/\nvendor/types/\n"
  },
  {
    "path": "snowpack/.npmignore",
    "content": "src\n\n"
  },
  {
    "path": "snowpack/CHANGELOG.md",
    "content": "# snowpack\n\n## 3.8.8\n\n### Patch Changes\n\n- 57ee22fc: Fix for dynamic import scanning\n\n## 3.8.7\n\n### Patch Changes\n\n- d72dc7df: Bugfix: dev server hanging on circular dependencies\n- c6146e61: Fixes a ghost dependency on 'magic-string'\n\n## 3.8.6\n\n### Patch Changes\n\n- 0e9829ce: Fixes a regression caused by #3597\n\n## 3.8.5\n\n### Patch Changes\n\n- c103f4d4: Downgrade skypack versions\n\n## 3.8.4\n\n### Patch Changes\n\n- 47d0792f: Fix using assets from linked packages\n- 57f545cc: Fix issue where multiple onFileChange handlers overwrote each other\n- Updated dependencies [5e84cdd8]\n  - skypack@0.3.3\n\n## 3.8.3\n\n### Patch Changes\n\n- 91da2b6a: Fix a small SSR bug with default exports\n\n## 3.8.2\n\n### Patch Changes\n\n- c4a55550: Fixes scanning of dynamic imports on packages\n\n## 3.8.1\n\n### Patch Changes\n\n- a1f56ef7: Remove type attribute from HMR script in dev server\n- 95d4309a: Remove exports field from package.json\n- Updated dependencies [9b1472f6]\n  - esinstall@1.1.7\n\n## 3.8.0\n\n### Minor Changes\n\n- a3eadde7: Ship unbundled ESM & CJS Snowpack builds\n\n### Patch Changes\n\n- f4e0bc42: Fixes regression with modules executing more than once\n- ab4ddec3: Fix dot folder dev response\n\n## 3.7.1\n\n### Patch Changes\n\n- a4768503: Fix CSS Modules + baseUrl (#3515) <Drew Powers>\n\n## 3.7.0\n\n### Minor Changes\n\n- 4ab4f07e: configure if dotfiles are included in build (#3455)\n\n### Patch Changes\n\n- 101dc42f: Pass `external` modules through to `esbuild`. (#3499) <Lucas Garron>\n- fe288ca4: Respect trailing slash in dev server (#3509) <Drew Powers>\n- 7939563b: Don’t scan imports from non-JS files (#3495) <Drew Powers>\n- e449b7b8: [ci] yarn format <drwpow>\n- 6506cff2: Chore: update deps (#3494) <Drew Powers>\n- 30b7ef45: Ensure remote package fetches always use the configured origin (#3397) <Jared Reisinger>\n\n## 3.6.2\n\n### Patch Changes\n\n- 33cd5648: Pass real filepath to transform plugins (#3483) <Drew Powers>\n\n## 3.6.1\n\n### Patch Changes\n\n- 110043e2: Check externals before resolving entrypoint (#3479) <Matthew Phillips>\n\n## 3.6.0\n\n### Minor Changes\n\n- ffee2c57: allow configuring loader (#3377) <Michael St Clair>\n\n### Patch Changes\n\n- fb7eaaa4: Allow `external` CommonJS modules to be imported properly in Node (#3473) <Matthew Phillips>\n- 8cff0336: Make import.meta.url be the file URL in SSR (#3472) <Matthew Phillips>\n- 29e609aa: [#3188] Add ant-design/icons to NEVER_PEER_PACKAGES (#3443) <manish gowardipe>\n- ded85e8a: Minor optimization on resolving path starts with '.' (#3361) <Jacty>\n- b8c76b00: Fix websocket proxying (#3225) <Gael du Plessix>\n\n## 3.5.9\n\n### Patch Changes\n\n- 343274e2: [ci] yarn format <matthewp>\n- d93d01ec: Fix race condition reading existing import-map.json files (#3453) <Matthew Phillips>\n\n## 3.5.8\n\n### Patch Changes\n\n- 611dac9a: [ci] yarn format <matthewp>\n- 7a1ae463: Handle runtime invalidation for proxy files (#3449) <Matthew Phillips>\n\n## 3.5.7\n\n### Patch Changes\n\n- 6e7f137b: [ci] yarn format <matthewp>\n- dc44eb75: Disconnect the HMR server when snowpack is shutdown (#3439) <Matthew Phillips>\n\n## 3.5.6\n\n### Patch Changes\n\n- f0534bb7: [ci] yarn format <matthewp>\n- 6ef3695d: Allow Snowpack to scan .astro files for imports (#3423) <Matthew Phillips>\n\n## 3.5.5\n\n### Patch Changes\n\n- d61fb0a8: [ci] yarn format <matthewp>\n- aed6a8fd: Modules marked as `external` should always be treated as external (#3408) <Matthew Phillips>\n- cd6ec781: [ci] yarn format <matthewp>\n- 64b377e3: Correctly handle subpackage imports marked as external (#3407) <Matthew Phillips>\n\n## 3.5.4\n\n### Patch Changes\n\n- 78d6ecf1: Fix: remove external override (#3401) <Nate Moore>\n\n## 3.5.3\n\n### Patch Changes\n\n- c659b7c3: [ci] yarn format <natemoo-re>\n- b375b8a3: Fix `external` behavior for local package source and SSR. (#3399) <Nate Moore>\n\n## 3.5.2\n\n### Patch Changes\n\n- 0f65cdf2: fix: construct NotFoundError before throwing (#3380) <Nate Moore>\n\n## 3.5.1\n\n### Patch Changes\n\n- 398ad9f1: Allow clean shutdown of dev server (#3349) <Drew Powers>\n\n## 3.5.0\n\n### Minor Changes\n\n- 84e39f8a: Enable cache directory path to be set explicitly (#3064) <François Wouts>\n\n### Patch Changes\n\n- 91bb53c0: Don’t cache .css files for Tailwind projects (#3326) <Drew Powers>\n- 48f9c524: [ci] yarn format <drwpow>\n- 45e2a22b: Avoid uncaught exception when file is deleted (#3313) <Adam Hupp>\n- e321bbee: resolve `.css` ESM imports to `.css.{js,ts}` if there's no `.css` file on disk (#3315) <Matt Mulder>\n\n## 3.4.0\n\n### Minor Changes\n\n- 4403595e: Sourcemaps (#3271) <Luke Jackson>\n\n### Patch Changes\n\n- fa7a5e3f: Typo (#3291) <Jacty>\n- 680272eb: Fix appending port 80 to url sometimes breaks hmr connectivity #3268 (#3269) <Mark Dorrill>\n- dc60a025: chore: update create-snowpack-app template deps (#3233) <Drew Powers>\n\n## 3.3.7\n\n### Patch Changes\n\n- 5e34b829: Fix missing build files from load plugins (#3230) <Drew Powers>\n\n## 3.3.6\n\n### Patch Changes\n\n- 9ad97afe: fix: CSS Modules exporting {} when no mount config (#3229) <Drew Powers>\n- ff1eaf66: [ci] yarn format <drwpow>\n- 0707fd63: fix: add mounted node_modules to ignore list (#3227) <Ivo Reis>\n- f53e1833: chore: bump Snowpack version (#3228) <Drew Powers>\n- 3701201b: Support packageOptions.rollup.plugins (#3123) <Spike>\n- cea40a05: Removes console log (#3204) <Luke Jackson>\n- 3af6e064: [ci] yarn format <matthewp>\n- 1902f5c2: Correctly resolve preload urls from build manifest (#3201) <Luke Jackson>\n\n## 3.3.4\n\n### Patch Changes\n\n- 8f044398: Restore proxy SSR rewriting for CSS Modules proxy (#3191) <Drew Powers>\n- 870b34c2: Take the result of the first plugin (#3190) <Matthew Phillips>\n- 758bdb27: Fix Sass + CSS Modules (#3186) <Drew Powers>\n- 5e58fc64: fix: Race condition in symlink directory read (#3181) <Bjørn Stabell>\n- 28ea1f86: [ci] yarn format <natemoo-re>\n- e6861227: Support mounting within node_modules directory (#3134)\n- a089d86a: Test fixtures continued (#3100) <Luke Jackson>\n\n## 3.3.3\n\n### Patch Changes\n\n- 1f82543d: Fix publicPath option in esbuild (#3175) <Drew Powers>\n- 83294444: Add CSS Modules in Build SSR (#3170) <Drew Powers>\n\n## 3.3.2\n\n### Patch Changes\n\n- dfd200a8: [ci] yarn format <matthewp>\n- fa96e618: Use a separate PackageSource for each config (#3164) <Matthew Phillips>\n\n## 3.3.1\n\n### Patch Changes\n\n- 35e38b6c: [ci] yarn format <matthewp>\n- a3951e31: Refactor the build to improve reusability (#3157) <Matthew Phillips>\n\n## 3.3.0\n\n### Minor Changes\n\n- deacbcd0: Streaming Package Imports v2 (#3028)\n- d9956f73: add explicit \"mode\" config (#3135)\n\n### Patch Changes\n\n- 25ed2885: [ci] yarn format\n- 6a15f872: Fix env.js always having MODE and NODE_ENV as development (#3132) <Francisco Sousa>\n- 63e30d32: Revert \"improve node_modules excluding\"\n- 3b3402bb: improve node_modules excluding\n- 48618f05: fix: remove tailing slash in import specifier as esinstall do (#3102) <yqrashawn>\n- b0481aa8: Honor devOptions.hmr option, fixes #3105 (#3114) <Matt Walker>\n- 42da07e4: fix: sourcemap config copy paste typo in config.ts in pr #2793 (#3115) <yqrashawn>\n- 9eb50368: update deps (#2928)\n- 18b9f09b: Simplify test suite (#2858)\n\n## 3.2.2\n\n### Patch Changes\n\n- a643af33: Detect Sass partial changes in dev (#3060) <Drew Powers>\n\n## 3.2.1\n\n### Patch Changes\n\n- 0663c1ac: fix HMR issue\n\n## 3.2.0\n\n### Minor Changes\n\n- 598f05a7: Feat: import.meta.glob and import.meta.globEager support (#2881) <Nate Moore>\n\n### Patch Changes\n\n- 56c5a231: fix typo in changelog\n- c3971f10: add snowpack release notes\n- 40f02cf4: reorder changelog entries\n- a25f407d: Update CHANGELOG.md\n- c9dacc29: Update CHANGELOG.md\n- a676d665: fix website package.json\n- 68df7237: support remote import if specifier has version in it\n- 16f58b99: [ci] yarn format\n- d3859c8d: fix lint\n- 57a65bb8: [ci] yarn format\n- 685f2200: add docs, cleanup handler\n- 5fe83d4d: [ci] yarn format\n- 844cbcbe: routes support upgrade event (#2988) <dishuostec>\n- a17dd97c: Fix: Only import directory/index.js as a fallback mechanism (#3018) <François Wouts>\n- e340dea9: Do not exclude folders starting with a dot (#2962) <Matthew Phillips>\n- fc6c1417: Improve CSS error message (#2973) <Drew Powers>\n- b41b14b0: Await promises in local source (#2972) <Drew Powers>\n\n## 3.1.2\n\n### Patch Changes\n\n- e50cb745: fix better handling for unscannable cjs packages\n- 1232e252: add back cjs-cjs compat from an earlier pr (#2934)\n\n## 3.1.1\n\n### Patch Changes\n\n- f53498ba: Fix preact regression (#2926)\n\n## 3.1.0\n\n### Minor Changes\n\n- bea1c56c: Simplify. cleanup, enhance snowpack internals (#2707)\n- 3ba7fede: feat: support specifying sourcemap type in config.optimize.sourcemap (#2793) <yqrashawn>\n- aa953cca: refactor: update to esbuild 0.9 (#2886) <Ludovico Fischer>\n\n### Patch Changes\n\n- 872bfc74: [ci] yarn format <natemoo-re>\n- c8aee80f: Support compound output file extensions (#2593) <Edward Faulkner>\n- 8dbd6af3: [ci] yarn format <natemoo-re>\n- 88d3a9a9: handle legacy package urls (#2915)\n- 094b7a12: Add `openUrl` option to config (#2902) <Dan Marshall>\n- aba028c4: [ci] yarn format <natemoo-re>\n- 4de244ef: Add support for custom TLS key files via devOptions.secure = { cert, key } (#2356) <Aral Balkan>\n- da049ce4: [ci] yarn format <natemoo-re>\n- b569d35b: add getUrlForPackage utility (#2913) <Nate Moore>\n- d826a60c: Remove enumerability of converted ESM in SSR (#2920) <Matthew Phillips>\n- 941110cd: fix esbuild 0.9.x breaking change (#2914)\n- 35289b4b: improve import scanner perf (#2900)\n- a800bf3d: finalize picomatch support (#2912)\n- d33076a3: Speed up exclusions with picomatch (#2904) <Ismail Syed>\n- 84e034cc: [ci] yarn format\n- f35bc421: fix debug log\n- 81fd028e: [ci] yarn format <natemoo-re>\n- 7c8236e8: Add config.env property to support non-prefixed env variables (#2390) <moonrailgun>\n- 337cfd7a: only target actual imports (Regex Fix) (#2817) <Danzo7>\n- cd4f344b: [ci] yarn format <natemoo-re>\n- 0fce7efd: Support buildOptions.jsxInject in config (#2884) <Nate Moore>\n- dc503c84: speed up mount scanning with fdir (#2876)\n- e8dead62: improve handling of \".\" & \"..\" imports (#2877)\n- a178f286: run transform on all dependencies (#2878)\n- 27321b83: collect known imports by package and version\n- 3a6ad53a: update (#2363) <Myou Aki>\n- b2738967: improve cjs<>esm conversion of named exports (#2859)\n- 03ceb62d: Resolve missing extensions (#2839) <Drew Powers>\n- 28689888: [ci] yarn format\n- 689f58e9: SSR fixes (#2853) <Matthew Phillips>\n- 3549e43c: Fix Mac OS devOptions.open bug (#2798) <joakim-mjardner>\n- 21461ce5: Update @snowpack/plugin-postcss API (#2854) <Drew Powers>\n- 9fbe93fb: fix: revert snowpack to v3.0.13 for CI tests (#2851) <Nate Moore>\n- 339d3cf1: [ci] yarn format <natemoo-re>\n- ea4ebd17: Proper loading of ESM config files (#2834) <Nate Moore>\n- 8f022949: 3.1.0\n- 9d987e4a: fix watching logic and dashboard output\n- 15428ae4: [ci] yarn format\n- 43677e89: Add import support for .interface files, alongside .svelte, and .vue. (#2380) <Aral Balkan>\n- 3d457a8e: fix(ssr-loader): support css modules (#2528) <Nate Moore>\n- 23d7b450: fix: recognise dot as a valid relative import (#2662) <Jon Rimmer>\n- 582808c3: [ci] yarn format\n- deabcb0e: don't escape utf-8 characters by cheerio and esbuild (#2755) <bsl-zcs>\n- d35d50b4: [ci] yarn format\n- b756b49d: Fix snowpack add/rm for npm packages with @ prefix (#2665) <Nigel>\n- 58df86d4: add a tip if someone uses process.env\n- fdda447d: dont match meta paths to routes\n\n## 3.0.13\n\n### Patch Changes\n\n- 74d0be10: add resolve for bundled package\n\n## 3.0.12\n\n### Patch Changes\n\n- d3b6f769: Support packages that use export maps but have no main (#2659) <Matthew Phillips>\n- 2ae933be: add true logger error message\n- 0de849ee: Catch WebSocket message parse errors (#2470) <Ben Foxall>\n- da75ff23: remove circular dependencies in util (#2366)\n- bfa32aff: proper default browser support for mac (#2364)\n- 1c44c22d: fix bad url access in import maps, snowpack add\n- 76dca31a: add octet-stream handling\n- 10f3461b: [ci] yarn format\n- 615f13a7: Add isHmrEnabled and isSSR to plugin transform. (#2332) <Chris Thomas>\n- 65008c63: fix: prettier snowpack/src/build dir (#2346) <ZYSzys>\n- 690d3b1d: update prettier to use explicit formatting\n- f07105a9: Add root level export of clearCache (#2330) <Kevin Scott>\n- 137139b4: [ci] yarn format\n- e0f01181: fix: prettier format (#2316) <ZYSzys>\n- 0fc858cf: fix bad optimize external filter\n- fb167098: load plugins relative to config root\n- 85ddf618: add JS API docs (#2315)\n- 49b29f97: [ci] yarn format\n\n## 3.0.11\n\n### Patch Changes\n\n- 58a36d4c: fix bad build conditional check\n- 37f7a55d: remove empty build folders from build\n- 6e01eeb5: improve build watch output\n- 137c58b0: fix init file issue\n- e2b74e7b: add fallback deprecation\n- 968720cf: remove rollup from bundle to pass peerDep checks\n- 70d25dad: Resolves #2265 (#2289) <Josh Wilson>\n- 7b38b486: get tests passing\n- e6b618c5: [ci] yarn format\n\n## 3.0.10\n\n### Patch Changes\n\n- 1d071628: cleanup the bundled build before publishing\n- beb3f9a1: stop ignoring postcss in generated bundle\n- 2b797521: [ci] yarn format\n\n## 3.0.9\n\n### Patch Changes\n\n- d26c7733: [ci] yarn format\n\n## 3.0.8\n\n### Patch Changes\n\n- c2124bd7: json fix\n- e040f071: Fix postcss-modules being required as a dependency in projects (#2257) <David Bailey>\n- c566aa10: add bundled type support for esinstall and skypack, remove as full deps\n- ecf85d52: move open back to regular dependency\n- b0f7280c: [ci] yarn format\n\n## 3.0.7\n\n### Patch Changes\n\n- 61bd4c3b: [ci] yarn format\n- eb5b366a: cleanup types, release script\n- 20e3ed21: move skypack and esbuild into real dependencies for now\n- e63d70fd: fix direct foo.svelte.css references\n- 01a80448: [ci] yarn format\n\n## 3.0.6\n\n### Patch Changes\n\n- 8f614490: final cleanup before v3 goes out\n- 15d77ea3: cleanup\n"
  },
  {
    "path": "snowpack/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Fred K. Schott\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n\"\"\"\n\nThis license applies to parts of the src/dev.ts file originating from the\nhttps://github.com/lukejacksonn/servor repository:\n\nMIT License\nCopyright (c) 2019 Luke Jackson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "snowpack/README.md",
    "content": "[![CI](https://github.com/withastro/snowpack/workflows/CI/badge.svg?event=push)](https://github.com/withastro/snowpack/actions)\n\n### What is Snowpack?\n\n**Snowpack is a modern, lightweight toolchain for web application development.** Traditional dev bundlers like webpack or Parcel need to rebuild & rebundle entire chunks of your application every time you save a single file. This introduces lag between changing a file and seeing those changes reflected in the browser, sometimes as slow as several seconds.\n\nSnowpack solves this problem by serving your application **unbundled in development.** Any time you change a file, Snowpack never rebuilds more than a single file. There's no bundling to speak of, just a few milliseconds of single-file rebuilding and then an instant update in the browser via HMR. We call this new approach **O(1) Build Tooling.** You can read more about it in our [Snowpack 2.0 Release Post.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/)\n\nWhen you're ready to deploy your web application to users, you can add back a traditional bundler like Webpack or Parcel. With Snowpack you get bundled & optimized production performance without sacrificing dev speed by adding an unnecessary bundler,\n\n### Key Features\n\n- A dev environment that starts up in **50ms or less.**\n- Changes are reflected [instantly in the browser.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#hot-module-replacement)\n- Integrates your favorite bundler for [production-optimized builds.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#snowpack-build)\n- Out-of-the-box support for [TypeScript, JSX, CSS Modules and more.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#features)\n- Connect your favorite tools with custom [build scripts](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#build-scripts) & [third-party plugins.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#build-plugins)\n\n**💁 More info at the official [Snowpack website ➞](https://snowpack.dev)**\n"
  },
  {
    "path": "snowpack/assets/hmr-client.js",
    "content": "/**\n * esm-hmr/runtime.ts\n * A client-side implementation of the ESM-HMR spec, for reference.\n */\n\nconst isWindowDefined = typeof window !== 'undefined';\n\nfunction log(...args) {\n  console.log('[ESM-HMR]', ...args);\n}\nfunction reload() {\n  if (!isWindowDefined) {\n    return;\n  }\n  location.reload(true);\n}\n/** Clear all error overlays from the page */\nfunction clearErrorOverlay() {\n  if (!isWindowDefined) {\n    return;\n  }\n  document.querySelectorAll('hmr-error-overlay').forEach((el) => el.remove());\n}\n/** Create an error overlay (if custom element exists on the page). */\nfunction createNewErrorOverlay(data) {\n  if (!isWindowDefined) {\n    return;\n  }\n  const HmrErrorOverlay = customElements.get('hmr-error-overlay');\n  if (HmrErrorOverlay) {\n    const overlay = new HmrErrorOverlay(data);\n    clearErrorOverlay();\n    document.body.appendChild(overlay);\n  }\n}\n\nlet SOCKET_MESSAGE_QUEUE = [];\nfunction _sendSocketMessage(msg) {\n  socket.send(JSON.stringify(msg));\n}\nfunction sendSocketMessage(msg) {\n  if (socket.readyState !== socket.OPEN) {\n    SOCKET_MESSAGE_QUEUE.push(msg);\n  } else {\n    _sendSocketMessage(msg);\n  }\n}\n\nlet socketURL = isWindowDefined && window.HMR_WEBSOCKET_URL;\nif (!socketURL) {\n  const socketHost =\n    isWindowDefined && window.HMR_WEBSOCKET_PORT && window.HMR_WEBSOCKET_PORT !== 80\n      ? `${location.hostname}:${window.HMR_WEBSOCKET_PORT}`\n      : location.host;\n  socketURL = (location.protocol === 'http:' ? 'ws://' : 'wss://') + socketHost + '/';\n}\n\nconst socket = new WebSocket(socketURL, 'esm-hmr');\nsocket.addEventListener('open', () => {\n  SOCKET_MESSAGE_QUEUE.forEach(_sendSocketMessage);\n  SOCKET_MESSAGE_QUEUE = [];\n});\nconst REGISTERED_MODULES = {};\nclass HotModuleState {\n  constructor(id) {\n    this.data = {};\n    this.isLocked = false;\n    this.isDeclined = false;\n    this.isAccepted = false;\n    this.acceptCallbacks = [];\n    this.disposeCallbacks = [];\n    this.id = id;\n  }\n  lock() {\n    this.isLocked = true;\n  }\n  dispose(callback) {\n    this.disposeCallbacks.push(callback);\n  }\n  invalidate() {\n    reload();\n  }\n  decline() {\n    this.isDeclined = true;\n  }\n  accept(_deps, callback = true) {\n    if (this.isLocked) {\n      return;\n    }\n    if (!this.isAccepted) {\n      sendSocketMessage({id: this.id, type: 'hotAccept'});\n      this.isAccepted = true;\n    }\n    if (!Array.isArray(_deps)) {\n      callback = _deps || callback;\n      _deps = [];\n    }\n    if (callback === true) {\n      callback = () => {};\n    }\n    const deps = _deps.map((dep) => {\n      const ext = dep.split('.').pop();\n      if (!ext) {\n        dep += '.js';\n      } else if (ext !== 'js') {\n        dep += '.proxy.js';\n      }\n      return new URL(dep, `${window.location.origin}${this.id}`).pathname;\n    });\n    this.acceptCallbacks.push({\n      deps,\n      callback,\n    });\n  }\n}\nexport function createHotContext(fullUrl) {\n  const id = new URL(fullUrl).pathname;\n  const existing = REGISTERED_MODULES[id];\n  if (existing) {\n    existing.lock();\n    runModuleDispose(id);\n    return existing;\n  }\n  const state = new HotModuleState(id);\n  REGISTERED_MODULES[id] = state;\n  return state;\n}\n\n/** Called when any CSS file is loaded. */\nasync function runCssStyleAccept({url: id}) {\n  const nonce = Date.now();\n  const oldLinkEl =\n    document.head.querySelector(`link[data-hmr=\"${id}\"]`) ||\n    document.head.querySelector(`link[href=\"${id}\"]`);\n  if (!oldLinkEl) {\n    return true;\n  }\n  const linkEl = oldLinkEl.cloneNode(false);\n  linkEl.dataset.hmr = id;\n  linkEl.type = 'text/css';\n  linkEl.rel = 'stylesheet';\n  linkEl.href = id + '?mtime=' + nonce;\n  linkEl.addEventListener(\n    'load',\n    // Once loaded, remove the old link element (with some delay, to avoid FOUC)\n    () => setTimeout(() => document.head.removeChild(oldLinkEl), 30),\n    false,\n  );\n  oldLinkEl.parentNode.insertBefore(linkEl, oldLinkEl);\n  return true;\n}\n\n/** Called when a new module is loaded, to pass the updated module to the \"active\" module */\nasync function runJsModuleAccept({url: id, bubbled}) {\n  const state = REGISTERED_MODULES[id];\n  if (!state) {\n    return false;\n  }\n  if (state.isDeclined) {\n    return false;\n  }\n  const acceptCallbacks = state.acceptCallbacks;\n  const updateID = Date.now();\n  for (const {deps, callback: acceptCallback} of acceptCallbacks) {\n    const [module, ...depModules] = await Promise.all([\n      import(id + `?mtime=${updateID}`),\n      ...deps.map((d) => import(d + `?mtime=${updateID}`)),\n    ]);\n    acceptCallback({module, bubbled, deps: depModules});\n  }\n  return true;\n}\n\n/** Called when a new module is loaded, to run cleanup on the old module (if needed) */\nasync function runModuleDispose(id) {\n  const state = REGISTERED_MODULES[id];\n  if (!state) {\n    return false;\n  }\n  if (state.isDeclined) {\n    return false;\n  }\n  const disposeCallbacks = state.disposeCallbacks;\n  state.disposeCallbacks = [];\n  state.data = {};\n  disposeCallbacks.map((callback) => callback());\n  return true;\n}\nsocket.addEventListener('message', ({data: _data}) => {\n  if (!_data) {\n    return;\n  }\n  const data = JSON.parse(_data);\n  if (data.type === 'reload') {\n    log('message: reload');\n    reload();\n    return;\n  }\n  if (data.type === 'error') {\n    console.error(\n      `[ESM-HMR] ${data.fileLoc ? data.fileLoc + '\\n' : ''}`,\n      data.title + '\\n' + data.errorMessage,\n    );\n    createNewErrorOverlay(data);\n    return;\n  }\n  if (data.type === 'update') {\n    log('message: update', data);\n    (data.url.endsWith('.css') ? runCssStyleAccept(data) : runJsModuleAccept(data))\n      .then((ok) => {\n        if (ok) {\n          clearErrorOverlay();\n        } else {\n          reload();\n        }\n      })\n      .catch((err) => {\n        console.error('[ESM-HMR] Hot Update Error', err);\n        // A failed import gives a TypeError, but invalid ESM imports/exports give a SyntaxError.\n        // Failed build results already get reported via a better WebSocket update.\n        // We only want to report invalid code like a bad import that doesn't exist.\n        if (err instanceof SyntaxError) {\n          createNewErrorOverlay({\n            title: 'Hot Update Error',\n            fileLoc: data.url,\n            errorMessage: err.message,\n            errorStackTrace: err.stack,\n          });\n        }\n      });\n    return;\n  }\n  log('message: unknown', data);\n});\nlog('listening for file changes...');\n\n/** Runtime error reporting: If a runtime error occurs, show it in an overlay. */\nisWindowDefined &&\n  window.addEventListener('error', function (event) {\n    if (window.snowpackHmrErrorOverlayIgnoreErrors) {\n      const ignoreErrors = window.snowpackHmrErrorOverlayIgnoreErrors;\n      for (const item of ignoreErrors) {\n        if (event.message && event.message.match(item)) {\n          console.warn('[ESM-HMR] Hmr Error Overlay Ignored', event.message);\n          return;\n        }\n      }\n    }\n    // Generate an \"error location\" string\n    let fileLoc;\n    if (event.filename) {\n      fileLoc = event.filename;\n      if (event.lineno !== undefined) {\n        fileLoc += ` [:${event.lineno}`;\n        if (event.colno !== undefined) {\n          fileLoc += `:${event.colno}`;\n        }\n        fileLoc += `]`;\n      }\n    }\n    let errorMessage = event.message;\n    if (event.message === 'Uncaught ReferenceError: process is not defined') {\n      errorMessage += `\\n(Tip: Node's \"process\" global does not exist in Snowpack. Use \"import.meta.env\" instead of \"process.env\").`;\n    }\n    createNewErrorOverlay({\n      title: 'Unhandled Runtime Error',\n      fileLoc,\n      errorMessage: errorMessage,\n      errorStackTrace: event.error ? event.error.stack : undefined,\n    });\n  });\n"
  },
  {
    "path": "snowpack/assets/hmr-error-overlay.js",
    "content": "/*\nThis license applies to parts of this file originating from the\nhttps://github.com/vercel/next.js repository:\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Vercel, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n/*\nBackground: This file was copied from the rendered HTML output of the\nnextjs-error-overlay package / component. The source component was authored\nfor React & JSX which we didn't want to add as dependencies, so we grab the\noutput itself here.\n*/\n\nconst ERROR_OVERLAY_TEMPLATE = `\n    <style>\n          :host {\n            all: initial;\n\n            /* the direction property is not reset by 'all' */\n            direction: ltr;\n          }\n\n          /*!\n           * Bootstrap Reboot v4.4.1 (https://getbootstrap.com/)\n           * Copyright 2011-2019 The Bootstrap Authors\n           * Copyright 2011-2019 Twitter, Inc.\n           * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n           * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n           */\n          *,\n          *::before,\n          *::after {\n            box-sizing: border-box;\n          }\n\n          :host {\n            font-family: sans-serif;\n            line-height: 1.15;\n            -webkit-text-size-adjust: 100%;\n            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n          }\n\n          article,\n          aside,\n          figcaption,\n          figure,\n          footer,\n          header,\n          hgroup,\n          main,\n          nav,\n          section {\n            display: block;\n          }\n\n          :host {\n            margin: 0;\n            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n              'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n              'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n              'Noto Color Emoji';\n            font-size: 1rem;\n            font-weight: 400;\n            line-height: 1.5;\n            color: #212529;\n            text-align: left;\n            background-color: #fff;\n          }\n\n          [tabindex='-1']:focus:not(:focus-visible) {\n            outline: 0 !important;\n          }\n\n          hr {\n            box-sizing: content-box;\n            height: 0;\n            overflow: visible;\n          }\n\n          h1,\n          h2,\n          h3,\n          h4,\n          h5,\n          h6 {\n            margin-top: 0;\n            margin-bottom: 0.5rem;\n          }\n\n          p {\n            margin-top: 0;\n            margin-bottom: 1rem;\n          }\n\n          abbr[title],\n          abbr[data-original-title] {\n            text-decoration: underline;\n            -webkit-text-decoration: underline dotted;\n            text-decoration: underline dotted;\n            cursor: help;\n            border-bottom: 0;\n            -webkit-text-decoration-skip-ink: none;\n            text-decoration-skip-ink: none;\n          }\n\n          address {\n            margin-bottom: 1rem;\n            font-style: normal;\n            line-height: inherit;\n          }\n\n          ol,\n          ul,\n          dl {\n            margin-top: 0;\n            margin-bottom: 1rem;\n          }\n\n          ol ol,\n          ul ul,\n          ol ul,\n          ul ol {\n            margin-bottom: 0;\n          }\n\n          dt {\n            font-weight: 700;\n          }\n\n          dd {\n            margin-bottom: 0.5rem;\n            margin-left: 0;\n          }\n\n          blockquote {\n            margin: 0 0 1rem;\n          }\n\n          b,\n          strong {\n            font-weight: bolder;\n          }\n\n          small {\n            font-size: 80%;\n          }\n\n          sub,\n          sup {\n            position: relative;\n            font-size: 75%;\n            line-height: 0;\n            vertical-align: baseline;\n          }\n\n          sub {\n            bottom: -0.25em;\n          }\n\n          sup {\n            top: -0.5em;\n          }\n\n          a {\n            color: #007bff;\n            text-decoration: none;\n            background-color: transparent;\n          }\n\n          a:hover {\n            color: #0056b3;\n            text-decoration: underline;\n          }\n\n          a:not([href]) {\n            color: inherit;\n            text-decoration: none;\n          }\n\n          a:not([href]):hover {\n            color: inherit;\n            text-decoration: none;\n          }\n\n          pre,\n          code,\n          kbd,\n          samp {\n            font-family: SFMono-Regular, Menlo, Monaco, Consolas,\n              'Liberation Mono', 'Courier New', monospace;\n            font-size: 1em;\n          }\n\n          pre {\n            margin-top: 0;\n            margin-bottom: 1rem;\n            overflow: auto;\n          }\n\n          figure {\n            margin: 0 0 1rem;\n          }\n\n          img {\n            vertical-align: middle;\n            border-style: none;\n          }\n\n          svg {\n            overflow: hidden;\n            vertical-align: middle;\n          }\n\n          table {\n            border-collapse: collapse;\n          }\n\n          caption {\n            padding-top: 0.75rem;\n            padding-bottom: 0.75rem;\n            color: #6c757d;\n            text-align: left;\n            caption-side: bottom;\n          }\n\n          th {\n            text-align: inherit;\n          }\n\n          label {\n            display: inline-block;\n            margin-bottom: 0.5rem;\n          }\n\n          button {\n            border-radius: 0;\n          }\n\n          button:focus {\n            outline: 1px dotted;\n            outline: 5px auto -webkit-focus-ring-color;\n          }\n\n          input,\n          button,\n          select,\n          optgroup,\n          textarea {\n            margin: 0;\n            font-family: inherit;\n            font-size: inherit;\n            line-height: inherit;\n          }\n\n          button,\n          input {\n            overflow: visible;\n          }\n\n          button,\n          select {\n            text-transform: none;\n          }\n\n          select {\n            word-wrap: normal;\n          }\n\n          button,\n          [type='button'],\n          [type='reset'],\n          [type='submit'] {\n            -webkit-appearance: button;\n          }\n\n          button:not(:disabled),\n          [type='button']:not(:disabled),\n          [type='reset']:not(:disabled),\n          [type='submit']:not(:disabled) {\n            cursor: pointer;\n          }\n\n          button::-moz-focus-inner,\n          [type='button']::-moz-focus-inner,\n          [type='reset']::-moz-focus-inner,\n          [type='submit']::-moz-focus-inner {\n            padding: 0;\n            border-style: none;\n          }\n\n          input[type='radio'],\n          input[type='checkbox'] {\n            box-sizing: border-box;\n            padding: 0;\n          }\n\n          input[type='date'],\n          input[type='time'],\n          input[type='datetime-local'],\n          input[type='month'] {\n            -webkit-appearance: listbox;\n          }\n\n          textarea {\n            overflow: auto;\n            resize: vertical;\n          }\n\n          fieldset {\n            min-width: 0;\n            padding: 0;\n            margin: 0;\n            border: 0;\n          }\n\n          legend {\n            display: block;\n            width: 100%;\n            max-width: 100%;\n            padding: 0;\n            margin-bottom: 0.5rem;\n            font-size: 1.5rem;\n            line-height: inherit;\n            color: inherit;\n            white-space: normal;\n          }\n\n          progress {\n            vertical-align: baseline;\n          }\n\n          [type='number']::-webkit-inner-spin-button,\n          [type='number']::-webkit-outer-spin-button {\n            height: auto;\n          }\n\n          [type='search'] {\n            outline-offset: -2px;\n            -webkit-appearance: none;\n          }\n\n          [type='search']::-webkit-search-decoration {\n            -webkit-appearance: none;\n          }\n\n          ::-webkit-file-upload-button {\n            font: inherit;\n            -webkit-appearance: button;\n          }\n\n          output {\n            display: inline-block;\n          }\n\n          summary {\n            display: list-item;\n            cursor: pointer;\n          }\n\n          template {\n            display: none;\n          }\n\n          [hidden] {\n            display: none !important;\n          }\n        </style><style>\n          :host {\n            --size-gap-half: 0.25rem; /* 4px */\n            --size-gap: 0.5rem; /* 8px */\n            --size-gap-double: 1rem; /* 16px */\n            --size-gap-quad: 2rem; /* 32px */\n\n            --size-font-small: 0.875rem; /* 14px */\n            --size-font: 1rem; /* 16px */\n            --size-font-big: 1.25rem; /* 20px */\n            --size-font-bigger: 1.5rem; /* 24px */\n\n            --color-accents-1: #808080;\n            --color-accents-2: #222222;\n            --color-accents-3: #404040;\n\n            --font-stack-monospace: 'SFMono-Regular', Consolas,\n              'Liberation Mono', Menlo, Courier, monospace;\n\n            --color-ansi-selection: rgba(95, 126, 151, 0.48);\n            --color-ansi-bg: #111111;\n            --color-ansi-fg: #cccccc;\n\n            --color-ansi-white: #777777;\n            --color-ansi-black: #141414;\n            --color-ansi-blue: #00aaff;\n            --color-ansi-cyan: #88ddff;\n            --color-ansi-green: #98ec65;\n            --color-ansi-magenta: #aa88ff;\n            --color-ansi-red: #ff5555;\n            --color-ansi-yellow: #ffcc33;\n            --color-ansi-bright-white: #ffffff;\n            --color-ansi-bright-black: #777777;\n            --color-ansi-bright-blue: #33bbff;\n            --color-ansi-bright-cyan: #bbecff;\n            --color-ansi-bright-green: #b6f292;\n            --color-ansi-bright-magenta: #cebbff;\n            --color-ansi-bright-red: #ff8888;\n            --color-ansi-bright-yellow: #ffd966;\n          }\n\n          .mono {\n            font-family: var(--font-stack-monospace);\n          }\n\n          h1,\n          h2,\n          h3,\n          h4,\n          h5,\n          h6 {\n            margin-bottom: var(--size-gap);\n            font-weight: 500;\n            line-height: 1.5;\n          }\n\n          h1 {\n            font-size: 2.5rem;\n          }\n          h2 {\n            font-size: 2rem;\n          }\n          h3 {\n            font-size: 1.75rem;\n          }\n          h4 {\n            font-size: 1.5rem;\n          }\n          h5 {\n            font-size: 1.25rem;\n          }\n          h6 {\n            font-size: 1rem;\n          }\n    </style><style>\n\n        [data-nextjs-dialog-overlay] {\n            position: fixed;\n            top: 0;\n            right: 0;\n            bottom: 0;\n            left: 0;\n            overflow: auto;\n            z-index: 9000;\n\n            display: flex;\n            align-content: center;\n            align-items: center;\n            flex-direction: column;\n            padding: 10vh 15px 0;\n        }\n\n        @media (max-height: 812px) {\n            [data-nextjs-dialog-overlay] {\n            padding: 15px 15px 0;\n            }\n        }\n\n        [data-nextjs-dialog-backdrop] {\n            position: fixed;\n            top: 0;\n            right: 0;\n            bottom: 0;\n            left: 0;\n            background-color: rgba(42, 42, 42, 0.3);\n            background: linear-gradient(to bottom, rgba(42, 42, 42, 0.2) 0%,rgba(20, 20, 20, 0.3) 100%);\n\n            pointer-events: all;\n            z-index: -1;\n        }\n\n        [data-nextjs-dialog-backdrop-fixed] {\n            cursor: not-allowed;\n            -webkit-backdrop-filter: blur(8px);\n            backdrop-filter: blur(8px);\n        }\n\n\n        [data-nextjs-toast] {\n            position: fixed;\n            bottom: var(--size-gap-double);\n            left: var(--size-gap-double);\n            max-width: 420px;\n            z-index: 9000;\n        }\n\n        @media (max-width: 440px) {\n            [data-nextjs-toast] {\n            max-width: 90vw;\n            left: 5vw;\n            }\n        }\n\n        [data-nextjs-toast-wrapper] {\n            padding: 1rem;\n            border-radius: var(--size-gap-half);\n            font-weight: 500;\n            color: var(--color-ansi-bright-white);\n            background-color: var(--color-ansi-red);\n            box-shadow: 0px var(--size-gap-double) var(--size-gap-quad)\n            rgba(0, 0, 0, 0.25);\n        }\n\n\n        [data-nextjs-dialog] {\n            display: flex;\n            flex-direction: column;\n            width: 100%;\n            margin-right: auto;\n            margin-left: auto;\n            outline: none;\n            background: white;\n            border-radius: var(--size-gap);\n            box-shadow: 0 var(--size-gap-half) var(--size-gap-double)\n            rgba(0, 0, 0, 0.25);\n            max-height: calc(100% - 3.5rem);\n            overflow-y: hidden;\n        }\n\n        @media (max-height: 812px) {\n            [data-nextjs-dialog-overlay] {\n            max-height: calc(100% - 15px);\n            }\n        }\n\n        @media (min-width: 576px) {\n            [data-nextjs-dialog] {\n            max-width: 540px;\n            box-shadow: 0 var(--size-gap) var(--size-gap-quad) rgba(0, 0, 0, 0.25);\n            }\n        }\n\n        @media (min-width: 768px) {\n            [data-nextjs-dialog] {\n            max-width: 720px;\n            }\n        }\n\n        @media (min-width: 992px) {\n            [data-nextjs-dialog] {\n            max-width: 960px;\n            }\n        }\n\n        [data-nextjs-dialog-banner] {\n            position: relative;\n        }\n        [data-nextjs-dialog-banner].banner-warning {\n            border-color: var(--color-ansi-yellow);\n        }\n        [data-nextjs-dialog-banner].banner-error {\n            border-color: var(--color-ansi-red);\n        }\n\n        [data-nextjs-dialog-banner]::after {\n            z-index: 2;\n            content: '';\n            position: absolute;\n            top: 0;\n            right: 0;\n            width: 100%;\n            /* banner width: */\n            border-top-width: var(--size-gap-half);\n            border-bottom-width: 0;\n            border-top-style: solid;\n            border-bottom-style: solid;\n            border-top-color: inherit;\n            border-bottom-color: transparent;\n        }\n\n        [data-nextjs-dialog-content] {\n            overflow-y: auto;\n            border: none;\n            margin: 0;\n            /* calc(padding + banner width offset) */\n            padding: calc(var(--size-gap-double) + var(--size-gap-half))\n            var(--size-gap-double);\n            height: 100%;\n            display: flex;\n            flex-direction: column;\n        }\n        [data-nextjs-dialog-content] > [data-nextjs-dialog-header] {\n            flex-shrink: 0;\n            margin-bottom: var(--size-gap-double);\n        }\n        [data-nextjs-dialog-content] > [data-nextjs-dialog-body] {\n            position: relative;\n            flex: 1 1 auto;\n        }\n\n\n        [data-nextjs-dialog-left-right] {\n            display: flex;\n            flex-direction: row;\n            align-content: center;\n            align-items: center;\n            justify-content: space-between;\n        }\n        [data-nextjs-dialog-left-right] > nav > button {\n            display: inline-flex;\n            align-items: center;\n            justify-content: center;\n\n            width: calc(var(--size-gap-double) + var(--size-gap));\n            height: calc(var(--size-gap-double) + var(--size-gap));\n            font-size: 0;\n            border: none;\n            background-color: rgba(255, 85, 85, 0.1);\n            color: var(--color-ansi-red);\n            cursor: pointer;\n            transition: background-color 0.25s ease;\n        }\n        [data-nextjs-dialog-left-right] > nav > button > svg {\n            width: auto;\n            height: calc(var(--size-gap) + var(--size-gap-half));\n        }\n        [data-nextjs-dialog-left-right] > nav > button:hover {\n            background-color: rgba(255, 85, 85, 0.2);\n        }\n        [data-nextjs-dialog-left-right] > nav > button:disabled {\n            background-color: rgba(255, 85, 85, 0.1);\n            color: rgba(255, 85, 85, 0.4);\n            cursor: not-allowed;\n        }\n\n        [data-nextjs-dialog-left-right] > nav > button:first-of-type {\n            border-radius: var(--size-gap-half) 0 0 var(--size-gap-half);\n            margin-right: 1px;\n        }\n        [data-nextjs-dialog-left-right] > nav > button:last-of-type {\n            border-radius: 0 var(--size-gap-half) var(--size-gap-half) 0;\n        }\n\n        [data-nextjs-dialog-left-right] > button:last-of-type {\n            border: 0;\n            padding: 0;\n\n            background-color: transparent;\n            appearance: none;\n\n            opacity: 0.4;\n            transition: opacity 0.25s ease;\n        }\n        [data-nextjs-dialog-left-right] > button:last-of-type:hover {\n            opacity: 0.7;\n        }\n\n\n        [data-nextjs-codeframe] {\n            border-radius: var(--size-gap-half);\n            background-color: var(--color-ansi-bg);\n            color: var(--color-ansi-fg);\n        }\n        [data-nextjs-codeframe]::selection,\n        [data-nextjs-codeframe] *::selection {\n            background-color: var(--color-ansi-selection);\n        }\n        [data-nextjs-codeframe] * {\n            color: inherit;\n            background-color: transparent;\n            font-family: var(--font-stack-monospace);\n            font-size: var(--size-font-small);\n        }\n\n        [data-nextjs-codeframe] > * {\n            margin: 0;\n            padding: calc(var(--size-gap) + var(--size-gap-half))\n            calc(var(--size-gap-double) + var(--size-gap-half));\n        }\n        [data-nextjs-codeframe] > hr {\n            margin: 0;\n            padding: 0;\n\n            border: none;\n            border-style: solid;\n            border-width: 0;\n            border-bottom-width: 1px;\n            border-color: var(--color-ansi-bright-black);\n        }\n\n        [data-nextjs-codeframe] > p {\n            display: flex;\n            align-items: center;\n            justify-content: space-between;\n            user-select: all;\n        }\n        [data-nextjs-codeframe] > p:hover {\n            background: #FFF2;\n\n        }\n        [data-nextjs-codeframe] > p > svg {\n            width: auto;\n            height: 1em;\n            margin-left: 0.5rem;\n        }\n\n\n        [data-nextjs-terminal] {\n            border-radius: var(--size-gap-half);\n            background-color: var(--color-ansi-bg);\n            color: var(--color-ansi-fg);\n        }\n        [data-nextjs-terminal]::selection,\n        [data-nextjs-terminal] *::selection {\n            background-color: var(--color-ansi-selection);\n        }\n        [data-nextjs-terminal] * {\n            color: inherit;\n            background-color: transparent;\n            font-family: var(--font-stack-monospace);\n        }\n        [data-nextjs-terminal] > * {\n            margin: 0;\n            padding: calc(var(--size-gap) + var(--size-gap-half))\n            calc(var(--size-gap-double) + var(--size-gap-half));\n        }\n\n        [data-nextjs-terminal] pre {\n            white-space: pre-wrap;\n            word-break: break-word;\n        }\n\n\n\n        .nextjs-container-build-error-header > h4 {\n            line-height: 1.5;\n            margin: 0;\n            padding: 0;\n        }\n\n        .nextjs-container-build-error-body footer {\n            margin-top: var(--size-gap);\n        }\n        .nextjs-container-build-error-body footer p {\n            margin: 0;\n        }\n\n        .nextjs-container-build-error-body small {\n            color: #757575;\n        }\n\n\n        .nextjs-container-errors-header > h1 {\n            font-size: var(--size-font-big);\n            line-height: var(--size-font-bigger);\n            font-weight: bold;\n            margin: 0;\n            margin-top: calc(var(--size-gap-double) + var(--size-gap-half));\n        }\n        .nextjs-container-errors-header small {\n            font-size: var(--size-font-small);\n            color: var(--color-accents-1);\n            margin-left: var(--size-gap-double);\n        }\n        .nextjs-container-errors-header small > span {\n            font-family: var(--font-stack-monospace);\n        }\n        .nextjs-container-errors-header > p {\n            font-family: var(--font-stack-monospace);\n            font-size: var(--size-font-small);\n            line-height: var(--size-font-big);\n            font-weight: bold;\n            margin: 0;\n            margin-top: var(--size-gap-half);\n            color: var(--color-ansi-red);\n            white-space: pre-wrap;\n        }\n        .nextjs-container-errors-header > div > small {\n            margin: 0;\n            margin-top: var(--size-gap-half);\n        }\n        .nextjs-container-errors-header > p > a {\n            color: var(--color-ansi-red);\n        }\n\n        .nextjs-container-errors-body > h5:not(:first-child) {\n            margin-top: calc(var(--size-gap-double) + var(--size-gap));\n        }\n        .nextjs-container-errors-body > h5 {\n            margin-bottom: var(--size-gap);\n        }\n\n        .nextjs-toast-errors-parent {\n            cursor: pointer;\n            transition: transform 0.2s ease;\n        }\n        .nextjs-toast-errors-parent:hover {\n            transform: scale(1.1);\n        }\n        .nextjs-toast-errors {\n            display: flex;\n            align-items: center;\n            justify-content: flex-start;\n        }\n        .nextjs-toast-errors > svg {\n            margin-right: var(--size-gap);\n        }\n\n\n        button[data-nextjs-data-runtime-error-collapsed-action] {\n            background: none;\n            border: none;\n            padding: 0;\n            font-size: var(--size-font-small);\n            line-height: var(--size-font-bigger);\n            color: var(--color-accents-3);\n        }\n\n        [data-nextjs-call-stack-frame]:not(:last-child) {\n            margin-bottom: var(--size-gap-double);\n        }\n\n        [data-nextjs-call-stack-frame] > h6 {\n            margin-top: 0;\n            margin-bottom: var(--size-gap);\n            font-family: var(--font-stack-monospace);\n            color: #222;\n        }\n        [data-nextjs-call-stack-frame] > h6[data-nextjs-frame-expanded='false'] {\n            color: #666;\n        }\n        [data-nextjs-call-stack-frame] > div {\n            display: flex;\n            align-items: center;\n            padding-left: calc(var(--size-gap) + var(--size-gap-half));\n            font-size: var(--size-font-small);\n            color: #999;\n        }\n        [data-nextjs-call-stack-frame] > div > svg {\n            width: auto;\n            height: var(--size-font-small);\n            margin-left: var(--size-gap);\n\n            display: none;\n        }\n\n        [data-nextjs-call-stack-frame] > div[data-has-source] {\n            cursor: pointer;\n        }\n        [data-nextjs-call-stack-frame] > div[data-has-source]:hover {\n            text-decoration: underline dotted;\n        }\n        [data-nextjs-call-stack-frame] > div[data-has-source] > svg {\n            display: unset;\n        }\n\n    </style>\n\n    <div data-nextjs-dialog-overlay=\"true\"><div data-nextjs-dialog-backdrop=\"true\"></div><div data-nextjs-dialog=\"true\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"nextjs__container_errors_label\" aria-describedby=\"nextjs__container_errors_desc\" aria-modal=\"true\"><div data-nextjs-dialog-banner=\"true\" class=\"banner-error\"></div><div data-nextjs-dialog-content=\"true\"><div data-nextjs-dialog-header=\"true\" class=\"nextjs-container-errors-header\"><div data-nextjs-dialog-left-right=\"true\">\n    <nav>\n        <button type=\"button\" disabled=\"\" aria-disabled=\"true\"><svg viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.99996 1.16666L1.16663 6.99999L6.99996 12.8333M12.8333 6.99999H1.99996H12.8333Z\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path></svg></button><button type=\"button\" disabled=\"\" aria-disabled=\"true\"><svg viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.99996 1.16666L12.8333 6.99999L6.99996 12.8333M1.16663 6.99999H12H1.16663Z\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path></svg></button>\n        &nbsp;<small><span>1</span> of <span>1</span> unhandled error</small>\n    </nav>\n    <button id=\"close-button\" type=\"button\" aria-label=\"Close\"><span aria-hidden=\"true\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18 6L6 18\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path><path d=\"M6 6L18 18\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path></svg></span></button></div><h1 id=\"nextjs__container_errors_label\">Error</h1><p id=\"nextjs__container_errors_desc\"></p></div><div data-nextjs-dialog-body=\"true\" class=\"nextjs-container-errors-body\"><h5>Source</h5><div data-nextjs-codeframe=\"true\">\n    <p>\n        <span id=\"error-file-loc\">Loading...</span>\n        <!--<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"></path><polyline points=\"15 3 21 3 21 9\"></polyline><line x1=\"10\" y1=\"14\" x2=\"21\" y2=\"3\"></line></svg>-->\n    </p>\n    <hr><pre>Loading...</pre></div>\n    </div></div></div></div>\n`;\n\nconst template = document.createElement('template');\ntemplate.innerHTML = ERROR_OVERLAY_TEMPLATE;\n\ncustomElements.define(\n  'hmr-error-overlay',\n  class HmrErrorOverlay extends HTMLElement {\n    constructor({title, errorMessage, fileLoc, errorStackTrace}) {\n      super();\n      this.title = title;\n      this.errorMessage = errorMessage;\n      this.fileLoc = fileLoc;\n      this.errorStackTrace = errorStackTrace;\n      this.sr = this.attachShadow({mode: 'open'});\n      this.sr.appendChild(template.content.cloneNode(true));\n      this.close = this.close.bind(this);\n    }\n\n    connectedCallback() {\n      this.sr.getElementById('close-button').addEventListener('click', this.close);\n      this.sr.querySelector('[data-nextjs-dialog-backdrop]').addEventListener('click', this.close);\n\n      this.sr.getElementById('nextjs__container_errors_label').innerText = this.title;\n      this.sr.getElementById('nextjs__container_errors_desc').innerText = this.errorMessage;\n      if (this.fileLoc) {\n        this.sr.getElementById('error-file-loc').innerText = this.fileLoc;\n      } else {\n        this.sr.getElementById('error-file-loc').innerText = 'No source file.';\n      }\n      if (this.errorStackTrace) {\n        this.sr.querySelector('pre').innerText = this.errorStackTrace;\n      } else {\n        this.sr.querySelector('pre').style.display = 'none';\n      }\n    }\n\n    disconnectedCallback() {\n      this.sr.getElementById('close-button').removeEventListener('click', this.close);\n      this.sr\n        .querySelector('[data-nextjs-dialog-backdrop]')\n        .removeEventListener('click', this.close);\n    }\n\n    close() {\n      this.parentNode.removeChild(this);\n    }\n\n    _watchEscape(event) {\n      if (event.key === 'Escape') {\n        this.close();\n      }\n    }\n  },\n);\n"
  },
  {
    "path": "snowpack/assets/openChrome.appleScript",
    "content": "(*\nCopyright (c) 2015-present, Facebook, Inc.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n*)\n\nproperty targetTab: null\nproperty targetTabIndex: -1\nproperty targetWindow: null\n\non run argv\n  set theURL to item 1 of argv\n\n  tell application \"Chrome\"\n\n    if (count every window) = 0 then\n      make new window\n    end if\n\n    -- 1: Looking for tab running debugger\n    -- then, Reload debugging tab if found\n    -- then return\n    set found to my lookupTabWithUrl(theURL)\n    if found then\n      set targetWindow's active tab index to targetTabIndex\n      tell targetTab to reload\n      tell targetWindow to activate\n      set index of targetWindow to 1\n      return\n    end if\n\n    -- 2: Looking for Empty tab\n    -- In case debugging tab was not found\n    -- We try to find an empty tab instead\n    set found to my lookupTabWithUrl(\"chrome://newtab/\")\n    if found then\n      set targetWindow's active tab index to targetTabIndex\n      set URL of targetTab to theURL\n      tell targetWindow to activate\n      return\n    end if\n\n    -- 3: Create new tab\n    -- both debugging and empty tab were not found\n    -- make a new tab with url\n    tell window 1\n      activate\n      make new tab with properties {URL:theURL}\n    end tell\n  end tell\nend run\n\n-- Function:\n-- Lookup tab with given url\n-- if found, store tab, index, and window in properties\n-- (properties were declared on top of file)\non lookupTabWithUrl(lookupUrl)\n  tell application \"Chrome\"\n    -- Find a tab with the given url\n    set found to false\n    set theTabIndex to -1\n    repeat with theWindow in every window\n      set theTabIndex to 0\n      repeat with theTab in every tab of theWindow\n        set theTabIndex to theTabIndex + 1\n        if (theTab's URL as string) contains lookupUrl then\n          -- assign tab, tab index, and window to properties\n          set targetTab to theTab\n          set targetTabIndex to theTabIndex\n          set targetWindow to theWindow\n          set found to true\n          exit repeat\n        end if\n      end repeat\n\n      if found then\n        exit repeat\n      end if\n    end repeat\n  end tell\n  return found\nend lookupTabWithUrl"
  },
  {
    "path": "snowpack/assets/require-or-import.js",
    "content": "'use strict';\nconst {pathToFileURL} = require('url');\nconst NATIVE_REQUIRE = eval('require');\nconst NATIVE_IMPORT = (filepath) => import(filepath);\nconst r = require('resolve');\n\n/**\n * A utility function to use Node's native `require` or dynamic `import` to load CJS or ESM files\n * @param {string} filepath\n */\nmodule.exports = async function requireOrImport(filepath, {from = process.cwd()} = {}) {\n  return new Promise((resolve, reject) => {\n    if (filepath.startsWith('node:')) {\n      return NATIVE_IMPORT(filepath).then(\n        (mdl) => resolve(mdl),\n        (err) => reject(err),\n      );\n    }\n\n    // Resolve path based on `from`\n    const resolvedPath = r.sync(filepath, {\n      basedir: from,\n    });\n    try {\n      const mdl = NATIVE_REQUIRE(resolvedPath);\n\n      // Add a `default` property on a CommonJS export so that it can be accessed from import statements.\n      // This is set to enumerable: false to make it hidden(ish) to code.\n      if (mdl && !('default' in mdl)) {\n        Object.defineProperty(mdl, 'default', {\n          configurable: true,\n          enumerable: false,\n          writable: true,\n          value: mdl,\n        });\n      }\n\n      resolve(mdl);\n    } catch (e) {\n      if (e instanceof SyntaxError && /export|import/.test(e.message)) {\n        console.error(\n          `Failed to load \"${filepath}\"!\\nESM format is not natively supported in \"node@${process.version}\".\\nPlease use CommonJS or upgrade to an LTS version of node above \"node@12.17.0\".`,\n        );\n      } else if (e.code === 'ERR_REQUIRE_ESM') {\n        const url = pathToFileURL(resolvedPath);\n        return NATIVE_IMPORT(url).then(\n          (mdl) => resolve(mdl.default ? mdl.default : mdl),\n          (err) => reject(err),\n        );\n      }\n      try {\n        return NATIVE_IMPORT(pathToFileURL(resolvedPath)).then(\n          (mdl) => resolve(mdl.default ? mdl.default : mdl),\n          (err) => reject(err),\n        );\n      } catch (e) {\n        reject(e);\n      }\n    }\n  });\n};\n"
  },
  {
    "path": "snowpack/assets/snowpack-init-file.js",
    "content": "// Snowpack Configuration File\n// See all supported options: https://www.snowpack.dev/reference/configuration\n\n/** @type {import(\"snowpack\").SnowpackUserConfig } */\nmodule.exports = {\n  mount: {\n    /* ... */\n  },\n  plugins: [\n    /* ... */\n  ],\n  packageOptions: {\n    /* ... */\n  },\n  devOptions: {\n    /* ... */\n  },\n  buildOptions: {\n    /* ... */\n  },\n};\n"
  },
  {
    "path": "snowpack/index.bin.js",
    "content": "#!/usr/bin/env node\n'use strict';\n\nconst ver = process.versions.node;\nconst majorVer = parseInt(ver.split('.')[0], 10);\n\nif (majorVer < 10) {\n  console.error('Node version ' + ver + ' is not supported, please use Node.js 10.0 or higher.');\n  process.exit(1);\n}\n\nconst cli = require('./lib/cjs/index.js');\nconst run = cli.run || cli.cli || cli.default;\nrun(process.argv).catch(function (error) {\n  console.error(`\n${error.stack || error.message || error}\n`);\n  process.exit(1);\n});\n"
  },
  {
    "path": "snowpack/package.json",
    "content": "{\n  \"name\": \"snowpack\",\n  \"version\": \"3.8.8\",\n  \"description\": \"The ESM-powered frontend build tool. Fast, lightweight, unbundled.\",\n  \"author\": \"Fred K. Schott <fkschott@gmail.com>\",\n  \"license\": \"MIT\",\n  \"keywords\": [\n    \"bundle\",\n    \"build\",\n    \"build tool\",\n    \"web\",\n    \"esm\",\n    \"esbuild\",\n    \"wasm\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/withastro/snowpack.git\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc --noUnusedLocals false --noUnusedParameters false && tsc -p tsconfig.cjs.json\",\n    \"build:watch\": \"tsc --watch -p tsconfig.cjs.json\",\n    \"lint\": \"tsc --noEmit\"\n  },\n  \"engines\": {\n    \"node\": \">=10.19.0\"\n  },\n  \"types\": \"./lib/cjs/index.d.ts\",\n  \"main\": \"./lib/cjs/index.js\",\n  \"bin\": {\n    \"sp\": \"./index.bin.js\",\n    \"snowpack\": \"./index.bin.js\"\n  },\n  \"files\": [\n    \"assets\",\n    \"lib\",\n    \"index.bin.js\"\n  ],\n  \"dependencies\": {\n    \"@npmcli/arborist\": \"^2.6.4\",\n    \"bufferutil\": \"^4.0.2\",\n    \"cachedir\": \"^2.3.0\",\n    \"cheerio\": \"1.0.0-rc.10\",\n    \"chokidar\": \"^3.4.0\",\n    \"cli-spinners\": \"^2.5.0\",\n    \"compressible\": \"^2.0.18\",\n    \"deepmerge\": \"^4.2.2\",\n    \"default-browser-id\": \"^2.0.0\",\n    \"detect-port\": \"^1.3.0\",\n    \"es-module-lexer\": \"^0.3.24\",\n    \"esbuild\": \"~0.9.0\",\n    \"esinstall\": \"^1.1.7\",\n    \"estree-walker\": \"^2.0.2\",\n    \"etag\": \"^1.8.1\",\n    \"execa\": \"^5.1.1\",\n    \"fdir\": \"^5.0.0\",\n    \"find-cache-dir\": \"^3.3.1\",\n    \"find-up\": \"^5.0.0\",\n    \"glob\": \"^7.1.7\",\n    \"httpie\": \"^1.1.2\",\n    \"is-plain-object\": \"^5.0.0\",\n    \"is-reference\": \"^1.2.1\",\n    \"isbinaryfile\": \"^4.0.6\",\n    \"jsonschema\": \"~1.2.5\",\n    \"kleur\": \"^4.1.1\",\n    \"magic-string\": \"^0.25.7\",\n    \"meriyah\": \"^3.1.6\",\n    \"mime-types\": \"^2.1.26\",\n    \"mkdirp\": \"^1.0.3\",\n    \"npm-run-path\": \"^4.0.1\",\n    \"open\": \"^8.2.1\",\n    \"pacote\": \"^11.3.4\",\n    \"periscopic\": \"^2.0.3\",\n    \"picomatch\": \"^2.3.0\",\n    \"postcss\": \"^8.3.5\",\n    \"postcss-modules\": \"^4.0.0\",\n    \"resolve\": \"^1.20.0\",\n    \"resolve-from\": \"^5.0.0\",\n    \"rimraf\": \"^3.0.0\",\n    \"rollup\": \"~2.37.1\",\n    \"signal-exit\": \"^3.0.3\",\n    \"skypack\": \"^0.3.2\",\n    \"slash\": \"~3.0.0\",\n    \"source-map\": \"^0.7.3\",\n    \"strip-ansi\": \"^6.0.0\",\n    \"strip-comments\": \"^2.0.1\",\n    \"utf-8-validate\": \"^5.0.3\",\n    \"ws\": \"^7.3.0\",\n    \"yargs-parser\": \"^20.0.0\"\n  },\n  \"devDependencies\": {\n    \"@types/cheerio\": \"^0.22.29\"\n  },\n  \"optionalDependencies\": {\n    \"fsevents\": \"^2.3.2\"\n  }\n}\n"
  },
  {
    "path": "snowpack/src/build/build-import-proxy.ts",
    "content": "import path from 'path';\nimport {logger} from '../logger';\nimport {SnowpackConfig} from '../types';\nimport {\n  appendHtmlToHead,\n  hasExtension,\n  spliceString,\n  HMR_CLIENT_CODE,\n  HMR_OVERLAY_CODE,\n} from '../util';\nimport {generateSRI} from './import-sri';\nimport {scanImportGlob} from '../scan-import-glob';\nimport {cssModuleJSON} from './import-css';\n\nexport const SRI_CLIENT_HMR_SNOWPACK = generateSRI(Buffer.from(HMR_CLIENT_CODE));\nexport const SRI_ERROR_HMR_SNOWPACK = generateSRI(Buffer.from(HMR_OVERLAY_CODE));\n\nconst importMetaRegex = /import\\s*\\.\\s*meta/;\n\nexport function getMetaUrlPath(urlPath: string, config: SnowpackConfig): string {\n  return path.posix.normalize(path.posix.join('/', config.buildOptions.metaUrlPath, urlPath));\n}\n\nexport function wrapImportMeta({\n  code,\n  hmr,\n  env,\n  config,\n}: {\n  code: string;\n  hmr: boolean;\n  env: boolean;\n  config: SnowpackConfig;\n}) {\n  // Create Regex expressions here, since global regex has per-string state\n  const importMetaHotRegex = /import\\s*\\.\\s*meta\\s*\\.\\s*hot/g;\n  const importMetaEnvRegex = /import\\s*\\.\\s*meta\\s*\\.\\s*env/g;\n  // Optimize: replace direct references to `import.meta.hot` by inlining undefined.\n  // Do this first so that we can bail out in the next `import.meta` test.\n  if (!hmr) {\n    code = code.replace(importMetaHotRegex, 'undefined /* [snowpack] import.meta.hot */ ');\n  }\n  if (!importMetaRegex.test(code)) {\n    return code;\n  }\n  let hmrSnippet = ``;\n  if (hmr) {\n    hmrSnippet = `import * as  __SNOWPACK_HMR__ from '${getMetaUrlPath(\n      'hmr-client.js',\n      config,\n    )}';\\nimport.meta.hot = __SNOWPACK_HMR__.createHotContext(import.meta.url);\\n`;\n  }\n  let envSnippet = ``;\n  if (env) {\n    envSnippet = `import * as __SNOWPACK_ENV__ from '${getMetaUrlPath('env.js', config)}';\\n`;\n    // Optimize any direct references `import.meta.env` by inlining the ref\n    code = code.replace(importMetaEnvRegex, '__SNOWPACK_ENV__');\n    // If we still detect references to `import.meta`, assign `import.meta.env` to be safe\n    if (importMetaRegex.test(code)) {\n      envSnippet += `import.meta.env = __SNOWPACK_ENV__;\\n`;\n    }\n  }\n  return hmrSnippet + envSnippet + '\\n' + code;\n}\n\nexport function wrapHtmlResponse({\n  code,\n  hmr,\n  hmrPort,\n  isDev,\n  config,\n  mode,\n}: {\n  code: string;\n  hmr: boolean;\n  hmrPort?: number;\n  isDev: boolean;\n  config: SnowpackConfig;\n  mode: 'development' | 'production';\n}) {\n  // replace %PUBLIC_URL% (along with surrounding slashes, if any)\n  code = code.replace(/\\/?%PUBLIC_URL%\\/?/g, isDev ? '/' : config.buildOptions.baseUrl);\n  // replace %MODE%\n  code = code.replace(/%MODE%/g, mode);\n\n  // replace any %SNOWPACK_PUBLIC_*%\n  const snowpackPublicEnv = getSnowpackPublicEnvVariables();\n  code = code.replace(/%SNOWPACK_PUBLIC_.+?%/gi, (match: string) => {\n    const envVariableName = match.slice(1, -1);\n\n    if (envVariableName in snowpackPublicEnv) {\n      return snowpackPublicEnv[envVariableName] || '';\n    }\n\n    logger.warn(`Environment variable \"${envVariableName}\" is not set`);\n\n    return match;\n  });\n\n  // replace any env variables defined in the config\n  for (const envVar in config.env) {\n    const matcher = new RegExp(`%${envVar}%`, 'g');\n    const val = config.env[envVar] as string;\n    code = code.replace(matcher, val);\n  }\n\n  // Full Page Transformations: Only full page responses should get these transformations.\n  // Any code not containing `<!DOCTYPE html>` is assumed to be an HTML fragment.\n  const isFullPage = code.trim().toLowerCase().startsWith('<!doctype html>');\n  if (hmr && !isFullPage && !config.buildOptions.htmlFragments) {\n    throw new Error(`HTML fragment found!\nHTML fragments (files not starting with \"<!doctype html>\") are not transformed like full HTML pages.\nAdd the missing doctype, or set buildOptions.htmlFragments=true if HTML fragments are expected.`);\n  }\n  if (hmr && isFullPage) {\n    let hmrScript = ``;\n    if (hmrPort) {\n      hmrScript += `<script>window.HMR_WEBSOCKET_PORT=${hmrPort}</script>\\n`;\n    }\n    hmrScript += `<script type=\"module\" integrity=\"${SRI_CLIENT_HMR_SNOWPACK}\" src=\"${getMetaUrlPath(\n      'hmr-client.js',\n      config,\n    )}\"></script>`;\n    if (config.devOptions.hmrErrorOverlay) {\n      hmrScript += `<script type=\"module\" integrity=\"${SRI_ERROR_HMR_SNOWPACK}\" src=\"${getMetaUrlPath(\n        'hmr-error-overlay.js',\n        config,\n      )}\"></script>`;\n    }\n    code = appendHtmlToHead(code, hmrScript);\n  }\n  return code;\n}\n\nfunction generateJsonImportProxy({\n  code,\n  hmr,\n  config,\n}: {\n  code: string;\n  hmr: boolean;\n  config: SnowpackConfig;\n}) {\n  const jsonImportProxyCode = `let json = ${JSON.stringify(JSON.parse(code))};\nexport default json;`;\n  return wrapImportMeta({code: jsonImportProxyCode, hmr, env: false, config});\n}\n\nfunction generateCssImportProxy({\n  code,\n  hmr,\n  config,\n}: {\n  code: string;\n  hmr: boolean;\n  config: SnowpackConfig;\n}) {\n  const cssImportProxyCode = `// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {${\n    hmr\n      ? `\n  import.meta.hot.accept();\n  import.meta.hot.dispose(() => {\n    document.head.removeChild(styleEl);\n  });\\n`\n      : ''\n  }\n  const code = ${JSON.stringify(code)};\n\n  const styleEl = document.createElement(\"style\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}`;\n  return wrapImportMeta({code: cssImportProxyCode, hmr, env: false, config});\n}\n\nfunction createImportGlobValue(importGlob, i: number): {value: string; imports: string} {\n  let value: string;\n  let imports: string;\n\n  if (importGlob.isEager) {\n    value = `{\\n${importGlob.resolvedImports\n      .map(\n        (spec: string, j: number, {length: len}) =>\n          `\\t\"${spec}\": __glob__${i}_${j}${j === len - 1 ? '' : ','}`,\n      )\n      .join('\\n')}\\n}`;\n    imports = importGlob.resolvedImports\n      .map((spec: string, j: number) => `import * as __glob__${i}_${j} from '${spec}';`)\n      .join('\\n');\n  } else {\n    value = `{\\n${importGlob.resolvedImports\n      .map(\n        (spec: string, j: number, {length: len}) =>\n          `\\t\"${spec}\": () => import(\"${spec}\")${j === len - 1 ? '' : ','}`,\n      )\n      .join('\\n')}\\n}`;\n    imports = '';\n  }\n\n  return {value, imports};\n}\n\nexport async function transformGlobImports({\n  contents: _code,\n  resolveImportGlobSpecifier = async (i) => [i],\n}: {\n  contents: string;\n  resolveImportGlobSpecifier: any;\n}) {\n  const importGlobs = scanImportGlob(_code);\n  let rewrittenCode = _code;\n  const resolvedImportGlobs = await Promise.all(\n    importGlobs.reverse().map(({glob, ...importGlob}) => {\n      return resolveImportGlobSpecifier(glob).then((resolvedImports) => ({\n        ...importGlob,\n        glob,\n        resolvedImports,\n      }));\n    }),\n  );\n\n  resolvedImportGlobs.forEach((importGlob, i) => {\n    const {value, imports} = createImportGlobValue(importGlob, i);\n    rewrittenCode = spliceString(rewrittenCode, value, importGlob.start, importGlob.end);\n    if (imports) {\n      rewrittenCode = `${imports}\\n${rewrittenCode}`;\n    }\n  });\n\n  return rewrittenCode;\n}\n\nasync function generateCssModuleImportProxy({\n  url,\n  code,\n  hmr,\n  config,\n}: {\n  url: string;\n  code: string;\n  hmr: boolean;\n  config: SnowpackConfig;\n}) {\n  const reqUrl = url.replace(new RegExp(`^${config.buildOptions.baseUrl}`), '/'); // note: in build, buildOptions.baseUrl gets prepended. Remove that for looking up CSS Module code\n  return `\nexport let code = ${JSON.stringify(code)};\nlet json = ${cssModuleJSON(reqUrl)};\nexport default json;\n${\n  hmr\n    ? `\nimport * as __SNOWPACK_HMR_API__ from '${getMetaUrlPath('hmr-client.js', config)}';\nimport.meta.hot = __SNOWPACK_HMR_API__.createHotContext(import.meta.url);\\n`\n    : ``\n}\n// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {${\n    hmr\n      ? `\n  import.meta.hot.dispose(() => {\n    document && document.head.removeChild(styleEl);\n  });\\n`\n      : ``\n  }\n  const styleEl = document.createElement(\"style\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}`;\n}\n\nfunction generateDefaultImportProxy(url: string) {\n  return `export default ${JSON.stringify(url)};`;\n}\n\nexport async function wrapImportProxy({\n  url,\n  code,\n  hmr,\n  config,\n}: {\n  url: string;\n  code: string | Buffer;\n  hmr: boolean;\n  config: SnowpackConfig;\n}) {\n  if (hasExtension(url, '.json')) {\n    return generateJsonImportProxy({code: code.toString(), hmr, config});\n  }\n\n  if (hasExtension(url, '.css')) {\n    // if proxying a CSS file, remove its source map (the path no longer applies)\n    const sanitized = code.toString().replace(/\\/\\*#\\s*sourceMappingURL=[^/]+\\//gm, '');\n    return hasExtension(url, '.module.css')\n      ? generateCssModuleImportProxy({url, code: sanitized, hmr, config})\n      : generateCssImportProxy({code: sanitized, hmr, config});\n  }\n\n  return generateDefaultImportProxy(url);\n}\n\nexport function generateEnvModule({\n  mode,\n  isSSR,\n  configEnv,\n}: {\n  mode: SnowpackConfig['mode'];\n  isSSR: boolean;\n  configEnv?: Record<string, string | boolean | undefined>;\n}) {\n  const envObject: Record<string, string | boolean | undefined> = {\n    ...getSnowpackPublicEnvVariables(),\n    ...(configEnv ?? {}),\n    MODE: mode,\n    NODE_ENV: mode,\n    SSR: isSSR,\n  };\n\n  return Object.entries(envObject)\n    .map(([key, val]) => {\n      return `export const ${key} = ${JSON.stringify(val)};`;\n    })\n    .join('\\n');\n}\n\nconst PUBLIC_ENV_REGEX = /^SNOWPACK_PUBLIC_.+/;\nfunction getSnowpackPublicEnvVariables() {\n  const envObject = {...process.env};\n  for (const env of Object.keys(envObject)) {\n    if (!PUBLIC_ENV_REGEX.test(env)) {\n      delete envObject[env];\n    }\n  }\n  return envObject;\n}\n"
  },
  {
    "path": "snowpack/src/build/build-pipeline.ts",
    "content": "import path from 'path';\nimport {RawSourceMap, SourceMapConsumer, SourceMapGenerator} from 'source-map';\nimport url from 'url';\nimport {validatePluginLoadResult} from '../config';\nimport {logger} from '../logger';\nimport {PluginTransformResult, SnowpackBuildMap, SnowpackConfig} from '../types';\nimport {getExtension, readFile, removeExtension} from '../util';\nimport {cssModules, needsCSSModules} from './import-css';\n\nexport interface BuildFileOptions {\n  isDev: boolean;\n  isSSR: boolean;\n  isPackage: boolean;\n  isHmrEnabled: boolean;\n  config: SnowpackConfig;\n}\n\n/**\n * Build Plugin First Pass: If a plugin defines a\n * `resolve` object, check it against the current\n * file's extension. If it matches, call the load()\n * functon and return it's result.\n *\n * If no match is found, fall back to just reading\n * the file from disk and return it.\n */\nasync function runPipelineLoadStep(\n  srcPath: string,\n  {isDev, isSSR, isPackage, isHmrEnabled, config}: BuildFileOptions,\n): Promise<SnowpackBuildMap> {\n  const srcExt = getExtension(srcPath);\n\n  const result: SnowpackBuildMap = {};\n\n  for (const step of config.plugins) {\n    if (!step.resolve || !step.resolve.input.some((ext) => srcPath.endsWith(ext))) {\n      continue;\n    }\n    if (!step.load) {\n      continue;\n    }\n    // v3.1: Some plugins break when run on node_modules/. This fix is in place until the plugins themselves have a chance to update.\n    if (step.name.endsWith('@prefresh/snowpack/dist/index.js') && isPackage) {\n      continue;\n    }\n    try {\n      const debugPath = path.relative(config.root, srcPath);\n      logger.debug(`load() starting… [${debugPath}]`, {name: step.name});\n      const stepResult = await step.load({\n        fileExt: srcExt,\n        filePath: srcPath,\n        isDev,\n        isSSR,\n        isPackage,\n        isHmrEnabled,\n      });\n      logger.debug(`✔ load() success [${debugPath}]`, {name: step.name});\n\n      validatePluginLoadResult(step, stepResult);\n\n      if (typeof stepResult === 'string' || Buffer.isBuffer(stepResult)) {\n        const mainOutputExt = step.resolve.output[0];\n        result[mainOutputExt] = {code: stepResult};\n      } else if (stepResult && typeof stepResult === 'object') {\n        Object.keys(stepResult).forEach((ext) => {\n          const output = stepResult[ext];\n\n          // normalize to {code, map} format\n          if (typeof output === 'string' || Buffer.isBuffer(output)) {\n            result[ext] = {code: output};\n          } else if (output) {\n            result[ext] = output;\n          }\n\n          // ensure source maps are strings (it’s easy for plugins to pass back a JSON object)\n          if (result[ext].map && typeof result[ext].map === 'object') {\n            result[ext].map = JSON.stringify(stepResult[ext].map);\n          }\n\n          // if source maps disabled, don’t return any\n          if (!config.buildOptions.sourcemap) result[ext].map = undefined;\n        });\n\n        break;\n      }\n    } catch (err) {\n      // Attach metadata detailing where the error occurred.\n      err.__snowpackBuildDetails = {name: step.name, step: 'load'};\n      throw err;\n    }\n  }\n\n  // handle CSS Modules, after plugins run\n  if (needsCSSModules(srcPath)) {\n    let contents: string = result['.css']\n      ? (result['.css'].code as string)\n      : ((await readFile(srcPath)) as string);\n    if (contents) {\n      // for CSS Modules URLs, we only need the destination URL (POSIX-style)\n      let url = srcPath;\n      for (const dir in config.mount) {\n        if (srcPath.startsWith(dir)) {\n          url = srcPath\n            .replace(dir, config.mount[dir].url)\n            .replace(/\\\\/g, '/')\n            .replace(/\\/+/g, '/')\n            .replace(/\\.(scss|sass)$/i, '.css');\n          break;\n        }\n      }\n      const {css, json} = await cssModules({contents, url});\n      result['.css'] = {...(result['.css'] || {}), code: css};\n      result['.json'] = {code: JSON.stringify(json)};\n    }\n  }\n\n  // if no result was generated, return file as-is\n  if (!Object.keys(result).length) {\n    return {\n      [srcExt]: {\n        code: await readFile(srcPath),\n      },\n    };\n  }\n\n  return result;\n}\n\nasync function composeSourceMaps(\n  id: string,\n  base: string | RawSourceMap,\n  derived: string | RawSourceMap,\n): Promise<string> {\n  const [baseMap, transformedMap] = await Promise.all([\n    new SourceMapConsumer(base),\n    new SourceMapConsumer(derived),\n  ]);\n  try {\n    const generator = SourceMapGenerator.fromSourceMap(transformedMap);\n    generator.applySourceMap(baseMap, id);\n    return generator.toString();\n  } finally {\n    baseMap.destroy();\n    transformedMap.destroy();\n  }\n}\n\n/**\n * Build Plugin Second Pass: If a plugin defines a\n * transform() method,call it. Transform cannot change\n * the file extension, and was designed to run on\n * every file type and return null/undefined if no\n * change needed.\n */\nasync function runPipelineTransformStep(\n  output: SnowpackBuildMap,\n  srcPath: string,\n  {isDev, isHmrEnabled, isPackage, isSSR, config}: BuildFileOptions,\n): Promise<SnowpackBuildMap> {\n  const rootFilePath = removeExtension(srcPath, getExtension(srcPath));\n  const rootFileName = path.basename(rootFilePath);\n  for (const step of config.plugins) {\n    if (!step.transform) {\n      continue;\n    }\n    // v3.1: Some plugins break when run on node_modules/. This fix is in place until the plugins themselves have a chance to update.\n    if (step.name.endsWith('@prefresh/snowpack/dist/index.js') && isPackage) {\n      continue;\n    }\n\n    try {\n      for (const destExt of Object.keys(output)) {\n        const destBuildFile = output[destExt];\n        const {code} = destBuildFile;\n        const fileName = rootFileName + destExt;\n        const filePath = rootFilePath + destExt;\n        const debugPath = path.relative(config.root, filePath);\n        logger.debug(`transform() starting… [${debugPath}]`, {name: step.name});\n        const result = await step.transform({\n          contents: code,\n          isDev,\n          isPackage,\n          fileExt: destExt,\n          id: filePath,\n          srcPath,\n          // @ts-ignore: Deprecated\n          filePath: fileName,\n          // @ts-ignore: Deprecated\n          urlPath: `./${path.basename(rootFileName + destExt)}`,\n          isHmrEnabled,\n          isSSR,\n        });\n        logger.debug(`✔ transform() success [${debugPath}]`, {name: step.name});\n        if (typeof result === 'string' || Buffer.isBuffer(result)) {\n          // V2 API, simple string variant\n          output[destExt].code = result;\n          output[destExt].map = undefined;\n        } else if (result && typeof result === 'object') {\n          // V2 API, structured result variant\n          const contents = (result as PluginTransformResult).contents || (result as any).result;\n          if (contents) {\n            output[destExt].code = contents;\n            const map = (result as PluginTransformResult).map;\n            let outputMap: string | undefined = undefined;\n            if (map && config.buildOptions.sourcemap) {\n              // if source maps disabled, don’t return any\n              if (output[destExt].map) {\n                outputMap = await composeSourceMaps(filePath, output[destExt].map!, map);\n              } else {\n                outputMap = typeof map === 'object' ? JSON.stringify(map) : map;\n              }\n            }\n            output[destExt].map = outputMap;\n          }\n        }\n      }\n    } catch (err) {\n      // Attach metadata detailing where the error occurred.\n      err.__snowpackBuildDetails = {name: step.name, step: 'transform'};\n      throw err;\n    }\n  }\n\n  return output;\n}\n\nexport async function runPipelineOptimizeStep(\n  buildDirectory: string,\n  {config}: {config: SnowpackConfig},\n) {\n  for (const step of config.plugins) {\n    if (!step.optimize) {\n      continue;\n    }\n\n    try {\n      logger.debug('optimize() starting…', {name: step.name});\n      await step.optimize({\n        buildDirectory,\n        // @ts-ignore: internal API only\n        log: (msg) => {\n          logger.info(msg, {name: step.name});\n        },\n      });\n      logger.debug('✔ optimize() success', {name: step.name});\n    } catch (err) {\n      logger.error(err.toString() || err, {name: step.name});\n      process.exit(1); // exit on error\n    }\n  }\n  return null;\n}\n\nexport async function runPipelineCleanupStep({plugins}: SnowpackConfig) {\n  for (const step of plugins) {\n    if (!step.cleanup) {\n      continue;\n    }\n    await step.cleanup();\n  }\n}\n\n/** Core Snowpack file pipeline builder */\nexport async function buildFile(\n  srcURL: URL,\n  buildFileOptions: BuildFileOptions,\n): Promise<SnowpackBuildMap> {\n  // Pass 1: Find the first plugin to load this file, and return the result\n  const loadResult = await runPipelineLoadStep(url.fileURLToPath(srcURL), buildFileOptions);\n  // Pass 2: Pass that result through every plugin transform() method.\n  const transformResult = await runPipelineTransformStep(\n    loadResult,\n    url.fileURLToPath(srcURL),\n    buildFileOptions,\n  );\n  // Return the final build result.\n  return transformResult;\n}\n"
  },
  {
    "path": "snowpack/src/build/file-builder.ts",
    "content": "import {InstallTarget} from 'esinstall';\nimport {promises as fs} from 'fs';\nimport mkdirp from 'mkdirp';\nimport path from 'path';\nimport url from 'url';\nimport {EsmHmrEngine} from '../hmr-server-engine';\nimport {\n  scanCodeImportsExports,\n  transformEsmImports,\n  transformFileImports,\n} from '../rewrite-imports';\nimport {matchDynamicImportValue, scanImportsFromFiles} from '../scan-imports';\nimport {getPackageSource} from '../sources/util';\nimport {\n  ImportMap,\n  SnowpackBuildMap,\n  SnowpackBuildResultFileManifest,\n  SnowpackBuiltFile,\n  SnowpackConfig,\n} from '../types';\nimport {\n  createInstallTarget,\n  isRemoteUrl,\n  relativeURL,\n  removeLeadingSlash,\n  replaceExtension,\n} from '../util';\nimport {\n  getMetaUrlPath,\n  SRI_CLIENT_HMR_SNOWPACK,\n  SRI_ERROR_HMR_SNOWPACK,\n  transformGlobImports,\n  wrapHtmlResponse,\n  wrapImportMeta,\n  wrapImportProxy,\n} from './build-import-proxy';\nimport {buildFile} from './build-pipeline';\nimport {getUrlsForFile} from './file-urls';\nimport {createImportResolver, createImportGlobResolver} from './import-resolver';\n\n/**\n * FileBuilder - This class is responsible for building a file. It is broken into\n * individual stages so that the entire application build process can be tackled\n * in stages (build -> resolve -> get response).\n */\nexport class FileBuilder {\n  buildOutput: SnowpackBuildMap = {};\n  resolvedOutput: SnowpackBuildMap = {};\n\n  isDev: boolean;\n  isHMR: boolean;\n  isSSR: boolean;\n  buildPromise: Promise<SnowpackBuildMap> | undefined;\n\n  readonly loc: string;\n  readonly urls: string[];\n  readonly config: SnowpackConfig;\n  hmrEngine: EsmHmrEngine | null = null;\n\n  constructor({\n    loc,\n    isDev,\n    isHMR,\n    isSSR,\n    config,\n    hmrEngine,\n  }: {\n    loc: string;\n    isDev: boolean;\n    isHMR: boolean;\n    isSSR: boolean;\n    config: SnowpackConfig;\n    hmrEngine?: EsmHmrEngine | null;\n  }) {\n    this.loc = loc;\n    this.isDev = isDev;\n    this.isHMR = isHMR;\n    this.isSSR = isSSR;\n    this.config = config;\n    this.hmrEngine = hmrEngine || null;\n    const urls = getUrlsForFile(loc, config);\n    if (!urls) {\n      throw new Error(`No mounted URLs configured for file: ${loc}`);\n    }\n    this.urls = urls;\n  }\n\n  private verifyRequestFromBuild(type: string): SnowpackBuiltFile | undefined {\n    const possibleExtensions = this.urls.map((url) => path.extname(url));\n    if (!possibleExtensions.includes(type))\n      throw new Error(\n        `${this.loc} - Requested content \"${type}\" but only built ${possibleExtensions.join(', ')}`,\n      );\n    return this.resolvedOutput[type];\n  }\n\n  /**\n   * Resolve Imports: Resolved imports are based on the state of the file\n   * system, so they can't be cached long-term with the build.\n   */\n  async resolveImports(\n    isResolve: boolean,\n    hmrParam?: string | false,\n    importMap?: ImportMap,\n  ): Promise<InstallTarget[]> {\n    const urlPathDirectory = path.posix.dirname(this.urls[0]!);\n    const pkgSource = getPackageSource(this.config);\n    const resolvedImports: InstallTarget[] = [];\n    for (const [type, outputResult] of Object.entries(this.buildOutput)) {\n      if (!(type === '.js' || type === '.html' || type === '.css')) {\n        continue;\n      }\n      let contents =\n        typeof outputResult.code === 'string'\n          ? outputResult.code\n          : outputResult.code.toString('utf8');\n\n      // Handle attached CSS.\n      if (type === '.js' && this.buildOutput['.css']) {\n        const relativeCssImport = `./${replaceExtension(\n          path.posix.basename(this.urls[0]!),\n          '.js',\n          '.css',\n        )}`;\n        contents = `import '${relativeCssImport}';\\n` + contents;\n      }\n      // Finalize the response\n      contents = this.finalizeResult(type, contents);\n      //\n      const resolveImportGlobSpecifier = createImportGlobResolver({\n        fileLoc: this.loc,\n        config: this.config,\n      });\n      // resolve all imports\n      const resolveImportSpecifier = createImportResolver({\n        fileLoc: this.loc,\n        config: this.config,\n      });\n      const resolveImport = async (spec) => {\n        // Ignore packages marked as external\n        if (this.config.packageOptions.external?.includes(spec)) {\n          return spec;\n        }\n        if (isRemoteUrl(spec)) {\n          return spec;\n        }\n        // Try to resolve the specifier to a known URL in the project\n        let resolvedImportUrl = resolveImportSpecifier(spec);\n        // Handle a package import\n        if (!resolvedImportUrl) {\n          try {\n            return await pkgSource.resolvePackageImport(spec, {\n              importMap: importMap || (isResolve ? undefined : {imports: {}}),\n            });\n          } catch (err) {\n            if (!isResolve && /not included in import map./.test(err.message)) {\n              return spec;\n            }\n            throw err;\n          }\n        }\n        return resolvedImportUrl || spec;\n      };\n\n      const scannedImports = await scanImportsFromFiles(\n        [\n          {\n            baseExt: type,\n            root: this.config.root,\n            locOnDisk: this.loc,\n            contents,\n          },\n        ],\n        this.config,\n      );\n      contents = await transformGlobImports({contents, resolveImportGlobSpecifier});\n      contents = await transformFileImports({type, contents}, async (spec) => {\n        let resolvedImportUrl = await resolveImport(spec);\n\n        // Handle normal \"./\" & \"../\" import specifiers\n        const importExtName = path.posix.extname(resolvedImportUrl);\n        const isProxyImport = importExtName && importExtName !== '.js' && importExtName !== '.mjs';\n        const isAbsoluteUrlPath = path.posix.isAbsolute(resolvedImportUrl);\n        if (isAbsoluteUrlPath) {\n          if (isResolve && this.config.buildOptions.resolveProxyImports && isProxyImport) {\n            resolvedImportUrl = resolvedImportUrl + '.proxy.js';\n          }\n          resolvedImports.push(createInstallTarget(resolvedImportUrl));\n        } else {\n          resolvedImports.push(\n            ...scannedImports\n              .filter(({specifier}) => specifier === spec)\n              .map((installTarget) => {\n                installTarget.specifier = resolvedImportUrl;\n                return installTarget;\n              }),\n          );\n        }\n        if (isAbsoluteUrlPath) {\n          // When dealing with an absolute import path, we need to honor the baseUrl\n          // proxy modules may attach code to the root HTML (like style) so don't resolve\n          resolvedImportUrl = relativeURL(urlPathDirectory, resolvedImportUrl);\n        }\n        return resolvedImportUrl;\n      });\n\n      // This is a hack since we can't currently scan \"script\" `src=` tags as imports.\n      // Either move these to inline JavaScript in the script body, or add support for\n      // `script.src=` and `link.href` scanning & resolving in transformFileImports().\n      if (type === '.html' && this.isHMR) {\n        if (contents.includes(SRI_CLIENT_HMR_SNOWPACK)) {\n          resolvedImports.push(createInstallTarget(getMetaUrlPath('hmr-client.js', this.config)));\n        }\n        if (contents.includes(SRI_ERROR_HMR_SNOWPACK)) {\n          resolvedImports.push(\n            createInstallTarget(getMetaUrlPath('hmr-error-overlay.js', this.config)),\n          );\n        }\n      }\n\n      if (type === '.js' && hmrParam) {\n        contents = await transformEsmImports(contents as string, (imp) => {\n          const importUrl = path.posix.resolve(urlPathDirectory, imp);\n          const node = this.hmrEngine?.getEntry(importUrl);\n          if (node && node.needsReplacement) {\n            this.hmrEngine?.markEntryForReplacement(node, false);\n            return `${imp}?${hmrParam}`;\n          }\n          return imp;\n        });\n      }\n\n      if (type === '.js') {\n        const isHmrEnabled = contents.includes('import.meta.hot');\n        const rawImports = await scanCodeImportsExports(contents);\n        const resolvedImports = rawImports.map((imp) => {\n          let spec = contents.substring(imp.s, imp.e).replace(/(\\/|\\\\)+$/, '');\n          if (imp.d > -1) {\n            spec = matchDynamicImportValue(spec) || '';\n          }\n          spec = spec.replace(/\\?mtime=[0-9]+$/, '');\n          return path.posix.resolve(urlPathDirectory, spec);\n        });\n        this.hmrEngine?.setEntry(this.urls[0], resolvedImports, isHmrEnabled);\n      }\n      // Update the output with the new resolved imports\n      this.resolvedOutput[type].code = contents;\n      this.resolvedOutput[type].map = undefined;\n    }\n    return resolvedImports;\n  }\n\n  /**\n   * Given a file, build it. Building a file sends it through our internal\n   * file builder pipeline, and outputs a build map representing the final\n   * build. A Build Map is used because one source file can result in multiple\n   * built files (Example: .svelte -> .js & .css).\n   */\n  async build(isStatic: boolean) {\n    if (this.buildPromise) {\n      return this.buildPromise;\n    }\n    const fileBuilderPromise = (async () => {\n      if (isStatic) {\n        return {\n          [path.extname(this.loc)]: {\n            code: await fs.readFile(this.loc),\n            map: undefined,\n          },\n        };\n      }\n      const builtFileOutput = await buildFile(url.pathToFileURL(this.loc), {\n        config: this.config,\n        isDev: this.isDev,\n        isSSR: this.isSSR,\n        isPackage: false,\n        isHmrEnabled: this.isHMR,\n      });\n      return builtFileOutput;\n    })();\n    this.buildPromise = fileBuilderPromise;\n    try {\n      this.resolvedOutput = {};\n      this.buildOutput = await fileBuilderPromise;\n      for (const [outputKey, {code, map}] of Object.entries(this.buildOutput)) {\n        this.resolvedOutput[outputKey] = {code, map};\n      }\n    } finally {\n      this.buildPromise = undefined;\n    }\n  }\n\n  private finalizeResult(type: string, content: string): string {\n    // Wrap the response.\n    switch (type) {\n      case '.html': {\n        content = wrapHtmlResponse({\n          code: content as string,\n          hmr: this.isHMR,\n          hmrPort: this.hmrEngine ? this.hmrEngine.port : undefined,\n          isDev: this.isDev,\n          config: this.config,\n          mode: this.isDev ? 'development' : 'production',\n        });\n        break;\n      }\n      case '.css': {\n        break;\n      }\n      case '.js':\n        {\n          content = wrapImportMeta({\n            code: content as string,\n            env: true,\n            hmr: this.isHMR,\n            config: this.config,\n          });\n        }\n        break;\n    }\n    // Return the finalized response.\n    return content;\n  }\n\n  getResult(type: string): string | Buffer | undefined {\n    const result = this.verifyRequestFromBuild(type);\n    if (result) {\n      // TODO: return result.map\n      return result.code;\n    }\n  }\n\n  getSourceMap(type: string): string | undefined {\n    return this.resolvedOutput[type].map;\n  }\n\n  async getProxy(_url: string, type: string) {\n    const code = this.resolvedOutput[type].code;\n    const url = this.isDev ? _url : this.config.buildOptions.baseUrl + removeLeadingSlash(_url);\n    return await wrapImportProxy({url, code, hmr: this.isHMR, config: this.config});\n  }\n\n  async writeToDisk(dir: string, results: SnowpackBuildResultFileManifest) {\n    await mkdirp(path.dirname(path.join(dir, this.urls[0])));\n    for (const outUrl of this.urls) {\n      const buildOutput = results[outUrl].contents;\n      const encoding = typeof buildOutput === 'string' ? 'utf8' : undefined;\n      await fs.writeFile(path.join(dir, outUrl), buildOutput, encoding);\n    }\n  }\n}\n"
  },
  {
    "path": "snowpack/src/build/file-urls.ts",
    "content": "import path from 'path';\nimport slash from 'slash';\nimport {MountEntry, SnowpackConfig} from '../types';\nimport {addExtension, getExtensionMatch, replaceExtension} from '../util';\nimport {needsCSSModules} from './import-css';\n\n/**\n * Map a file path to the hosted URL for a given \"mount\" entry.\n */\nexport function getUrlsForFileMount({\n  fileLoc,\n  mountKey,\n  mountEntry,\n  config,\n}: {\n  fileLoc: string;\n  mountKey: string;\n  mountEntry: MountEntry;\n  config: SnowpackConfig;\n}): string[] {\n  const resolvedDirUrl = mountEntry.url === '/' ? '' : mountEntry.url;\n  const mountedUrl = fileLoc.replace(mountKey, resolvedDirUrl).replace(/[/\\\\]+/g, '/');\n  if (mountEntry.static) {\n    return [mountedUrl];\n  }\n  return getBuiltFileUrls(mountedUrl, config);\n}\n\n/**\n * Map a file path to the hosted URL for a given \"mount\" entry.\n */\nexport function getBuiltFileUrls(filepath: string, config: SnowpackConfig): string[] {\n  const fileName = path.basename(filepath);\n  const extensionMatch = getExtensionMatch(fileName, config._extensionMap);\n  if (!extensionMatch) {\n    // CSS Modules require a special .json mapping here\n    if (needsCSSModules(filepath)) {\n      return [filepath, filepath + '.json'];\n    }\n\n    // Otherwise, return only the requested file\n    return [filepath];\n  }\n  const [inputExt, outputExts] = extensionMatch;\n  return outputExts.map((outputExt) => {\n    if (outputExts.length > 1) {\n      return addExtension(filepath, outputExt);\n    } else {\n      return replaceExtension(filepath, inputExt, outputExt);\n    }\n  });\n}\n\n/**\n * Get the final, hosted URL path for a given file on disk.\n */\nexport function getMountEntryForFile(\n  fileLoc: string,\n  config: SnowpackConfig,\n): [string, MountEntry] | null {\n  // PERF: Use `for...in` here instead of the slower `Object.entries()` method\n  // that we use everywhere else, since this function can get called 100s of\n  // times during a build.\n  for (const mountKey in config.mount) {\n    if (!config.mount.hasOwnProperty(mountKey)) {\n      continue;\n    }\n    if (!fileLoc.startsWith(mountKey + path.sep)) {\n      continue;\n    }\n    return [mountKey, config.mount[mountKey]];\n  }\n  return null;\n}\n\n/**\n * Get the final, hosted URL path for a given file on disk.\n */\nexport function getUrlsForFile(fileLoc: string, config: SnowpackConfig): undefined | string[] {\n  const mountEntryResult = getMountEntryForFile(fileLoc, config);\n  if (!mountEntryResult) {\n    if (!config.workspaceRoot) {\n      return undefined;\n    }\n    const builtEntrypointUrls = getBuiltFileUrls(fileLoc, config);\n    return builtEntrypointUrls.map((u) =>\n      path.posix.join(\n        config.buildOptions.metaUrlPath,\n        'link',\n        slash(path.relative(config.workspaceRoot as string, u)),\n      ),\n    );\n  }\n  const [mountKey, mountEntry] = mountEntryResult;\n  return getUrlsForFileMount({fileLoc, mountKey, mountEntry, config});\n}\n"
  },
  {
    "path": "snowpack/src/build/import-css.ts",
    "content": "import postCss from 'postcss';\nimport postCssModules from 'postcss-modules';\nimport {logger} from '../logger';\n\nconst cssModuleNames = new Map<string, string>();\n\n/** Generate CSS Modules for a given URL */\nexport async function cssModules({\n  contents,\n  url,\n}: {\n  contents: string;\n  url: string;\n}): Promise<{css: string; json: Record<string, string>}> {\n  let json: Record<string, string> = {};\n  const processor = postCss([\n    postCssModules({\n      getJSON: (_, moduleNames) => {\n        json = moduleNames;\n        cssModuleNames.set(url, JSON.stringify(moduleNames));\n      },\n    }),\n  ]);\n\n  const result = await processor.process(contents, {from: url, to: url});\n  // log any warnings that happened.\n  result\n    .warnings()\n    .forEach((element) => logger.warn(`${url} - ${element.text}`, {name: 'snowpack:cssmodules'}));\n  return {\n    css: result.css,\n    json,\n  };\n}\n\n/** Return CSS Modules JSON from URL */\nexport function cssModuleJSON(url: string): string {\n  return cssModuleNames.get(url) || '{}';\n}\n\n/** Should this file get CSS Modules? */\nexport function needsCSSModules(url: string): boolean {\n  return (\n    url.endsWith('.module.css') || url.endsWith('.module.scss') || url.endsWith('.module.sass')\n  );\n}\n"
  },
  {
    "path": "snowpack/src/build/import-resolver.ts",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport slash from 'slash';\nimport {SnowpackConfig} from '../types';\nimport {\n  addExtension,\n  findMatchingAliasEntry,\n  getExtensionMatch,\n  hasExtension,\n  isRemoteUrl,\n  replaceExtension,\n} from '../util';\nimport {getUrlsForFile} from './file-urls';\nimport glob from 'glob';\n\n/** Perform a file disk lookup for the requested import specifier. */\nexport function getFsStat(importedFileOnDisk: string): fs.Stats | false {\n  try {\n    return fs.statSync(importedFileOnDisk);\n  } catch (err) {\n    // file doesn't exist, that's fine\n  }\n  return false;\n}\n\n/** Resolve an import based on the state of the file/folder found on disk. */\nfunction resolveSourceSpecifier(\n  lazyFileLoc: string,\n  {parentFile, config}: {parentFile: string; config: SnowpackConfig},\n) {\n  const lazyFileStat = getFsStat(lazyFileLoc);\n\n  if (lazyFileStat && lazyFileStat.isFile()) {\n    lazyFileLoc = lazyFileLoc;\n  } else if (hasExtension(lazyFileLoc, '.js')) {\n    const tsWorkaroundImportFileLoc = replaceExtension(lazyFileLoc, '.js', '.ts');\n    if (getFsStat(tsWorkaroundImportFileLoc)) {\n      lazyFileLoc = tsWorkaroundImportFileLoc;\n    }\n  } else if (hasExtension(lazyFileLoc, '.jsx')) {\n    const tsWorkaroundImportFileLoc = replaceExtension(lazyFileLoc, '.jsx', '.tsx');\n    if (getFsStat(tsWorkaroundImportFileLoc)) {\n      lazyFileLoc = tsWorkaroundImportFileLoc;\n    }\n  } else {\n    // missing extension\n    if (getFsStat(lazyFileLoc + path.extname(parentFile))) {\n      // first, try parent file’s extension\n      lazyFileLoc = lazyFileLoc + path.extname(parentFile);\n    } else {\n      // otherwise, try and match any extension from the extension map\n      for (const [ext, outputExts] of Object.entries(config._extensionMap)) {\n        if (!outputExts.includes('.js')) continue; // only look through .js-friendly extensions\n        if (getFsStat(lazyFileLoc + ext)) {\n          lazyFileLoc = lazyFileLoc + ext;\n          break;\n        }\n      }\n    }\n\n    if (!path.extname(lazyFileLoc)) {\n      if (lazyFileStat && lazyFileStat.isDirectory()) {\n        // Handle directory imports (ex: \"./components\" -> \"./components/index.js\")\n        const trailingSlash = lazyFileLoc.endsWith(path.sep) ? '' : path.sep;\n        lazyFileLoc = lazyFileLoc + trailingSlash + 'index.js';\n      } else {\n        // Fall back to .js.\n        lazyFileLoc = lazyFileLoc + '.js';\n      }\n    }\n  }\n\n  // Transform the file extension (from input to output)\n  const extensionMatch = getExtensionMatch(lazyFileLoc, config._extensionMap);\n\n  if (extensionMatch) {\n    const [inputExt, outputExts] = extensionMatch;\n    if (outputExts.length > 1) {\n      lazyFileLoc = addExtension(lazyFileLoc, outputExts[0]);\n    } else {\n      lazyFileLoc = replaceExtension(lazyFileLoc, inputExt, outputExts[0]);\n    }\n  }\n\n  const resolvedUrls = getUrlsForFile(lazyFileLoc, config);\n  return resolvedUrls ? resolvedUrls[0] : resolvedUrls;\n}\n\n/**\n * Create a import resolver function, which converts any import relative to the given file at \"fileLoc\"\n * to a proper URL. Returns false if no matching import was found, which usually indicates a package\n * not found in the import map.\n */\nexport function createImportResolver({fileLoc, config}: {fileLoc: string; config: SnowpackConfig}) {\n  return function importResolver(spec: string): string | false {\n    // Ignore \"http://*\" imports\n    if (isRemoteUrl(spec)) {\n      return spec;\n    }\n    // Ignore packages marked as external\n    if (config.packageOptions.external?.includes(spec)) {\n      return spec;\n    }\n\n    if (spec[0] === '/') {\n      return spec;\n    }\n    if (spec[0] === '.') {\n      const importedFileLoc = path.resolve(path.dirname(fileLoc), path.normalize(spec));\n      return resolveSourceSpecifier(importedFileLoc, {parentFile: fileLoc, config}) || spec;\n    }\n    const aliasEntry = findMatchingAliasEntry(config, spec);\n    if (aliasEntry && (aliasEntry.type === 'path' || aliasEntry.type === 'url')) {\n      const {from, to} = aliasEntry;\n      let result = spec.replace(from, to);\n      if (aliasEntry.type === 'url') {\n        return result;\n      }\n      const importedFileLoc = path.resolve(config.root, result);\n      return resolveSourceSpecifier(importedFileLoc, {parentFile: fileLoc, config}) || spec;\n    }\n    return false;\n  };\n}\n\nfunction toPath(url: string) {\n  return url.replace(/\\//g, path.sep);\n}\n\n/**\n * Create a import glob resolver function, which converts any import globs relative to the given file at \"fileLoc\"\n * to a local file. These will additionally be transformed by the regular import resolver, so they do not need\n * to be finalized just yet\n */\nexport function createImportGlobResolver({\n  fileLoc,\n  config,\n}: {\n  fileLoc: string;\n  config: SnowpackConfig;\n}) {\n  const rootDir = path.parse(process.cwd()).root;\n  return async function importGlobResolver(spec: string): Promise<string[]> {\n    let searchSpec = toPath(spec);\n    if (spec.startsWith('/')) {\n      searchSpec = path.join(config.root, spec);\n    }\n\n    const aliasEntry = findMatchingAliasEntry(config, spec);\n    if (aliasEntry && aliasEntry.type === 'path') {\n      const {from, to} = aliasEntry;\n      searchSpec = searchSpec.replace(from, to);\n      searchSpec = path.resolve(config.root, searchSpec);\n    }\n\n    if (!searchSpec.startsWith(rootDir) && !searchSpec.startsWith('.')) {\n      throw new Error(\n        `Glob imports must be relative (starting with \".\") or absolute (starting with \"/\", which is treated as relative to project root)`,\n      );\n    }\n\n    if (searchSpec.startsWith(rootDir)) {\n      searchSpec = path.resolve(config.root, searchSpec);\n      searchSpec = path.relative(path.dirname(fileLoc), searchSpec);\n    }\n\n    const resolved = await new Promise<string[]>((resolve, reject) =>\n      glob(searchSpec, {cwd: path.dirname(fileLoc), nodir: true}, (err, matches) => {\n        if (err) {\n          return reject(err);\n        }\n        return resolve(matches);\n      }),\n    );\n    return resolved\n      .map((fileLoc) => {\n        const normalized = slash(fileLoc);\n        if (normalized.startsWith('.') || normalized.startsWith('/')) return normalized;\n        return `./${normalized}`;\n      })\n      .filter((_fileLoc) => {\n        // If final import *might* be the same as the source file, double check to avoid importing self\n        const finalImportAbsolute = slash(path.resolve(path.dirname(fileLoc), toPath(_fileLoc)));\n        return slash(finalImportAbsolute) !== slash(fileLoc);\n      });\n  };\n}\n"
  },
  {
    "path": "snowpack/src/build/import-sri.ts",
    "content": "import {createHash} from 'crypto';\n\ntype SupportedSRIAlgorithm = 'sha512' | 'sha384' | 'sha256';\nconst DEFAULT_CRYPTO_HASH = 'sha384';\nconst EMPTY_BUFFER = Buffer.from('');\n\nexport const generateSRI = (\n  buffer: Buffer = EMPTY_BUFFER,\n  hashAlgorithm: SupportedSRIAlgorithm = DEFAULT_CRYPTO_HASH,\n) => `${hashAlgorithm}-${createHash(hashAlgorithm).update(buffer).digest('base64')}`;\n"
  },
  {
    "path": "snowpack/src/build/optimize.ts",
    "content": "import cheerio from 'cheerio';\nimport * as esbuild from 'esbuild';\nimport {promises as fs, readFileSync, unlinkSync, writeFileSync} from 'fs';\nimport {fdir} from 'fdir';\nimport mkdirp from 'mkdirp';\nimport path from 'path';\nimport {logger} from '../logger';\nimport {OptimizeOptions, SnowpackConfig} from '../types';\nimport {\n  addLeadingSlash,\n  addTrailingSlash,\n  hasExtension,\n  isRemoteUrl,\n  isTruthy,\n  removeLeadingSlash,\n  removeTrailingSlash,\n  deleteFromBuildSafe,\n} from '../util';\nimport {getUrlsForFile} from './file-urls';\n\ninterface ScannedHtmlEntrypoint {\n  file: string;\n  root: cheerio.Root;\n  getScripts: () => cheerio.Cheerio;\n  getStyles: () => cheerio.Cheerio;\n  getLinks: (rel: 'stylesheet') => cheerio.Cheerio;\n}\n\n// The manifest type is the one from ESBuild, but we might delete the outputs key\ntype SnowpackMetaManifest = Omit<esbuild.Metafile, 'outputs'> & Partial<esbuild.Metafile>;\n\n// We want to output our bundled build directly into our build directory, but esbuild\n// has a bug where it complains about overwriting source files even when write: false.\n// We create a fake bundle directory for now. Nothing ever actually gets written here.\nconst FAKE_BUILD_DIRECTORY = path.join(process.cwd(), '~~bundle~~');\nconst FAKE_BUILD_DIRECTORY_REGEX = /.*\\~\\~bundle\\~\\~[\\\\\\/]/;\n\n/** Collect deep imports in the given set, recursively. */\nfunction collectDeepImports(\n  config: SnowpackConfig,\n  url: string,\n  manifest: SnowpackMetaManifest,\n  set: Set<string>,\n): void {\n  const buildPrefix = removeLeadingSlash(config.buildOptions.out.replace(process.cwd(), ''))\n    .split(path.sep)\n    .join(path.posix.sep);\n  const normalizedUrl = !url.startsWith(buildPrefix) ? path.posix.join(buildPrefix, url) : url;\n  const relativeImportUrl = url.replace(buildPrefix, '');\n\n  if (set.has(relativeImportUrl)) {\n    return;\n  }\n\n  set.add(relativeImportUrl);\n\n  const manifestEntry = manifest.inputs[normalizedUrl];\n  if (!manifestEntry) {\n    throw new Error('Not Found in manifest: ' + normalizedUrl);\n  }\n  manifestEntry.imports.forEach(({path}) => collectDeepImports(config, path, manifest, set));\n  return;\n}\n\n/**\n * Scan a collection of HTML files for entrypoints. A file is deemed an \"html entrypoint\"\n * if it contains an <html> element. This prevents partials from being scanned.\n */\nasync function scanHtmlEntrypoints(htmlFiles: string[]): Promise<(ScannedHtmlEntrypoint | null)[]> {\n  return Promise.all(\n    htmlFiles.map(async (htmlFile) => {\n      const code = await fs.readFile(htmlFile, 'utf8');\n      const root = cheerio.load(code, {decodeEntities: false});\n      const isHtmlFragment = root.html().startsWith('<html><head></head><body>');\n      if (isHtmlFragment) {\n        return null;\n      }\n      return {\n        file: htmlFile,\n        root,\n        getScripts: () => root('script[type=\"module\"]'),\n        getStyles: () => root('style'),\n        getLinks: (rel: 'stylesheet') => root(`link[rel=\"${rel}\"]`),\n      };\n    }),\n  );\n}\n\nasync function extractBaseUrl(htmlData: ScannedHtmlEntrypoint, baseUrl: string): Promise<void> {\n  const {root, getScripts, getLinks} = htmlData;\n  if (!baseUrl || baseUrl === '/') {\n    return;\n  }\n  getScripts().each((_, elem) => {\n    const scriptRoot = root(elem);\n    const scriptSrc = scriptRoot.attr('src');\n    if (!scriptSrc || !scriptSrc.startsWith(baseUrl)) {\n      return;\n    }\n    scriptRoot.attr('src', addLeadingSlash(scriptSrc.replace(baseUrl, '')));\n    scriptRoot.attr('snowpack-baseurl', 'true');\n  });\n  getLinks('stylesheet').each((_, elem) => {\n    const linkRoot = root(elem);\n    const styleHref = linkRoot.attr('href');\n    if (!styleHref || !styleHref.startsWith(baseUrl)) {\n      return;\n    }\n    linkRoot.attr('href', addLeadingSlash(styleHref.replace(baseUrl, '')));\n    linkRoot.attr('snowpack-baseurl', 'true');\n  });\n}\n\nasync function restitchBaseUrl(htmlData: ScannedHtmlEntrypoint, baseUrl: string): Promise<void> {\n  const {root, getScripts, getLinks} = htmlData;\n  getScripts()\n    .filter('[snowpack-baseurl]')\n    .each((_, elem) => {\n      const scriptRoot = root(elem);\n      const scriptSrc = scriptRoot.attr('src')!;\n      scriptRoot.attr('src', removeTrailingSlash(baseUrl) + addLeadingSlash(scriptSrc));\n      scriptRoot.removeAttr('snowpack-baseurl');\n    });\n  getLinks('stylesheet')\n    .filter('[snowpack-baseurl]')\n    .each((_, elem) => {\n      const linkRoot = root(elem);\n      const styleHref = linkRoot.attr('href')!;\n      linkRoot.attr('href', removeTrailingSlash(baseUrl) + addLeadingSlash(styleHref));\n      linkRoot.removeAttr('snowpack-baseurl');\n    });\n}\n\nasync function extractInlineScripts(htmlData: ScannedHtmlEntrypoint): Promise<void> {\n  const {file, root, getScripts, getStyles} = htmlData;\n  getScripts().each((i, elem) => {\n    const scriptRoot = root(elem);\n    const scriptContent = scriptRoot.contents().text();\n    if (!scriptContent) {\n      return;\n    }\n    scriptRoot.empty();\n    writeFileSync(file + `.inline.${i}.js`, scriptContent);\n    scriptRoot.attr('src', `./${path.basename(file)}.inline.${i}.js`);\n    scriptRoot.attr('snowpack-inline', `true`);\n  });\n  getStyles().each((i, elem) => {\n    const styleRoot = root(elem);\n    const styleContent = styleRoot.contents().text();\n    if (!styleContent) {\n      return;\n    }\n    styleRoot.after(\n      `<link rel=\"stylesheet\" href=\"./${path.basename(\n        file,\n      )}.inline.${i}.css\" snowpack-inline=\"true\" />`,\n    );\n    styleRoot.remove();\n    writeFileSync(file + `.inline.${i}.css`, styleContent);\n  });\n}\n\nasync function restitchInlineScripts(htmlData: ScannedHtmlEntrypoint): Promise<void> {\n  const {file, root, getScripts, getLinks} = htmlData;\n  getScripts()\n    .filter('[snowpack-inline]')\n    .each((_, elem) => {\n      const scriptRoot = root(elem);\n      const scriptFile = path.resolve(file, '..', scriptRoot.attr('src')!);\n      const scriptContent = readFileSync(scriptFile, 'utf8');\n      scriptRoot.text(scriptContent);\n      scriptRoot.removeAttr('src');\n      scriptRoot.removeAttr('snowpack-inline');\n      unlinkSync(scriptFile);\n    });\n  getLinks('stylesheet')\n    .filter('[snowpack-inline]')\n    .each((_, elem) => {\n      const linkRoot = root(elem);\n      const styleFile = path.resolve(file, '..', linkRoot.attr('href')!);\n      const styleContent = readFileSync(styleFile, 'utf8');\n      const newStyleEl = root('<style></style>');\n      newStyleEl.text(styleContent);\n      linkRoot.after(newStyleEl);\n      linkRoot.remove();\n      unlinkSync(styleFile);\n    });\n}\n\n/** Add new bundled CSS files to the HTML entrypoint file, if not already there. */\nfunction addNewBundledCss(\n  htmlData: ScannedHtmlEntrypoint,\n  manifest: SnowpackMetaManifest,\n  baseUrl: string,\n): void {\n  if (!manifest.outputs) {\n    return;\n  }\n  for (const key of Object.keys(manifest.outputs)) {\n    if (!hasExtension(key, '.css')) {\n      continue;\n    }\n    const scriptKey = key.replace('.css', '.js');\n    if (!manifest.outputs[scriptKey]) {\n      continue;\n    }\n    const hasCssImportAlready = htmlData\n      .getLinks('stylesheet')\n      .toArray()\n      .some((v) => {\n        const {attribs} = v as cheerio.TagElement;\n        return attribs && attribs.href.includes(removeLeadingSlash(key));\n      });\n    const hasScriptImportAlready = htmlData\n      .getScripts()\n      .toArray()\n      .some((v) => {\n        const {attribs} = v as cheerio.TagElement;\n        return attribs && attribs.src.includes(removeLeadingSlash(scriptKey));\n      });\n\n    if (hasCssImportAlready || !hasScriptImportAlready) {\n      continue;\n    }\n    const linkHref = removeTrailingSlash(baseUrl) + addLeadingSlash(key);\n    htmlData.root('head').append(`<link rel=\"stylesheet\" href=\"${linkHref}\" />`);\n  }\n}\n\n/**\n * Traverse the entrypoint for JS scripts, and add preload links to the HTML entrypoint.\n */\nfunction preloadEntrypoint(\n  htmlData: ScannedHtmlEntrypoint,\n  manifest: SnowpackMetaManifest,\n  config: SnowpackConfig,\n): void {\n  const {root, getScripts} = htmlData;\n  const preloadScripts = getScripts()\n    .map((_, elem) => {\n      const {attribs} = elem as cheerio.TagElement;\n      return attribs.src;\n    })\n    .get()\n    .filter(isTruthy);\n  const collectedDeepImports = new Set<string>();\n  for (const preloadScript of preloadScripts) {\n    collectDeepImports(config, preloadScript, manifest, collectedDeepImports);\n  }\n  const baseUrl = config.buildOptions.baseUrl;\n  for (const imp of collectedDeepImports) {\n    const preloadUrl = (baseUrl ? removeTrailingSlash(baseUrl) : '') + addLeadingSlash(imp);\n    root('head').append(`<link rel=\"modulepreload\" href=\"${preloadUrl}\" />`);\n  }\n}\n\n/**\n * Handle the many different user input formats to return an array of strings.\n * resolve \"auto\" mode here.\n */\nasync function getEntrypoints(\n  entrypoints: OptimizeOptions['entrypoints'],\n  allBuildFiles: string[],\n) {\n  if (entrypoints === 'auto') {\n    // TODO: Filter allBuildFiles by HTML with head & body\n    return allBuildFiles.filter((f) => hasExtension(f, '.html'));\n  }\n  if (Array.isArray(entrypoints)) {\n    return entrypoints;\n  }\n  if (typeof entrypoints === 'function') {\n    return entrypoints({files: allBuildFiles});\n  }\n  throw new Error('UNEXPECTED ENTRYPOINTS: ' + entrypoints);\n}\n\n/**\n * Resolve an array of string entrypoints to absolute file paths. Handle\n * source vs. build directory relative entrypoints here as well.\n */\nasync function resolveEntrypoints(\n  entrypoints: string[],\n  cwd: string,\n  buildDirectoryLoc: string,\n  config: SnowpackConfig,\n) {\n  return Promise.all(\n    entrypoints.map(async (entrypoint) => {\n      if (path.isAbsolute(entrypoint)) {\n        return entrypoint;\n      }\n      const buildEntrypoint = path.resolve(buildDirectoryLoc, entrypoint);\n      if (await fs.stat(buildEntrypoint).catch(() => null)) {\n        return buildEntrypoint;\n      }\n      const resolvedSourceFile = path.resolve(cwd, entrypoint);\n      let resolvedSourceEntrypoint: string | undefined;\n      if (await fs.stat(resolvedSourceFile).catch(() => null)) {\n        const resolvedSourceUrls = getUrlsForFile(resolvedSourceFile, config);\n        if (resolvedSourceUrls) {\n          resolvedSourceEntrypoint = path.resolve(\n            buildDirectoryLoc,\n            removeLeadingSlash(resolvedSourceUrls[0]),\n          );\n          if (await fs.stat(resolvedSourceEntrypoint).catch(() => null)) {\n            return resolvedSourceEntrypoint;\n          }\n        }\n      }\n      logger.error(`Error: entrypoint \"${entrypoint}\" not found in either build or source:`, {\n        name: 'optimize',\n      });\n      logger.error(`  ✘ Build Entrypoint: ${buildEntrypoint}`, {name: 'optimize'});\n      logger.error(\n        `  ✘ Source Entrypoint: ${resolvedSourceFile} ${\n          resolvedSourceEntrypoint ? `-> ${resolvedSourceEntrypoint}` : ''\n        }`,\n        {name: 'optimize'},\n      );\n      throw new Error(`Optimize entrypoint \"${entrypoint}\" does not exist.`);\n    }),\n  );\n}\n\n/**\n * Process your entrypoints as either all JS or all HTML. If HTML,\n * scan those HTML files and add a Cheerio-powered root document\n * so that we can modify the HTML files as we go.\n */\nasync function processEntrypoints(\n  originalEntrypointValue: OptimizeOptions['entrypoints'],\n  entrypointFiles: string[],\n  buildDirectoryLoc: string,\n  baseUrl: string,\n): Promise<{htmlEntrypoints: null | ScannedHtmlEntrypoint[]; bundleEntrypoints: string[]}> {\n  // If entrypoints are JS:\n  if (entrypointFiles.every((f) => hasExtension(f, '.js'))) {\n    return {htmlEntrypoints: null, bundleEntrypoints: entrypointFiles};\n  }\n  // If entrypoints are HTML:\n  if (entrypointFiles.every((f) => hasExtension(f, '.html'))) {\n    const rawHtmlEntrypoints = await scanHtmlEntrypoints(entrypointFiles);\n    const htmlEntrypoints = rawHtmlEntrypoints.filter(isTruthy);\n    if (\n      originalEntrypointValue !== 'auto' &&\n      rawHtmlEntrypoints.length !== htmlEntrypoints.length\n    ) {\n      throw new Error('INVALID HTML ENTRYPOINTS: ' + originalEntrypointValue);\n    }\n    htmlEntrypoints.forEach((val) => extractBaseUrl(val, baseUrl));\n    htmlEntrypoints.forEach(extractInlineScripts);\n    const bundleEntrypoints = Array.from(\n      htmlEntrypoints.reduce((all, val) => {\n        val.getLinks('stylesheet').each((_, elem) => {\n          const {attribs} = elem as cheerio.TagElement;\n          if (!attribs || !attribs.href || isRemoteUrl(attribs.href)) {\n            return;\n          }\n          const resolvedCSS =\n            attribs.href[0] === '/'\n              ? path.resolve(buildDirectoryLoc, removeLeadingSlash(attribs.href))\n              : path.resolve(val.file, '..', attribs.href);\n          all.add(resolvedCSS);\n        });\n        val.getScripts().each((_, elem) => {\n          const {attribs} = elem as cheerio.TagElement;\n          if (!attribs.src || isRemoteUrl(attribs.src)) {\n            return;\n          }\n          const resolvedJS =\n            attribs.src[0] === '/'\n              ? path.join(buildDirectoryLoc, removeLeadingSlash(attribs.src))\n              : path.join(val.file, '..', attribs.src);\n          all.add(resolvedJS);\n        });\n        return all;\n      }, new Set<string>()),\n    );\n    return {htmlEntrypoints, bundleEntrypoints};\n  }\n  // If entrypoints are mixed or neither, throw an error.\n  throw new Error('MIXED ENTRYPOINTS: ' + entrypointFiles);\n}\n\n/**\n * Run esbuild on the build directory. This is run regardless of bundle=true or false,\n * since we use the generated manifest in either case.\n */\nasync function runEsbuildOnBuildDirectory(\n  bundleEntrypoints: string[],\n  allFiles: string[],\n  config: SnowpackConfig,\n): Promise<{manifest: SnowpackMetaManifest; outputFiles: esbuild.OutputFile[]}> {\n  // esbuild requires publicPath to be a remote URL. Only pass to esbuild if baseUrl is remote.\n  let publicPath: string | undefined;\n  if (\n    config.buildOptions.baseUrl.startsWith('http:') ||\n    config.buildOptions.baseUrl.startsWith('https:') ||\n    config.buildOptions.baseUrl.startsWith('//')\n  ) {\n    publicPath = config.buildOptions.baseUrl;\n  }\n  const {outputFiles, warnings, metafile} = await esbuild.build({\n    entryPoints: bundleEntrypoints,\n    outdir: FAKE_BUILD_DIRECTORY,\n    outbase: config.buildOptions.out,\n    write: false,\n    bundle: true,\n    loader: config.optimize!.loader,\n    sourcemap: config.optimize!.sourcemap,\n    splitting: config.optimize!.splitting,\n    format: 'esm',\n    platform: 'browser',\n    metafile: true,\n    publicPath,\n    minify: config.optimize!.minify,\n    target: config.optimize!.target,\n    external: Array.from(new Set(allFiles.map((f) => '*' + path.extname(f))))\n      .filter((ext) => ext !== '*.js' && ext !== '*.mjs' && ext !== '*.css' && ext !== '*')\n      .concat(config.packageOptions?.external ?? []),\n    charset: 'utf8',\n  });\n\n  if (!outputFiles) {\n    throw new Error('EMPTY BUILD');\n  }\n  if (warnings.length > 0) {\n    console.warn(warnings);\n  }\n  outputFiles.forEach((f) => {\n    f.path = f.path.replace(FAKE_BUILD_DIRECTORY_REGEX, addTrailingSlash(config.buildOptions.out));\n  });\n  const manifest = metafile!;\n  if (!config.optimize?.bundle) {\n    delete (manifest as SnowpackMetaManifest).outputs;\n  } else {\n    Object.entries(manifest.outputs).forEach(([f, val]) => {\n      const newKey = f.replace(FAKE_BUILD_DIRECTORY_REGEX, '/');\n      manifest.outputs[newKey] = val;\n      delete manifest.outputs[f];\n    });\n  }\n  logger.debug(`outputFiles: ${JSON.stringify(outputFiles.map((f) => f.path))}`);\n  logger.debug(`manifest: ${JSON.stringify(manifest)}`);\n\n  return {outputFiles, manifest};\n}\n\n/** The main optimize function: runs optimization on a build directory. */\nexport async function runBuiltInOptimize(config: SnowpackConfig) {\n  const originalCwd = process.cwd();\n  const buildDirectoryLoc = config.buildOptions.out;\n  const options = config.optimize;\n  if (!options) {\n    return;\n  }\n\n  // * Scan to collect all build files: We'll need this throughout.\n  const allBuildFiles = (await new fdir()\n    .withFullPaths()\n    .crawl(buildDirectoryLoc)\n    .withPromise()) as string[];\n\n  // * Resolve and validate your entrypoints: they may be JS or HTML\n  const userEntrypoints = await getEntrypoints(options.entrypoints, allBuildFiles);\n  logger.debug(JSON.stringify(userEntrypoints), {name: 'optimize.entrypoints'});\n  const resolvedEntrypoints = await resolveEntrypoints(\n    userEntrypoints,\n    originalCwd,\n    buildDirectoryLoc,\n    config,\n  );\n  logger.debug('(resolved) ' + JSON.stringify(resolvedEntrypoints), {name: 'optimize.entrypoints'});\n  const {htmlEntrypoints, bundleEntrypoints} = await processEntrypoints(\n    options.entrypoints,\n    resolvedEntrypoints,\n    buildDirectoryLoc,\n    config.buildOptions.baseUrl,\n  );\n  logger.debug(`htmlEntrypoints: ${JSON.stringify(htmlEntrypoints?.map((f) => f.file))}`);\n  logger.debug(`bundleEntrypoints: ${JSON.stringify(bundleEntrypoints)}`);\n\n  if (\n    (!htmlEntrypoints || htmlEntrypoints.length === 0) &&\n    bundleEntrypoints.length === 0 &&\n    (options.bundle || options.preload)\n  ) {\n    throw new Error(\n      '[optimize] No HTML entrypoints detected. Set \"entrypoints\" manually if your site HTML is generated outside of Snowpack (SSR, Rails, PHP, etc.).',\n    );\n  }\n\n  // * Run esbuild on the entire build directory. Even if you are not writing the result\n  // to disk (bundle: false), we still use the bundle manifest as an in-memory representation\n  // of our import graph, saved to disk.\n  const {manifest, outputFiles} = await runEsbuildOnBuildDirectory(\n    bundleEntrypoints,\n    allBuildFiles,\n    config,\n  );\n\n  // * BUNDLE: TRUE - Save the bundle result to the build directory, and clean up to remove all original\n  // build files that now live in the bundles.\n  if (options.bundle) {\n    for (const bundledInput of Object.keys(manifest.inputs)) {\n      const outputKey = path.relative(buildDirectoryLoc, path.resolve(process.cwd(), bundledInput));\n      if (!manifest.outputs![`/` + outputKey]) {\n        logger.debug(`Removing bundled source file: ${path.resolve(buildDirectoryLoc, outputKey)}`);\n        deleteFromBuildSafe(path.resolve(buildDirectoryLoc, outputKey), config);\n      }\n    }\n    deleteFromBuildSafe(\n      path.resolve(\n        buildDirectoryLoc,\n        removeLeadingSlash(path.posix.join(config.buildOptions.metaUrlPath, 'pkg')),\n      ),\n      config,\n    );\n    for (const outputFile of outputFiles!) {\n      mkdirp.sync(path.dirname(outputFile.path));\n      await fs.writeFile(outputFile.path, outputFile.contents);\n    }\n    if (htmlEntrypoints) {\n      for (const htmlEntrypoint of htmlEntrypoints) {\n        addNewBundledCss(htmlEntrypoint, manifest, config.buildOptions.baseUrl);\n      }\n    }\n  }\n  // * BUNDLE: FALSE - Just minifying & transform the CSS & JS files in place.\n  else if (options.minify || options.target) {\n    for (const f of allBuildFiles) {\n      if (['.js', '.css'].includes(path.extname(f))) {\n        let code = await fs.readFile(f, 'utf8');\n        const minified = await esbuild.transform(code, {\n          sourcefile: path.basename(f),\n          loader: path.extname(f).slice(1) as 'js' | 'css',\n          minify: options.minify,\n          target: options.target,\n          charset: 'utf8',\n        });\n        code = minified.code;\n        await fs.writeFile(f, code);\n      }\n    }\n  }\n\n  // * Restitch any inline scripts into HTML entrypoints that had been split out\n  // for the sake of bundling/manifest.\n  if (htmlEntrypoints) {\n    for (const htmlEntrypoint of htmlEntrypoints) {\n      restitchInlineScripts(htmlEntrypoint);\n    }\n  }\n\n  // * PRELOAD: TRUE - Add preload link elements for each HTML entrypoint, to flatten\n  // and optimize any deep import waterfalls.\n  if (options.preload) {\n    if (options.bundle) {\n      throw new Error('preload is not needed when bundle=true, and cannot be used in combination.');\n    }\n    if (!htmlEntrypoints || htmlEntrypoints.length === 0) {\n      throw new Error('preload only works with HTML entrypoints.');\n    }\n    for (const htmlEntrypoint of htmlEntrypoints) {\n      preloadEntrypoint(htmlEntrypoint, manifest, config);\n    }\n  }\n\n  // * Restitch any inline scripts into HTML entrypoints that had been split out\n  // for the sake of bundling/manifest.\n  if (htmlEntrypoints) {\n    for (const htmlEntrypoint of htmlEntrypoints) {\n      restitchBaseUrl(htmlEntrypoint, config.buildOptions.baseUrl);\n    }\n  }\n\n  // Write the final HTML entrypoints to disk (if they exist).\n  if (htmlEntrypoints) {\n    for (const htmlEntrypoint of htmlEntrypoints) {\n      await fs.writeFile(htmlEntrypoint.file, htmlEntrypoint.root.html());\n    }\n  }\n\n  // Write the final build manifest to disk.\n  if (options.manifest) {\n    await fs.writeFile(\n      path.join(config.buildOptions.out, 'build-manifest.json'),\n      JSON.stringify(manifest),\n    );\n  }\n  process.chdir(originalCwd);\n  return;\n}\n"
  },
  {
    "path": "snowpack/src/build/process.ts",
    "content": "import type {ImportMap, InstallTarget} from 'esinstall';\nimport type {\n  LoadUrlOptions,\n  CommandOptions,\n  OnFileChangeCallback,\n  SnowpackConfig,\n  SnowpackDevServer,\n} from '../types';\nimport * as colors from 'kleur/colors';\nimport {promises as fs} from 'fs';\nimport {performance} from 'perf_hooks';\nimport {fdir} from 'fdir';\nimport mkdirp from 'mkdirp';\nimport path from 'path';\nimport picomatch from 'picomatch';\nimport slash from 'slash';\nimport {getUrlsForFile} from './file-urls';\nimport {runPipelineCleanupStep, runPipelineOptimizeStep} from './build-pipeline';\nimport {wrapImportProxy} from './build-import-proxy';\nimport {runBuiltInOptimize} from './optimize';\nimport {startServer} from '../commands/dev';\nimport {getPackageSource} from '../sources/util';\nimport {installPackages} from '../sources/local-install';\nimport {deleteFromBuildSafe, isPathImport, isRemoteUrl, IS_DOTFILE_REGEX} from '../util';\nimport {logger} from '../logger';\n\ninterface BuildState {\n  commandOptions: CommandOptions;\n  config: SnowpackConfig;\n\n  // Environments\n  isWatch: boolean;\n  isDev: boolean;\n  isSSR: boolean;\n  isHMR: boolean;\n\n  // Options\n  // Should the build directory be cleaned first\n  clean: boolean;\n\n  // State\n  allBareModuleSpecifiers: InstallTarget[];\n  allFileUrlsUnique: Set<string>;\n  allFileUrlsToProcess: string[];\n  buildDirectoryLoc: string;\n  devServer: SnowpackDevServer;\n  optimizedImportMap?: ImportMap;\n}\n\nfunction getIsHmrEnabled(config: SnowpackConfig) {\n  return config.buildOptions.watch && !!config.devOptions.hmr;\n}\n\n/**\n * Scan a directory and remove any empty folders, recursively.\n */\nasync function removeEmptyFolders(directoryLoc: string): Promise<boolean> {\n  if (!(await fs.stat(directoryLoc)).isDirectory()) {\n    return false;\n  }\n  // If folder is empty, clear it\n  const files = await fs.readdir(directoryLoc);\n  if (files.length === 0) {\n    await fs.rmdir(directoryLoc);\n    return false;\n  }\n  // Otherwise, step in and clean each contained item\n  await Promise.all(files.map((file) => removeEmptyFolders(path.join(directoryLoc, file))));\n  // After, check again if folder is now empty\n  const afterFiles = await fs.readdir(directoryLoc);\n  if (afterFiles.length == 0) {\n    await fs.rmdir(directoryLoc);\n  }\n  return true;\n}\n\nasync function installOptimizedDependencies(\n  installTargets: InstallTarget[],\n  installDest: string,\n  commandOptions: CommandOptions,\n) {\n  const baseInstallOptions = {\n    dest: installDest,\n    external: commandOptions.config.packageOptions.external,\n    env: {NODE_ENV: commandOptions.config.mode},\n    treeshake: commandOptions.config.buildOptions.watch\n      ? false\n      : commandOptions.config.optimize?.treeshake !== false,\n  };\n\n  const pkgSource = getPackageSource(commandOptions.config);\n  const installOptions = await pkgSource.modifyBuildInstallOptions(\n    baseInstallOptions,\n    installTargets,\n  );\n  // 2. Install dependencies, based on the scan of your final build.\n  const installResult = await installPackages({\n    config: commandOptions.config,\n    isSSR: commandOptions.config.buildOptions.ssr,\n    isDev: false,\n    installTargets,\n    installOptions,\n  });\n  return installResult;\n}\n\nexport async function createBuildState(commandOptions: CommandOptions): Promise<BuildState> {\n  const {config} = commandOptions;\n  const isWatch = !!config.buildOptions.watch;\n  const isDev = !!isWatch;\n  const isSSR = !!config.buildOptions.ssr;\n  const isHMR = getIsHmrEnabled(config);\n\n  // Seems like maybe we shouldn't be doing this...\n  config.buildOptions.resolveProxyImports = !config.optimize?.bundle;\n  config.devOptions.hmrPort = isHMR ? config.devOptions.hmrPort : undefined;\n  config.devOptions.port = 0;\n\n  const clean = config.buildOptions.clean;\n  const buildDirectoryLoc = config.buildOptions.out;\n\n  const devServer = await startServer(commandOptions, {isDev, isWatch, preparePackages: false});\n\n  return {\n    commandOptions,\n    config,\n    isDev,\n    isHMR,\n    isSSR,\n    isWatch,\n    clean,\n\n    buildDirectoryLoc,\n    allBareModuleSpecifiers: [],\n    allFileUrlsUnique: new Set<string>(),\n    allFileUrlsToProcess: [],\n    devServer,\n  };\n}\n\nexport function maybeCleanBuildDirectory(state: BuildState) {\n  const {buildDirectoryLoc} = state;\n  if (state.clean) {\n    deleteFromBuildSafe(buildDirectoryLoc, state.config);\n  }\n  mkdirp.sync(buildDirectoryLoc);\n}\n\nexport async function addBuildFiles(state: BuildState, files: string[]) {\n  const {config} = state;\n  const excludeGlobs = [...config.exclude, ...config.testOptions.files];\n  const foundExcludeMatch = picomatch(excludeGlobs);\n  const mountedNodeModules = Object.keys(config.mount).filter((v) => v.includes('node_modules'));\n\n  const allFileUrls: string[] = [];\n\n  for (const f of files) {\n    if (foundExcludeMatch(f)) {\n      const isMounted = mountedNodeModules.find((mountKey) => f.startsWith(mountKey));\n      if (!isMounted || (isMounted && foundExcludeMatch(f.slice(isMounted.length)))) {\n        continue;\n      }\n    }\n    const fileUrls = getUrlsForFile(f, config)!;\n    allFileUrls.push(...fileUrls);\n  }\n\n  state.allBareModuleSpecifiers = [];\n  state.allFileUrlsUnique = new Set(allFileUrls);\n  state.allFileUrlsToProcess = [...state.allFileUrlsUnique];\n}\n\nexport async function addBuildFilesFromMountpoints(state: BuildState): Promise<void> {\n  const {config} = state;\n\n  const possibleFiles: string[] = [];\n\n  for (const [mountKey, mountEntry] of Object.entries(config.mount)) {\n    logger.debug(`Mounting directory: '${mountKey}' as URL '${mountEntry.url}'`);\n    const allMatchedFiles = (await new fdir()\n      .withFullPaths()\n      .crawl(mountKey)\n      .withPromise()) as string[];\n    if (mountEntry.dot) {\n      possibleFiles.push(...allMatchedFiles);\n    } else {\n      possibleFiles.push(...allMatchedFiles.filter((f) => !IS_DOTFILE_REGEX.test(slash(f)))); // TODO: use a file URL instead\n    }\n  }\n\n  addBuildFiles(state, possibleFiles);\n}\n\ntype FlushLoadOptions = LoadUrlOptions & {encoding?: undefined};\n\nasync function flushFileQueue(\n  state: BuildState,\n  ignorePkg: boolean,\n  loadOptions: FlushLoadOptions,\n) {\n  const {\n    config,\n    allFileUrlsUnique,\n    allFileUrlsToProcess,\n    allBareModuleSpecifiers,\n    buildDirectoryLoc,\n    devServer,\n    isHMR,\n  } = state;\n\n  const pkgUrlPrefix = path.posix.join(config.buildOptions.metaUrlPath, 'pkg/');\n\n  logger.debug(`QUEUE: ${allFileUrlsToProcess}`);\n  while (allFileUrlsToProcess.length > 0) {\n    const fileUrl = allFileUrlsToProcess.shift()!;\n    const fileDestinationLoc = path.join(buildDirectoryLoc, fileUrl);\n    logger.debug(`BUILD: ${fileUrl}`);\n    // ignore package URLs when `ignorePkg` is true, EXCEPT proxy imports. Those can sometimes\n    // be added after the intial package scan, depending on how a non-JS package is imported.\n    if (ignorePkg && fileUrl.startsWith(pkgUrlPrefix)) {\n      if (fileUrl.endsWith('.proxy.js')) {\n        const pkgContents = await fs.readFile(\n          path.join(buildDirectoryLoc, fileUrl.replace('.proxy.js', '')),\n        );\n        const pkgContentsProxy = await wrapImportProxy({\n          url: fileUrl.replace('.proxy.js', ''),\n          code: pkgContents,\n          hmr: isHMR,\n          config: config,\n        });\n        await fs.writeFile(fileDestinationLoc, pkgContentsProxy);\n      }\n      continue;\n    }\n    const result = await devServer.loadUrl(fileUrl, loadOptions);\n    if (!result) {\n      // if this URL doesn’t exist, skip to next file (it may be an optional output type, such as .css for .svelte)\n      logger.debug(`BUILD: ${fileUrl} skipped (no output)`);\n      continue;\n    }\n    await mkdirp(path.dirname(fileDestinationLoc));\n    await fs.writeFile(fileDestinationLoc, result.contents);\n    for (const installTarget of result.imports) {\n      const importedUrl = installTarget.specifier;\n      logger.debug(`ADD: ${importedUrl}`);\n      if (isRemoteUrl(importedUrl)) {\n        // do nothing\n      } else if (isPathImport(importedUrl)) {\n        if (importedUrl[0] === '/') {\n          if (!allFileUrlsUnique.has(importedUrl)) {\n            allFileUrlsUnique.add(importedUrl);\n            allFileUrlsToProcess.push(importedUrl);\n          }\n        } else {\n          logger.warn(`warn: import \"${importedUrl}\" of \"${fileUrl}\" could not be resolved.`);\n        }\n      } else {\n        allBareModuleSpecifiers.push(installTarget);\n      }\n    }\n  }\n}\n\nexport async function buildFiles(state: BuildState) {\n  const {isSSR, isHMR} = state;\n\n  logger.info(colors.yellow('! building files...'));\n  const buildStart = performance.now();\n  await flushFileQueue(state, false, {isSSR, isHMR, isResolve: false});\n  const buildEnd = performance.now();\n  logger.info(\n    `${colors.green('✔')} files built. ${colors.dim(\n      `[${((buildEnd - buildStart) / 1000).toFixed(2)}s]`,\n    )}`,\n  );\n}\n\nexport async function buildDependencies(state: BuildState) {\n  const {commandOptions, config, buildDirectoryLoc, isWatch} = state;\n  logger.info(colors.yellow('! building dependencies...'));\n  const packagesStart = performance.now();\n  if (isWatch) {\n    const pkgSource = getPackageSource(config);\n    await pkgSource.prepare();\n  } else {\n    const installDest = path.join(buildDirectoryLoc, config.buildOptions.metaUrlPath, 'pkg');\n    const installResult = await installOptimizedDependencies(\n      [...state.allBareModuleSpecifiers],\n      installDest,\n      commandOptions,\n    );\n    state.optimizedImportMap = installResult.importMap;\n  }\n  const packagesEnd = performance.now();\n  logger.info(\n    `${colors.green('✔')} dependencies built. ${colors.dim(\n      `[${((packagesEnd - packagesStart) / 1000).toFixed(2)}s]`,\n    )}`,\n  );\n}\n\nexport async function writeToDisk(state: BuildState) {\n  const {isHMR, isSSR, isWatch} = state;\n\n  logger.info(colors.yellow('! writing to disk...'));\n  const writeStart = performance.now();\n  state.allFileUrlsToProcess = [...state.allFileUrlsUnique];\n  await flushFileQueue(state, !isWatch, {\n    isSSR,\n    isHMR,\n    isResolve: true,\n    importMap: state.optimizedImportMap,\n  });\n  const writeEnd = performance.now();\n  logger.info(\n    `${colors.green('✔')} write complete. ${colors.dim(\n      `[${((writeEnd - writeStart) / 1000).toFixed(2)}s]`,\n    )}`,\n  );\n}\n\nexport async function startWatch(state: BuildState) {\n  const {config, devServer, isSSR, isHMR} = state;\n\n  let onFileChangeCallback: OnFileChangeCallback = () => {};\n  devServer.onFileChange(async ({filePath}) => {\n    // First, do our own re-build logic\n    const fileUrls = getUrlsForFile(filePath, config);\n    if (!fileUrls || fileUrls.length === 0) {\n      return;\n    }\n    state.allFileUrlsToProcess.push(fileUrls[0]);\n    await flushFileQueue(state, false, {\n      isSSR,\n      isHMR,\n      isResolve: true,\n      importMap: state.optimizedImportMap,\n    });\n    // Then, call the user's onFileChange callback (if one was provided)\n    await onFileChangeCallback({filePath});\n  });\n\n  if (devServer.hmrEngine) {\n    logger.info(`${colors.green(`HMR ready:`)} ws://localhost:${devServer.hmrEngine.port}`);\n  }\n\n  return {\n    onFileChange: (callback) => (onFileChangeCallback = callback),\n    shutdown() {\n      return devServer.shutdown();\n    },\n  };\n}\n\nexport async function optimize(state: BuildState) {\n  const {config, buildDirectoryLoc} = state;\n\n  // \"--optimize\" mode - Optimize the build.\n  if (config.optimize || config.plugins.some((p) => p.optimize)) {\n    const optimizeStart = performance.now();\n    logger.info(colors.yellow('! optimizing build...'));\n    await runBuiltInOptimize(config);\n    await runPipelineOptimizeStep(buildDirectoryLoc, {config});\n    const optimizeEnd = performance.now();\n    logger.info(\n      `${colors.green('✔')} build optimized. ${colors.dim(\n        `[${((optimizeEnd - optimizeStart) / 1000).toFixed(2)}s]`,\n      )}`,\n    );\n  }\n}\n\nexport async function postBuildCleanup(state: BuildState) {\n  const {buildDirectoryLoc, config, devServer} = state;\n\n  await removeEmptyFolders(buildDirectoryLoc);\n  await runPipelineCleanupStep(config);\n  logger.info(`${colors.underline(colors.green(colors.bold('▶ Build Complete!')))}`);\n  await devServer.shutdown();\n}\n"
  },
  {
    "path": "snowpack/src/commands/add-rm.ts",
    "content": "import {send} from 'httpie';\nimport {cyan, dim, underline} from 'kleur/colors';\nimport path from 'path';\nimport {logger} from '../logger';\nimport {CommandOptions, LockfileManifest} from '../types';\nimport {\n  convertLockfileToSkypackImportMap,\n  convertSkypackImportMapToLockfile,\n  LOCKFILE_NAME,\n  writeLockfile,\n  createRemotePackageSDK,\n} from '../util';\nimport {getPackageSource} from '../sources/util';\n\nfunction pkgInfoFromString(str) {\n  const idx = str.lastIndexOf('@');\n  if (idx <= 0) return [str];\n  return [str.slice(0, idx), str.slice(idx + 1)];\n}\n\nexport async function addCommand(addValue: string, commandOptions: CommandOptions) {\n  const {lockfile, config} = commandOptions;\n  if (config.packageOptions.source === 'remote-next') {\n    throw new Error(\n      `[remote-next] add command has been deprecated. Manually add dependencies to the \"dependencies\" object in your snowpack config file.`,\n    );\n  }\n  if (config.packageOptions.source !== 'remote') {\n    throw new Error(`add command requires packageOptions.source=\"remote\".`);\n  }\n  const remotePackageSDK = createRemotePackageSDK(config);\n  let [pkgName, pkgSemver] = pkgInfoFromString(addValue);\n  const installMessage = pkgSemver ? `${pkgName}@${pkgSemver}` : pkgName;\n  logger.info(`fetching ${cyan(installMessage)} from CDN...`);\n  if (!pkgSemver || pkgSemver === 'latest') {\n    const {data} = await send('GET', `http://registry.npmjs.org/${pkgName}/latest`);\n    pkgSemver = `^${data.version}`;\n  }\n  logger.info(\n    `adding ${cyan(underline(`${pkgName}@${pkgSemver}`))} to your project lockfile. ${dim(\n      `(${LOCKFILE_NAME})`,\n    )}`,\n  );\n  const addedDependency = {[pkgName]: pkgSemver};\n  const lookupResponse = await remotePackageSDK.lookupBySpecifier(pkgName, pkgSemver);\n  if (lookupResponse.error) {\n    throw new Error(`There was a problem looking up ${pkgName}@${pkgSemver}`);\n  }\n  const newLockfile: LockfileManifest = convertSkypackImportMapToLockfile(\n    {\n      ...lockfile?.dependencies,\n      ...addedDependency,\n    },\n    await remotePackageSDK.generateImportMap(\n      addedDependency,\n      lockfile\n        ? convertLockfileToSkypackImportMap(config.packageOptions.origin, lockfile)\n        : undefined,\n    ),\n  );\n  await writeLockfile(path.join(config.root, LOCKFILE_NAME), newLockfile);\n  await getPackageSource(config).prepare();\n}\n\nexport async function rmCommand(addValue: string, commandOptions: CommandOptions) {\n  const {lockfile, config} = commandOptions;\n  if (config.packageOptions.source === 'remote-next') {\n    throw new Error(\n      `[remote-next] rm command has been deprecated. Manually remove dependencies from the \"dependencies\" object in your snowpack config file.`,\n    );\n  }\n  if (config.packageOptions.source !== 'remote') {\n    throw new Error(`rm command requires packageOptions.source=\"remote\".`);\n  }\n  const remotePackageSDK = createRemotePackageSDK(config);\n  let [pkgName] = pkgInfoFromString(addValue);\n  logger.info(`removing ${cyan(pkgName)} from project lockfile...`);\n  const newLockfile: LockfileManifest = convertSkypackImportMapToLockfile(\n    lockfile?.dependencies ?? {},\n    await remotePackageSDK.generateImportMap(\n      {[pkgName]: null},\n      lockfile\n        ? convertLockfileToSkypackImportMap(config.packageOptions.origin, lockfile)\n        : undefined,\n    ),\n  );\n  delete newLockfile.dependencies[pkgName];\n  await writeLockfile(path.join(config.root, LOCKFILE_NAME), newLockfile);\n  await getPackageSource(config).prepare();\n}\n"
  },
  {
    "path": "snowpack/src/commands/build.ts",
    "content": "import type {CommandOptions, SnowpackBuildResult} from '../types';\nimport {logger} from '../logger';\nimport {\n  createBuildState,\n  maybeCleanBuildDirectory,\n  addBuildFilesFromMountpoints,\n  buildFiles,\n  buildDependencies,\n  optimize,\n  writeToDisk,\n  postBuildCleanup,\n  startWatch,\n} from '../build/process';\n\nexport async function build(commandOptions: CommandOptions): Promise<SnowpackBuildResult> {\n  const buildState = await createBuildState(commandOptions);\n\n  // Start by cleaning the directory\n  maybeCleanBuildDirectory(buildState);\n\n  await addBuildFilesFromMountpoints(buildState);\n  await buildFiles(buildState);\n  await buildDependencies(buildState);\n  await writeToDisk(buildState);\n\n  // \"--watch\" mode - Start watching the file system.\n  if (buildState.isWatch) {\n    return startWatch(buildState);\n  }\n\n  await optimize(buildState);\n  await postBuildCleanup(buildState);\n\n  return {\n    onFileChange: () => {\n      throw new Error('build().onFileChange() only supported in \"watch\" mode.');\n    },\n    shutdown: () => {\n      throw new Error('build().shutdown() only supported in \"watch\" mode.');\n    },\n  };\n}\n\nexport async function command(commandOptions: CommandOptions) {\n  try {\n    commandOptions.config.devOptions.output =\n      commandOptions.config.devOptions.output ||\n      (commandOptions.config.buildOptions.watch ? 'dashboard' : 'stream');\n    await build(commandOptions);\n  } catch (err) {\n    logger.error(err.message);\n    logger.error(err.stack);\n    process.exit(1);\n  }\n\n  if (commandOptions.config.buildOptions.watch) {\n    // We intentionally never want to exit in watch mode!\n    return new Promise(() => {});\n  }\n}\n"
  },
  {
    "path": "snowpack/src/commands/dev.ts",
    "content": "import {FSWatcher} from 'chokidar';\nimport isCompressible from 'compressible';\nimport {InstallTarget} from 'esinstall';\nimport etag from 'etag';\nimport {EventEmitter} from 'events';\nimport {createReadStream, promises as fs, statSync} from 'fs';\nimport {fdir} from 'fdir';\nimport picomatch from 'picomatch';\nimport type {Socket} from 'net';\nimport http from 'http';\nimport http2 from 'http2';\nimport * as colors from 'kleur/colors';\nimport mime from 'mime-types';\nimport os from 'os';\nimport path from 'path';\nimport {performance} from 'perf_hooks';\nimport slash from 'slash';\nimport stream from 'stream';\nimport url from 'url';\nimport zlib from 'zlib';\nimport {generateEnvModule, getMetaUrlPath, wrapImportProxy} from '../build/build-import-proxy';\nimport {FileBuilder} from '../build/file-builder';\nimport {getBuiltFileUrls, getMountEntryForFile, getUrlsForFile} from '../build/file-urls';\nimport {startHmrEngine} from '../dev/hmr';\nimport {logger} from '../logger';\nimport {getPackageSource} from '../sources/util';\nimport {createLoader as createServerRuntime} from '../ssr-loader';\nimport {\n  CommandOptions,\n  LoadResult,\n  LoadUrlOptions,\n  OnFileChangeCallback,\n  RouteConfigObject,\n  ServerRuntime,\n  SnowpackConfig,\n  SnowpackDevServer,\n} from '../types';\nimport {\n  createInstallTarget,\n  getCacheKey,\n  HMR_CLIENT_CODE,\n  HMR_OVERLAY_CODE,\n  isFsEventsEnabled,\n  IS_DOTFILE_REGEX,\n  openInBrowser,\n} from '../util';\nimport {getPort, startDashboard, paintEvent} from './paint';\nimport {cssModuleJSON} from '../build/import-css';\nimport {runPipelineCleanupStep} from '../build/build-pipeline';\n\nexport class OneToManyMap {\n  readonly keyToValue = new Map<string, string[]>();\n  readonly valueToKey = new Map<string, string>();\n  add(key: string, _value: string | string[]) {\n    const value = Array.isArray(_value) ? _value : [_value];\n    this.keyToValue.set(key, value);\n    for (const val of value) {\n      this.valueToKey.set(val, key);\n    }\n  }\n  delete(key: string) {\n    const value = this.value(key);\n    this.keyToValue.delete(key);\n    if (value) {\n      for (const val of value) {\n        this.valueToKey.delete(val);\n      }\n    }\n  }\n  key(value: string) {\n    return this.valueToKey.get(value);\n  }\n  value(key: string) {\n    return this.keyToValue.get(key);\n  }\n}\n\ninterface FoundFile {\n  loc: string;\n  type: string;\n  // contents: Buffer;\n  isStatic: boolean;\n  isResolve: boolean;\n}\n\nconst FILE_BUILD_RESULT_ERROR = `Build Result Error: There was a problem with a file build result.`;\n\n/**\n * If encoding is defined, return a string. Otherwise, return a Buffer.\n */\nfunction encodeResponse(\n  response: Buffer | string,\n  encoding: BufferEncoding | undefined | null,\n): Buffer | string {\n  if (encoding === undefined) {\n    return response;\n  }\n  if (encoding) {\n    if (typeof response === 'string') {\n      return response;\n    } else {\n      return response.toString(encoding);\n    }\n  }\n  if (typeof response === 'string') {\n    return Buffer.from(response);\n  } else {\n    return response;\n  }\n}\n\n/**\n * A helper class for \"Not Found\" errors, storing data about what file lookups were attempted.\n */\nexport class NotFoundError extends Error {\n  constructor(url: string, lookups?: string[]) {\n    if (!lookups) {\n      super(`Not Found (${url})`);\n    } else {\n      super(`Not Found (${url}):\\n${lookups.map((loc) => '  ✘ ' + loc).join('\\n')}`);\n    }\n  }\n}\n\nfunction sendResponseFile(\n  req: http.IncomingMessage,\n  res: http.ServerResponse,\n  {contents, originalFileLoc, contentType}: LoadResult,\n) {\n  const body = Buffer.from(contents);\n  const ETag = etag(body, {weak: true});\n  const headers: Record<string, string> = {\n    'Accept-Ranges': 'bytes',\n    'Access-Control-Allow-Origin': '*',\n    'Content-Type': contentType || 'application/octet-stream',\n    ETag,\n    Vary: 'Accept-Encoding',\n  };\n\n  if (req.headers['if-none-match'] === ETag) {\n    res.writeHead(304, headers);\n    res.end();\n    return;\n  }\n\n  let acceptEncoding = (req.headers['accept-encoding'] as string) || '';\n  if (\n    req.headers['cache-control']?.includes('no-transform') ||\n    ['HEAD', 'OPTIONS'].includes(req.method!) ||\n    !contentType ||\n    !isCompressible(contentType)\n  ) {\n    acceptEncoding = '';\n  }\n\n  // Handle gzip compression\n  if (/\\bgzip\\b/.test(acceptEncoding) && stream.Readable.from) {\n    const bodyStream = stream.Readable.from([body]);\n    headers['Content-Encoding'] = 'gzip';\n    res.writeHead(200, headers);\n    stream.pipeline(bodyStream, zlib.createGzip(), res, function onError(err) {\n      if (err) {\n        res.end();\n        logger.error(`✘ An error occurred serving ${colors.bold(req.url!)}`);\n        logger.error(typeof err !== 'string' ? err.toString() : err);\n      }\n    });\n    return;\n  }\n\n  // Handle partial requests\n  // TODO: This throws out a lot of hard work, and ignores any build. Improve.\n  const {range} = req.headers;\n  if (range) {\n    if (!originalFileLoc) {\n      throw new Error('Virtual files do not support partial requests');\n    }\n    const {size: fileSize} = statSync(originalFileLoc);\n    const [rangeStart, rangeEnd] = range.replace(/bytes=/, '').split('-');\n\n    const start = parseInt(rangeStart, 10);\n    const end = rangeEnd ? parseInt(rangeEnd, 10) : fileSize - 1;\n    const chunkSize = end - start + 1;\n\n    const fileStream = createReadStream(originalFileLoc, {start, end});\n    res.writeHead(206, {\n      ...headers,\n      'Content-Range': `bytes ${start}-${end}/${fileSize}`,\n      'Content-Length': chunkSize,\n    });\n    fileStream.pipe(res);\n    return;\n  }\n\n  res.writeHead(200, headers);\n  res.write(body);\n  res.end();\n}\n\nfunction sendResponseError(req: http.IncomingMessage, res: http.ServerResponse, status: number) {\n  const contentType = mime.contentType(path.extname(req.url!) || '.html');\n  const headers: Record<string, string> = {\n    'Access-Control-Allow-Origin': '*',\n    'Accept-Ranges': 'bytes',\n    'Content-Type': contentType || 'application/octet-stream',\n    Vary: 'Accept-Encoding',\n  };\n  res.writeHead(status, headers);\n  res.end();\n}\n\nfunction handleResponseError(req, res, err: Error | NotFoundError) {\n  if (err instanceof NotFoundError) {\n    // Don't log favicon \"Not Found\" errors. Browsers automatically request a favicon.ico file\n    // from the server, which creates annoying errors for new apps / first experiences.\n    if (req.url !== '/favicon.ico') {\n      logger.error(`[404] ${err.message}`);\n    }\n    sendResponseError(req, res, 404);\n    return;\n  }\n  console.log(err);\n  logger.error(err.toString());\n  logger.error(`[500] ${req.url}`, {\n    // @ts-ignore\n    name: err.__snowpackBuildDetails?.name,\n  });\n  sendResponseError(req, res, 500);\n  return;\n}\n\nfunction getServerRuntime(\n  sp: SnowpackDevServer,\n  config: SnowpackConfig,\n  options: {invalidateOnChange?: boolean} = {},\n): ServerRuntime {\n  const runtime = createServerRuntime({\n    config,\n    load: async (url) => {\n      const result = await sp.loadUrl(url, {isSSR: true, allowStale: false, encoding: 'utf8'});\n      if (!result) throw new NotFoundError(url);\n      return result;\n    },\n  });\n\n  if (options.invalidateOnChange !== false) {\n    sp.onFileChange(({filePath}) => {\n      const url = sp.getUrlForFile(filePath);\n      if (url) {\n        runtime.invalidateModule(url);\n      }\n    });\n  }\n  return runtime;\n}\n\nexport async function startServer(\n  commandOptions: CommandOptions,\n  {\n    isDev: _isDev,\n    isWatch: _isWatch,\n    preparePackages: _preparePackages,\n  }: {isDev?: boolean; isWatch?: boolean; preparePackages?: boolean} = {},\n): Promise<SnowpackDevServer> {\n  const {config} = commandOptions;\n  const isDev = _isDev ?? config.mode !== 'production';\n  const isWatch = _isWatch ?? true;\n  const isPreparePackages = _preparePackages ?? true;\n  const pkgSource = getPackageSource(config);\n  if (isPreparePackages) {\n    await pkgSource.prepare();\n    logger.info(colors.bold('Ready!'));\n  }\n  let serverStart = performance.now();\n  const {port: defaultPort, hostname, open, openUrl} = config.devOptions;\n  const messageBus = new EventEmitter();\n  const PACKAGE_PATH_PREFIX = path.posix.join(config.buildOptions.metaUrlPath, 'pkg/');\n  const PACKAGE_LINK_PATH_PREFIX = path.posix.join(config.buildOptions.metaUrlPath, 'link/');\n  let port: number | undefined;\n  let warnedDeprecatedPackageImport = new Set();\n  if (defaultPort !== 0) {\n    port = await getPort(defaultPort);\n    // Reset the clock if we had to wait for the user prompt to select a new port.\n    if (port !== defaultPort) {\n      serverStart = performance.now();\n    }\n  }\n\n  // Fill in any command-specific plugin methods.\n  for (const p of config.plugins) {\n    p.markChanged = (fileLoc) => {\n      knownETags.clear();\n      onWatchEvent(fileLoc);\n    };\n  }\n\n  if (isWatch && config.devOptions.output === 'dashboard' && process.stdout.isTTY) {\n    startDashboard(messageBus, config);\n  } else {\n    // \"stream\": Log relevent events to the console.\n    messageBus.on(paintEvent.WORKER_MSG, ({id, msg}) => {\n      logger.info(msg.trim(), {name: id});\n    });\n  }\n\n  const symlinkDirectories = new Map<string, Promise<any>>();\n  const inMemoryBuildCache = new Map<string, FileBuilder>();\n  let fileToUrlMapping = new OneToManyMap();\n  const excludeGlobs = [\n    ...config.exclude,\n    ...(config.mode === 'test' ? [] : config.testOptions.files),\n  ];\n\n  const foundExcludeMatch = picomatch(excludeGlobs, {ignore: '**/node_modules/**'});\n\n  for (const [mountKey, mountEntry] of Object.entries(config.mount)) {\n    logger.debug(`Mounting directory: '${mountKey}' as URL '${mountEntry.url}'`);\n    const files = (await new fdir()\n      .withFullPaths()\n      // Note: exclude() only matches directories, and not files. However, the cost\n      // of false positives here is minor, so do this as a quick check to possibly\n      // skip scanning into entire folder trees.\n      .exclude((_, dirPath) => foundExcludeMatch(dirPath))\n      .crawl(mountKey)\n      .withPromise()) as string[];\n\n    for (const f of files) {\n      fileToUrlMapping.add(f, getUrlsForFile(f, config)!);\n    }\n  }\n\n  logger.debug(`Using in-memory cache: ${fileToUrlMapping}`);\n\n  const readCredentials = async (cwd: string) => {\n    const secure = config.devOptions.secure;\n    let cert: Buffer;\n    let key: Buffer;\n\n    if (typeof secure === 'object') {\n      cert = secure.cert as Buffer;\n      key = secure.key as Buffer;\n    } else {\n      const certPath = path.join(cwd, 'snowpack.crt');\n      const keyPath = path.join(cwd, 'snowpack.key');\n      [cert, key] = await Promise.all([fs.readFile(certPath), fs.readFile(keyPath)]);\n    }\n\n    return {\n      cert,\n      key,\n    };\n  };\n\n  let credentials: {cert: Buffer; key: Buffer} | undefined;\n  if (config.devOptions.secure) {\n    try {\n      logger.debug(`reading credentials`);\n      credentials = await readCredentials(config.root);\n    } catch (e) {\n      logger.error(`✘ No HTTPS credentials found!`);\n      logger.info(`You can specify HTTPS credentials via either:\n\n  - Including credentials in your project config under ${colors.yellow(`devOptions.secure`)}.\n  - Including ${colors.yellow('snowpack.crt')} and ${colors.yellow(\n        'snowpack.key',\n      )} files in your project's root directory.\n\n    You can automatically generate credentials for your project via either:\n\n  - ${colors.cyan('devcert')}: ${colors.yellow('npx devcert-cli generate localhost')}\n    https://github.com/davewasmer/devcert-cli (no install required)\n\n  - ${colors.cyan('mkcert')}: ${colors.yellow(\n        'mkcert -install && mkcert -key-file snowpack.key -cert-file snowpack.crt localhost',\n      )}\n    https://github.com/FiloSottile/mkcert (install required)`);\n      process.exit(1);\n    }\n  }\n\n  for (const runPlugin of config.plugins) {\n    if (runPlugin.run) {\n      logger.debug(`starting ${runPlugin.name} run() workers`);\n      runPlugin\n        .run({\n          isDev,\n          // @ts-ignore: internal API only\n          log: (msg, data) => {\n            if (msg === 'CONSOLE_INFO') {\n              logger.info(data.msg, {name: runPlugin.name});\n            } else {\n              messageBus.emit(msg, {...data, id: runPlugin.name});\n            }\n          },\n        })\n        .then(() => {\n          logger.info('Command completed.', {name: runPlugin.name});\n        })\n        .catch((err) => {\n          logger.error(`Command exited with error code: ${err}`, {name: runPlugin.name});\n          process.exit(1);\n        });\n    }\n  }\n\n  function getOutputExtensionMatch() {\n    let outputExts: string[] = [];\n    for (const plugin of config.plugins) {\n      if (plugin.resolve) {\n        for (const outputExt of plugin.resolve.output) {\n          const ext = outputExt.toLowerCase();\n          if (!outputExts.includes(ext)) {\n            outputExts.push(ext);\n          }\n        }\n      }\n    }\n    outputExts = outputExts.sort((a, b) => b.split('.').length - a.split('.').length);\n\n    return (base: string): string => {\n      const basename = base.toLowerCase();\n      for (const ext of outputExts) {\n        if (basename.endsWith(ext)) return ext;\n      }\n      return path.extname(basename);\n    };\n  }\n\n  const matchOutputExt = getOutputExtensionMatch();\n\n  async function loadUrl(\n    reqUrl: string,\n    opt?: (LoadUrlOptions & {encoding?: undefined}) | undefined,\n  ): Promise<LoadResult<Buffer | string> | undefined>;\n  async function loadUrl(\n    reqUrl: string,\n    opt: LoadUrlOptions & {encoding: BufferEncoding},\n  ): Promise<LoadResult<string> | undefined>;\n  async function loadUrl(\n    reqUrl: string,\n    opt: LoadUrlOptions & {encoding: null},\n  ): Promise<LoadResult<Buffer> | undefined>;\n  async function loadUrl(\n    reqUrl: string,\n    {\n      isSSR: _isSSR,\n      isHMR: _isHMR,\n      isResolve: _isResolve,\n      encoding: _encoding,\n      importMap,\n    }: LoadUrlOptions = {},\n  ): Promise<LoadResult | undefined> {\n    const isSSR = _isSSR ?? false;\n    //   // Default to HMR on, but disable HMR if SSR mode is enabled.\n    const isHMR = _isHMR ?? (!!config.devOptions.hmr && !isSSR);\n    const encoding = _encoding ?? null;\n    const reqUrlHmrParam = reqUrl.includes('?mtime=') && reqUrl.split('?')[1];\n    let reqPath = decodeURI(url.parse(reqUrl).pathname!);\n\n    if (reqPath === getMetaUrlPath('/hmr-client.js', config)) {\n      return {\n        contents: encodeResponse(HMR_CLIENT_CODE, encoding),\n        imports: [],\n        originalFileLoc: null,\n        contentType: 'application/javascript',\n      };\n    }\n    if (reqPath === getMetaUrlPath('/hmr-error-overlay.js', config)) {\n      return {\n        contents: encodeResponse(HMR_OVERLAY_CODE, encoding),\n        imports: [],\n        originalFileLoc: null,\n        contentType: 'application/javascript',\n      };\n    }\n    if (reqPath === getMetaUrlPath('/env.js', config)) {\n      return {\n        contents: encodeResponse(\n          generateEnvModule({\n            mode: config.mode,\n            isSSR,\n            configEnv: config.env,\n          }),\n          encoding,\n        ),\n        imports: [],\n        originalFileLoc: null,\n        contentType: 'application/javascript',\n      };\n    }\n    // * NPM Packages:\n    // NPM packages are served via `/_snowpack/pkg/` URLs. Behavior varies based on package source (local, remote)\n    // but as a general rule all URLs contained within are managed by the package source loader. When this URL\n    // prefix is hit, we load the file through the selected package source loader.\n    if (reqPath.startsWith(PACKAGE_PATH_PREFIX)) {\n      // Backwards-compatable redirect for legacy package URLs: If someone has created an import URL manually\n      // (ex: /_snowpack/pkg/react.js) then we need to redirect and warn to use our new API in the future.\n      if (reqUrl.split('.').length <= 2 && config.packageOptions.source !== 'remote') {\n        if (!warnedDeprecatedPackageImport.has(reqUrl)) {\n          logger.warn(\n            `(${reqUrl}) Deprecated manual package import. Please use snowpack.getUrlForPackage() to create package URLs instead.`,\n          );\n          warnedDeprecatedPackageImport.add(reqUrl);\n        }\n        const redirectUrl = await pkgSource.resolvePackageImport(\n          reqUrl.replace(PACKAGE_PATH_PREFIX, '').replace(/\\.js/, ''),\n        );\n        reqPath = decodeURI(url.parse(redirectUrl).pathname!);\n      }\n      const resourcePath = reqPath.replace(/\\.map$/, '').replace(/\\.proxy\\.js$/, '');\n      const webModuleUrl = resourcePath.substr(PACKAGE_PATH_PREFIX.length);\n      let loadedModule = await pkgSource.load(webModuleUrl, {isSSR});\n      if (!loadedModule) {\n        throw new NotFoundError(reqPath);\n      }\n      if (reqPath.endsWith('.proxy.js')) {\n        return {\n          imports: [],\n          contents: await wrapImportProxy({\n            url: resourcePath,\n            code: loadedModule.contents,\n            hmr: isHMR,\n            config: config,\n          }),\n          originalFileLoc: null,\n          contentType: 'application/javascript',\n        };\n      }\n      return {\n        imports: loadedModule.imports,\n        contents: encodeResponse(loadedModule.contents, encoding),\n        originalFileLoc: null,\n        contentType: mime.lookup(reqPath) || 'application/javascript',\n      };\n    }\n\n    // Most of the time, resourcePath should have \".map\" and \".proxy.js\" extensions stripped to\n    // match the file on disk. However, sometimes the on disk is an actual source map in a static\n    // directory, so we can't strip that info just yet. Try the exact match first, and then strip\n    // it later on if there is no match.\n    let resourcePath = reqPath;\n    let resourceType = matchOutputExt(reqPath);\n    if (IS_DOTFILE_REGEX.test(reqPath)) resourceType = '';\n    let foundFile: FoundFile;\n\n    // * Workspaces & Linked Packages:\n    // The \"local\" package resolver supports npm packages that live in a local directory,\n    // usually a part of your monorepo/workspace. Snowpack treats these files as source files,\n    // with each file served individually and rebuilt instantly when changed. In the future,\n    // these linked packages may be bundled again with a rapid bundler like esbuild.\n    if (config.workspaceRoot && reqPath.startsWith(PACKAGE_LINK_PATH_PREFIX)) {\n      const symlinkResourceUrl = reqPath.substr(PACKAGE_LINK_PATH_PREFIX.length);\n      const symlinkResourceLoc = path.resolve(\n        config.workspaceRoot as string,\n        process.platform === 'win32' ? symlinkResourceUrl.replace(/\\//g, '\\\\') : symlinkResourceUrl,\n      );\n      const symlinkResourceDirectory = path.dirname(symlinkResourceLoc);\n      const fileStat = await fs.stat(symlinkResourceDirectory).catch(() => null);\n      if (!fileStat) {\n        throw new NotFoundError(reqPath, [symlinkResourceDirectory]);\n      }\n      // If this is the first file served out of this linked directory\n      // - add it to our file watcher (to enable HMR)\n      // - add it to our file<>URL mapping for future lookups\n      // - add a promise to our directory<>promise map, which acts as\n      //   a guard to ensure no loadUrls for this directory proceed before\n      //   proccessing of this directory is done\n      // Each directory is scanned shallowly, so nested directories inside\n      // of `symlinkDirectories` are okay.\n      if (!symlinkDirectories.get(symlinkResourceDirectory)) {\n        logger.debug(\n          `Mounting symlink directory: '${symlinkResourceDirectory}' as URL '${path.dirname(\n            reqPath,\n          )}'`,\n        );\n        symlinkDirectories.set(symlinkResourceDirectory, processDirectory());\n        watcher && watcher.add(symlinkResourceDirectory);\n\n        async function processDirectory() {\n          const shallowFiles = (await new fdir()\n            .withFullPaths()\n            .withMaxDepth(0)\n            .crawl(symlinkResourceDirectory)\n            .withPromise()) as string[];\n\n          for (const f of shallowFiles) {\n            if (fileToUrlMapping.value(f)) {\n              logger.warn(\n                `Warning: mounted file is being imported as a package.\\n` +\n                  `Workspace & monorepo packages work automatically and do not need to be mounted.`,\n              );\n            } else {\n              fileToUrlMapping.add(\n                f,\n                getBuiltFileUrls(f, config).map((u) => {\n                  const url = path.posix.join(\n                    config.buildOptions.metaUrlPath,\n                    'link',\n                    slash(path.relative(config.workspaceRoot as string, u)),\n                  );\n                  return url;\n                }),\n              );\n            }\n          }\n        }\n      }\n\n      // guard: ensure directory is properly read and files registered before proceeding\n      await symlinkDirectories.get(symlinkResourceDirectory);\n\n      let attemptedFileLoc = fileToUrlMapping.key(reqPath);\n      if (!attemptedFileLoc) {\n        resourcePath = reqPath.replace(/\\.map$/, '').replace(/\\.proxy\\.js$/, '');\n        resourceType = path.extname(resourcePath);\n      }\n      attemptedFileLoc = fileToUrlMapping.key(resourcePath);\n      if (!attemptedFileLoc) {\n        throw new NotFoundError(reqPath);\n      }\n      const fileLocationExists = await fs.stat(attemptedFileLoc).catch(() => null);\n      if (!fileLocationExists) {\n        throw new NotFoundError(reqPath, [attemptedFileLoc]);\n      }\n      let foundType = path.extname(reqPath);\n      if (!foundType && attemptedFileLoc.endsWith('.html')) foundType = '.html';\n      if (IS_DOTFILE_REGEX.test(reqPath)) foundType = '';\n      foundFile = {\n        loc: attemptedFileLoc,\n        type: foundType,\n        isStatic: false,\n        isResolve: true,\n      };\n    }\n    // * Local Files\n    // If this is not a special URL route, then treat it as a normal file request.\n    // Check our file<>URL mapping for the most relevant match, and continue if found.\n    // Otherwise, return a 404.\n    else {\n      let attemptedFileLoc = fileToUrlMapping.key(resourcePath);\n      if (!attemptedFileLoc) {\n        resourcePath = reqPath.replace(/\\.map$/, '').replace(/\\.proxy\\.js$/, '');\n        if (resourcePath.endsWith('/')) {\n          resourcePath += 'index.html'; // if trailing slash, pretending like /index.html was requested makes the below much easier\n        }\n        resourceType = path.extname(resourcePath);\n      }\n      attemptedFileLoc =\n        fileToUrlMapping.key(resourcePath) ||\n        fileToUrlMapping.key(resourcePath + '.html') ||\n        fileToUrlMapping.key(resourcePath + '/index.html');\n      if (!attemptedFileLoc) {\n        // last attempt: if this is a CSS Module, try and load JSON\n        if (resourcePath.endsWith('.module.css.json')) {\n          const srcLoc = resourcePath.replace(/\\.json$/i, '');\n          return {\n            imports: [],\n            contents: cssModuleJSON(srcLoc),\n            originalFileLoc: srcLoc,\n            contentType: mime.lookup('.json'),\n          };\n        }\n\n        throw new NotFoundError(reqPath);\n      }\n\n      const [, mountEntry] = getMountEntryForFile(attemptedFileLoc, config)!;\n\n      // TODO: This data type structuring/destructuring is neccesary for now,\n      // but we hope to add \"virtual file\" support soon via plugins. This would\n      // be the interface for those response types.\n      let foundType = path.extname(reqPath);\n      if (!foundType && attemptedFileLoc.endsWith('.html')) foundType = '.html';\n      if (IS_DOTFILE_REGEX.test(reqPath)) foundType = '';\n      foundFile = {\n        loc: attemptedFileLoc,\n        type: foundType,\n        isStatic: mountEntry.static,\n        isResolve: mountEntry.resolve,\n      };\n    }\n\n    const {loc: fileLoc, type: responseType} = foundFile;\n\n    // TODO: Once plugins are able to add virtual files + imports, this will no longer be needed.\n    // - isStatic Workaround: HMR plugins need to add scripts to HTML file, even if static.\n    const isStatic = foundFile.isStatic && responseType !== '.html';\n    const isResolve = _isResolve ?? true;\n\n    // 1. Check the hot build cache. If it's already found, then just serve it.\n    const cacheKey = getCacheKey(fileLoc, {isSSR, mode: config.mode});\n    let fileBuilder: FileBuilder | undefined = inMemoryBuildCache.get(cacheKey);\n    if (!fileBuilder) {\n      fileBuilder = new FileBuilder({\n        loc: fileLoc,\n        isDev,\n        isSSR,\n        isHMR,\n        config,\n        hmrEngine,\n      });\n      // note: for Tailwind, CSS needs to avoid caching in dev server (Tailwind needs to handle rebuilding, not Snowpack)\n      const isTailwind =\n        config.devOptions.tailwindConfig && (fileLoc.endsWith('.css') || fileLoc.endsWith('.pcss'));\n      if (!isTailwind) {\n        inMemoryBuildCache.set(cacheKey, fileBuilder);\n      }\n    }\n\n    function handleFinalizeError(err: Error) {\n      logger.error(FILE_BUILD_RESULT_ERROR);\n      hmrEngine &&\n        hmrEngine.broadcastMessage({\n          type: 'error',\n          title: FILE_BUILD_RESULT_ERROR,\n          errorMessage: err.toString(),\n          fileLoc,\n          errorStackTrace: err.stack,\n        });\n    }\n\n    let finalizedResponse: string | Buffer | undefined;\n    let resolvedImports: InstallTarget[] = [];\n    try {\n      if (Object.keys(fileBuilder.buildOutput).length === 0) {\n        await fileBuilder.build(isStatic);\n      }\n      if (resourcePath !== reqPath && reqPath.endsWith('.proxy.js')) {\n        finalizedResponse = await fileBuilder.getProxy(resourcePath, resourceType);\n\n        // CSS Modules only: also generate JSON module mapping (not imported so must be added manually)\n        if (reqPath.endsWith('.module.css.proxy.js') && fileBuilder.buildOutput['.json']) {\n          resolvedImports.push(createInstallTarget(`${resourcePath}.json`));\n        }\n      } else if (resourcePath !== reqPath && reqPath.endsWith('.map')) {\n        finalizedResponse = fileBuilder.getSourceMap(resourcePath);\n      } else {\n        if (foundFile.isResolve) {\n          // TODO: Warn if reqUrlHmrParam was needed here? HMR can't work if URLs aren't resolved.\n          resolvedImports = await fileBuilder.resolveImports(isResolve, reqUrlHmrParam, importMap);\n        }\n        finalizedResponse = fileBuilder.getResult(resourceType);\n      }\n    } catch (err) {\n      handleFinalizeError(err);\n      throw err;\n    }\n\n    if (finalizedResponse) {\n      return {\n        imports: resolvedImports,\n        contents: encodeResponse(finalizedResponse, encoding),\n        originalFileLoc: fileLoc,\n        contentType: mime.lookup(responseType),\n      };\n    }\n  }\n\n  /**\n   * A simple map to optimize the speed of our 304 responses. If an ETag check is\n   * sent in the request, check if it matches the last known etag for tat file.\n   *\n   * Remember: This is just a nice-to-have! If we get this logic wrong, it can mean\n   * stale files in the user's cache. Feel free to clear aggressively, as needed.\n   */\n  const knownETags = new Map<string, string>();\n\n  function matchRouteHandler(\n    reqUrl: string,\n    expectHandler: 'dest',\n  ): RouteConfigObject['dest'] | null;\n  function matchRouteHandler(\n    reqUrl: string,\n    expectHandler: 'upgrade',\n  ): RouteConfigObject['upgrade'] | null;\n  function matchRouteHandler(\n    reqUrl: string,\n    expectHandler: 'dest' | 'upgrade',\n  ): RouteConfigObject['dest'] | RouteConfigObject['upgrade'] | null {\n    if (reqUrl.startsWith(config.buildOptions.metaUrlPath)) {\n      return null;\n    }\n    const reqPath = decodeURI(url.parse(reqUrl).pathname!);\n    const reqExt = matchOutputExt(reqPath);\n    const isRoute = !reqExt || reqExt.toLowerCase() === '.html';\n    for (const route of config.routes) {\n      if (route.match === 'routes' && !isRoute) {\n        continue;\n      }\n      if (!route[expectHandler]) {\n        continue;\n      }\n      if (route._srcRegex.test(reqPath)) {\n        return route[expectHandler];\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Fully handle the response for a given request. This is used internally for\n   * every response that the dev server sends, but it can also be used via the\n   * JS API to handle most boilerplate around request handling.\n   */\n  async function handleRequest(\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    {handleError}: {handleError?: boolean} = {},\n  ) {\n    let reqUrl = req.url!;\n    const matchedRouteHandler = matchRouteHandler(reqUrl, 'dest');\n    // If a route is matched, rewrite the URL or call the route function\n    if (matchedRouteHandler) {\n      if (typeof matchedRouteHandler === 'string') {\n        reqUrl = matchedRouteHandler;\n      } else {\n        return matchedRouteHandler(req, res);\n      }\n    }\n    // Check if we can send back an optimized 304 response\n    const quickETagCheck = req.headers['if-none-match'];\n    const quickETagCheckUrl = reqUrl.replace(/\\/$/, '/index.html');\n    if (quickETagCheck && quickETagCheck === knownETags.get(quickETagCheckUrl)) {\n      logger.debug(`optimized etag! sending 304...`);\n      res.writeHead(304, {'Access-Control-Allow-Origin': '*'});\n      res.end();\n      return;\n    }\n    // Backwards-compatable redirect for legacy package URLs: If someone has created an import URL manually\n    // (ex: /_snowpack/pkg/react.js) then we need to redirect and warn to use our new API in the future.\n    if (\n      reqUrl.startsWith(PACKAGE_PATH_PREFIX) &&\n      reqUrl.split('.').length <= 2 &&\n      config.packageOptions.source !== 'remote'\n    ) {\n      if (!warnedDeprecatedPackageImport.has(reqUrl)) {\n        logger.warn(\n          `(${reqUrl}) Deprecated manual package import. Please use snowpack.getUrlForPackage() to create package URLs instead.`,\n        );\n        warnedDeprecatedPackageImport.add(reqUrl);\n      }\n      const redirectUrl = await pkgSource.resolvePackageImport(\n        reqUrl.replace(PACKAGE_PATH_PREFIX, '').replace(/\\.js/, ''),\n      );\n      res.writeHead(301, {Location: redirectUrl});\n      res.end();\n      return;\n    }\n\n    // Otherwise, load the file and respond if successful.\n    try {\n      const result = await loadUrl(reqUrl, {allowStale: true, encoding: null});\n      if (!result) {\n        throw new NotFoundError(reqUrl);\n      }\n      sendResponseFile(req, res, result);\n      if (result.checkStale) {\n        await result.checkStale();\n      }\n      if (result.contents) {\n        const tag = etag(result.contents, {weak: true});\n        const reqPath = decodeURI(url.parse(reqUrl).pathname!);\n        knownETags.set(reqPath, tag);\n      }\n      return;\n    } catch (err) {\n      // Some consumers may want to handle/ignore errors themselves.\n      if (handleError === false) {\n        throw err;\n      }\n      handleResponseError(req, res, err);\n    }\n  }\n\n  async function handleUpgrade(req: http.IncomingMessage, socket: Socket, head: Buffer) {\n    let reqUrl = req.url!;\n    const matchedRouteHandler = matchRouteHandler(reqUrl, 'upgrade');\n    if (matchedRouteHandler) {\n      matchedRouteHandler(req, socket, head);\n    }\n  }\n\n  type Http2RequestListener = (\n    request: http2.Http2ServerRequest,\n    response: http2.Http2ServerResponse,\n  ) => void;\n  const createServer = (responseHandler: http.RequestListener | Http2RequestListener) => {\n    if (credentials) {\n      return http2.createSecureServer(\n        {...credentials!, allowHTTP1: true},\n        responseHandler as Http2RequestListener,\n      );\n    }\n\n    return http.createServer(responseHandler as http.RequestListener);\n  };\n\n  let server: http.Server | http2.Http2Server | undefined;\n  if (port) {\n    server = createServer(async (req, res) => {\n      // Attach a request logger.\n      res.on('finish', () => {\n        const {method, url} = req;\n        const {statusCode} = res;\n        logger.debug(`[${statusCode}] ${method} ${url}`);\n      });\n      // Otherwise, pass requests directly to Snowpack's request handler.\n      handleRequest(req, res);\n    })\n      .on('upgrade', (req, socket, head) => {\n        handleUpgrade(req, socket, head);\n      })\n      .on('error', (err: Error) => {\n        logger.error(colors.red(`  ✘ Failed to start server at port ${colors.bold(port!)}.`), err);\n        server!.close();\n        process.exit(1);\n      })\n      .listen(port);\n\n    // Announce server has started\n    const remoteIps = Object.values(os.networkInterfaces())\n      .reduce((every: os.NetworkInterfaceInfo[], i) => [...every, ...(i || [])], [])\n      .filter((i) => i.family === 'IPv4' && i.internal === false)\n      .map((i) => i.address);\n    const protocol = config.devOptions.secure ? 'https:' : 'http:';\n\n    // Log the successful server start.\n    const startTimeMs = Math.round(performance.now() - serverStart);\n    logger.info(colors.green(`Server started in ${startTimeMs}ms.`));\n    logger.info(`${colors.green('Local:')} ${`${protocol}//${hostname}:${port}`}`);\n    if (remoteIps.length > 0) {\n      logger.info(`${colors.green('Network:')} ${`${protocol}//${remoteIps[0]}:${port}`}`);\n    }\n  }\n\n  // HMR Engine\n  const {hmrEngine, handleHmrUpdate} = config.devOptions.hmr\n    ? startHmrEngine(inMemoryBuildCache, server, port, config)\n    : {hmrEngine: undefined, handleHmrUpdate: undefined};\n\n  // Allow the user to hook into this callback, if they like (noop by default)\n  let onFileChangeCallbacks: OnFileChangeCallback[] = [];\n  let watcher: FSWatcher | undefined;\n\n  // Watch src files\n  async function onWatchEvent(fileLoc: string) {\n    logger.info(\n      colors.cyan('File changed: ') + path.relative(config.workspaceRoot || config.root, fileLoc),\n    );\n\n    const updatedUrls = getUrlsForFile(fileLoc, config);\n    if (updatedUrls) {\n      handleHmrUpdate && handleHmrUpdate(fileLoc, updatedUrls[0]);\n      knownETags.delete(updatedUrls[0]);\n      knownETags.delete(updatedUrls[0] + '.proxy.js');\n    }\n    inMemoryBuildCache.delete(getCacheKey(fileLoc, {isSSR: true, mode: config.mode}));\n    inMemoryBuildCache.delete(getCacheKey(fileLoc, {isSSR: false, mode: config.mode}));\n    await Promise.all(onFileChangeCallbacks.map((callback) => callback({filePath: fileLoc})));\n\n    for (const plugin of config.plugins) {\n      plugin.onChange && plugin.onChange({filePath: fileLoc});\n    }\n  }\n\n  if (isWatch) {\n    // Start watching the file system.\n    // Defer \"chokidar\" loading to here, to reduce impact on overall startup time\n    const chokidar = await import('chokidar');\n    watcher = chokidar.watch([], {\n      ignored: config.exclude.filter((k) => k !== '**/_*.{sass,scss}'), // Sass partials ignored for builds, but not for dev changes\n      persistent: true,\n      ignoreInitial: true,\n      disableGlobbing: false,\n      useFsEvents: isFsEventsEnabled(),\n    });\n    watcher.on('add', async (fileLoc) => {\n      knownETags.clear();\n      await pkgSource.prepareSingleFile(fileLoc);\n      await onWatchEvent(fileLoc);\n      fileToUrlMapping.add(fileLoc, getUrlsForFile(fileLoc, config)!);\n    });\n    watcher.on('unlink', async (fileLoc) => {\n      knownETags.clear();\n      await onWatchEvent(fileLoc);\n      fileToUrlMapping.delete(fileLoc);\n    });\n    watcher.on('change', async (fileLoc) => {\n      // TODO: If this needs to build a new dependency, report to the browser via HMR event.\n      await pkgSource.prepareSingleFile(fileLoc);\n      await onWatchEvent(fileLoc);\n    });\n    // [hmrDelay] - Let users with noisy startups delay HMR (ex: 11ty, tsc builds)\n    setTimeout(() => {\n      watcher!.add(Object.keys(config.mount));\n      if (config.devOptions.output !== 'dashboard' || !process.stdout.isTTY) {\n        logger.info(colors.cyan('watching for file changes... '));\n      }\n    }, config.devOptions.hmrDelay);\n  }\n\n  // Open the user's browser (ignore if failed)\n  if (server && port && open && open !== 'none') {\n    const protocol = config.devOptions.secure ? 'https:' : 'http:';\n    await openInBrowser(protocol, hostname, port, open, openUrl).catch((err) => {\n      logger.debug(`Browser open error: ${err}`);\n    });\n  }\n\n  const sp: SnowpackDevServer = {\n    port: port || defaultPort,\n    hmrEngine,\n    rawServer: server,\n    loadUrl,\n    handleRequest,\n    sendResponseFile,\n    sendResponseError,\n    getUrlForPackage: (pkgSpec: string) => {\n      return pkgSource.resolvePackageImport(pkgSpec);\n    },\n    getUrlForFile: (fileLoc: string) => {\n      const result = getUrlsForFile(fileLoc, config);\n      return result ? result[0] : null;\n    },\n    onFileChange: (callback) => onFileChangeCallbacks.push(callback),\n    getServerRuntime: (options) => getServerRuntime(sp, config, options),\n    async shutdown() {\n      watcher && (await watcher.close());\n      await runPipelineCleanupStep(config);\n      server && server.close();\n      hmrEngine && (await hmrEngine.stop());\n    },\n    markChanged(fileLoc) {\n      knownETags.clear();\n      onWatchEvent(fileLoc);\n    },\n  };\n  return sp;\n}\n\nexport async function command(commandOptions: CommandOptions) {\n  try {\n    // Set some CLI-focused defaults\n    commandOptions.config.devOptions.output =\n      commandOptions.config.devOptions.output || 'dashboard';\n    commandOptions.config.devOptions.open = commandOptions.config.devOptions.open || 'default';\n    commandOptions.config.devOptions.hmr = commandOptions.config.devOptions.hmr !== false;\n    // Start the server\n    await startServer(commandOptions, {isWatch: true});\n  } catch (err) {\n    logger.error(err.message);\n    logger.debug(err.stack);\n    process.exit(1);\n  }\n  return new Promise(() => {});\n}\n"
  },
  {
    "path": "snowpack/src/commands/init.ts",
    "content": "import {promises as fs, existsSync} from 'fs';\nimport {bold, dim} from 'kleur/colors';\nimport path from 'path';\nimport {logger} from '../logger';\nimport {CommandOptions} from '../types';\nimport {INIT_TEMPLATE_FILE} from '../util';\n\nexport async function command(commandOptions: CommandOptions) {\n  const {config} = commandOptions;\n  logger.info(`Creating new project configuration file... ${dim('(snowpack.config.js)')}`);\n  if (!existsSync(path.join(config.root, 'package.json'))) {\n    logger.error(`Error: create a package.json file in your project root`);\n    process.exit(1);\n  }\n  const destLoc = path.join(config.root, 'snowpack.config.js');\n  if (existsSync(destLoc)) {\n    logger.error(`Error: File already exists, cannot overwrite ${destLoc}`);\n    process.exit(1);\n  }\n  await fs.writeFile(destLoc, INIT_TEMPLATE_FILE);\n  logger.info(`File created! Open ${bold('snowpack.config.js')} to customize your project.`);\n}\n"
  },
  {
    "path": "snowpack/src/commands/paint.ts",
    "content": "import spinners from 'cli-spinners';\nimport detectPort from 'detect-port';\nimport {EventEmitter} from 'events';\nimport * as colors from 'kleur/colors';\nimport readline from 'readline';\nimport util from 'util';\nimport {logger} from '../logger';\nimport {SnowpackConfig} from '../types';\n\nexport const paintEvent = {\n  BUILD_FILE: 'BUILD_FILE',\n  LOAD_ERROR: 'LOAD_ERROR',\n  SERVER_START: 'SERVER_START',\n  WORKER_COMPLETE: 'WORKER_COMPLETE',\n  WORKER_MSG: 'WORKER_MSG',\n  WORKER_RESET: 'WORKER_RESET',\n};\n\n/**\n * Get the actual port, based on the `defaultPort`.\n * If the default port was not available, then we'll prompt the user if its okay\n * to use the next available port.\n */\nexport async function getPort(defaultPort: number): Promise<number> {\n  const bestAvailablePort = await detectPort(defaultPort);\n  if (defaultPort !== bestAvailablePort) {\n    let useNextPort: boolean = false;\n    if (process.stdout.isTTY) {\n      const rl = readline.createInterface({input: process.stdin, output: process.stdout});\n      useNextPort = await new Promise((resolve) => {\n        rl.question(\n          colors.yellow(\n            `! Port ${colors.bold(defaultPort)} not available. Run on port ${colors.bold(\n              bestAvailablePort,\n            )} instead? (Y/n) `,\n          ),\n          (answer) => {\n            resolve(!/^no?$/i.test(answer));\n          },\n        );\n      });\n      rl.close();\n    }\n    if (!useNextPort) {\n      logger.error(\n        `✘ Port ${colors.bold(defaultPort)} not available. Use ${colors.bold(\n          '--port',\n        )} to specify a different port.`,\n      );\n      process.exit(1);\n    }\n  }\n  return bestAvailablePort;\n}\n\nexport function startDashboard(bus: EventEmitter, _config: SnowpackConfig) {\n  let spinnerFrame = 0;\n\n  // \"dashboard\": Pipe console methods to the logger, and then start the dashboard.\n  logger.debug(`attaching console.log listeners`);\n  console.log = (...args: [any, ...any[]]) => {\n    logger.info(util.format(...args));\n  };\n  console.warn = (...args: [any, ...any[]]) => {\n    logger.warn(util.format(...args));\n  };\n  console.error = (...args: [any, ...any[]]) => {\n    logger.error(util.format(...args));\n  };\n\n  function paintDashboard() {\n    let dashboardMsg = colors.cyan(\n      `${spinners.dots.frames[spinnerFrame]} watching for file changes...`,\n    );\n    const lines = dashboardMsg.split('\\n').length;\n    return {msg: dashboardMsg, lines};\n  }\n\n  function clearDashboard(num, msg?) {\n    // Clear Info Line\n    while (num > 0) {\n      process.stdout.clearLine(0);\n      process.stdout.cursorTo(0);\n      process.stdout.moveCursor(0, -1);\n      num--;\n    }\n    if (!msg || cleanTimestamp(msg) !== lastMsg) {\n      process.stdout.moveCursor(0, 1);\n    }\n  }\n\n  let lastMsg: string = '\\0';\n  let lastMsgCount = 1;\n  function addTimestamp(msg: string): string {\n    let counter = '';\n    if (cleanTimestamp(msg) === lastMsg) {\n      lastMsgCount++;\n      counter = colors.yellow(` (x${lastMsgCount})`);\n    } else {\n      lastMsgCount = 1;\n    }\n    return msg + counter;\n  }\n\n  function cleanTimestamp(msg: string): string {\n    return msg.replace(/^.*\\]/, '');\n  }\n\n  bus.on(paintEvent.WORKER_MSG, ({id, msg}) => {\n    const cleanedMsg = msg.trim();\n    if (!cleanedMsg) {\n      return;\n    }\n    for (const individualMsg of cleanedMsg.split('\\n')) {\n      logger.info(individualMsg, {name: id});\n    }\n  });\n\n  let currentDashboardHeight = 1;\n\n  function onLog(msg: string) {\n    clearDashboard(currentDashboardHeight, msg);\n    process.stdout.write(addTimestamp(msg));\n    lastMsg = cleanTimestamp(msg);\n    process.stdout.write('\\n');\n    const result = paintDashboard();\n    process.stdout.write(result.msg);\n    currentDashboardHeight = result.lines;\n  }\n  logger.on('debug', onLog);\n  logger.on('info', onLog);\n  logger.on('warn', onLog);\n  logger.on('error', onLog);\n\n  setInterval(() => {\n    spinnerFrame = (spinnerFrame + 1) % spinners.dots.frames.length;\n    clearDashboard(currentDashboardHeight);\n    const result = paintDashboard();\n    process.stdout.write(result.msg);\n    currentDashboardHeight = result.lines;\n  }, 1000);\n\n  logger.debug(`dashboard started`);\n}\n"
  },
  {
    "path": "snowpack/src/commands/prepare.ts",
    "content": "import * as colors from 'kleur/colors';\nimport {logger} from '../logger';\nimport {getPackageSource} from '../sources/util';\nimport {CommandOptions} from '../types';\n\nexport async function command(commandOptions: CommandOptions) {\n  const {config, lockfile} = commandOptions;\n  logger.info(colors.yellow('! preparing your project...'));\n  if (config.packageOptions.source === 'remote') {\n    if (!config.packageOptions.types) {\n      logger.info(\n        colors.green('✔') +\n          ' nothing to prepare. ' +\n          colors.dim(\n            '(if using TypeScript, set `packageOptions.types=true` to fetch package TypeScript types ahead-of-time.)',\n          ),\n      );\n      return;\n    }\n    if (!lockfile) {\n      logger.info(\n        colors.yellow(\n          '! no dependencies found. run \"snowpack add [package]\" to add a dependencies to your project.',\n        ),\n      );\n      return;\n    }\n  }\n  const pkgSource = getPackageSource(config);\n  await pkgSource.prepare();\n  logger.info(colors.green('✔') + ' project ready!');\n}\n"
  },
  {
    "path": "snowpack/src/config.ts",
    "content": "import crypto from 'crypto';\nimport {all as merge} from 'deepmerge';\nimport projectCacheDir from 'find-cache-dir';\nimport {existsSync} from 'fs';\nimport {isPlainObject} from 'is-plain-object';\nimport {validate} from 'jsonschema';\nimport {dim} from 'kleur/colors';\nimport os from 'os';\nimport path from 'path';\nimport {logger} from './logger';\nimport {esbuildPlugin} from './plugins/plugin-esbuild';\nimport {\n  CLIFlags,\n  MountEntry,\n  PackageOptionsLocal,\n  PackageOptionsRemote,\n  PluginLoadResult,\n  RouteConfigObject,\n  SnowpackConfig,\n  SnowpackPlugin,\n  SnowpackUserConfig,\n} from './types';\nimport {\n  addLeadingSlash,\n  addTrailingSlash,\n  NATIVE_REQUIRE,\n  REQUIRE_OR_IMPORT,\n  removeTrailingSlash,\n  isPathImport,\n} from './util';\nimport {GLOBAL_CACHE_DIR} from './sources/util';\nimport type {Awaited} from './util';\n\nconst CONFIG_NAME = 'snowpack';\nconst ALWAYS_EXCLUDE = ['**/_*.{sass,scss}', '**.d.ts'];\nconst DEFAULT_PROJECT_CACHE_DIR =\n  projectCacheDir({name: 'snowpack'}) ||\n  // If `projectCacheDir()` is null, no node_modules directory exists.\n  // Use the current path (hashed) to create a cache entry in the global cache instead.\n  // Because this is specifically for dependencies, this fallback should rarely be used.\n  path.join(GLOBAL_CACHE_DIR, crypto.createHash('md5').update(process.cwd()).digest('hex'));\n\n// default settings\nconst DEFAULT_ROOT = process.cwd();\nconst DEFAULT_CONFIG: SnowpackUserConfig = {\n  root: DEFAULT_ROOT,\n  plugins: [],\n  alias: {},\n  env: {},\n  exclude: [],\n  routes: [],\n  dependencies: {},\n  devOptions: {\n    secure: false,\n    hostname: 'localhost',\n    port: 8080,\n    hmrDelay: 0,\n    hmrPort: undefined,\n    hmrErrorOverlay: true,\n  },\n  buildOptions: {\n    out: 'build',\n    baseUrl: '/',\n    metaUrlPath: '_snowpack',\n    cacheDirPath: DEFAULT_PROJECT_CACHE_DIR,\n    clean: true,\n    sourcemap: false,\n    watch: false,\n    htmlFragments: false,\n    ssr: false,\n    resolveProxyImports: true,\n  },\n  testOptions: {\n    files: ['__tests__/**/*', '**/*.@(spec|test).*'],\n  },\n  packageOptions: {source: 'local'},\n};\n\nexport const DEFAULT_PACKAGES_LOCAL_CONFIG: PackageOptionsLocal = {\n  source: 'local',\n  external: [],\n  packageLookupFields: [],\n  knownEntrypoints: [],\n};\n\nexport const REMOTE_PACKAGE_ORIGIN = 'https://pkg.snowpack.dev';\n\nconst DEFAULT_PACKAGES_REMOTE_CONFIG: PackageOptionsRemote = {\n  source: 'remote',\n  origin: REMOTE_PACKAGE_ORIGIN,\n  external: [],\n  knownEntrypoints: [],\n  cache: '.snowpack',\n  types: false,\n};\n\nconst configSchema = {\n  type: 'object',\n  properties: {\n    mode: {type: 'string', enum: ['test', 'development', 'production']},\n    extends: {type: 'string'},\n    exclude: {type: 'array', items: {type: 'string'}},\n    plugins: {type: 'array'},\n    env: {type: 'object'},\n    alias: {\n      type: 'object',\n      additionalProperties: {type: 'string'},\n    },\n    mount: {\n      type: 'object',\n      additionalProperties: {\n        oneOf: [\n          {type: 'string'},\n          {\n            type: ['object'],\n            properties: {\n              url: {type: 'string'},\n              static: {type: 'boolean'},\n              resolve: {type: 'boolean'},\n              dot: {type: 'boolean'},\n            },\n          },\n        ],\n      },\n    },\n    devOptions: {\n      type: 'object',\n      properties: {\n        secure: {\n          oneOf: [\n            {type: 'boolean'},\n            {\n              type: 'object',\n              properties: {\n                cert: {},\n                key: {},\n              },\n            },\n          ],\n        },\n        port: {type: 'number'},\n        openUrl: {type: 'string'},\n        open: {type: 'string'},\n        output: {type: 'string', enum: ['stream', 'dashboard']},\n        hmr: {type: 'boolean'},\n        hmrDelay: {type: 'number'},\n        hmrPort: {type: 'number'},\n        hmrErrorOverlay: {type: 'boolean'},\n        tailwindConfig: {type: 'string'},\n      },\n    },\n    packageOptions: {\n      type: 'object',\n      properties: {\n        dest: {type: 'string'},\n        external: {type: 'array', items: {type: 'string'}},\n        treeshake: {type: 'boolean'},\n        installTypes: {type: 'boolean'},\n        polyfillNode: {type: 'boolean'},\n        env: {\n          type: 'object',\n          additionalProperties: {\n            oneOf: [\n              {id: 'EnvVarString', type: 'string'},\n              {id: 'EnvVarNumber', type: 'number'},\n              {id: 'EnvVarTrue', type: 'boolean', enum: [true]},\n            ],\n          },\n        },\n        rollup: {\n          type: 'object',\n          properties: {\n            context: {type: 'string'},\n            plugins: {type: 'array', items: {type: 'object'}},\n            dedupe: {\n              type: 'array',\n              items: {type: 'string'},\n            },\n          },\n        },\n      },\n    },\n    buildOptions: {\n      type: ['object'],\n      properties: {\n        out: {type: 'string'},\n        baseUrl: {type: 'string'},\n        cacheDirPath: {type: 'string'},\n        clean: {type: 'boolean'},\n        sourcemap: {\n          oneOf: [{type: 'boolean'}, {type: 'string', enum: ['inline']}],\n        },\n        watch: {type: 'boolean'},\n        ssr: {type: 'boolean'},\n        htmlFragments: {type: 'boolean'},\n        jsxFactory: {type: 'string'},\n        jsxFragment: {type: 'string'},\n        jsxInject: {type: 'string'},\n      },\n    },\n    testOptions: {\n      type: 'object',\n      properties: {\n        files: {type: 'array', items: {type: 'string'}},\n      },\n    },\n    experiments: {\n      type: ['object'],\n      properties: {},\n    },\n    optimize: {\n      type: ['object'],\n      properties: {\n        preload: {type: 'boolean'},\n        bundle: {type: 'boolean'},\n        loader: {type: 'object'},\n        splitting: {type: 'boolean'},\n        treeshake: {type: 'boolean'},\n        manifest: {type: 'boolean'},\n        minify: {type: 'boolean'},\n        target: {type: 'string'},\n      },\n    },\n    proxy: {\n      type: 'object',\n    },\n  },\n};\n\n/**\n * Convert CLI flags to an incomplete Snowpack config representation.\n * We need to be careful about setting properties here if the flag value\n * is undefined, since the deep merge strategy would then overwrite good\n * defaults with 'undefined'.\n */\nexport function expandCliFlags(flags: CLIFlags): SnowpackUserConfig {\n  const result = {\n    packageOptions: {},\n    devOptions: {},\n    buildOptions: {},\n    experiments: {},\n  } as {packageOptions: any; devOptions: any; buildOptions: any; experiments: any; optimize?: any};\n  const {help, version, reload, config, ...relevantFlags} = flags;\n\n  const CLI_ONLY_FLAGS = ['quiet', 'verbose'];\n\n  for (const [flag, val] of Object.entries(relevantFlags)) {\n    if (flag === '_' || flag.includes('-')) {\n      continue;\n    }\n    if (configSchema.properties[flag]) {\n      result[flag] = val;\n      continue;\n    }\n    if (flag === 'source') {\n      result.packageOptions = {source: val};\n      continue;\n    }\n    if (configSchema.properties.experiments.properties[flag]) {\n      result.experiments[flag] = val;\n      continue;\n    }\n    if (configSchema.properties.optimize.properties[flag]) {\n      result.optimize = result.optimize || {};\n      result.optimize[flag] = val;\n      continue;\n    }\n    if (configSchema.properties.packageOptions.properties[flag]) {\n      result.packageOptions[flag] = val;\n      continue;\n    }\n    if (configSchema.properties.devOptions.properties[flag]) {\n      result.devOptions[flag] = val;\n      continue;\n    }\n    if (configSchema.properties.buildOptions.properties[flag]) {\n      result.buildOptions[flag] = val;\n      continue;\n    }\n    if (CLI_ONLY_FLAGS.includes(flag)) {\n      continue;\n    }\n    logger.error(`Unknown CLI flag: \"${flag}\"`);\n    process.exit(1);\n  }\n  if (result.packageOptions.env) {\n    result.packageOptions.env = result.packageOptions.env.reduce((acc, id) => {\n      const index = id.indexOf('=');\n      const [key, val] = index > 0 ? [id.substr(0, index), id.substr(index + 1)] : [id, true];\n      acc[key] = val;\n      return acc;\n    }, {});\n  }\n  return result;\n}\n\n/** load and normalize plugins from config */\nfunction loadPlugins(config: SnowpackConfig): {\n  plugins: SnowpackPlugin[];\n  extensionMap: Record<string, string[]>;\n} {\n  const plugins: SnowpackPlugin[] = [];\n\n  function execPluginFactory(pluginFactory: any, pluginOptions: any = {}): SnowpackPlugin {\n    let plugin: SnowpackPlugin | null = null;\n    plugin = pluginFactory(config, pluginOptions) as SnowpackPlugin;\n    return plugin;\n  }\n\n  function loadPluginFromConfig(\n    pluginLoc: string,\n    options: any,\n    config: SnowpackConfig,\n  ): SnowpackPlugin {\n    if (!path.isAbsolute(pluginLoc)) {\n      throw new Error(\n        `Snowpack Internal Error: plugin ${pluginLoc} should have been resolved to an absolute path.`,\n      );\n    }\n    const pluginRef = NATIVE_REQUIRE(pluginLoc, {paths: [config.root]});\n    let plugin: SnowpackPlugin;\n    try {\n      plugin = typeof pluginRef.default === 'function' ? pluginRef.default : pluginRef;\n      if (typeof plugin !== 'function') logger.error(`plugin ${pluginLoc} must export a function.`);\n      plugin = execPluginFactory(plugin, options) as SnowpackPlugin;\n    } catch (err) {\n      logger.error(err.toString());\n      throw err;\n    }\n\n    if (!plugin.name) {\n      plugin.name = path.relative(process.cwd(), pluginLoc);\n    }\n\n    // Add any internal plugin methods. Placeholders are okay when individual\n    // commands implement these differently.\n    plugin.markChanged = (file) => {\n      logger.debug(`clearCache(${file}) called, but function not yet hooked up.`, {\n        name: plugin.name,\n      });\n    };\n\n    // Finish up.\n    validatePlugin(plugin);\n    return plugin;\n  }\n\n  // 2. config.plugins\n  config.plugins.forEach((ref) => {\n    const pluginName = Array.isArray(ref) ? ref[0] : ref;\n    const pluginOptions = Array.isArray(ref) ? ref[1] : {};\n    const plugin = loadPluginFromConfig(pluginName, pluginOptions, config);\n    logger.debug(`loaded plugin: ${pluginName}`);\n    plugins.push(plugin);\n  });\n\n  // add internal JS handler plugin\n  plugins.push(execPluginFactory(esbuildPlugin, {input: ['.mjs', '.jsx', '.ts', '.tsx']}));\n\n  const extensionMap = plugins.reduce((map, {resolve}) => {\n    if (resolve) {\n      for (const inputExt of resolve.input) {\n        map[inputExt] = resolve.output;\n      }\n    }\n    return map;\n  }, {} as Record<string, string[]>);\n\n  return {\n    plugins,\n    extensionMap,\n  };\n}\n\nfunction normalizeMount(config: SnowpackConfig) {\n  const mountedDirs: Record<string, string | Partial<MountEntry>> = config.mount || {};\n  const normalizedMount: Record<string, MountEntry> = {};\n  for (const [mountDir, rawMountEntry] of Object.entries(mountedDirs)) {\n    const mountEntry: Partial<MountEntry> =\n      typeof rawMountEntry === 'string'\n        ? {url: rawMountEntry, static: false, resolve: true, dot: false}\n        : rawMountEntry;\n    if (!mountEntry.url) {\n      handleConfigError(\n        `mount[${mountDir}]: Object \"${mountEntry.url}\" missing required \"url\" option.`,\n      );\n      return normalizedMount;\n    }\n    if (mountEntry.url[0] !== '/') {\n      handleConfigError(\n        `mount[${mountDir}]: Value \"${mountEntry.url}\" must be a URL path, and start with a \"/\"`,\n      );\n    }\n    normalizedMount[removeTrailingSlash(mountDir)] = {\n      url: mountEntry.url === '/' ? '/' : removeTrailingSlash(mountEntry.url),\n      static: mountEntry.static ?? false,\n      resolve: mountEntry.resolve ?? true,\n      dot: mountEntry.dot ?? false,\n    };\n  }\n  // if no mounted directories, mount the root directory to the base URL\n  if (!Object.keys(normalizedMount).length) {\n    normalizedMount[config.root] = {\n      url: '/',\n      static: false,\n      resolve: true,\n      dot: false,\n    };\n  }\n  return normalizedMount;\n}\n\nfunction normalizeRoutes(routes: RouteConfigObject[]): RouteConfigObject[] {\n  return routes.map(({src, dest, upgrade, match}, i) => {\n    // Normalize\n    if (typeof dest === 'string') {\n      dest = addLeadingSlash(dest);\n    }\n    if (!src.startsWith('^')) {\n      src = '^' + src;\n    }\n    if (!src.endsWith('$')) {\n      src = src + '$';\n    }\n    // Validate\n    try {\n      return {src, dest, upgrade, match: match || 'all', _srcRegex: new RegExp(src)};\n    } catch (err) {\n      throw new Error(`config.routes[${i}].src: invalid regular expression syntax \"${src}\"`);\n    }\n  });\n}\n\n/** resolve --dest relative to cwd, etc. */\nfunction normalizeConfig(_config: SnowpackUserConfig): SnowpackConfig {\n  // TODO: This function is really fighting with TypeScript. Now that we have an accurate\n  // SnowpackUserConfig type, we can have this function construct a fresh config object\n  // from scratch instead of trying to modify the user's config object in-place.\n  let config: SnowpackConfig = _config as any as SnowpackConfig;\n  config.mode = config.mode || (process.env.NODE_ENV as SnowpackConfig['mode']);\n  if (config.packageOptions.source === 'local') {\n    config.packageOptions.rollup = config.packageOptions.rollup || {};\n    config.packageOptions.rollup.plugins = config.packageOptions.rollup.plugins || [];\n  }\n  // normalize config URL/path values\n  config.buildOptions.out = removeTrailingSlash(config.buildOptions.out);\n  config.buildOptions.baseUrl = addTrailingSlash(config.buildOptions.baseUrl);\n  config.buildOptions.metaUrlPath = removeTrailingSlash(\n    addLeadingSlash(config.buildOptions.metaUrlPath),\n  );\n  config.mount = normalizeMount(config);\n  config.routes = normalizeRoutes(config.routes);\n\n  config.exclude = Array.from(\n    new Set([\n      ...ALWAYS_EXCLUDE,\n      // Always ignore the final build directory.\n      `${config.buildOptions.out}/**`,\n      // We want to ignore all node_modules directories.\n      `**/node_modules/**`,\n      // If a node_modules directory is explicity mounted, it should be treated as source.\n      // In that case, we add the mounted directory to \"picomatch.ignore\" elsewhere\n      ...config.exclude,\n    ]),\n  );\n\n  if (config.optimize && JSON.stringify(config.optimize) !== '{}') {\n    config.optimize = {\n      entrypoints: config.optimize.entrypoints ?? 'auto',\n      preload: config.optimize.preload ?? false,\n      bundle: config.optimize.bundle ?? false,\n      loader: config.optimize.loader,\n      sourcemap: config.optimize.sourcemap ?? true,\n      splitting: config.optimize.splitting ?? false,\n      treeshake: config.optimize.treeshake ?? true,\n      manifest: config.optimize.manifest ?? false,\n      target: config.optimize.target ?? 'es2020',\n      minify: config.optimize.minify ?? false,\n    };\n  } else {\n    config.optimize = undefined;\n  }\n\n  // new pipeline\n  const {plugins, extensionMap} = loadPlugins(config);\n  config.plugins = plugins;\n  config._extensionMap = extensionMap;\n\n  // If any plugins defined knownEntrypoints, add them here\n  for (const {knownEntrypoints} of config.plugins) {\n    if (knownEntrypoints) {\n      config.packageOptions.knownEntrypoints =\n        config.packageOptions.knownEntrypoints.concat(knownEntrypoints);\n    }\n  }\n\n  plugins.forEach((plugin) => {\n    if (plugin.config) {\n      plugin.config(config);\n    }\n  });\n\n  return config;\n}\n\nfunction handleConfigError(msg: string) {\n  logger.error(msg);\n  throw new Error(msg);\n}\n\nfunction handleValidationErrors(filepath: string, err: ConfigValidationError) {\n  const msg = `! ${filepath}\\n${err.message}`;\n  logger.error(msg);\n  logger.info(dim(`See https://www.snowpack.dev for more info.`));\n  throw new Error(msg);\n}\n\nfunction handleDeprecatedConfigError(mainMsg: string, ...msgs: string[]) {\n  const msg = `${mainMsg}\\n${msgs.join('\\n')}See https://www.snowpack.dev for more info.`;\n  logger.error(msg);\n  throw new Error(msg);\n}\n\nfunction valdiateDeprecatedConfig(rawConfig: any) {\n  if (rawConfig.scripts) {\n    handleDeprecatedConfigError(\n      '[v3.0] Legacy \"scripts\" config is deprecated in favor of \"plugins\". Safe to remove if empty.',\n    );\n  }\n  if (rawConfig.proxy) {\n    handleDeprecatedConfigError(\n      '[v3.0] Legacy \"proxy\" config is deprecated in favor of \"routes\". Safe to remove if empty.',\n    );\n  }\n  if (rawConfig.buildOptions?.metaDir) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.buildOptions.metaDir\" is now \"config.buildOptions.metaUrlPath\".',\n    );\n  }\n  if (rawConfig.buildOptions?.webModulesUrl) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.buildOptions.webModulesUrl\" is now always set within the \"config.buildOptions.metaUrlPath\" directory.',\n    );\n  }\n  if (rawConfig.buildOptions?.sourceMaps) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.buildOptions.sourceMaps\" is now \"config.buildOptions.sourcemap\".',\n    );\n  }\n  if (rawConfig.installOptions) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.installOptions\" is now \"config.packageOptions\". Safe to remove if empty.',\n    );\n  }\n  if (rawConfig.packageOptions?.externalPackage) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.installOptions.externalPackage\" is now \"config.packageOptions.external\".',\n    );\n  }\n  if (rawConfig.packageOptions?.treeshake) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.installOptions.treeshake\" is now \"config.optimize.treeshake\".',\n    );\n  }\n  if (rawConfig.install) {\n    handleDeprecatedConfigError(\n      '[v3.0] \"config.install\" is now \"config.packageOptions.knownEntrypoints\". Safe to remove if empty.',\n    );\n  }\n  if (rawConfig.experiments?.source) {\n    handleDeprecatedConfigError(\n      '[v3.0] Experiment promoted! \"config.experiments.source\" is now \"config.packageOptions.source\".',\n    );\n  }\n  if (rawConfig.packageOptions?.source === 'skypack') {\n    handleDeprecatedConfigError(\n      '[v3.0] Renamed! \"config.experiments.source=skypack\" is now \"config.packageOptions.source=remote\".',\n    );\n  }\n  if (rawConfig.experiments?.ssr) {\n    handleDeprecatedConfigError(\n      '[v3.0] Experiment promoted! \"config.experiments.ssr\" is now \"config.buildOptions.ssr\".',\n    );\n  }\n  if (rawConfig.experiments?.optimize) {\n    handleDeprecatedConfigError(\n      '[v3.0] Experiment promoted! \"config.experiments.optimize\" is now \"config.optimize\".',\n    );\n  }\n  if (rawConfig.experiments?.routes) {\n    handleDeprecatedConfigError(\n      '[v3.0] Experiment promoted! \"config.experiments.routes\" is now \"config.routes\".',\n    );\n  }\n  if (rawConfig.devOptions?.fallback) {\n    handleDeprecatedConfigError(\n      '[v3.0] Deprecated! \"devOptions.fallback\" is now replaced by \"routes\".\\n' +\n        'More info: https://www.snowpack.dev/guides/routing',\n    );\n  }\n}\n\nfunction validatePlugin(plugin: SnowpackPlugin) {\n  const pluginName = plugin.name;\n  if (plugin.resolve && !plugin.load) {\n    handleConfigError(`[${pluginName}] \"resolve\" config found but \"load()\" method missing.`);\n  }\n  if (!plugin.resolve && plugin.load) {\n    handleConfigError(`[${pluginName}] \"load\" method found but \"resolve()\" config missing.`);\n  }\n  if (plugin.resolve && !Array.isArray(plugin.resolve.input)) {\n    handleConfigError(\n      `[${pluginName}] \"resolve.input\" should be an array of input file extensions.`,\n    );\n  }\n  if (plugin.resolve && !Array.isArray(plugin.resolve.output)) {\n    handleConfigError(\n      `[${pluginName}] \"resolve.output\" should be an array of output file extensions.`,\n    );\n  }\n}\n\nexport function validatePluginLoadResult(\n  plugin: SnowpackPlugin,\n  result: PluginLoadResult | string | void | undefined | null,\n) {\n  const pluginName = plugin.name;\n  if (!result) {\n    return;\n  }\n  const isValidSingleResultType = typeof result === 'string' || Buffer.isBuffer(result);\n  if (isValidSingleResultType && plugin.resolve!.output.length !== 1) {\n    handleConfigError(\n      `[plugin=${pluginName}] \"load()\" returned a string, but \"resolve.output\" contains multiple possible outputs. If multiple outputs are expected, the object return format is required.`,\n    );\n  }\n  const unexpectedOutput =\n    typeof result === 'object' &&\n    Object.keys(result).find((fileExt) => !plugin.resolve!.output.includes(fileExt));\n  if (unexpectedOutput) {\n    handleConfigError(\n      `[plugin=${pluginName}] \"load()\" returned entry \"${unexpectedOutput}\" not found in \"resolve.output\": ${\n        plugin.resolve!.output\n      }`,\n    );\n  }\n}\n\n/**\n * Get the config base path, that all relative config values should resolve to. In order:\n *   - The directory of the config file path, if it exists.\n *   - The config.root value, if given.\n *   - Otherwise, the current working directory of the process.\n */\nfunction getConfigBasePath(configFileLoc: string | undefined, configRoot: string | undefined) {\n  return (\n    (configFileLoc && path.dirname(configFileLoc)) ||\n    (configRoot && path.resolve(process.cwd(), configRoot)) ||\n    process.cwd()\n  );\n}\n\nfunction resolveRelativeConfigAlias(\n  aliasConfig: Record<string, string>,\n  configBase: string,\n): SnowpackUserConfig['alias'] {\n  const cleanAliasConfig = {};\n  for (const [target, replacement] of Object.entries(aliasConfig)) {\n    const isDirectory = target.endsWith('/');\n    if (isPathImport(replacement)) {\n      cleanAliasConfig[target] = isDirectory\n        ? addTrailingSlash(path.resolve(configBase, replacement))\n        : removeTrailingSlash(path.resolve(configBase, replacement));\n    } else {\n      cleanAliasConfig[target] = replacement;\n    }\n  }\n  return cleanAliasConfig;\n}\n\nfunction resolveRelativeConfigMount(\n  mountConfig: Record<string, any>,\n  configBase: string,\n): SnowpackUserConfig['mount'] {\n  const cleanMountConfig = {};\n  for (const [target, replacement] of Object.entries(mountConfig)) {\n    cleanMountConfig[path.resolve(configBase, target)] = replacement;\n  }\n  return cleanMountConfig;\n}\n\nfunction resolveRelativeConfig(config: SnowpackUserConfig, configBase: string): SnowpackUserConfig {\n  if (config.root) {\n    config.root = path.resolve(configBase, config.root);\n  }\n  if (config.workspaceRoot) {\n    config.workspaceRoot = path.resolve(configBase, config.workspaceRoot);\n  }\n  if (config.buildOptions?.out) {\n    config.buildOptions.out = path.resolve(configBase, config.buildOptions.out);\n  }\n  if (config.packageOptions?.source === 'remote' && config.packageOptions.cache) {\n    config.packageOptions.cache = path.resolve(configBase, config.packageOptions.cache);\n  }\n  if (config.extends && /^[\\.\\/\\\\]/.test(config.extends)) {\n    config.extends = path.resolve(configBase, config.extends);\n  }\n  if (config.plugins) {\n    config.plugins = config.plugins.map((plugin) => {\n      const name = Array.isArray(plugin) ? plugin[0] : plugin;\n      const absName = path.isAbsolute(name) ? name : require.resolve(name, {paths: [configBase]});\n      if (Array.isArray(plugin)) {\n        plugin.splice(0, 1, absName);\n        return plugin;\n      }\n      return absName;\n    });\n  }\n  if (config.mount) {\n    config.mount = resolveRelativeConfigMount(config.mount, configBase);\n  }\n  if (config.alias) {\n    config.alias = resolveRelativeConfigAlias(config.alias, configBase);\n  }\n  return config;\n}\n\nclass ConfigValidationError extends Error {\n  constructor(errors: (Error | string)[]) {\n    super(`Configuration Error:\\n${errors.map((err) => `  - ${err.toString()}`).join(os.EOL)}`);\n  }\n}\n\nfunction validateConfig(config: SnowpackConfig) {\n  for (const mountDir of Object.keys(config.mount)) {\n    if (!existsSync(mountDir)) {\n      logger.warn(`config.mount[${mountDir}]: mounted directory does not exist.`);\n    }\n  }\n}\n\nexport function createConfiguration(config: SnowpackUserConfig = {}): SnowpackConfig {\n  // Validate the configuration object against our schema. Report any errors.\n  const {errors: validationErrors} = validate(config, configSchema, {\n    propertyName: CONFIG_NAME,\n    allowUnknownAttributes: false,\n  });\n  if (validationErrors.length > 0) {\n    throw new ConfigValidationError(validationErrors);\n  }\n  // Inherit any undefined values from the default configuration. If no config argument\n  // was passed (or no configuration file found in loadConfiguration) then this function\n  // will effectively return a copy of the DEFAULT_CONFIG object.\n  const mergedConfig = merge<SnowpackUserConfig>(\n    [\n      DEFAULT_CONFIG,\n      {\n        packageOptions:\n          config.packageOptions?.source === 'remote'\n            ? DEFAULT_PACKAGES_REMOTE_CONFIG\n            : DEFAULT_PACKAGES_LOCAL_CONFIG,\n      },\n      config,\n    ],\n    {\n      isMergeableObject: (val) => isPlainObject(val) || Array.isArray(val),\n    },\n  );\n  // Resolve relative config values. If using loadConfiguration, all config values should\n  // already be resolved relative to the config file path so that this should be a no-op.\n  // But, we still need to run it in case you called this function directly.\n  const configBase = getConfigBasePath(undefined, config.root);\n  resolveRelativeConfig(mergedConfig, configBase);\n  const normalizedConfig = normalizeConfig(mergedConfig);\n  validateConfig(normalizedConfig);\n  return normalizedConfig;\n}\n\nasync function loadConfigurationFile(\n  filename: string,\n  overrides: SnowpackUserConfig = {},\n): Promise<{filepath: string | undefined; config: SnowpackUserConfig} | null> {\n  const loc = path.resolve(overrides.root || process.cwd(), filename);\n  if (!existsSync(loc)) return null;\n  const config = await REQUIRE_OR_IMPORT(loc);\n  return {filepath: loc, config};\n}\n\nexport async function loadConfiguration(\n  overrides: SnowpackUserConfig = {},\n  configPath?: string,\n): Promise<SnowpackConfig> {\n  let result: Awaited<ReturnType<typeof loadConfigurationFile>> = null;\n  // if user specified --config path, load that\n  if (configPath) {\n    result = await loadConfigurationFile(configPath, overrides);\n    if (!result) {\n      throw new Error(`Snowpack config file could not be found: ${configPath}`);\n    }\n  }\n\n  const configs = [\n    'snowpack.config.mjs',\n    'snowpack.config.cjs',\n    'snowpack.config.js',\n    'snowpack.config.json',\n  ];\n\n  // If no config was found above, search for one.\n  if (!result) {\n    for (const potentialConfigurationFile of configs) {\n      if (result) break;\n      result = await loadConfigurationFile(potentialConfigurationFile, overrides);\n    }\n  }\n\n  // Support package.json \"snowpack\" config\n  if (!result) {\n    const potentialPackageJsonConfig = await loadConfigurationFile('package.json', overrides);\n    if (potentialPackageJsonConfig && (potentialPackageJsonConfig.config as any).snowpack) {\n      result = {\n        filepath: potentialPackageJsonConfig.filepath,\n        config: (potentialPackageJsonConfig.config as any).snowpack,\n      };\n    }\n  }\n\n  if (!result) {\n    logger.warn('Hint: run \"snowpack init\" to create a project config file. Using defaults...');\n    result = {filepath: undefined, config: {}};\n  }\n\n  const {config, filepath} = result;\n  const configBase = getConfigBasePath(filepath, config.root);\n  valdiateDeprecatedConfig(config);\n  valdiateDeprecatedConfig(overrides);\n  resolveRelativeConfig(config, configBase);\n\n  let extendConfig: SnowpackUserConfig = {} as SnowpackUserConfig;\n  if (config.extends) {\n    const extendConfigLoc = require.resolve(config.extends, {paths: [configBase]});\n    const extendResult = await loadConfigurationFile(extendConfigLoc, {});\n    if (!extendResult) {\n      handleConfigError(`Could not locate \"extends\" config at ${extendConfigLoc}`);\n      process.exit(1);\n    }\n    extendConfig = extendResult.config;\n    const extendValidation = validate(extendConfig, configSchema, {\n      allowUnknownAttributes: false,\n      propertyName: CONFIG_NAME,\n    });\n    if (extendValidation.errors && extendValidation.errors.length > 0) {\n      handleValidationErrors(extendConfigLoc, new ConfigValidationError(extendValidation.errors));\n    }\n    valdiateDeprecatedConfig(extendConfig);\n    resolveRelativeConfig(extendConfig, configBase);\n  }\n\n  // if valid, apply config over defaults\n  const mergedConfig = merge<SnowpackUserConfig>([extendConfig, config, overrides], {\n    isMergeableObject: (val) => isPlainObject(val) || Array.isArray(val),\n  });\n\n  try {\n    return createConfiguration(mergedConfig);\n  } catch (err) {\n    if (err instanceof ConfigValidationError) {\n      handleValidationErrors(filepath!, err);\n    }\n    throw err;\n  }\n}\n"
  },
  {
    "path": "snowpack/src/dev/hmr.ts",
    "content": "import type http from 'http';\nimport type http2 from 'http2';\nimport path from 'path';\nimport onProcessExit from 'signal-exit';\nimport {FileBuilder} from '../build/file-builder';\nimport {EsmHmrEngine} from '../hmr-server-engine';\nimport {SnowpackConfig} from '../types';\nimport {getCacheKey, hasExtension} from '../util';\n\nexport function startHmrEngine(\n  inMemoryBuildCache: Map<string, FileBuilder>,\n  server: http.Server | http2.Http2Server | undefined,\n  serverPort: number | undefined,\n  config: SnowpackConfig,\n) {\n  const {hmrDelay} = config.devOptions;\n  const hmrPort = config.devOptions.hmrPort || serverPort;\n  const hmrEngine = new EsmHmrEngine({server, port: hmrPort, delay: hmrDelay});\n  onProcessExit(() => {\n    hmrEngine.disconnectAllClients();\n  });\n\n  // Live Reload + File System Watching\n  function updateOrBubble(url: string, visited: Set<string>) {\n    if (visited.has(url)) {\n      return;\n    }\n    const node = hmrEngine.getEntry(url);\n    const isBubbled = visited.size > 0;\n    if (node && node.isHmrEnabled) {\n      hmrEngine.broadcastMessage({type: 'update', url, bubbled: isBubbled});\n    }\n    visited.add(url);\n    if (node && node.isHmrAccepted) {\n      // Found a boundary, no bubbling needed\n    } else if (node && node.dependents.size > 0) {\n      node.dependents.forEach((dep) => {\n        hmrEngine.markEntryForReplacement(node, true);\n        updateOrBubble(dep, visited);\n      });\n    } else {\n      // We've reached the top, trigger a full page refresh\n      hmrEngine.broadcastMessage({type: 'reload'});\n    }\n  }\n\n  function handleHmrUpdate(fileLoc: string, originalUrl: string) {\n    // CSS files may be loaded directly in the client (not via JS import / .proxy.js)\n    // so send an \"update\" event to live update if thats the case.\n    if (hasExtension(originalUrl, '.css') && !hasExtension(originalUrl, '.module.css')) {\n      hmrEngine.broadcastMessage({type: 'update', url: originalUrl, bubbled: false});\n    }\n\n    // Append \".proxy.js\" to Non-JS files to match their registered URL in the\n    // client app.\n    let updatedUrl = originalUrl;\n    if (!hasExtension(updatedUrl, '.js')) {\n      updatedUrl += '.proxy.js';\n    }\n\n    // Check if a virtual file exists in the resource cache (ex: CSS from a\n    // Svelte file) If it does, mark it for HMR replacement but DONT trigger a\n    // separate HMR update event. This is because a virtual resource doesn't\n    // actually exist on disk, so we need the main resource (the JS) to load\n    // first. Only after that happens will the CSS exist.\n    const virtualCssFileUrl = updatedUrl.replace(/.js$/, '.css');\n    const virtualNode =\n      virtualCssFileUrl.includes(path.basename(fileLoc)) &&\n      hmrEngine.getEntry(`${virtualCssFileUrl}.proxy.js`);\n    if (virtualNode) {\n      hmrEngine.markEntryForReplacement(virtualNode, true);\n    }\n\n    // If the changed file exists on the page, trigger a new HMR update.\n    if (hmrEngine.getEntry(updatedUrl)) {\n      updateOrBubble(updatedUrl, new Set());\n      return;\n    }\n\n    // Otherwise, reload the page if the file exists in our hot cache (which\n    // means that the file likely exists on the current page, but is not\n    // supported by HMR (HTML, image, etc)).\n    if (inMemoryBuildCache.has(getCacheKey(fileLoc, {isSSR: false, mode: config.mode}))) {\n      hmrEngine.broadcastMessage({type: 'reload'});\n      return;\n    }\n  }\n\n  return {hmrEngine, handleHmrUpdate};\n}\n"
  },
  {
    "path": "snowpack/src/hmr-server-engine.ts",
    "content": "import WebSocket from 'ws';\nimport stripAnsi from 'strip-ansi';\nimport type http from 'http';\nimport type http2 from 'http2';\nimport {logger} from './logger';\n\ninterface Dependency {\n  dependents: Set<string>;\n  dependencies: Set<string>;\n  isHmrEnabled: boolean;\n  isHmrAccepted: boolean;\n  needsReplacement: boolean;\n  needsReplacementCount: number;\n}\n\ntype HMRMessage =\n  | {type: 'reload'}\n  | {type: 'update'; url: string; bubbled: boolean}\n  | {\n      type: 'error';\n      title: string;\n      errorMessage: string;\n      fileLoc?: string;\n      errorStackTrace?: string;\n    };\n\nconst DEFAULT_CONNECT_DELAY = 2000;\nconst DEFAULT_PORT = 12321;\n\ninterface EsmHmrEngineOptions {\n  server: http.Server | http2.Http2Server | undefined;\n  port?: number | undefined;\n  delay?: number;\n}\nexport class EsmHmrEngine {\n  clients: Set<WebSocket> = new Set();\n  dependencyTree = new Map<string, Dependency>();\n\n  private delay: number = 0;\n  private currentBatch: HMRMessage[] = [];\n  private currentBatchTimeout: NodeJS.Timer | null = null;\n  private cachedConnectErrors: Set<HMRMessage> = new Set();\n  readonly port: number = 0;\n  private wss: WebSocket.Server;\n\n  constructor(options: EsmHmrEngineOptions) {\n    this.port = options.port || DEFAULT_PORT;\n    const wss = (this.wss = options.server\n      ? new WebSocket.Server({noServer: true})\n      : new WebSocket.Server({port: this.port}));\n    if (options.delay) {\n      this.delay = options.delay;\n    }\n\n    if (options.server) {\n      options.server.on('upgrade', (req, socket, head) => {\n        // Only handle upgrades to ESM-HMR requests, ignore others.\n        if (req.headers['sec-websocket-protocol'] !== 'esm-hmr') {\n          return;\n        }\n        wss.handleUpgrade(req, socket, head, (client) => {\n          wss.emit('connection', client, req);\n        });\n      });\n    }\n    wss.on('connection', (client) => {\n      this.connectClient(client);\n      this.registerListener(client);\n      if (this.cachedConnectErrors.size > 0) {\n        this.dispatchMessage(Array.from(this.cachedConnectErrors), client);\n      }\n    });\n    wss.on('close', (client: WebSocket | undefined) => {\n      if (client) {\n        this.disconnectClient(client);\n      }\n    });\n  }\n\n  registerListener(client: WebSocket) {\n    client.on('message', (data) => {\n      try {\n        const message = JSON.parse(data.toString());\n        if (message.type === 'hotAccept') {\n          const entry = this.getEntry(message.id, true) as Dependency;\n          entry.isHmrAccepted = true;\n          entry.isHmrEnabled = true;\n        }\n      } catch (error) {\n        logger.error(error.toString());\n      }\n    });\n  }\n\n  createEntry(sourceUrl: string) {\n    const newEntry: Dependency = {\n      dependencies: new Set(),\n      dependents: new Set(),\n      needsReplacement: false,\n      needsReplacementCount: 0,\n      isHmrEnabled: false,\n      isHmrAccepted: false,\n    };\n    this.dependencyTree.set(sourceUrl, newEntry);\n    return newEntry;\n  }\n\n  getEntry(sourceUrl: string, createIfNotFound = false) {\n    const result = this.dependencyTree.get(sourceUrl);\n    if (result) {\n      return result;\n    }\n    if (createIfNotFound) {\n      return this.createEntry(sourceUrl);\n    }\n    return null;\n  }\n\n  setEntry(sourceUrl: string, imports: string[], isHmrEnabled = false) {\n    const result = this.getEntry(sourceUrl, true)!;\n    const outdatedDependencies = new Set(result.dependencies);\n    result.isHmrEnabled = isHmrEnabled;\n    for (const importUrl of imports) {\n      this.addRelationship(sourceUrl, importUrl);\n      outdatedDependencies.delete(importUrl);\n    }\n    for (const importUrl of outdatedDependencies) {\n      this.removeRelationship(sourceUrl, importUrl);\n    }\n  }\n\n  removeRelationship(sourceUrl: string, importUrl: string) {\n    let importResult = this.getEntry(importUrl);\n    importResult && importResult.dependents.delete(sourceUrl);\n    const sourceResult = this.getEntry(sourceUrl);\n    sourceResult && sourceResult.dependencies.delete(importUrl);\n  }\n\n  addRelationship(sourceUrl: string, importUrl: string) {\n    if (importUrl !== sourceUrl) {\n      let importResult = this.getEntry(importUrl, true)!;\n      importResult.dependents.add(sourceUrl);\n      const sourceResult = this.getEntry(sourceUrl, true)!;\n      sourceResult.dependencies.add(importUrl);\n    }\n  }\n\n  markEntryForReplacement(entry: Dependency, state: boolean) {\n    if (state) {\n      entry.needsReplacementCount++;\n    } else {\n      entry.needsReplacementCount--;\n    }\n    entry.needsReplacement = !!entry.needsReplacementCount;\n  }\n\n  broadcastMessage(data: HMRMessage) {\n    // Special \"error\" event handling\n    if (data.type === 'error') {\n      // Clean: remove any console styling before we send to the browser\n      // NOTE(@fks): If another event ever needs this, okay to generalize.\n      data.title = data.title && stripAnsi(data.title);\n      data.errorMessage = data.errorMessage && stripAnsi(data.errorMessage);\n      data.fileLoc = data.fileLoc && stripAnsi(data.fileLoc);\n      data.errorStackTrace = data.errorStackTrace && stripAnsi(data.errorStackTrace);\n      // Cache: Cache errors in case an HMR client connects after the error (first page load).\n      if (\n        Array.from(this.cachedConnectErrors).every(\n          (f) => JSON.stringify(f) !== JSON.stringify(data),\n        )\n      ) {\n        this.cachedConnectErrors.add(data);\n        setTimeout(() => {\n          this.cachedConnectErrors.delete(data);\n        }, DEFAULT_CONNECT_DELAY);\n      }\n    }\n    if (this.delay > 0) {\n      if (this.currentBatchTimeout) {\n        clearTimeout(this.currentBatchTimeout);\n      }\n      this.currentBatch.push(data);\n      this.currentBatchTimeout = setTimeout(() => this.dispatchBatch(), this.delay || 100);\n    } else {\n      this.dispatchMessage([data]);\n    }\n  }\n\n  dispatchBatch() {\n    if (this.currentBatchTimeout) {\n      clearTimeout(this.currentBatchTimeout);\n    }\n    if (this.currentBatch.length > 0) {\n      this.dispatchMessage(this.currentBatch);\n      this.currentBatch = [];\n    }\n  }\n\n  /**\n   * This is shared logic to dispatch messages to the clients. The public methods\n   * `broadcastMessage` and `dispatchBatch` manage the delay then use this,\n   * internally when it's time to actually send the data.\n   */\n  private dispatchMessage(messageBatch: HMRMessage[], singleClient?: WebSocket) {\n    if (messageBatch.length === 0) {\n      return;\n    }\n    const clientRecipientList = singleClient ? [singleClient] : this.clients;\n    let singleSummaryMessage = messageBatch.find((message) => message.type === 'reload') || null;\n    clientRecipientList.forEach((client) => {\n      if (client.readyState === WebSocket.OPEN) {\n        if (singleSummaryMessage) {\n          client.send(JSON.stringify(singleSummaryMessage));\n        } else {\n          messageBatch.forEach((data) => {\n            client.send(JSON.stringify(data));\n          });\n        }\n      } else {\n        this.disconnectClient(client);\n      }\n    });\n  }\n\n  connectClient(client: WebSocket) {\n    this.clients.add(client);\n  }\n\n  disconnectClient(client: WebSocket) {\n    client.terminate();\n    this.clients.delete(client);\n  }\n\n  disconnectAllClients() {\n    for (const client of this.clients) {\n      this.disconnectClient(client);\n    }\n  }\n\n  stop(): Promise<void> {\n    // This will disconnect clients so no need to do that ourselves.\n    return new Promise((resolve, reject) => {\n      this.wss.close((err) => {\n        if (err) {\n          reject(err);\n        } else {\n          resolve(void 0);\n        }\n      });\n    });\n  }\n}\n"
  },
  {
    "path": "snowpack/src/index.ts",
    "content": "import * as colors from 'kleur/colors';\nimport util from 'util';\nimport yargs from 'yargs-parser';\nimport {addCommand, rmCommand} from './commands/add-rm';\nimport {command as initCommand} from './commands/init';\nimport {command as prepareCommand} from './commands/prepare';\nimport {command as buildCommand} from './commands/build';\nimport {command as devCommand} from './commands/dev';\nimport {clearCache, getPackageSource} from './sources/util';\nimport {logger} from './logger';\nimport {loadConfiguration, expandCliFlags} from './config';\nimport {CLIFlags, CommandOptions, SnowpackConfig} from './types';\nimport {readLockfile} from './util.js';\nimport {getUrlsForFile} from './build/file-urls';\nexport * from './types';\n\n// Stable API\nexport {startServer, NotFoundError} from './commands/dev';\nexport {build} from './commands/build';\nexport {loadConfiguration, createConfiguration} from './config.js';\nexport {readLockfile as loadLockfile} from './util.js';\nexport {clearCache} from './sources/util';\nexport {logger} from './logger';\n\n// Helper API\nexport function getUrlForFile(fileLoc: string, config: SnowpackConfig) {\n  const result = getUrlsForFile(fileLoc, config);\n  return result ? result[0] : result;\n}\nexport function preparePackages({config}: CommandOptions) {\n  const pkgSource = getPackageSource(config);\n  return pkgSource.prepare();\n}\n\n// Deprecated API\nexport function startDevServer() {\n  throw new Error('startDevServer() was been renamed to startServer().');\n}\nexport function buildProject() {\n  throw new Error('buildProject() was been renamed to build().');\n}\nexport function loadAndValidateConfig() {\n  throw new Error(\n    'loadAndValidateConfig() has been deprecated in favor of loadConfiguration() and createConfiguration().',\n  );\n}\n\nfunction printHelp() {\n  logger.info(\n    `\n${colors.bold(`snowpack`)} - A faster build system for the modern web.\n\n  Snowpack is best configured via config file.\n  But, most configuration can also be passed via CLI flags.\n  📖 ${colors.dim('https://www.snowpack.dev/reference/configuration')}\n\n${colors.bold('Commands:')}\n  snowpack init          Create a new project config file.\n  snowpack prepare       Prepare your project for development (optional).\n  snowpack dev           Develop your project locally.\n  snowpack build         Build your project for production.\n  snowpack add [package] Add a package to your project.\n  snowpack rm [package]  Remove a package from your project.\n\n${colors.bold('Flags:')}\n  --config [path]        Set the location of your project config file.\n  --help                 Show this help message.\n  --version              Show the current version.\n  --reload               Clear the local cache (useful for troubleshooting).\n  --cache-dir-path       Specify a custom cache directory.\n  --verbose              Enable verbose log messages.\n  --quiet                Enable minimal log messages.\n    `.trim(),\n  );\n}\n\nexport async function cli(args: string[]) {\n  // parse CLI flags\n  const cliFlags = yargs(args, {\n    array: ['install', 'env', 'exclude', 'external'],\n  }) as CLIFlags;\n\n  if (cliFlags.verbose) {\n    logger.level = 'debug';\n  }\n  if (cliFlags.quiet) {\n    logger.level = 'silent';\n  }\n  if (cliFlags.help) {\n    printHelp();\n    process.exit(0);\n  }\n  if (cliFlags.version) {\n    logger.info(require('../../package.json').version);\n    process.exit(0);\n  }\n  if (cliFlags.reload) {\n    logger.info(colors.yellow('! clearing cache...'));\n    await clearCache();\n  }\n\n  const cmd = cliFlags['_'][2];\n  logger.debug(`run command: ${cmd}`);\n  if (!cmd) {\n    printHelp();\n    process.exit(1);\n  }\n\n  // Set this early -- before config loading -- so that plugins see it.\n  if (cmd === 'build') {\n    process.env.NODE_ENV = process.env.NODE_ENV || 'production';\n  }\n  if (cmd === 'dev') {\n    process.env.NODE_ENV = process.env.NODE_ENV || 'development';\n  }\n\n  const cliConfig = expandCliFlags(cliFlags);\n  const config = await loadConfiguration(cliConfig, cliFlags.config);\n  logger.debug(`config loaded: ${util.format(config)}`);\n  const lockfile = await readLockfile(config.root);\n  logger.debug(`lockfile ${lockfile ? 'loaded.' : 'not loaded'}`);\n  const commandOptions: CommandOptions = {\n    config,\n    lockfile,\n  };\n\n  if (cmd === 'add') {\n    await addCommand(cliFlags['_'][3], commandOptions);\n    return process.exit(0);\n  }\n  if (cmd === 'rm') {\n    await rmCommand(cliFlags['_'][3], commandOptions);\n    return process.exit(0);\n  }\n\n  if (cliFlags['_'].length > 3) {\n    logger.error(`Unexpected multiple commands`);\n    process.exit(1);\n  }\n\n  if (cmd === 'prepare') {\n    await prepareCommand(commandOptions);\n    return process.exit(0);\n  }\n  if (cmd === 'init') {\n    await initCommand(commandOptions);\n    return process.exit(0);\n  }\n  if (cmd === 'build') {\n    await buildCommand(commandOptions);\n    return process.exit(0);\n  }\n  if (cmd === 'dev') {\n    await devCommand(commandOptions);\n    return process.exit(0);\n  }\n\n  logger.error(`Unrecognized command: ${cmd}`);\n  process.exit(1);\n}\n"
  },
  {
    "path": "snowpack/src/lexer-util.ts",
    "content": "export function checkIdent(code: string, pos: number, text: string): boolean {\n  return code.slice(pos, pos + text.length) === text;\n}\n\nexport function isEOL(code: string, pos: number): boolean {\n  return code.charAt(pos) === '\\n' || (code.charAt(pos) === '\\r' && code.charAt(pos + 1) === '\\n');\n}\n\n/*\n * Adopted from https://github.com/guybedford/es-module-lexer\n * Licensed under the\n *\n * MIT License\n * -----------\n *\n * Copyright (C) 2018-2019 Guy Bedford\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport function isBrOrWsOrPunctuatorNotDot(ch: string): boolean {\n  const c = ch.charCodeAt(0);\n  return (c > 8 && c < 14) || c == 32 || c == 160 || (isPunctuator(ch) && ch != '.');\n}\n\nexport function isPunctuator(ch: string): boolean {\n  const c = ch.charCodeAt(0);\n  // 23 possible punctuator endings: !%&()*+,-./:;<=>?[]^{}|~\n  return (\n    ch == '!' ||\n    ch == '%' ||\n    ch == '&' ||\n    (c > 39 && c < 48) ||\n    (c > 57 && c < 64) ||\n    ch == '[' ||\n    ch == ']' ||\n    ch == '^' ||\n    (c > 122 && c < 127)\n  );\n}\n\nexport function keywordStart(source: string, pos: number) {\n  return pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charAt(pos - 1));\n}\n"
  },
  {
    "path": "snowpack/src/logger.ts",
    "content": "import * as colors from 'kleur/colors';\nimport {LoggerLevel, LoggerEvent, LoggerOptions} from './types';\n\nexport interface LogRecord {\n  val: string;\n  count: number;\n}\n\nconst levels: Record<LoggerLevel, number> = {\n  debug: 20,\n  info: 30,\n  warn: 40,\n  error: 50,\n  silent: 90,\n};\n\n/** Custom logger heavily-inspired by https://github.com/pinojs/pino with extra features like log retentian */\nclass SnowpackLogger {\n  /** set the log level (can be changed after init) */\n  public level: LoggerLevel = 'info';\n  /** configure maximum number of logs to keep (default: 500) */\n  public logCount = 500;\n\n  private history: {val: string; count: number}[] = []; // this is immutable; must be accessed with Logger.getHistory()\n  private callbacks: Record<LoggerEvent, (message: string) => void> = {\n    debug: (message: string) => {\n      console.log(message);\n    },\n    info: (message: string) => {\n      console.log(message);\n    },\n    warn: (message: string) => {\n      console.warn(message);\n    },\n    error: (message: string) => {\n      console.error(message);\n    },\n  };\n\n  private log({\n    level,\n    name,\n    message,\n    task,\n  }: {\n    level: LoggerEvent;\n    name: string;\n    message: string;\n    task?: Function;\n  }) {\n    // test if this level is enabled or not\n    if (levels[this.level] > levels[level]) {\n      return; // do nothing\n    }\n\n    // format\n    let text = message;\n    if (level === 'warn') text = colors.yellow(text);\n    if (level === 'error') text = colors.red(text);\n    const time = new Date();\n    const log = `${colors.dim(\n      `[${String(time.getHours() + 1).padStart(2, '0')}:${String(time.getMinutes() + 1).padStart(\n        2,\n        '0',\n      )}:${String(time.getSeconds()).padStart(2, '0')}]`,\n    )} ${colors.dim(`[${name}]`)} ${text}`;\n\n    // add to log history and remove old logs to keep memory low\n    const lastHistoryItem = this.history[this.history.length - 1];\n    if (lastHistoryItem && lastHistoryItem.val === log) {\n      lastHistoryItem.count++;\n    } else {\n      this.history.push({val: log, count: 1});\n    }\n    while (this.history.length > this.logCount) {\n      this.history.shift();\n    }\n\n    // log\n    if (typeof this.callbacks[level] === 'function') {\n      this.callbacks[level](log);\n    } else {\n      throw new Error(`No logging method defined for ${level}`);\n    }\n\n    // logger takes a possibly processor-intensive task, and only\n    // processes it when this log level is enabled\n    task && task(this);\n  }\n\n  /** emit messages only visible when --debug is passed */\n  public debug(message: string, options?: LoggerOptions): void {\n    const name = (options && options.name) || 'snowpack';\n    this.log({level: 'debug', name, message, task: options?.task});\n  }\n\n  /** emit general info */\n  public info(message: string, options?: LoggerOptions): void {\n    const name = (options && options.name) || 'snowpack';\n    this.log({level: 'info', name, message, task: options?.task});\n  }\n\n  /** emit non-fatal warnings */\n  public warn(message: string, options?: LoggerOptions): void {\n    const name = (options && options.name) || 'snowpack';\n    this.log({level: 'warn', name, message, task: options?.task});\n  }\n\n  /** emit critical error messages */\n  public error(message: string, options?: LoggerOptions): void {\n    const name = (options && options.name) || 'snowpack';\n    this.log({level: 'error', name, message, task: options?.task});\n  }\n\n  /** get full logging history */\n  public getHistory(): ReadonlyArray<LogRecord> {\n    return this.history;\n  }\n\n  /** listen for events */\n  public on(event: LoggerEvent, callback: (message: string) => void) {\n    this.callbacks[event] = callback;\n  }\n}\n\n/** export one logger to rest of app */\nexport const logger = new SnowpackLogger();\n"
  },
  {
    "path": "snowpack/src/plugins/plugin-esbuild.ts",
    "content": "import * as esbuild from 'esbuild';\nimport * as colors from 'kleur/colors';\nimport path from 'path';\nimport {promises as fs} from 'fs';\nimport {SnowpackPlugin, SnowpackConfig} from '../types';\nimport {logger} from '../logger';\n\nconst IS_PREACT = /from\\s+['\"]preact['\"]/;\nfunction checkIsPreact(contents: string) {\n  return IS_PREACT.test(contents);\n}\n\ntype Loader = 'js' | 'jsx' | 'ts' | 'tsx';\n\nfunction getLoader(filePath: string): {loader: Loader; isJSX: boolean} {\n  const ext = path.extname(filePath);\n  const loader: Loader = ext === '.mjs' ? 'js' : (ext.substr(1) as Loader);\n  const isJSX = loader.endsWith('x');\n  return {loader, isJSX};\n}\n\nexport function esbuildPlugin(config: SnowpackConfig, {input}: {input: string[]}): SnowpackPlugin {\n  return {\n    name: '@snowpack/plugin-esbuild',\n    resolve: {\n      input,\n      output: ['.js'],\n    },\n    async load({filePath}) {\n      let contents = await fs.readFile(filePath, 'utf8');\n      const {loader, isJSX} = getLoader(filePath);\n      if (isJSX) {\n        const jsxInject = config.buildOptions.jsxInject ? `${config.buildOptions.jsxInject}\\n` : '';\n        contents = jsxInject + contents;\n      }\n      const isPreact = isJSX && checkIsPreact(contents);\n      let jsxFactory = config.buildOptions.jsxFactory ?? (isPreact ? 'h' : undefined);\n      let jsxFragment = config.buildOptions.jsxFragment ?? (isPreact ? 'Fragment' : undefined);\n\n      const {code, map, warnings} = await esbuild.transform(contents, {\n        loader: loader,\n        jsxFactory,\n        jsxFragment,\n        sourcefile: filePath,\n        sourcemap: config.buildOptions.sourcemap && 'inline',\n        charset: 'utf8',\n        sourcesContent: config.mode !== 'production',\n      });\n      for (const warning of warnings) {\n        logger.error(`${colors.bold('!')} ${filePath}\n  ${warning.text}`);\n      }\n      return {\n        '.js': {\n          code: code || '',\n          map,\n        },\n      };\n    },\n    cleanup() {},\n  };\n}\n"
  },
  {
    "path": "snowpack/src/rewrite-imports.ts",
    "content": "import {matchDynamicImportValue} from './scan-imports';\nimport {CSS_REGEX, HTML_JS_REGEX, HTML_STYLE_REGEX} from './util';\n\nconst {parse} = require('es-module-lexer');\n\nconst WEBPACK_MAGIC_COMMENT_REGEX = /\\/\\*[\\s\\S]*?\\*\\//g;\n\ninterface RewriteInstruction {\n  start: number;\n  end: number;\n  rewrite: string;\n}\n\nfunction applyRewrites(source: string, rewrites: RewriteInstruction[]) {\n  let result = ``;\n  let index = 0;\n  rewrites\n    .sort((a, b) => a.start - b.start)\n    .forEach(({start, end, rewrite}) => {\n      result += source.substring(index, start) + rewrite;\n      index = end;\n    });\n  result += source.substring(index);\n  return result;\n}\n\nexport async function scanCodeImportsExports(code: string): Promise<any[]> {\n  const [imports] = await parse(code);\n  return imports.filter((imp: any) => {\n    //imp.d = -2 = import.meta.url = we can skip this for now\n    if (imp.d === -2) {\n      return false;\n    }\n    // imp.d > -1 === dynamic import\n    if (imp.d > -1) {\n      const importStatement = code.substring(imp.s, imp.e);\n      return !!matchDynamicImportValue(importStatement);\n    }\n    return true;\n  });\n}\n\nexport async function transformEsmImports(\n  _code: string,\n  replaceImport: (specifier: string) => string | Promise<string>,\n) {\n  const imports = await scanCodeImportsExports(_code);\n  const collectedRewrites: RewriteInstruction[] = [];\n  await Promise.all(\n    imports.map(async (imp) => {\n      let spec = _code.substring(imp.s, imp.e).replace(/(\\/|\\\\)+$/, '');\n      let webpackMagicCommentMatches;\n      if (imp.d > -1) {\n        // Extracting comments from spec as they are stripped in `matchDynamicImportValue`\n        webpackMagicCommentMatches = spec.match(WEBPACK_MAGIC_COMMENT_REGEX);\n        spec = matchDynamicImportValue(spec) || '';\n      }\n      let rewrittenImport = await replaceImport(spec);\n      if (imp.d > -1) {\n        rewrittenImport = webpackMagicCommentMatches\n          ? `${webpackMagicCommentMatches.join(' ')} ${JSON.stringify(rewrittenImport)}`\n          : JSON.stringify(rewrittenImport);\n      }\n      collectedRewrites.push({rewrite: rewrittenImport, start: imp.s, end: imp.e});\n    }),\n  );\n  const result = applyRewrites(_code, collectedRewrites);\n  return result;\n}\n\nasync function transformHtmlImports(\n  code: string,\n  replaceImport: (specifier: string) => string | Promise<string>,\n) {\n  const collectedRewrites: RewriteInstruction[] = [];\n  let match;\n  const jsImportRegex = new RegExp(HTML_JS_REGEX);\n  while ((match = jsImportRegex.exec(code))) {\n    const [, scriptTag, scriptCode] = match;\n    // Only transform a script element if it contains inlined code / is not empty.\n    if (scriptCode.trim()) {\n      collectedRewrites.push({\n        rewrite: await transformEsmImports(scriptCode, replaceImport),\n        start: match.index + scriptTag.length,\n        end: match.index + scriptTag.length + scriptCode.length,\n      });\n    }\n  }\n  const cssImportRegex = new RegExp(HTML_STYLE_REGEX);\n  while ((match = cssImportRegex.exec(code))) {\n    const [, styleTag, styleCode] = match;\n    // Only transform a script element if it contains inlined code / is not empty.\n    if (styleCode.trim()) {\n      collectedRewrites.push({\n        rewrite: await transformCssImports(styleCode, replaceImport),\n        start: match.index + styleTag.length,\n        end: match.index + styleTag.length + styleCode.length,\n      });\n    }\n  }\n  const rewrittenCode = applyRewrites(code, collectedRewrites);\n  return rewrittenCode;\n}\n\nasync function transformCssImports(\n  code: string,\n  replaceImport: (specifier: string) => string | Promise<string>,\n) {\n  const collectedRewrites: RewriteInstruction[] = [];\n  let match;\n  const importRegex = new RegExp(CSS_REGEX);\n  while ((match = importRegex.exec(code))) {\n    const [fullMatch, spec] = match;\n    // Only transform a script element if it contains inlined code / is not empty.\n    collectedRewrites.push({\n      // CSS doesn't support proxy files, so always point to the original file\n      rewrite: `@import \"${(await replaceImport(spec)).replace('.proxy.js', '')}\";`,\n      start: match.index,\n      end: match.index + fullMatch.length,\n    });\n  }\n  const rewrittenCode = applyRewrites(code, collectedRewrites);\n  return rewrittenCode;\n}\n\nexport async function transformFileImports(\n  {type, contents}: {type: string; contents: string},\n  replaceImport: (specifier: string) => string | Promise<string>,\n) {\n  if (type === '.js') {\n    return transformEsmImports(contents, replaceImport);\n  }\n  if (type === '.html') {\n    return transformHtmlImports(contents, replaceImport);\n  }\n  if (type === '.css') {\n    return transformCssImports(contents, replaceImport);\n  }\n  throw new Error(\n    `Incompatible filetype: cannot scan ${type} files for ESM imports. This is most likely an error within Snowpack.`,\n  );\n}\n\nexport async function transformAddMissingDefaultExport(_code: string) {\n  // We need to add a default export, just so that our re-importer doesn't break\n  const [, allExports] = await parse(_code);\n  if (!allExports.includes('default')) {\n    return _code + '\\n\\nexport default null;';\n  }\n  return _code;\n}\n"
  },
  {
    "path": "snowpack/src/scan-import-glob.ts",
    "content": "import {keywordStart, checkIdent, isEOL} from './lexer-util';\n\nexport interface ImportGlobStatement {\n  start: number;\n  end: number;\n  glob: string;\n  isEager: boolean;\n}\n\nconst enum ScannerState {\n  idle,\n  inImport,\n  maybeImportMeta,\n  onImportMeta,\n  onImportMetaGlob,\n  inSingleQuote,\n  inDoubleQuote,\n  inTemplateLiteral,\n  inCall,\n  inSingleLineComment,\n  inMutliLineComment,\n}\n\n// Specifically NOT using /g here as it is stateful!\nconst IMPORT_META_GLOB_REGEX = /import\\s*\\.\\s*meta\\s*\\.\\s*glob/;\n\nexport function scanImportGlob(code: string) {\n  if (!IMPORT_META_GLOB_REGEX.test(code)) return [];\n\n  let pos = -1;\n  let start = 0;\n  let end = 0;\n  let state = ScannerState.idle;\n\n  let importGlobs: ImportGlobStatement[] = [];\n  let importGlob: ImportGlobStatement | null = null;\n  let glob: string = '';\n\n  while (pos++ < code.length) {\n    const ch = code.charAt(pos);\n\n    if (isInQuote(state)) {\n      switch (ch) {\n        case '\"':\n        case \"'\":\n        case '`': {\n          state = ScannerState.idle;\n          break;\n        }\n        default: {\n          glob += ch;\n        }\n      }\n      continue;\n    }\n\n    if (isInComment(state)) {\n      if (state === ScannerState.inSingleLineComment && isEOL(code, pos)) {\n        state = ScannerState.idle;\n      } else if (state === ScannerState.inMutliLineComment && checkIdent(code, pos, '*/')) {\n        state = ScannerState.idle;\n      } else {\n        continue;\n      }\n    }\n\n    switch (ch) {\n      case '/': {\n        if (isInQuote(state)) continue;\n\n        if (code[pos + 1] === '/') {\n          state = ScannerState.inSingleLineComment;\n        } else if (code[pos + 1] === '*') {\n          state = ScannerState.inMutliLineComment;\n        }\n        break;\n      }\n      case 'i': {\n        if (keywordStart(code, pos) && checkIdent(code, pos, 'import')) {\n          state = ScannerState.inImport;\n          start = pos;\n        }\n        break;\n      }\n      case '.': {\n        if (state === ScannerState.inImport) {\n          state = ScannerState.maybeImportMeta;\n        }\n        break;\n      }\n      case 'm': {\n        if (state === ScannerState.maybeImportMeta && checkIdent(code, pos, 'meta')) {\n          state = ScannerState.onImportMeta;\n        }\n        break;\n      }\n      case 'g': {\n        if (state === ScannerState.onImportMeta && checkIdent(code, pos, 'glob')) {\n          state = ScannerState.onImportMetaGlob;\n          const isEager = checkIdent(code, pos, 'globEager');\n          importGlob = {start, isEager} as any;\n        }\n        break;\n      }\n      case '\"': {\n        state = ScannerState.inDoubleQuote;\n        glob = '';\n        break;\n      }\n      case \"'\": {\n        state = ScannerState.inSingleQuote;\n        glob = '';\n        break;\n      }\n      case '`': {\n        state = ScannerState.inTemplateLiteral;\n        glob = '';\n        break;\n      }\n      case '(': {\n        if (state === ScannerState.onImportMetaGlob) state = ScannerState.inCall;\n        break;\n      }\n      case ')': {\n        state = ScannerState.idle;\n        end = pos + 1;\n        if (importGlob) {\n          Object.assign(importGlob, {glob, end});\n          importGlobs.push(importGlob);\n          importGlob = null;\n          start = 0;\n          end = 0;\n        }\n        break;\n      }\n    }\n  }\n\n  return importGlobs as ImportGlobStatement[];\n}\n\nfunction isInQuote(state: ScannerState): boolean {\n  return (\n    state === ScannerState.inDoubleQuote ||\n    state === ScannerState.inSingleQuote ||\n    state === ScannerState.inTemplateLiteral\n  );\n}\n\nfunction isInComment(state: ScannerState): boolean {\n  return state === ScannerState.inSingleLineComment || state === ScannerState.inMutliLineComment;\n}\n"
  },
  {
    "path": "snowpack/src/scan-imports.ts",
    "content": "import {ImportSpecifier, init as initESModuleLexer, parse} from 'es-module-lexer';\nimport {InstallTarget} from 'esinstall';\nimport glob from 'glob';\nimport picomatch from 'picomatch';\nimport {fdir} from 'fdir';\nimport path from 'path';\nimport slash from 'slash';\nimport stripComments from 'strip-comments';\nimport {logger} from './logger';\nimport {ScannableExt, SnowpackConfig, SnowpackSourceFile} from './types';\nimport {\n  createInstallTarget,\n  CSS_REGEX,\n  findMatchingAliasEntry,\n  getExtension,\n  HTML_JS_REGEX,\n  HTML_STYLE_REGEX,\n  isImportOfPackage,\n  isTruthy,\n  readFile,\n  SVELTE_VUE_REGEX,\n  ASTRO_REGEX,\n  IS_DOTFILE_REGEX,\n} from './util';\n\n// [@\\w] - Match a word-character or @ (valid package name)\n// (?!.*(:\\/\\/)) - Ignore if previous match was a protocol (ex: http://)\nconst BARE_SPECIFIER_REGEX = /^[@\\w](?!.*(:\\/\\/))/;\n\nconst ESM_IMPORT_REGEX =\n  /(?<![^;\\n])[ ]*import(?:[\"'\\s]*([\\w*${}\\n\\r\\t, ]+)\\s*from\\s*)?\\s*[\"'](.*?)[\"']/gm;\nconst ESM_DYNAMIC_IMPORT_REGEX = /(?<!\\.)\\bimport\\((?:['\"].+['\"]|`[^$]+`)\\)/gm;\nconst HAS_NAMED_IMPORTS_REGEX = /^[\\w\\s\\,]*\\{(.*)\\}/s;\nconst STRIP_AS = /\\s+as\\s+.*/; // for `import { foo as bar }`, strips “as bar”\nconst DEFAULT_IMPORT_REGEX = /import\\s+(\\w)+(,\\s\\{[\\w\\s,]*\\})?\\s+from/s;\n\nexport async function getInstallTargets(\n  config: SnowpackConfig,\n  knownEntrypoints: string[],\n  scannedFiles?: SnowpackSourceFile[],\n) {\n  let installTargets: InstallTarget[] = [];\n  if (knownEntrypoints.length > 0) {\n    installTargets.push(...scanDepList(knownEntrypoints, config.root));\n  }\n  // TODO: remove this if block; move logic inside scanImports\n  if (scannedFiles) {\n    installTargets.push(...(await scanImportsFromFiles(scannedFiles, config)));\n  } else {\n    installTargets.push(...(await scanImports(config.mode === 'test', config)));\n  }\n  return installTargets.filter(\n    (dep) =>\n      !config.packageOptions.external.some((packageName) =>\n        isImportOfPackage(dep.specifier, packageName),\n      ),\n  );\n}\n\nconst scannableExts = new Set<ScannableExt>([\n  '.astro',\n  '.cjs',\n  '.css',\n  '.html',\n  '.interface',\n  '.js',\n  '.jsx',\n  '.less',\n  '.mjs',\n  '.sass',\n  '.scss',\n  '.svelte',\n  '.ts',\n  '.tsx',\n  '.vue',\n]);\nfunction isFileScannable(ext: string): boolean {\n  return scannableExts.has(ext as ScannableExt); // note: <ScannableExts> needed to keep Set() correct above, but this fn should test any string (hence \"as\").\n}\n\nexport function matchDynamicImportValue(importStatement: string) {\n  const matched = stripComments(importStatement).match(/^\\s*('([^']+)'|\"([^\"]+)\")\\s*$/m);\n  return matched?.[2] || matched?.[3] || null;\n}\n\nexport function getWebModuleSpecifierFromCode(code: string, imp: ImportSpecifier): string | null {\n  // import.meta: we can ignore\n  if (imp.d === -2) {\n    return null;\n  }\n  // Static imports: easy to parse\n  if (imp.d === -1) {\n    return code.substring(imp.s, imp.e);\n  }\n  // Dynamic imports: a bit trickier to parse. Today, we only support string literals.\n  const importStatement = code.substring(imp.s, imp.e);\n  return matchDynamicImportValue(importStatement);\n}\n\n/**\n * parses an import specifier, looking for a web modules to install. If a web module is not detected,\n * null is returned.\n */\nfunction parseWebModuleSpecifier(specifier: string | null): null | string {\n  if (!specifier) {\n    return null;\n  }\n  // If specifier is a \"bare module specifier\" (ie: package name) just return it directly\n  if (BARE_SPECIFIER_REGEX.test(specifier)) {\n    return specifier;\n  }\n  return null;\n}\n\nfunction parseImportStatement(code: string, imp: ImportSpecifier): null | InstallTarget {\n  const webModuleSpecifier = parseWebModuleSpecifier(getWebModuleSpecifierFromCode(code, imp));\n  if (!webModuleSpecifier) {\n    return null;\n  }\n\n  const importStatement = stripComments(code.substring(imp.ss, imp.se));\n  if (/^import\\s+type/.test(importStatement)) {\n    return null;\n  }\n\n  const isDynamicImport = imp.d > -1;\n  const hasDefaultImport = !isDynamicImport && DEFAULT_IMPORT_REGEX.test(importStatement);\n  const hasNamespaceImport = !isDynamicImport && importStatement.includes('*');\n\n  const namedImports = (importStatement.match(HAS_NAMED_IMPORTS_REGEX)! || [, ''])[1]\n    .split(',') // split `import { a, b, c }` by comma\n    .map((name) => name.replace(STRIP_AS, '').trim()) // remove “ as …” and trim\n    .filter(isTruthy);\n\n  return {\n    specifier: webModuleSpecifier,\n    all: isDynamicImport || (!hasDefaultImport && !hasNamespaceImport && namedImports.length === 0),\n    default: hasDefaultImport,\n    namespace: hasNamespaceImport,\n    named: namedImports,\n  };\n}\n\nfunction cleanCodeForParsing(code: string): string {\n  code = stripComments(code);\n  const allMatches: string[] = [];\n  let match;\n  const importRegex = new RegExp(ESM_IMPORT_REGEX);\n  while ((match = importRegex.exec(code))) {\n    allMatches.push(match);\n  }\n  const dynamicImportRegex = new RegExp(ESM_DYNAMIC_IMPORT_REGEX);\n  while ((match = dynamicImportRegex.exec(code))) {\n    allMatches.push(match);\n  }\n  return allMatches.map(([full]) => full).join('\\n');\n}\n\nfunction parseJsForInstallTargets(contents: string): InstallTarget[] {\n  let imports: ImportSpecifier[] = [];\n  // Attempt #1: Parse the file as JavaScript. JSX and some decorator\n  // syntax will break this.\n  try {\n    imports.push(...parse(contents)[0]);\n  } catch (err) {\n    // Attempt #2: Parse only the import statements themselves.\n    // This lets us guarentee we aren't sending any broken syntax to our parser,\n    // but at the expense of possible false +/- caused by our regex extractor.\n    contents = cleanCodeForParsing(contents);\n    imports.push(...parse(contents)[0]);\n  }\n  return (\n    imports\n      .map((imp) => parseImportStatement(contents, imp))\n      .filter(isTruthy)\n      // Babel macros are not install targets!\n      .filter((target) => !/[./]macro(\\.js)?$/.test(target.specifier))\n  );\n}\n\nfunction parseCssForInstallTargets(code: string): InstallTarget[] {\n  const installTargets: InstallTarget[] = [];\n  let match;\n  const importRegex = new RegExp(CSS_REGEX);\n  while ((match = importRegex.exec(code))) {\n    const [, spec] = match;\n    const webModuleSpecifier = parseWebModuleSpecifier(spec);\n    if (webModuleSpecifier) {\n      installTargets.push(createInstallTarget(webModuleSpecifier));\n    }\n  }\n  return installTargets;\n}\n\nfunction parseFileForInstallTargets({\n  locOnDisk,\n  baseExt,\n  contents,\n  root,\n}: SnowpackSourceFile<string>): InstallTarget[] {\n  const relativeLoc = path.relative(root, locOnDisk);\n\n  try {\n    switch (baseExt as ScannableExt) {\n      case '.css':\n      case '.less':\n      case '.sass':\n      case '.scss': {\n        logger.debug(`Scanning ${relativeLoc} for imports as CSS`);\n        return parseCssForInstallTargets(contents);\n      }\n      case '.html':\n      case '.svelte':\n      case '.interface':\n      case '.vue': {\n        logger.debug(`Scanning ${relativeLoc} for imports as HTML`);\n        return [\n          ...parseCssForInstallTargets(extractCssFromHtml(contents)),\n          ...parseJsForInstallTargets(extractJsFromHtml({contents, baseExt})),\n        ];\n      }\n      case '.astro': {\n        logger.debug(`Scanning ${relativeLoc} for imports as Astro`);\n        return [\n          ...parseCssForInstallTargets(extractCssFromHtml(contents)),\n          ...parseJsForInstallTargets(extractJsFromAstro(contents)),\n        ];\n      }\n      case '.cjs':\n      case '.js':\n      case '.jsx':\n      case '.mjs':\n      case '.ts':\n      case '.tsx': {\n        logger.debug(`Scanning ${relativeLoc} for imports as JS`);\n        return parseJsForInstallTargets(contents);\n      }\n      default: {\n        logger.debug(\n          `Skip scanning ${relativeLoc} for imports (unknown file extension ${baseExt})`,\n        );\n        return [];\n      }\n    }\n  } catch (err) {\n    // Another error! No hope left, just abort.\n    logger.error(`! ${locOnDisk}`);\n    throw err;\n  }\n}\n\n/** Extract only JS within <script type=\"module\"> tags (works for .svelte and .vue files, too) */\nfunction extractJsFromHtml({contents, baseExt}: {contents: string; baseExt: string}): string {\n  // TODO: Replace with matchAll once Node v10 is out of TLS.\n  // const allMatches = [...result.matchAll(new RegExp(HTML_JS_REGEX))];\n  const allMatches: string[][] = [];\n  let match;\n  let regex = new RegExp(HTML_JS_REGEX);\n  if (baseExt === '.svelte' || baseExt === '.interface' || baseExt === '.vue') {\n    regex = new RegExp(SVELTE_VUE_REGEX); // scan <script> tags, not <script type=\"module\">\n  }\n  while ((match = regex.exec(contents))) {\n    allMatches.push(match);\n  }\n\n  return allMatches\n    .map((match) => match[2]) // match[2] is the code inside the <script></script> element\n    .filter((s) => s.trim())\n    .join('\\n');\n}\n\n/** Extract only CSS within <style> tags (works for .svelte and .vue files, too) */\nfunction extractCssFromHtml(contents: string): string {\n  // TODO: Replace with matchAll once Node v10 is out of TLS.\n  // const allMatches = [...result.matchAll(new RegExp(HTML_JS_REGEX))];\n  const allMatches: string[][] = [];\n  let match;\n  let regex = new RegExp(HTML_STYLE_REGEX);\n  while ((match = regex.exec(contents))) {\n    allMatches.push(match);\n  }\n  return allMatches\n    .map((match) => match[2]) // match[2] is the code inside the <style></style> element\n    .filter((s) => s.trim())\n    .join('\\n');\n}\n\nfunction extractJsFromAstro(contents: string): string {\n  const allMatches: string[][] = [];\n  let match;\n  let regex = new RegExp(ASTRO_REGEX);\n  // No while loop because we only care about the top frontmatter\n  if ((match = regex.exec(contents))) {\n    allMatches.push(match);\n  }\n  return allMatches\n    .map((match) => match[1]) // match[1] is the code inside the frontmatter\n    .filter((s) => s.trim())\n    .join('\\n');\n}\n\nexport function scanDepList(depList: string[], cwd: string): InstallTarget[] {\n  return depList\n    .map((whitelistItem) => {\n      if (!glob.hasMagic(whitelistItem)) {\n        return [createInstallTarget(whitelistItem, true)];\n      } else {\n        const nodeModulesLoc = path.join(cwd, 'node_modules');\n        return scanDepList(glob.sync(whitelistItem, {cwd: nodeModulesLoc, nodir: true}), cwd);\n      }\n    })\n    .reduce((flat, item) => flat.concat(item), []);\n}\n\nexport async function scanImports(\n  includeTests: boolean,\n  config: SnowpackConfig,\n): Promise<InstallTarget[]> {\n  await initESModuleLexer;\n\n  const includeFileSets = await Promise.all(\n    Object.entries(config.mount).map(async ([fromDisk, mountEntry]) => {\n      const allMatchedFiles = (await new fdir()\n        .withFullPaths()\n        .crawl(fromDisk)\n        .withPromise()) as string[];\n      if (mountEntry.dot) {\n        return allMatchedFiles;\n      }\n      return allMatchedFiles.filter((f) => !IS_DOTFILE_REGEX.test(slash(f))); // TODO: use a file URL instead\n    }),\n  );\n  const includeFiles = Array.from(new Set(([] as string[]).concat.apply([], includeFileSets)));\n  if (includeFiles.length === 0) {\n    return [];\n  }\n\n  // Scan every matched JS file for web dependency imports\n  const excludeGlobs = includeTests\n    ? config.exclude\n    : [...config.exclude, ...config.testOptions.files];\n  const mountedNodeModules = Object.keys(config.mount).filter((v) => v.includes('node_modules'));\n  const foundExcludeMatch = picomatch(excludeGlobs);\n  const loadedFiles: (SnowpackSourceFile | null)[] = await Promise.all(\n    includeFiles.map(async (filePath: string): Promise<SnowpackSourceFile | null> => {\n      // don’t waste time trying to scan files that aren’t scannable\n      if (!isFileScannable(path.extname(filePath))) {\n        return null;\n      }\n      if (foundExcludeMatch(filePath)) {\n        const isMounted = mountedNodeModules.find((mountKey) => filePath.startsWith(mountKey));\n        if (!isMounted || (isMounted && foundExcludeMatch(filePath.slice(isMounted.length)))) {\n          return null;\n        }\n      }\n      return {\n        baseExt: getExtension(filePath),\n        root: config.root,\n        locOnDisk: filePath,\n        contents: await readFile(filePath),\n      };\n    }),\n  );\n\n  return scanImportsFromFiles(loadedFiles.filter(isTruthy), config);\n}\n\nexport async function scanImportsFromFiles(\n  loadedFiles: SnowpackSourceFile[],\n  config: SnowpackConfig,\n): Promise<InstallTarget[]> {\n  await initESModuleLexer;\n  return loadedFiles\n    .filter((sourceFile) => !Buffer.isBuffer(sourceFile.contents)) // filter out binary files from import scanning\n    .map((sourceFile) => parseFileForInstallTargets(sourceFile as SnowpackSourceFile<string>))\n    .reduce((flat, item) => flat.concat(item), [])\n    .filter((target) => {\n      const aliasEntry = findMatchingAliasEntry(config, target.specifier);\n      return !aliasEntry || aliasEntry.type === 'package';\n    })\n    .sort((impA, impB) => impA.specifier.localeCompare(impB.specifier));\n}\n"
  },
  {
    "path": "snowpack/src/sources/local-install.ts",
    "content": "import {install, InstallOptions as EsinstallOptions, InstallTarget} from 'esinstall';\nimport url from 'url';\nimport util from 'util';\nimport {buildFile} from '../build/build-pipeline';\nimport {logger} from '../logger';\nimport {ImportMap, SnowpackBuiltFile, SnowpackConfig} from '../types';\n\ninterface InstallOptions {\n  config: SnowpackConfig;\n  isDev: boolean;\n  isSSR: boolean;\n  installOptions: EsinstallOptions;\n  installTargets: (InstallTarget | string)[];\n}\n\ninterface InstallResult {\n  importMap: ImportMap;\n  needsSsrBuild: boolean;\n}\n\nexport async function installPackages({\n  config,\n  isDev,\n  isSSR,\n  installOptions,\n  installTargets,\n}: InstallOptions): Promise<InstallResult> {\n  if (installTargets.length === 0) {\n    return {\n      importMap: {imports: {}} as ImportMap,\n      needsSsrBuild: false,\n    };\n  }\n  const loggerName =\n    installTargets.length === 1\n      ? `esinstall:${\n          typeof installTargets[0] === 'string' ? installTargets[0] : installTargets[0].specifier\n        }`\n      : `esinstall`;\n  let needsSsrBuild = false;\n\n  const finalResult = await install(installTargets, {\n    cwd: config.root,\n    alias: config.alias,\n    logger: {\n      debug: (...args: [any, ...any[]]) => logger.debug(util.format(...args), {name: loggerName}),\n      log: (...args: [any, ...any[]]) => logger.info(util.format(...args), {name: loggerName}),\n      warn: (...args: [any, ...any[]]) => logger.warn(util.format(...args), {name: loggerName}),\n      error: (...args: [any, ...any[]]) => logger.error(util.format(...args), {name: loggerName}),\n    },\n    // Important! Lots of options come in through here,\n    // `external` is a very important one to NOT override.\n    ...installOptions,\n    stats: false,\n    rollup: {\n      plugins: [\n        ...(installOptions?.rollup?.plugins ?? []),\n        {\n          name: 'esinstall:snowpack',\n          async load(id: string) {\n            // SSR Packages: Some file types build differently for SSR vs. non-SSR.\n            // This line checks for those file types. Svelte is the only known file\n            // type for now, but you can add to this line if you encounter another.\n            needsSsrBuild = needsSsrBuild || id.endsWith('.svelte');\n            const output = await buildFile(url.pathToFileURL(id), {\n              config,\n              isDev,\n              isSSR,\n              isPackage: true,\n              isHmrEnabled: false,\n            });\n            let jsResponse: SnowpackBuiltFile | undefined;\n            for (const [outputType, outputContents] of Object.entries(output)) {\n              if (outputContents && outputType === '.js') {\n                jsResponse = outputContents;\n              }\n            }\n            if (jsResponse && Buffer.isBuffer(jsResponse.code)) {\n              jsResponse.code = jsResponse.code.toString();\n            }\n            return jsResponse as {code: string; map?: string};\n          },\n        },\n      ],\n    },\n  });\n  logger.debug('Successfully ran esinstall.');\n  return {importMap: finalResult.importMap, needsSsrBuild};\n}\n"
  },
  {
    "path": "snowpack/src/sources/local.ts",
    "content": "import Arborist from '@npmcli/arborist';\nimport {\n  InstallOptions,\n  InstallTarget,\n  resolveDependencyManifest as _resolveDependencyManifest,\n  resolveEntrypoint,\n} from 'esinstall';\nimport findUp from 'find-up';\nimport {existsSync, promises as fs} from 'fs';\nimport * as colors from 'kleur/colors';\nimport mkdirp from 'mkdirp';\nimport pacote from 'pacote';\nimport path from 'path';\nimport rimraf from 'rimraf';\nimport slash from 'slash';\nimport {getBuiltFileUrls} from '../build/file-urls';\nimport {logger} from '../logger';\nimport {scanCodeImportsExports, transformFileImports} from '../rewrite-imports';\nimport {getInstallTargets, getWebModuleSpecifierFromCode} from '../scan-imports';\nimport {ImportMap, PackageOptionsLocal, PackageSource, SnowpackConfig} from '../types';\nimport {\n  createInstallTarget,\n  findMatchingAliasEntry,\n  getExtension,\n  isJavaScript,\n  isPathImport,\n  isRemoteUrl,\n  parsePackageImportSpecifier,\n  readFile,\n} from '../util';\nimport {GLOBAL_CACHE_DIR} from './util';\nimport {installPackages} from './local-install';\n\nconst CURRENT_META_FILE_CONTENTS = `.snowpack cache - Do not edit this directory!\n\nThe \".snowpack\" cache directory is fully managed for you by Snowpack.\nManual changes that you make to the files inside could break things.\n\nCommit this directory to source control to speed up cold starts.\n\nFound an issue? You can always delete the \".snowpack\"\ndirectory and Snowpack will recreate it on next run.\n\n[.meta.version=2]`;\n\nconst NEVER_PEER_PACKAGES: Set<string> = new Set([\n  '@babel/runtime',\n  '@babel/runtime-corejs3',\n  'babel-runtime',\n  'dom-helpers',\n  'es-abstract',\n  'node-fetch',\n  'whatwg-fetch',\n  'tslib',\n  '@ant-design/icons-svg',\n  '@ant-design/icons',\n]);\n\nfunction isPackageCJS(manifest: any): boolean {\n  return (\n    // If a \"module\" entrypoint is defined, we'll use that.\n    !manifest.module &&\n    // If \"type\":\"module\", assume ESM.\n    manifest.type !== 'module' &&\n    // If export map exists, assume ESM exists somewhere within it.\n    !manifest.exports &&\n    // If \"main\" exists and ends in \".mjs\", assume ESM.\n    !manifest.main?.endsWith('.mjs')\n  );\n}\n\nfunction getRootPackageDirectory(loc: string) {\n  const parts = loc.split('node_modules');\n  if (parts.length === 1) {\n    return undefined;\n  }\n  const packageParts = parts.pop()!.split(path.sep).filter(Boolean);\n  const packageRoot = path.join(parts.join('node_modules'), 'node_modules');\n  if (packageParts[0].startsWith('@')) {\n    return path.join(packageRoot, packageParts[0], packageParts[1]);\n  } else {\n    return path.join(packageRoot, packageParts[0]);\n  }\n}\n\n/**\n * Return your source config, in object format. pacote, arborist, and cacahe\n * all support the same set of options here for configuring your npm registry.\n */\nfunction getNpmConnectionOptions(source: string | object): object {\n  if (source === 'local' || source === 'remote-next') {\n    return {};\n  } else if (typeof source === 'string') {\n    return {registry: source};\n  } else {\n    return source;\n  }\n}\n\ntype PackageImportData = {\n  entrypoint: string;\n  loc: string;\n  installDest: string;\n  packageVersion: string;\n  packageName: string;\n};\n\nexport class PackageSourceLocal implements PackageSource {\n  config: SnowpackConfig;\n  arb: Arborist;\n  npmConnectionOptions: object;\n  cacheDirectory: string;\n  packageSourceDirectory: string;\n  memoizedResolve: Record<string, string> = {};\n  memoizedImportMap: Record<string, ImportMap> = {};\n  allPackageImports: Record<string, PackageImportData> = {};\n  allSymlinkImports: Record<string, string> = {};\n  allKnownSpecs = new Set<string>();\n  allKnownProjectSpecs = new Set<string>();\n  hasWorkspaceWarningFired = false;\n\n  constructor(config: SnowpackConfig) {\n    this.config = config;\n    this.npmConnectionOptions = getNpmConnectionOptions(config.packageOptions.source);\n    if (config.packageOptions.source === 'local') {\n      this.cacheDirectory = config.buildOptions.cacheDirPath\n        ? path.resolve(config.buildOptions.cacheDirPath)\n        : GLOBAL_CACHE_DIR;\n      this.packageSourceDirectory = config.root;\n      this.arb = null;\n    } else {\n      this.cacheDirectory = path.join(config.root, '.snowpack');\n      this.packageSourceDirectory = path.join(config.root, '.snowpack', 'source');\n      this.arb = new Arborist({\n        ...this.npmConnectionOptions,\n        path: this.packageSourceDirectory,\n        packageLockOnly: true,\n      });\n    }\n  }\n\n  private async setupCacheDirectory() {\n    const {config, packageSourceDirectory, cacheDirectory} = this;\n    const lockfileLoc = path.join(cacheDirectory, 'lock.json');\n    const manifestLoc = path.join(packageSourceDirectory, 'package.json');\n    const manifestLockLoc = path.join(packageSourceDirectory, 'package-lock.json');\n    await mkdirp(packageSourceDirectory);\n    if (config.dependencies) {\n      await fs.writeFile(\n        path.join(packageSourceDirectory, 'package.json'),\n        JSON.stringify(\n          {\n            '//': 'snowpack-mananged meta file. Do not edit this file!',\n            dependencies: config.dependencies,\n          },\n          null,\n          2,\n        ),\n        'utf8',\n      );\n      if (existsSync(lockfileLoc)) {\n        const lockfile = await fs.readFile(lockfileLoc);\n        await fs.writeFile(manifestLockLoc, lockfile);\n      } else {\n        if (existsSync(manifestLockLoc)) await fs.unlink(manifestLockLoc);\n      }\n    } else {\n      if (existsSync(manifestLoc)) await fs.unlink(manifestLoc);\n      if (existsSync(manifestLockLoc)) await fs.unlink(manifestLockLoc);\n    }\n  }\n\n  private async setupPackageRootDirectory(installTargets: InstallTarget[]) {\n    const {arb, config} = this;\n    const result = await arb.loadVirtual().catch(() => null);\n    const packageNamesNeedInstall = new Set(\n      installTargets\n        .map((spec) => {\n          let [_packageName] = parsePackageImportSpecifier(spec.specifier);\n          // handle aliases\n          const aliasEntry = findMatchingAliasEntry(config, _packageName);\n          if (aliasEntry && aliasEntry.type === 'package') {\n            const {from, to} = aliasEntry;\n            _packageName = _packageName.replace(from, to);\n          }\n          if (!config.dependencies[_packageName]) {\n            return _packageName;\n          }\n          // Needed to make TS happy. Gets filtered out in next step.\n          return '';\n        })\n        .filter(Boolean),\n    );\n\n    const needsInstall = result\n      ? [...packageNamesNeedInstall].every((name) => !result.children.get(name))\n      : true;\n    if (needsInstall) {\n      await arb.buildIdealTree({add: [...packageNamesNeedInstall]});\n      await arb.reify();\n      const savedPackageLockfileLoc = path.join(this.packageSourceDirectory, 'package-lock.json');\n      const savedPackageLockfile = await fs.readFile(savedPackageLockfileLoc);\n      await fs.writeFile(path.join(this.cacheDirectory, 'lock.json'), savedPackageLockfile);\n    }\n  }\n\n  async prepare() {\n    const installDirectoryHashLoc = path.join(this.cacheDirectory, '.meta');\n    const installDirectoryHash = existsSync(installDirectoryHashLoc)\n      ? await fs.readFile(installDirectoryHashLoc, 'utf8')\n      : undefined;\n\n    if (installDirectoryHash === CURRENT_META_FILE_CONTENTS) {\n      logger.debug(`Install directory \".meta\" file is up-to-date. Welcome back!`);\n    } else if (installDirectoryHash) {\n      logger.info(\n        'Snowpack updated! Rebuilding your dependencies for the latest version of Snowpack...',\n      );\n      await this.clearCache();\n    } else {\n      logger.info(\n        `${colors.bold('Welcome to Snowpack!')} Because this is your first time running\\n` +\n          `this project, Snowpack needs to prepare your dependencies. This is a one-time step\\n` +\n          `and the results will be cached for the lifetime of your project. Please wait...`,\n      );\n    }\n\n    const {config} = this;\n    // If we're managing the the packages directory, setup some basic files.\n    if (config.packageOptions.source !== 'local') {\n      await this.setupCacheDirectory();\n    }\n    // Scan your project for imports.\n    const installTargets = await getInstallTargets(config, config.packageOptions.knownEntrypoints);\n    this.allKnownProjectSpecs = new Set(installTargets.map((t) => t.specifier));\n    const allKnownPackageNames = new Set([\n      ...[...this.allKnownProjectSpecs].map((spec) => parsePackageImportSpecifier(spec)[0]),\n      ...Object.keys(config.dependencies),\n    ]);\n    // If we're managing the the packages directory, lookup & resolve the packages.\n    if (config.packageOptions.source !== 'local') {\n      await this.setupPackageRootDirectory(installTargets);\n      await Promise.all(\n        [...allKnownPackageNames].map((packageName) => this.installPackage(packageName)),\n      );\n    }\n    for (const spec of this.allKnownProjectSpecs) {\n      await this.buildPackageImport(spec);\n    }\n    // Save some metdata. Useful for next time.\n    await mkdirp(path.dirname(installDirectoryHashLoc));\n    await fs.writeFile(installDirectoryHashLoc, CURRENT_META_FILE_CONTENTS, 'utf-8');\n    return;\n  }\n\n  async prepareSingleFile(fileLoc: string) {\n    const {config, allKnownProjectSpecs} = this;\n    // get install targets (imports) for a single file.\n    const installTargets = await getInstallTargets(config, config.packageOptions.knownEntrypoints, [\n      {\n        baseExt: getExtension(fileLoc),\n        root: config.root,\n        locOnDisk: fileLoc,\n        contents: await readFile(fileLoc),\n      },\n    ]);\n    // Filter out all known imports, we're only looking for new ones.\n    const newImports = installTargets.filter((t) => !allKnownProjectSpecs.has(t.specifier));\n    // Build all new package imports.\n    for (const spec of newImports) {\n      await this.buildPackageImport(spec.specifier);\n      allKnownProjectSpecs.add(spec.specifier);\n    }\n  }\n\n  async load(id: string, {isSSR}: {isSSR?: boolean} = {}) {\n    const {config, allPackageImports} = this;\n    const packageImport = allPackageImports[id];\n    if (!packageImport) {\n      return;\n    }\n    const {loc, entrypoint, packageName, packageVersion} = packageImport;\n    let {installDest} = packageImport;\n    if (isSSR && existsSync(installDest + '-ssr')) {\n      installDest += '-ssr';\n    }\n    let packageCode = await fs.readFile(loc, 'utf8');\n    const imports: InstallTarget[] = [];\n    const type = path.extname(loc);\n    if (!(type === '.js' || type === '.html' || type === '.css')) {\n      return {contents: packageCode, imports};\n    }\n    const packageImportMap = JSON.parse(\n      await fs.readFile(path.join(installDest, 'import-map.json'), 'utf8'),\n    );\n    const resolveImport = async (spec): Promise<string> => {\n      if (isRemoteUrl(spec)) {\n        return spec;\n      }\n      if (spec.startsWith('/')) {\n        return spec;\n      }\n      // These are a bit tricky: relative paths within packages always point to\n      // relative files within the built package (ex: 'pkg/common/XXX-hash.js`).\n      // We resolve these to a new kind of \"internal\" import URL that's different\n      // from the normal, flattened URL for public imports.\n      if (isPathImport(spec)) {\n        const newLoc = path.resolve(path.dirname(loc), spec);\n        const resolvedSpec = slash(path.relative(installDest, newLoc));\n        const publicImportEntry = Object.entries(packageImportMap.imports).find(\n          ([, v]) => v === './' + resolvedSpec,\n        );\n        // If this matches the destination of a public package import, resolve to it.\n        if (publicImportEntry) {\n          spec = publicImportEntry[0];\n          return await this.resolvePackageImport(spec, {source: entrypoint});\n        }\n        // Otherwise, create a relative import ID for the internal file.\n        const relativeImportId = path.posix.join(`${packageName}.v${packageVersion}`, resolvedSpec);\n        this.allPackageImports[relativeImportId] = {\n          entrypoint: path.join(installDest, 'package.json'),\n          loc: newLoc,\n          installDest,\n          packageVersion,\n          packageName,\n        };\n        return path.posix.join(config.buildOptions.metaUrlPath, 'pkg', relativeImportId);\n      }\n      // Otherwise, resolve this specifier as an external package.\n      return await this.resolvePackageImport(spec, {source: entrypoint});\n    };\n    packageCode = await transformFileImports({type, contents: packageCode}, async (spec) => {\n      let resolvedImportUrl = await resolveImport(spec);\n      const importExtName = path.posix.extname(resolvedImportUrl);\n      const isProxyImport = importExtName && importExtName !== '.js' && importExtName !== '.mjs';\n      if (config.buildOptions.resolveProxyImports && isProxyImport) {\n        resolvedImportUrl = resolvedImportUrl + '.proxy.js';\n      }\n      imports.push(\n        createInstallTarget(\n          path.resolve(\n            path.posix.join(config.buildOptions.metaUrlPath, 'pkg', id),\n            resolvedImportUrl,\n          ),\n        ),\n      );\n      return resolvedImportUrl;\n    });\n    return {contents: packageCode, imports};\n  }\n\n  async modifyBuildInstallOptions(installOptions, installTargets) {\n    const config = this.config;\n    if (config.packageOptions.source === 'remote') {\n      return installOptions;\n    }\n    installOptions.cwd = config.root;\n    installOptions.rollup = config.packageOptions.rollup;\n    installOptions.sourcemap = config.buildOptions.sourcemap;\n    installOptions.polyfillNode = config.packageOptions.polyfillNode;\n    installOptions.packageLookupFields = config.packageOptions.packageLookupFields;\n    installOptions.packageExportLookupFields = config.packageOptions.packageExportLookupFields;\n    if (config.packageOptions.source === 'local') {\n      return installOptions;\n    }\n    installOptions.cwd = this.packageSourceDirectory;\n    await this.setupCacheDirectory();\n    await this.setupPackageRootDirectory(installTargets);\n    const buildArb = new Arborist({\n      ...this.npmConnectionOptions,\n      path: this.packageSourceDirectory,\n    });\n    await buildArb.buildIdealTree();\n    await buildArb.reify();\n    return installOptions;\n  }\n\n  private async resolveArbNode(packageName: string, source: string): Promise<any> {\n    const {config, arb} = this;\n    if (config.packageOptions.source === 'local') {\n      return false;\n    }\n    const lookupStr = path.relative(this.packageSourceDirectory, source);\n    const lookupParts = lookupStr.split(path.sep);\n    let lookupNode = arb.actualTree || arb.virtualTree;\n    let exactLookupNode = lookupNode;\n    // Use the souce file path to travel the dependency tree,\n    // looking for the most specific match for packageName.\n    while (lookupNode && lookupNode.children && lookupParts.length > 0) {\n      const part = lookupParts.shift();\n      if (part !== 'node_modules') {\n        continue;\n      }\n      let lookupPackageName = lookupParts.shift()!;\n      if (lookupPackageName.startsWith('@')) {\n        lookupPackageName += '/' + lookupParts.shift()!;\n      }\n      lookupNode = lookupNode.children.get(lookupPackageName);\n      if (lookupNode && lookupNode.children.has(packageName)) {\n        exactLookupNode = lookupNode;\n      }\n    }\n    // If no nested match was found, exactLookupNode is still the root node.\n    return exactLookupNode.children.get(packageName);\n  }\n\n  private async installPackage(packageName: string, _source?: string): Promise<boolean> {\n    const {config, arb} = this;\n    const source = _source || this.packageSourceDirectory;\n    if (config.packageOptions.source === 'local') {\n      return false;\n    }\n    const arbNode = await this.resolveArbNode(packageName, source);\n    if (!arbNode) {\n      await arb.buildIdealTree({add: [packageName]});\n      await arb.reify();\n      // TODO: log this to the user somehow? Tell them to add the new package to dependencies obj?\n      const savedPackageLockfileLoc = path.join(this.packageSourceDirectory, 'package-lock.json');\n      const savedPackageLockfile = await fs.readFile(savedPackageLockfileLoc, 'utf-8');\n      await fs.writeFile(path.join(this.cacheDirectory, 'lock.json'), savedPackageLockfile);\n      // Retry.\n      return this.installPackage(packageName, source);\n    }\n    if (existsSync(arbNode.path)) {\n      return false;\n    }\n    await pacote.extract(arbNode.resolved, arbNode.path, this.npmConnectionOptions);\n    return true;\n  }\n\n  private async buildPackageImport(spec: string, _source?: string, logLine = false, depth = 0) {\n    const {config, memoizedResolve, memoizedImportMap, allKnownSpecs, allPackageImports} = this;\n    const source = _source || this.packageSourceDirectory;\n    const aliasEntry = findMatchingAliasEntry(config, spec);\n    if (aliasEntry && aliasEntry.type === 'package') {\n      const {from, to} = aliasEntry;\n      spec = spec.replace(from, to);\n    }\n\n    const [_packageName] = parsePackageImportSpecifier(spec);\n\n    // Before doing anything, check for symlinks because symlinks shouldn't be built.\n    try {\n      const entrypoint = resolveEntrypoint(spec, {\n        cwd: source,\n        packageLookupFields: [\n          'snowpack:source',\n          ...((config.packageOptions as PackageOptionsLocal).packageLookupFields || []),\n        ],\n      });\n      const isSymlink = !entrypoint.includes(path.join('node_modules', _packageName));\n      if (isSymlink) {\n        return;\n      }\n    } catch (err) {\n      // that's fine, package just doesn't exist yet. Go download it.\n    }\n\n    // Check to see if this package is marked as external, in which case skip the build.\n    if (this.isExternal(_packageName, spec)) {\n      return;\n    }\n\n    await this.installPackage(_packageName, source);\n    const entrypoint = resolveEntrypoint(spec, {\n      cwd: source,\n      packageLookupFields: [\n        'snowpack:source',\n        ...((config.packageOptions as PackageOptionsLocal).packageLookupFields || []),\n      ],\n    });\n\n    // if this has already been memoized, exit\n    if (memoizedResolve[entrypoint]) return memoizedResolve[entrypoint];\n\n    let rootPackageDirectory = getRootPackageDirectory(entrypoint);\n    if (!rootPackageDirectory) {\n      const rootPackageManifestLoc = await findUp('package.json', {cwd: entrypoint});\n      if (!rootPackageManifestLoc) {\n        throw new Error(`Error resolving import ${spec}: No parent package.json found.`);\n      }\n      rootPackageDirectory = path.dirname(rootPackageManifestLoc);\n    }\n\n    const packageManifestLoc = path.join(rootPackageDirectory, 'package.json');\n    const packageManifestStr = await fs.readFile(packageManifestLoc, 'utf8');\n    const packageManifest = JSON.parse(packageManifestStr);\n    const packageName = packageManifest.name || _packageName;\n    const packageVersion = packageManifest.version || 'unknown';\n    const packageUID = packageName + '@' + packageVersion;\n    const installDest = path.join(this.cacheDirectory, 'build', packageUID);\n    const isKnownSpec = allKnownSpecs.has(`${packageUID}:${spec}`);\n    allKnownSpecs.add(`${packageUID}:${spec}`);\n\n    // NOTE(@fks): This build step used to use a queue system, which allowed multiple\n    // parallel builds at once. Unfortunately, these builds are compute heavy and not well\n    // parallelized, so the queue was removed but the standalone inline function remains.\n    const newImportMap = await (async (): Promise<ImportMap> => {\n      // Look up the import map of the already-installed package.\n      // If spec already exists, then this import map is valid.\n      const lineBullet = colors.dim(depth === 0 ? '+' : '└──'.padStart(depth * 2 + 1, ' '));\n      let packageFormatted = spec + colors.dim('@' + packageVersion);\n      const existingImportMapLoc = path.join(installDest, 'import-map.json');\n      let existingImportMap: ImportMap | undefined = memoizedImportMap[packageName];\n      if (!existingImportMap) {\n        // note: this must happen BEFORE the check on disk to prevent a race condition.\n        // If two lookups occur at once from different sources, then we mark this as “taken” immediately and finish the lookup async\n        memoizedImportMap[packageName] = {imports: {}}; // TODO: this may not exist; should we throw an error?\n        try {\n          const importMapHandle = await fs.open(existingImportMapLoc, 'r+');\n          if (importMapHandle) {\n            const importMapData = await importMapHandle.readFile('utf8');\n            existingImportMap = importMapData ? JSON.parse(importMapData) : null;\n            memoizedImportMap[packageName] = existingImportMap as ImportMap;\n            await importMapHandle.close();\n          }\n        } catch (err) {\n          delete memoizedImportMap[packageName]; // if there was trouble reading this, free up memoization\n        }\n      }\n\n      // Kick off a build, if needed.\n      let importMap = existingImportMap;\n      let needsBuild = !existingImportMap?.imports[spec];\n      if (logLine || (depth === 0 && (!importMap || needsBuild))) {\n        logLine = true;\n        // TODO: We need to confirm version match, not just package import match\n        const isDedupe = depth > 0 && (isKnownSpec || this.allKnownProjectSpecs.has(spec));\n        logger.info(`${lineBullet} ${packageFormatted}${isDedupe ? colors.dim(` (dedupe)`) : ''}`);\n      }\n      if (!importMap || needsBuild) {\n        const installTargets = [...allKnownSpecs]\n          .filter((spec) => spec.startsWith(packageUID))\n          .map((spec) => spec.substr(packageUID.length + 1));\n        // TODO: external should be a function in esinstall\n\n        const filteredExternal = (external: string) =>\n          external !== _packageName && !NEVER_PEER_PACKAGES.has(external);\n\n        const dependenciesAndPeerDependencies = Object.keys(\n          packageManifest.dependencies || {},\n        ).concat(Object.keys(packageManifest.peerDependencies || {}));\n        const devDependencies = Object.keys(packageManifest.devDependencies || {});\n\n        // Packages that should be marked as externalized. Any dependency\n        // or peerDependency that is not one of the packages we want to always bundle\n        const externalPackages = config.packageOptions.external.concat(\n          dependenciesAndPeerDependencies.filter(filteredExternal),\n        );\n\n        // The same as above, but includes devDependencies.\n        const externalPackagesFull = externalPackages.concat(\n          devDependencies.filter(filteredExternal),\n        );\n\n        // To improve our ESM<>CJS conversion, we need to know the status of all dependencies.\n        // This function returns a function, which can be used to fetch package.json manifests.\n        // - When source = \"local\", this happens on the local file system (/w memoization).\n        // - When source = \"remote-next\", this happens via remote manifest fetching (/w pacote caching).\n        const getMemoizedResolveDependencyManifest = async () => {\n          const results = {};\n          if (config.packageOptions.source === 'local') {\n            return (packageName: string) => {\n              results[packageName] =\n                results[packageName] ||\n                _resolveDependencyManifest(packageName, rootPackageDirectory!)[1];\n              return results[packageName];\n            };\n          }\n          await Promise.all(\n            externalPackages.map(async (externalPackage) => {\n              const arbNode = await this.resolveArbNode(externalPackage, rootPackageDirectory!);\n              results[arbNode.name] = await pacote.manifest(`${arbNode.name}@${arbNode.version}`, {\n                ...this.npmConnectionOptions,\n                fullMetadata: true,\n              });\n            }),\n          );\n          return (packageName: string) => {\n            return results[packageName];\n          };\n        };\n        const resolveDependencyManifest = await getMemoizedResolveDependencyManifest();\n        const installOptions: InstallOptions = {\n          dest: installDest,\n          cwd: packageManifestLoc,\n          // This installer is only ever run in development. In production, many packages\n          // are installed together to take advantage of tree-shaking and package bundling.\n          env: {NODE_ENV: this.config.mode},\n          treeshake: false,\n          sourcemap: config.buildOptions.sourcemap,\n          alias: config.alias,\n          external: externalPackagesFull,\n          // ESM<>CJS Compatability: If we can detect that a dependency is common.js vs. ESM, then\n          // we can provide this hint to esinstall to improve our cross-package import support.\n          externalEsm: (imp) => {\n            const [packageName] = parsePackageImportSpecifier(imp);\n            const result = resolveDependencyManifest(packageName);\n            return !result || !isPackageCJS(result);\n          },\n        };\n        if (config.packageOptions.source === 'local') {\n          if (config.packageOptions.polyfillNode !== undefined) {\n            installOptions.polyfillNode = config.packageOptions.polyfillNode;\n          }\n          if (config.packageOptions.packageLookupFields !== undefined) {\n            installOptions.packageLookupFields = config.packageOptions.packageLookupFields;\n          }\n          if (config.packageOptions.namedExports !== undefined) {\n            installOptions.namedExports = config.packageOptions.namedExports;\n          }\n          if (config.packageOptions.rollup !== undefined) {\n            installOptions.rollup = config.packageOptions.rollup;\n          }\n        }\n        const installResult = await installPackages({\n          config,\n          isDev: true,\n          isSSR: false,\n          installTargets,\n          installOptions,\n        });\n        logger.debug(`${lineBullet} ${packageFormatted} DONE`);\n        if (installResult.needsSsrBuild) {\n          logger.info(`${lineBullet} ${packageFormatted} ${colors.dim(`(ssr)`)}`);\n          await installPackages({\n            config,\n            isDev: true,\n            isSSR: true,\n            installTargets,\n            installOptions: {\n              ...installOptions,\n              dest: installDest + '-ssr',\n            },\n          });\n          logger.debug(`${lineBullet} ${packageFormatted} (ssr) DONE`);\n        }\n        importMap = installResult.importMap;\n      }\n      const dependencyFileLoc = path.join(installDest, importMap.imports[spec]);\n      const loadedFile = await fs.readFile(dependencyFileLoc!);\n      if (isJavaScript(dependencyFileLoc)) {\n        const newPackageImports = new Set<string>();\n        const code = loadedFile.toString('utf8');\n        for (const imp of await scanCodeImportsExports(code)) {\n          let spec = getWebModuleSpecifierFromCode(code, imp);\n          if (spec === null) {\n            continue;\n          }\n\n          // remove trailing slash from end of specifier (easier for Node to resolve)\n          spec = spec.replace(/(\\/|\\\\)+$/, '');\n\n          if (isRemoteUrl(spec)) {\n            continue; // ignore remote files\n          }\n          if (isPathImport(spec)) {\n            continue;\n          }\n          const [scannedPackageName] = parsePackageImportSpecifier(spec);\n          if (scannedPackageName && memoizedImportMap[scannedPackageName]) {\n            continue; // if we’ve already installed this, then don’t reinstall\n          }\n          newPackageImports.add(spec);\n        }\n\n        for (const packageImport of newPackageImports) {\n          await this.buildPackageImport(packageImport, entrypoint, logLine, depth + 1);\n        }\n      }\n      return importMap;\n    })();\n\n    const dependencyFileLoc = path.join(installDest, newImportMap.imports[spec]);\n\n    // Flatten the import map value into a resolved, public import ID.\n    // ex: \"./react.js\" -> \"react.v17.0.1.js\"\n    const importId = newImportMap.imports[spec]\n      .replace(/\\//g, '.')\n      .replace(/^\\.+/g, '')\n      .replace(/\\.([^\\.]*?)$/, `.v${packageVersion}.$1`);\n    allPackageImports[importId] = {\n      entrypoint,\n      loc: dependencyFileLoc,\n      installDest,\n      packageName,\n      packageVersion,\n    };\n    // Memoize the result, for faster runtime lookups.\n    memoizedResolve[entrypoint] = importId;\n    return memoizedResolve[entrypoint];\n  }\n\n  async resolvePackageImport(\n    _spec: string,\n    options: {source?: string; importMap?: ImportMap; isRetry?: boolean} = {},\n  ) {\n    const {config, memoizedResolve, allSymlinkImports} = this;\n    const source = options.source || this.packageSourceDirectory;\n    let spec = _spec;\n    const aliasEntry = findMatchingAliasEntry(config, spec);\n    if (aliasEntry && aliasEntry.type === 'package') {\n      const {from, to} = aliasEntry;\n      spec = spec.replace(from, to);\n    }\n\n    const [packageName] = parsePackageImportSpecifier(spec);\n\n    // If this import is marked as external, do not transform the original spec\n    if (this.isExternal(packageName, spec)) {\n      return spec;\n    }\n\n    const entrypoint = resolveEntrypoint(spec, {\n      cwd: source,\n      packageLookupFields: [\n        'snowpack:source',\n        ...((config.packageOptions as PackageOptionsLocal).packageLookupFields || []),\n      ],\n    });\n\n    // Imports in the same project should never change once resolved. Check the memoized cache here to speed up faster repeat page loads.\n    // NOTE(fks): This is mainly needed because `resolveEntrypoint` can be slow and blocking, which creates issues when many files\n    // are loaded/resolved at once (ex: antd). If we can improve the performance there and make that async, this may no longer be\n    // necessary.\n    if (!options.importMap) {\n      if (memoizedResolve[entrypoint]) {\n        return path.posix.join(config.buildOptions.metaUrlPath, 'pkg', memoizedResolve[entrypoint]);\n      }\n    }\n\n    const isSymlink = !entrypoint.includes(path.join('node_modules', packageName));\n    const isWithinRoot = config.workspaceRoot && entrypoint.startsWith(config.workspaceRoot);\n    if (isSymlink && config.workspaceRoot && isWithinRoot) {\n      const builtEntrypointUrls = getBuiltFileUrls(entrypoint, config);\n      const builtEntrypointUrl = slash(\n        path.relative(config.workspaceRoot, builtEntrypointUrls[0]!),\n      );\n      allSymlinkImports[builtEntrypointUrl] = entrypoint;\n      return path.posix.join(config.buildOptions.metaUrlPath, 'link', builtEntrypointUrl);\n    } else if (isSymlink && config.workspaceRoot !== false && !this.hasWorkspaceWarningFired) {\n      this.hasWorkspaceWarningFired = true;\n      logger.warn(\n        colors.bold(`${spec}: Locally linked package detected outside of project root.\\n`) +\n          `If you are working in a workspace/monorepo, set your snowpack.config.js \"workspaceRoot\" to your workspace\\n` +\n          `directory to take advantage of fast HMR updates for linked packages. Otherwise, this package will be\\n` +\n          `cached until its package.json \"version\" changes. To silence this warning, set \"workspaceRoot: false\".`,\n      );\n    }\n\n    if (options.importMap) {\n      if (options.importMap.imports[spec]) {\n        return path.posix.join(\n          config.buildOptions.metaUrlPath,\n          'pkg',\n          options.importMap.imports[spec],\n        );\n      }\n      throw new Error(`Unexpected: spec ${spec} not included in import map.`);\n    }\n    // Unscanned package imports can happen. Warn the user, and then build the import individually.\n    logger.warn(\n      colors.bold(`${spec}: Unscannable package import found.\\n`) +\n        `Snowpack scans source files for package imports at startup, and on every change.\\n` +\n        `But, sometimes an import gets added during the build process, invisible to our file scanner.\\n` +\n        `We'll prepare this package for you now, but should add \"${spec}\" to \"knownEntrypoints\"\\n` +\n        `in your config file so that this gets prepared with the rest of your imports during startup.`,\n    );\n    // Built the new import, and then try resolving again.\n    if (options.isRetry) {\n      throw new Error(`Unexpected: Unscanned package import \"${spec}\" couldn't be built/resolved.`);\n    }\n    await this.buildPackageImport(_spec, options.source, true);\n    return this.resolvePackageImport(_spec, {source: options.source, isRetry: true});\n  }\n\n  clearCache() {\n    return rimraf.sync(this.cacheDirectory);\n  }\n\n  getCacheFolder() {\n    return this.cacheDirectory;\n  }\n\n  private isExternal(packageName: string, specifier: string): boolean {\n    const {config} = this;\n    for (const external of config.packageOptions.external) {\n      if (\n        packageName === external ||\n        specifier === external ||\n        packageName.startsWith(external + '/')\n      ) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\n"
  },
  {
    "path": "snowpack/src/sources/remote.ts",
    "content": "import {existsSync} from 'fs';\nimport * as colors from 'kleur/colors';\nimport path from 'path';\nimport rimraf from 'rimraf';\nimport {clearCache as clearSkypackCache, rollupPluginSkypack, SkypackSDK} from 'skypack';\nimport util from 'util';\nimport {logger} from '../logger';\nimport {LockfileManifest, PackageOptionsRemote, PackageSource, SnowpackConfig} from '../types';\nimport {\n  convertLockfileToSkypackImportMap,\n  createRemotePackageSDK,\n  isJavaScript,\n  parsePackageImportSpecifier,\n  readLockfile,\n} from '../util';\n\nconst fetchedPackages = new Set<string>();\nfunction logFetching(origin: string, packageName: string, packageSemver: string | undefined) {\n  if (fetchedPackages.has(packageName)) {\n    return;\n  }\n  fetchedPackages.add(packageName);\n  logger.info(\n    `import ${colors.bold(packageName + (packageSemver ? `@${packageSemver}` : ''))} ${colors.dim(\n      `→ ${origin}/${packageName}`,\n    )}`,\n  );\n  if (!packageSemver || packageSemver === 'latest') {\n    logger.info(colors.yellow(`pin dependency to this version: \\`snowpack add ${packageName}\\``));\n  }\n}\n\n/**\n * Remote Package Source: A generic interface through which\n * Snowpack interacts with the Skypack CDN. Used to load dependencies\n * from the CDN during both development and optimized building.\n */\nexport class PackageSourceRemote implements PackageSource {\n  config: SnowpackConfig;\n  lockfile: LockfileManifest | null = null;\n  remotePackageSDK: SkypackSDK;\n\n  constructor(config: SnowpackConfig) {\n    this.config = config;\n    this.remotePackageSDK = createRemotePackageSDK(config);\n  }\n\n  async prepare() {\n    this.lockfile = await readLockfile(this.config.root);\n    const {config, lockfile} = this;\n    // Only install types if `packageOptions.types=true`. Otherwise, no need to prepare anything.\n    if (config.packageOptions.source === 'remote' && !config.packageOptions.types) {\n      return;\n    }\n    const lockEntryList = lockfile && (Object.keys(lockfile.lock) as string[]);\n    if (!lockfile || !lockEntryList || lockEntryList.length === 0) {\n      return;\n    }\n\n    logger.info('checking for new TypeScript types...', {name: 'packageOptions.types'});\n    await rimraf.sync(path.join(this.getCacheFolder(), '.snowpack/types'));\n    for (const lockEntry of lockEntryList) {\n      const [packageName, semverRange] = lockEntry.split('#');\n      const exactVersion = lockfile.lock[lockEntry]?.substr(packageName.length + 1);\n      await this.remotePackageSDK\n        .installTypes(\n          packageName,\n          exactVersion || semverRange,\n          path.join(this.getCacheFolder(), 'types'),\n        )\n        .catch((err) => logger.debug('dts fetch error: ' + err.message));\n    }\n    // Skypack resolves imports on the fly, so no import map needed.\n    logger.info(`types updated. ${colors.dim('→ ./.snowpack/types')}`, {\n      name: 'packageOptions.types',\n    });\n  }\n\n  async prepareSingleFile() {\n    // Do nothing! Skypack loads packages on-demand.\n  }\n\n  async modifyBuildInstallOptions(installOptions) {\n    const {config, lockfile} = this;\n    installOptions.importMap = lockfile\n      ? convertLockfileToSkypackImportMap(\n          (config.packageOptions as PackageOptionsRemote).origin,\n          lockfile,\n        )\n      : undefined;\n    installOptions.rollup = installOptions.rollup || {};\n    installOptions.rollup.plugins = installOptions.rollup.plugins || [];\n    installOptions.rollup.plugins.push(\n      rollupPluginSkypack({\n        sdk: this.remotePackageSDK,\n        logger: {\n          debug: (...args: [any, ...any[]]) => logger.debug(util.format(...args)),\n          log: (...args: [any, ...any[]]) => logger.info(util.format(...args)),\n          warn: (...args: [any, ...any[]]) => logger.warn(util.format(...args)),\n          error: (...args: [any, ...any[]]) => logger.error(util.format(...args)),\n        },\n      }) as Plugin,\n    );\n    // config.installOptions.lockfile = lockfile || undefined;\n    return installOptions;\n  }\n\n  async load(spec: string) {\n    const {config, lockfile} = this;\n    let body: Buffer;\n    if (\n      spec.startsWith('-/') ||\n      spec.startsWith('pin/') ||\n      spec.startsWith('new/') ||\n      spec.startsWith('error/')\n    ) {\n      body = (await this.remotePackageSDK.fetch(`/${spec}`)).body;\n    } else {\n      const [packageName, packagePath] = parsePackageImportSpecifier(spec);\n      if (lockfile && lockfile.dependencies[packageName]) {\n        const lockEntry = packageName + '#' + lockfile.dependencies[packageName];\n        if (packagePath) {\n          body = (\n            await this.remotePackageSDK.fetch('/' + lockfile.lock[lockEntry] + '/' + packagePath)\n          ).body;\n        } else {\n          body = (await this.remotePackageSDK.fetch('/' + lockfile.lock[lockEntry])).body;\n        }\n      } else {\n        const packageSemver = 'latest';\n        logFetching(\n          (config.packageOptions as PackageOptionsRemote).origin,\n          packageName,\n          packageSemver,\n        );\n        let lookupResponse = await this.remotePackageSDK.lookupBySpecifier(spec, packageSemver);\n        if (!lookupResponse.error && lookupResponse.importStatus === 'NEW') {\n          const buildResponse = await this.remotePackageSDK.buildNewPackage(spec, packageSemver);\n          if (!buildResponse.success) {\n            throw new Error('Package could not be built!');\n          }\n          lookupResponse = await this.remotePackageSDK.lookupBySpecifier(spec, packageSemver);\n        }\n        if (lookupResponse.error) {\n          throw lookupResponse.error;\n        }\n        // Trigger a type fetch asynchronously. We want to resolve the JS as fast as possible, and\n        // the result of this is totally disconnected from the loading flow.\n        if (!existsSync(path.join(this.getCacheFolder(), '.snowpack/types', packageName))) {\n          this.remotePackageSDK\n            .installTypes(\n              packageName,\n              packageSemver,\n              path.join(this.getCacheFolder(), '.snowpack/types'),\n            )\n            .catch(() => 'thats fine!');\n        }\n        body = lookupResponse.body;\n      }\n    }\n    const ext = path.extname(spec);\n    if (!ext || isJavaScript(spec)) {\n      return {\n        contents: body\n          .toString()\n          .replace(/(from|import) \\'\\//g, `$1 '${config.buildOptions.metaUrlPath}/pkg/`)\n          .replace(/(from|import) \\\"\\//g, `$1 \"${config.buildOptions.metaUrlPath}/pkg/`),\n        imports: [],\n      };\n    }\n\n    return {contents: body, imports: []};\n  }\n\n  // TODO: Remove need for lookup URLs\n  async resolvePackageImport(spec: string) {\n    return path.posix.join(this.config.buildOptions.metaUrlPath, 'pkg', spec);\n  }\n\n  static clearCache() {\n    return clearSkypackCache();\n  }\n\n  /** @deprecated */\n  clearCache() {\n    return clearSkypackCache();\n  }\n\n  getCacheFolder() {\n    const {config} = this;\n    return (\n      (config.packageOptions.source === 'remote' && config.packageOptions.cache) ||\n      path.join(config.root, '.snowpack')\n    );\n  }\n}\n"
  },
  {
    "path": "snowpack/src/sources/util.ts",
    "content": "import {PackageSource, SnowpackConfig} from '../types';\nimport {PackageSourceLocal} from './local';\nimport {PackageSourceRemote} from './remote';\nimport path from 'path';\nimport rimraf from 'rimraf';\nimport globalCacheDir from 'cachedir';\n\nexport const GLOBAL_CACHE_DIR = globalCacheDir('snowpack');\n\nexport async function clearCache() {\n  return Promise.all([\n    PackageSourceRemote.clearCache(),\n    // NOTE(v4.0): This function is called before config has been created.\n    // But, when `packageOptions.source=\"remote-next\"` the \".snowpack\" cache\n    // directory lives in the config.root directory. We fake it here,\n    // and can revisit this API (probably add config as an arg) in v4.0.\n    rimraf.sync(path.join(process.cwd(), '.snowpack')),\n    rimraf.sync(path.join(process.cwd(), 'node_modules', '.cache', 'snowpack')),\n  ]);\n}\n\nconst remoteSourceCache = new WeakMap<SnowpackConfig, PackageSource>();\nconst localSourceCache = new WeakMap<SnowpackConfig, PackageSource>();\n\nexport function getPackageSource(config: SnowpackConfig): PackageSource {\n  if (config.packageOptions.source === 'remote') {\n    if (remoteSourceCache.has(config)) {\n      return remoteSourceCache.get(config)!;\n    }\n\n    const source = new PackageSourceRemote(config);\n    remoteSourceCache.set(config, source);\n    return source;\n  }\n\n  if (localSourceCache.has(config)) {\n    return localSourceCache.get(config)!;\n  }\n\n  const source = new PackageSourceLocal(config);\n  localSourceCache.set(config, source);\n  return source;\n}\n"
  },
  {
    "path": "snowpack/src/ssr-loader/index.ts",
    "content": "import {existsSync, readFileSync} from 'fs';\nimport {resolve, pathToFileURL} from 'url';\nimport {ServerRuntime, ServerRuntimeConfig, LoadResult} from '../types';\nimport {sourcemap_stacktrace} from './sourcemaps';\nimport {transform} from './transform';\nimport {REQUIRE_OR_IMPORT} from '../util';\n\ninterface ModuleInstance {\n  exports: any;\n  css: string[];\n}\n\ntype ModuleInitializer = () => Promise<ModuleInstance>;\n\nfunction moduleInit(fn: ModuleInitializer) {\n  let promise: null | Promise<ModuleInstance> = null;\n  return function () {\n    return promise || (promise = fn());\n  };\n}\n\n// This function makes it possible to load modules from the snowpack server, for the sake of SSR.\nexport function createLoader({config, load}: ServerRuntimeConfig): ServerRuntime {\n  const cache = new Map();\n  const graph = new Map();\n\n  async function getModule(importer: string, imported: string, urlStack: string[]) {\n    if (imported[0] === '/' || imported[0] === '.') {\n      const pathname = resolve(importer, imported);\n      if (!graph.has(pathname)) graph.set(pathname, new Set());\n      graph.get(pathname).add(importer);\n      return _load(pathname, urlStack);\n    }\n\n    return moduleInit(async function () {\n      const mod = await REQUIRE_OR_IMPORT(imported, {\n        from: config.root || config.workspaceRoot || process.cwd(),\n      });\n\n      return {\n        exports: mod,\n        css: [],\n      };\n    });\n  }\n\n  function invalidateModule(path) {\n    // If the cache doesn't have this path, check if it's a proxy file.\n    if (!cache.has(path) && cache.has(path + '.proxy.js')) {\n      path = path + '.proxy.js';\n    }\n\n    cache.delete(path);\n    const dependents = graph.get(path);\n    graph.delete(path);\n    if (dependents) dependents.forEach(invalidateModule);\n  }\n\n  async function _load(url, urlStack): Promise<ModuleInitializer> {\n    if (urlStack.includes(url)) {\n      console.warn(`Circular dependency: ${urlStack.join(' -> ')} -> ${url}`);\n      return async () => ({\n        exports: null,\n        css: [],\n      });\n    }\n    if (cache.has(url)) {\n      return cache.get(url);\n    }\n    const promise = (async function () {\n      const loaded = await load(url);\n      return moduleInit(function () {\n        try {\n          return initializeModule(url, loaded, urlStack.concat(url));\n        } catch (e) {\n          cache.delete(url);\n          throw e;\n        }\n      });\n    })();\n    cache.set(url, promise);\n    return promise;\n  }\n\n  async function initializeModule(\n    url: string,\n    loaded: LoadResult<string>,\n    urlStack: string[],\n  ): Promise<ModuleInstance> {\n    const {code, deps, css, names} = transform(loaded.contents);\n\n    const exports = {};\n    const allCss = new Set(css.map((relative) => resolve(url, relative)));\n    const fileURL = loaded.originalFileLoc ? pathToFileURL(loaded.originalFileLoc) : null;\n\n    // Load dependencies but do not execute.\n    const depsLoaded: Array<Promise<{name: string; init: ModuleInitializer}>> = deps.map(\n      async (dep) => {\n        return {\n          name: dep.name,\n          init: await getModule(url, dep.source, urlStack),\n        };\n      },\n    );\n\n    // Execute dependencies *in order*.\n    const depValues: Array<{name: string; value: any}> = [];\n    for await (const {name, init} of depsLoaded) {\n      const module = await init();\n      module.css.forEach((dep) => allCss.add(dep));\n\n      depValues.push({\n        name: name,\n        value: module.exports,\n      });\n    }\n\n    const args = [\n      {\n        name: 'global',\n        value: global,\n      },\n      {\n        name: 'require',\n        value: (id) => {\n          // TODO can/should this restriction be relaxed?\n          throw new Error(\n            `Use import instead of require (attempted to load '${id}' from '${url}')`,\n          );\n        },\n      },\n      {\n        name: names.exports,\n        value: exports,\n      },\n      {\n        name: names.__export,\n        value: (name, get) => {\n          Object.defineProperty(exports, name, {get});\n        },\n      },\n      {\n        name: names.__export_all,\n        value: (mod) => {\n          // Copy over all of the descriptors.\n          const descriptors = Object.getOwnPropertyDescriptors(mod);\n          Object.defineProperties(exports, descriptors);\n        },\n      },\n      {\n        name: names.__import,\n        value: (source) =>\n          getModule(url, source, urlStack)\n            .then((fn) => fn())\n            .then((mod) => mod.exports),\n      },\n      {\n        name: names.__import_meta,\n        value: {url: fileURL},\n      },\n      ...depValues,\n    ];\n\n    const fn = new Function(...args.map((d) => d.name), `${code}\\n//# sourceURL=${url}`);\n\n    try {\n      fn(...args.map((d) => d.value));\n    } catch (e) {\n      e.stack = await sourcemap_stacktrace(e.stack, async (address) => {\n        if (existsSync(address)) {\n          // it's a filepath\n          return readFileSync(address, 'utf-8');\n        }\n\n        try {\n          const {contents} = await load(address);\n          return contents;\n        } catch {\n          // fail gracefully\n        }\n      });\n\n      throw e;\n    }\n\n    return {\n      exports,\n      css: Array.from(allCss),\n    };\n  }\n\n  return {\n    importModule: async (url) => {\n      const init = await _load(url, []);\n      const mod = await init();\n      return mod;\n    },\n    invalidateModule: (url) => {\n      invalidateModule(url);\n    },\n  };\n}\n"
  },
  {
    "path": "snowpack/src/ssr-loader/sourcemaps.ts",
    "content": "import path from 'path';\nimport {SourceMapConsumer} from 'source-map';\n\nfunction get_sourcemap_url(contents) {\n  const reversed = contents.split('\\n').reverse().join('\\n');\n\n  const match = /\\/[/*]#[ \\t]+sourceMappingURL=([^\\s'\"]+?)(?:[ \\t]+|$)/gm.exec(reversed);\n  if (match) return match[1];\n\n  return undefined;\n}\n\nasync function replace_async(str, regex, asyncFn) {\n  const promises: Promise<any>[] = [];\n  str.replace(regex, (match, ...args) => {\n    const promise = asyncFn(match, ...args);\n    promises.push(promise);\n  });\n  const data = await Promise.all(promises);\n  return str.replace(regex, () => data.shift());\n}\n\n// TODO does Snowpack compose sourcemaps, or will this only undo\n// the last in a series of transformations?\nexport async function sourcemap_stacktrace(stack, load_contents) {\n  const replace = (line) =>\n    replace_async(\n      line,\n      /^ {4}at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?)\\)?/,\n      async (input, var_name, address, line, column) => {\n        if (!address) return input;\n\n        const contents = await load_contents(address);\n        if (!contents) return input;\n\n        const sourcemap_url = get_sourcemap_url(contents);\n        if (!sourcemap_url) return input;\n\n        let dir = path.dirname(address);\n        let sourcemap_data;\n\n        if (/^data:application\\/json[^,]+base64,/.test(sourcemap_url)) {\n          const raw_data = sourcemap_url.slice(sourcemap_url.indexOf(',') + 1);\n          try {\n            sourcemap_data = Buffer.from(raw_data, 'base64').toString();\n          } catch {\n            return input;\n          }\n        } else {\n          const sourcemap_path = path.resolve(dir, sourcemap_url);\n          const data = await load_contents(sourcemap_path);\n\n          if (!data) return input;\n\n          sourcemap_data = data;\n          dir = path.dirname(sourcemap_path);\n        }\n\n        let raw_sourcemap;\n        try {\n          raw_sourcemap = JSON.parse(sourcemap_data);\n        } catch {\n          return input;\n        }\n\n        // TODO: according to typings, this code cannot work;\n        // the constructor returns a promise that needs to be awaited\n        const consumer = await new SourceMapConsumer(raw_sourcemap);\n\n        const pos = consumer.originalPositionFor({\n          line: Number(line),\n          column: Number(column),\n          bias: SourceMapConsumer.LEAST_UPPER_BOUND,\n        });\n\n        if (!pos.source) return input;\n\n        const source_path = path.resolve(dir, pos.source);\n        const source = `${source_path}:${pos.line || 0}:${pos.column || 0}`;\n\n        if (!var_name) return `    at ${source}`;\n        return `    at ${var_name} (${source})`;\n      },\n    );\n\n  return (await Promise.all(stack.split('\\n').map(replace))).join('\\n');\n}\n"
  },
  {
    "path": "snowpack/src/ssr-loader/transform.ts",
    "content": "import * as meriyah from 'meriyah';\nimport MagicString from 'magic-string';\nimport {analyze, extract_names} from 'periscopic';\nimport {walk} from 'estree-walker';\nimport is_reference from 'is-reference';\n\nexport function transform(data) {\n  const code = new MagicString(data);\n  const ast: any = meriyah.parseModule(data, {\n    ranges: true,\n    next: true,\n  });\n\n  const {map, scope} = analyze(ast);\n  const all_identifiers = new Set();\n\n  // first, get a list of all the identifiers used in the module...\n  walk(ast, {\n    enter(node: any, parent: any) {\n      if (is_reference(node as any, parent as any)) {\n        all_identifiers.add(node.name);\n      }\n    },\n  });\n\n  // ...then deconflict injected values...\n  function deconflict(name) {\n    while (all_identifiers.has(name)) name += '_';\n    return name;\n  }\n\n  const exports = deconflict('exports');\n  const __import = deconflict('__import');\n  const __import_meta = deconflict('__import_meta');\n  const __export = deconflict('__export');\n  const __export_all = deconflict('__export_all');\n\n  // ...then extract imports/exports...\n  let uid = 0;\n  const get_import_name = () => deconflict(`__import${uid++}`);\n\n  const replacements = new Map();\n  const deps: any[] = [];\n  const css: any[] = [];\n\n  ast.body.forEach((node) => {\n    if (node.type === 'ImportDeclaration') {\n      const is_namespace =\n        node.specifiers[0] && node.specifiers[0].type === 'ImportNamespaceSpecifier';\n      const default_specifier = node.specifiers.find((specifier) => !specifier.imported);\n\n      const name = is_namespace\n        ? node.specifiers[0].local.name\n        : default_specifier\n        ? default_specifier.local.name\n        : get_import_name();\n\n      const source = node.source.value;\n      if (source.endsWith('.css.proxy.js') && !source.endsWith('.module.css.proxy.js')) {\n        // CSS proxy: only include CSS\n        css.push(source.replace(/\\.proxy\\.js$/, ''));\n      } else {\n        if (source.endsWith('.module.css.proxy.js')) {\n          // CSS Modules Proxy: include both CSS and JS\n          const cssSource = source.replace(/\\.proxy\\.js$/, '');\n          css.push(cssSource);\n        }\n        deps.push({name, source});\n\n        if (!is_namespace) {\n          node.specifiers.forEach((specifier) => {\n            const prop = specifier.imported ? specifier.imported.name : 'default';\n            replacements.set(specifier.local.name, `${name}.${prop}`);\n          });\n        }\n      }\n\n      code.remove(node.start, node.end);\n    }\n\n    if (node.type === 'ExportAllDeclaration') {\n      const source = node.source.value;\n      const name = get_import_name();\n\n      deps.push({name, source});\n\n      code.overwrite(node.start, node.end, `${__export_all}(${name})`);\n    }\n\n    if (node.type === 'ExportDefaultDeclaration') {\n      code.overwrite(node.start, node.declaration.start - 1, `${exports}.default = `);\n    }\n\n    if (node.type === 'ExportNamedDeclaration') {\n      if (node.source) {\n        const name = get_import_name();\n        const source = node.source.value;\n\n        deps.push({name, source});\n\n        const export_block = node.specifiers\n          .map((specifier) => {\n            return `${__export}('${specifier.exported.name}', () => ${name}.${specifier.local.name})`;\n          })\n          .join('; ');\n\n        code.overwrite(node.start, node.end, export_block);\n      } else if (node.declaration) {\n        // `export const foo = ...` or `export function foo() {...}`\n        code.remove(node.start, node.declaration.start);\n\n        let suffix;\n\n        if (node.declaration.type === 'VariableDeclaration') {\n          const names: string[] = [];\n          node.declaration.declarations.forEach((declarator) => {\n            names.push(...extract_names(declarator.id));\n          });\n\n          suffix = names.map((name) => ` ${__export}('${name}', () => ${name});`).join('');\n        } else {\n          const {name} = node.declaration.id;\n          suffix = ` ${__export}('${name}', () => ${name});`;\n        }\n\n        code.appendLeft(node.end, suffix);\n      } else {\n        if (node.specifiers.length > 0) {\n          code.remove(node.start, node.specifiers[0].start);\n\n          node.specifiers.forEach((specifier) => {\n            code.overwrite(\n              specifier.start,\n              specifier.end,\n              `${__export}('${specifier.exported.name}', () => ${specifier.local.name})`,\n            );\n          });\n\n          code.remove(node.specifiers[node.specifiers.length - 1].end, node.end);\n        } else {\n          // export {};\n          code.remove(node.start, node.end);\n        }\n      }\n    }\n  });\n\n  // ...then rewrite import references\n  if (replacements.size) {\n    let current_scope = scope;\n\n    walk(ast, {\n      enter(node: any, parent: any) {\n        if (map.has(node)) {\n          current_scope = map.get(node) || current_scope;\n        }\n\n        if (node.type === 'ImportDeclaration') {\n          this.skip();\n          return;\n        }\n\n        if (!is_reference(node, parent)) return;\n        if (!replacements.has(node.name)) return;\n        if (parent.type === 'ExportSpecifier') return;\n\n        if (current_scope.find_owner(node.name) === scope) {\n          let replacement = replacements.get(node.name);\n          if (parent.type === 'Property' && node === parent.key && node === parent.value) {\n            replacement = `${node.name}: ${replacement}`;\n          }\n          code.overwrite(node.start, node.end, replacement);\n        }\n      },\n      leave(node: any) {\n        if (map.has(node)) {\n          if (!current_scope.parent) {\n            throw new Error('Unexpected: (!current_scope.parent.parent)');\n          }\n          current_scope = current_scope.parent;\n        }\n      },\n    });\n  }\n\n  // replace import.meta and import(dynamic)\n  if (/import\\s*\\.\\s*meta/.test(data) || /import\\s*\\(/.test(data)) {\n    walk(ast.body, {\n      enter(node: any) {\n        if (node.type === 'MetaProperty' && node.meta.name === 'import') {\n          code.overwrite(node.start, node.end, __import_meta);\n        } else if (node.type === 'ImportExpression') {\n          code.overwrite(node.start, node.start + 6, __import);\n        }\n      },\n    });\n  }\n\n  return {\n    code: code.toString(),\n    deps,\n    css,\n    names: {exports, __import, __import_meta, __export, __export_all},\n  };\n}\n"
  },
  {
    "path": "snowpack/src/types.ts",
    "content": "import type {InstallOptions as EsinstallOptions, InstallTarget} from 'esinstall';\nimport type {Loader} from 'esbuild';\nimport type * as net from 'net';\nimport type * as http from 'http';\nimport type * as http2 from 'http2';\nimport type {EsmHmrEngine} from './hmr-server-engine';\n\n// RawSourceMap is inlined here for bundle purposes.\n// import type {RawSourceMap} from 'source-map';\nexport interface RawSourceMap {\n  version: number;\n  sources: string[];\n  names: string[];\n  sourceRoot?: string;\n  sourcesContent?: string[];\n  mappings: string;\n  file: string;\n}\n\nexport type DeepPartial<T> = {\n  [P in keyof T]?: T[P] extends Array<infer U>\n    ? Array<DeepPartial<U>>\n    : T[P] extends ReadonlyArray<infer U>\n    ? ReadonlyArray<DeepPartial<U>>\n    : DeepPartial<T[P]>;\n};\n\nexport interface ServerRuntimeConfig {\n  config: SnowpackConfig;\n  load: (url: string) => Promise<LoadResult<string>>;\n}\nexport interface ServerRuntime {\n  importModule: <T = any>(url: string) => Promise<ServerRuntimeModule<T>>;\n  invalidateModule: (url: string) => void;\n}\n\nexport interface ServerRuntimeModule<T extends any> {\n  exports: T;\n  css: string[];\n}\n\nexport interface LoadResult<T = Buffer | string> {\n  contents: T;\n  imports: InstallTarget[];\n  originalFileLoc: string | null;\n  contentType: string | false;\n  checkStale?: () => Promise<void>;\n}\n\nexport type OnFileChangeCallback = ({filePath: string}) => any;\nexport interface LoadUrlOptions {\n  isSSR?: boolean;\n  isHMR?: boolean;\n  isResolve?: boolean;\n  allowStale?: boolean;\n  encoding?: undefined | BufferEncoding | null;\n  importMap?: ImportMap;\n}\n\nexport interface SnowpackDevServer {\n  port: number;\n  hmrEngine?: EsmHmrEngine;\n  rawServer?: http.Server | http2.Http2Server | undefined;\n  loadUrl: {\n    (reqUrl: string, opt?: (LoadUrlOptions & {encoding?: undefined}) | undefined): Promise<\n      LoadResult<Buffer | string> | undefined\n    >;\n    (reqUrl: string, opt: LoadUrlOptions & {encoding: BufferEncoding}): Promise<\n      LoadResult<string> | undefined\n    >;\n    (reqUrl: string, opt: LoadUrlOptions & {encoding: null}): Promise<\n      LoadResult<Buffer> | undefined\n    >;\n  };\n  handleRequest: (\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    options?: {handleError?: boolean},\n  ) => Promise<void>;\n  sendResponseFile: (\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    {contents, originalFileLoc, contentType}: LoadResult,\n  ) => void;\n  getServerRuntime: (options?: {invalidateOnChange?: boolean}) => ServerRuntime;\n  sendResponseError: (req: http.IncomingMessage, res: http.ServerResponse, status: number) => void;\n  getUrlForFile: (fileLoc: string) => string | null;\n  getUrlForPackage: (packageSpec: string) => Promise<string>;\n  onFileChange: (callback: OnFileChangeCallback) => void;\n  shutdown(): Promise<void>;\n  markChanged: (fileLoc: string) => void;\n}\n\nexport type SnowpackBuildResultFileManifest = Record<\n  string,\n  {source: string | null; contents: string | Buffer}\n>;\n\nexport interface SnowpackBuildResult {\n  // result: SnowpackBuildResultFileManifest;\n  onFileChange: (callback: OnFileChangeCallback) => void;\n  shutdown(): Promise<void>;\n}\n\nexport type SnowpackBuiltFile = {\n  code: string | Buffer;\n  map?: string;\n};\n\nexport type SnowpackBuildMap = Record<string, SnowpackBuiltFile>;\n\n/** Standard file interface */\nexport interface SnowpackSourceFile<Type = string | Buffer> {\n  /** base extension (e.g. `.js`) */\n  baseExt: string;\n  /** file contents */\n  contents: Type;\n  /** if no location on disk, assume this exists in memory */\n  locOnDisk: string;\n  /** project \"root\" directory */\n  root: string;\n}\n\nexport interface PluginLoadOptions {\n  /** The absolute file path of the source file, on disk. */\n  filePath: string;\n  /** A helper for just the file extension of the source file (ex: \".js\", \".svelte\") */\n  fileExt: string;\n  /** True if builder is in dev mode (`snowpack dev` or `snowpack build --watch`) */\n  isDev: boolean;\n  /** True if HMR is enabled (add any HMR code to the output here). */\n  isHmrEnabled: boolean;\n  /** True if builder is in SSR mode */\n  isSSR: boolean;\n  /** True if file being transformed is inside of a package. */\n  isPackage: boolean;\n}\n\nexport interface PluginTransformOptions {\n  /** The final build file path (note: this may differ from the source, e.g. `.vue` will yield `.js` and `.css` IDs) */\n  id: string;\n  /** The original source location on disk (it may differ from ID) */\n  srcPath: string;\n  /** The extension of the file */\n  fileExt: string;\n  /** Contents of the file to transform */\n  contents: string | Buffer;\n  /** True if builder is in dev mode (`snowpack dev` or `snowpack build --watch`) */\n  isDev: boolean;\n  /** True if HMR is enabled (add any HMR code to the output here). */\n  isHmrEnabled: boolean;\n  /** True if builder is in SSR mode */\n  isSSR: boolean;\n  /** True if file being transformed is inside of a package. */\n  isPackage: boolean;\n}\n\nexport interface PluginRunOptions {\n  isDev: boolean;\n}\n\n/** map of extensions -> code (e.g. { \".js\": \"[code]\", \".css\": \"[code]\" }) */\nexport type PluginLoadResult = SnowpackBuildMap;\n\nexport type PluginTransformResult = {contents: string; map: string | RawSourceMap};\n\nexport interface PluginOptimizeOptions {\n  buildDirectory: string;\n}\n\nexport interface SnowpackPlugin {\n  /** name of the plugin */\n  name: string;\n  /** Tell Snowpack how the load() function will resolve files. */\n  resolve?: {\n    /**\n       file extensions that this load function takes as input (e.g. [\".jsx\",\n       \".js\", …])\n     */\n    input: string[];\n    /**\n       file extensions that this load function outputs (e.g. [\".js\", \".css\"])\n     */\n    output: string[];\n  };\n  /** load a file that matches resolve.input */\n  load?(options: PluginLoadOptions): Promise<PluginLoadResult | string | null | undefined | void>;\n  /** transform a file that matches resolve.input */\n  transform?(\n    options: PluginTransformOptions,\n  ): Promise<PluginTransformResult | string | null | undefined | void>;\n  /** runs a command, unrelated to file building (e.g. TypeScript, ESLint) */\n  run?(options: PluginRunOptions): Promise<unknown>;\n  /** optimize the entire built application */\n  optimize?(options: PluginOptimizeOptions): Promise<void>;\n  /** cleanup any long-running instances/services before exiting.  */\n  cleanup?(): void | Promise<void>;\n  /** Known dependencies that should be installed */\n  knownEntrypoints?: string[];\n  /** read and modify the Snowpack config object */\n  config?(snowpackConfig: SnowpackConfig): void;\n  /** Called when a watched file changes during development. */\n  onChange?({filePath}: {filePath: string}): void;\n  /** (internal interface, not set by the user) Mark a file as changed. */\n  markChanged?(file: string): void;\n}\n\n/** Snowpack Build Plugin type */\nexport type SnowpackPluginFactory<PluginOptions = object> = (\n  snowpackConfig: SnowpackConfig,\n  pluginOptions?: PluginOptions,\n) => SnowpackPlugin;\n\nexport type MountEntry = {\n  url: string;\n  static: boolean;\n  resolve: boolean;\n  dot: boolean;\n};\n\nexport interface OptimizeOptions {\n  entrypoints: 'auto' | string[] | ((options: {files: string[]}) => string[]);\n  preload: boolean;\n  bundle: boolean;\n  loader?: {[ext: string]: Loader};\n  sourcemap: boolean | 'both' | 'inline' | 'external';\n  splitting: boolean;\n  treeshake: boolean;\n  manifest: boolean;\n  minify: boolean;\n  target: 'es2020' | 'es2019' | 'es2018' | 'es2017';\n}\n\nexport interface RouteConfigObject {\n  src: string;\n  dest: string | ((req: http.IncomingMessage, res: http.ServerResponse) => void) | undefined;\n  upgrade: ((req: http.IncomingMessage, socket: net.Socket, head: Buffer) => void) | undefined;\n  match: 'routes' | 'all';\n  _srcRegex: RegExp;\n}\n\nexport interface PackageOptionsLocal\n  extends Omit<\n    EsinstallOptions,\n    'alias' | 'dest' | 'sourcemap' | 'verbose' | 'logger' | 'cwd' | 'dest' | 'treeshake'\n  > {\n  source: 'local' | 'remote-next' | {[key: string]: string};\n  external: string[];\n  knownEntrypoints: string[];\n}\n\nexport interface PackageOptionsRemote {\n  source: 'remote';\n  external: string[];\n  knownEntrypoints: string[];\n  origin: string;\n  cache: string;\n  types: boolean;\n}\n\n// interface this library uses internally\nexport interface SnowpackConfig {\n  root: string;\n  mode: 'test' | 'development' | 'production';\n  workspaceRoot?: string | false;\n  extends?: string;\n  exclude: string[];\n  env?: Record<string, string | boolean | undefined>;\n  mount: Record<string, MountEntry>;\n  alias: Record<string, string>;\n  plugins: SnowpackPlugin[];\n  dependencies: Record<string, string>;\n  devOptions: {\n    secure: boolean | {cert: string | Buffer; key: string | Buffer};\n    hostname: string;\n    port: number;\n    openUrl?: string;\n    open?: string;\n    output?: 'stream' | 'dashboard';\n    hmr?: boolean;\n    hmrDelay: number;\n    hmrPort: number | undefined;\n    hmrErrorOverlay: boolean;\n    tailwindConfig?: string;\n  };\n  buildOptions: {\n    out: string;\n    baseUrl: string;\n    metaUrlPath: string;\n    cacheDirPath: string;\n    clean: boolean;\n    sourcemap: 'inline' | false | undefined;\n    watch: boolean;\n    htmlFragments: boolean;\n    jsxFactory: string | undefined;\n    jsxFragment: string | undefined;\n    jsxInject: string | undefined;\n    ssr: boolean;\n    resolveProxyImports: boolean;\n  };\n  testOptions: {\n    files: string[];\n  };\n  packageOptions: PackageOptionsLocal | PackageOptionsRemote;\n  /** Optimize your site for production. */\n  optimize?: OptimizeOptions;\n  /** Configure routes during development. */\n  routes: RouteConfigObject[];\n  /** EXPERIMENTAL - This section is experimental and not yet finalized. May change across minor versions. */\n  experiments: {\n    /* intentionally left blank */\n  };\n  _extensionMap: Record<string, string[]>;\n}\n\nexport type SnowpackUserConfig = {\n  root?: string;\n  mode?: SnowpackConfig['mode'];\n  workspaceRoot?: string;\n  install?: string[];\n  env?: Record<string, string>;\n  extends?: string;\n  exclude?: string[];\n  mount?: Record<string, string | Partial<MountEntry>>;\n  alias?: Record<string, string>;\n  plugins?: (string | [string, any])[];\n  dependencies?: Record<string, string>;\n  devOptions?: Partial<SnowpackConfig['devOptions']>;\n  buildOptions?: Partial<SnowpackConfig['buildOptions']>;\n  testOptions?: Partial<SnowpackConfig['testOptions']>;\n  packageOptions?: Partial<SnowpackConfig['packageOptions']>;\n  optimize?: Partial<SnowpackConfig['optimize']>;\n  routes?: Pick<RouteConfigObject, 'src' | 'dest' | 'match'>[];\n  experiments?: {\n    /* intentionally left blank */\n  };\n};\nexport interface CLIFlags {\n  help?: boolean; // display help text\n  version?: boolean; // display Snowpack version\n  reload?: boolean;\n  root?: string; // manual path to project root\n  config?: string; // manual path to config file\n  env?: string[]; // env vars\n  open?: string[];\n  secure?: boolean;\n  verbose?: boolean;\n  quiet?: boolean;\n  [flag: string]: any;\n}\n\nexport interface ImportMap {\n  imports: {[specifier: string]: string};\n}\n\nexport interface LockfileManifest {\n  dependencies: {[packageName: string]: string};\n  lock: {[specifier: string]: string};\n}\n\nexport interface CommandOptions {\n  config: SnowpackConfig;\n  lockfile?: LockfileManifest | null;\n}\n\nexport type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; // same as Pino\nexport type LoggerEvent = 'debug' | 'info' | 'warn' | 'error';\nexport interface LoggerOptions {\n  /** (optional) change name at beginning of line */\n  name?: string;\n  /** (optional) do some additional work after logging a message, if log level is enabled */\n  task?: Function;\n}\n\n/** PackageSource - a common interface for loading and interacting with dependencies.  */\nexport interface PackageSource {\n  /**\n   * Do any work needed before starting the dev server or build. Either will wait\n   * for this to complete before continuing. Example: For \"local\", this involves\n   * running esinstall (if needed) to prepare your local dependencies as ESM.\n   */\n  prepare(): Promise<void>;\n  /**\n   * Like prepare(), but only looks at a single file and meant to run at anytime,\n   * usually after the server has already started and is running.\n   */\n  prepareSingleFile(fileLoc: string): Promise<void>;\n  /**\n   * Load a dependency with the given spec (ex: \"/pkg/react\" -> \"react\")\n   * If load fails or is unsuccessful, reject the promise.\n   */\n  load(\n    spec: string,\n    options: {isSSR: boolean},\n  ): Promise<undefined | {contents: Buffer | string; imports: InstallTarget[]}>;\n  /** Resolve a package import to URL (ex: \"react\" -> \"/pkg/react\") */\n  resolvePackageImport(\n    spec: string,\n    options?: {source?: string; importMap?: ImportMap; depth?: number},\n  ): Promise<string>;\n  /** Modify the build install config for optimized build install. */\n  modifyBuildInstallOptions(\n    installOptions: EsinstallOptions,\n    installTargets: InstallTarget[],\n  ): Promise<EsinstallOptions>;\n  getCacheFolder(): string;\n  clearCache(): void | Promise<void>;\n}\n\nexport type ScannableExt =\n  | '.astro'\n  | '.cjs'\n  | '.css'\n  | '.html'\n  | '.interface'\n  | '.js'\n  | '.jsx'\n  | '.less'\n  | '.mjs'\n  | '.sass'\n  | '.scss'\n  | '.svelte'\n  | '.ts'\n  | '.tsx'\n  | '.vue';\n"
  },
  {
    "path": "snowpack/src/util.ts",
    "content": "import etag from 'etag';\nimport execa from 'execa';\nimport findUp from 'find-up';\nimport fs from 'fs';\nimport {isBinaryFile} from 'isbinaryfile';\nimport mkdirp from 'mkdirp';\nimport open from 'open';\nimport path from 'path';\nimport rimraf from 'rimraf';\nimport url from 'url';\nimport getDefaultBrowserId from 'default-browser-id';\nimport type {ImportMap, LockfileManifest, SnowpackConfig} from './types';\nimport type {InstallTarget} from 'esinstall';\nimport {SkypackSDK} from 'skypack';\nimport {REMOTE_PACKAGE_ORIGIN} from './config';\nimport {GLOBAL_CACHE_DIR} from './sources/util';\n\n// (!) Beware circular dependencies! No relative imports!\n// Because this file is imported from so many different parts of Snowpack,\n// importing other relative files inside of it is likely to introduce broken\n// circular dependencies (sometimes only visible in the final bundled build.)\nexport const IS_DOTFILE_REGEX = /\\/\\.[^\\/]+$/; // note: always assume forward-slashes, even on Windows\n\nexport const LOCKFILE_NAME = 'snowpack.deps.json';\n\n// We need to use eval here to prevent Rollup from detecting this use of `require()`\nexport const NATIVE_REQUIRE = eval('require');\n\n// We need to use an external file here to prevent Typescript/Rollup from modifying `require` and `import`\n// NOTE: revisit this when `node@10` reaches EOL. Can we move everything to ESM and just use `import`?\nexport const REQUIRE_OR_IMPORT: (\n  id: string,\n  opts?: {from?: string},\n) => Promise<any> = require('../../assets/require-or-import.js');\n\nexport function createRemotePackageSDK(config: SnowpackConfig) {\n  // This should only be called when config.packageOptions.source is 'remote'.\n  if (config.packageOptions.source !== 'remote') {\n    throw new Error('expected \"remote\" packageOptions.source');\n  }\n\n  // For consistency with previous behavior, we default to REMOTE_PACKAGE_ORIGIN\n  // if no origin is provided.  We could simply leave it undefined and allow\n  // SkypackSDK to use its own default.\n  return new SkypackSDK({\n    origin: config.packageOptions.origin || REMOTE_PACKAGE_ORIGIN,\n  });\n}\n\n// A note on cache naming/versioning: We currently version our global caches\n// with the version of the last breaking change. This allows us to re-use the\n// same cache across versions until something in the data structure changes.\n// At that point, bump the version in the cache name to create a new unique\n// cache name.\nexport const BUILD_CACHE = path.join(GLOBAL_CACHE_DIR, 'build-cache-2.7');\nconst LOCKFILE_HASH_FILE = '.hash';\n\n// NOTE(fks): Must match empty script elements to work properly.\nexport const HTML_JS_REGEX = /(<script[^>]*?type=\"module\".*?>)(.*?)<\\/script>/gims;\nexport const HTML_STYLE_REGEX = /(<style.*?>)(.*?)<\\/style>/gims;\nexport const CSS_REGEX = /@import\\s*['\"](.*?)['\"];/gs;\nexport const SVELTE_VUE_REGEX = /(<script[^>]*>)(.*?)<\\/script>/gims;\nexport const ASTRO_REGEX = /---(.*?)---/gims;\n\nexport function getCacheKey(fileLoc: string, {isSSR, mode}) {\n  return `${fileLoc}?mode=${mode}&isSSR=${isSSR ? '1' : '0'}`;\n}\n\nexport type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;\n\n/**\n * Like rimraf, but will fail if \"dir\" is outside of your configured build output directory.\n */\nexport function deleteFromBuildSafe(dir: string, config: SnowpackConfig) {\n  const {out} = config.buildOptions;\n  if (!path.isAbsolute(dir)) {\n    throw new Error(`rimrafSafe(): dir ${dir} must be a absolute path`);\n  }\n  if (!path.isAbsolute(out)) {\n    throw new Error(`rimrafSafe(): buildOptions.out ${out} must be a absolute path`);\n  }\n  if (!dir.startsWith(out)) {\n    throw new Error(`rimrafSafe(): ${dir} outside of buildOptions.out ${out}`);\n  }\n  return rimraf.sync(dir);\n}\n\n/** Read file from disk; return a string if it’s a code file */\nexport async function readFile(filepath: string): Promise<string | Buffer> {\n  let data = await fs.promises.readFile(filepath);\n  if (!data) {\n    console.error(\n      `Unexpected Node.js error: readFile(${filepath}) returned undefined.\\n\\n` +\n        `Somehow in Github CI / Jest its possible for fs.promises.readFile to return undefined.\\n` +\n        `This should be impossible, and has not yet been reproduced in the real world, but we do see it in our own CI.\\n` +\n        `If you are seeing this error, please report!`,\n    );\n    data = fs.readFileSync(filepath);\n  }\n  const isBinary = await isBinaryFile(data);\n  return isBinary ? data : data.toString('utf8');\n}\n\nexport async function readLockfile(cwd: string): Promise<LockfileManifest | null> {\n  try {\n    var lockfileContents = fs.readFileSync(path.join(cwd, LOCKFILE_NAME), {\n      encoding: 'utf8',\n    });\n  } catch (err) {\n    // no lockfile found, ignore and continue\n    return null;\n  }\n  // If this fails, we actually do want to alert the user by throwing\n  return JSON.parse(lockfileContents);\n}\n\nexport function createInstallTarget(specifier: string, all = true): InstallTarget {\n  return {\n    specifier,\n    all,\n    default: false,\n    namespace: false,\n    named: [],\n  };\n}\n\nfunction sortObject<T>(originalObject: Record<string, T>): Record<string, T> {\n  const newObject = {};\n  for (const key of Object.keys(originalObject).sort()) {\n    newObject[key] = originalObject[key];\n  }\n  return newObject;\n}\n\nexport function convertLockfileToSkypackImportMap(\n  origin: string,\n  lockfile: LockfileManifest,\n): ImportMap {\n  const result = {imports: {}};\n  for (const [key, val] of Object.entries(lockfile.lock)) {\n    result.imports[key.replace(/\\#.*/, '')] = origin + '/' + val;\n    result.imports[key.replace(/\\#.*/, '') + '/'] = origin + '/' + val + '/';\n  }\n  return result;\n}\n\nexport function convertSkypackImportMapToLockfile(\n  dependencies: Record<string, string>,\n  importMap: ImportMap,\n): LockfileManifest {\n  const result = {dependencies, lock: {}};\n  for (const [key, val] of Object.entries(dependencies)) {\n    if (importMap.imports[key]) {\n      const valPath = url.parse(importMap.imports[key]).pathname;\n      result.lock[key + '#' + val] = valPath?.substr(1);\n    }\n  }\n  return result;\n}\n\nexport async function writeLockfile(loc: string, importMap: LockfileManifest): Promise<void> {\n  importMap.dependencies = sortObject(importMap.dependencies);\n  importMap.lock = sortObject(importMap.lock);\n  fs.writeFileSync(loc, JSON.stringify(importMap, undefined, 2), {encoding: 'utf8'});\n}\n\nexport function isTruthy<T>(item: T | false | null | undefined): item is T {\n  return Boolean(item);\n}\n\n/**\n * Returns true if fsevents exists. When Snowpack is bundled, automatic fsevents\n * detection fails for many libraries. This function helps add back support.\n */\nexport function isFsEventsEnabled(): boolean {\n  try {\n    NATIVE_REQUIRE('fsevents');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/** Get the package name + an entrypoint within that package (if given). */\nexport function parsePackageImportSpecifier(imp: string): [string, string | null] {\n  const impParts = imp.split('/');\n  if (imp.startsWith('@')) {\n    const [scope, name, ...rest] = impParts;\n    return [`${scope}/${name}`, rest.join('/') || null];\n  }\n  const [name, ...rest] = impParts;\n  return [name, rest.join('/') || null];\n}\n\n/**\n * Given a package name, look for that package's package.json manifest.\n * Return both the manifest location (if believed to exist) and the\n * manifest itself (if found).\n *\n * NOTE: You used to be able to require() a package.json file directly,\n * but now with export map support in Node v13 that's no longer possible.\n */\nexport function resolveDependencyManifest(dep: string, cwd: string): [string | null, any | null] {\n  // Attempt #1: Resolve the dependency manifest normally. This works for most\n  // packages, but fails when the package defines an export map that doesn't\n  // include a package.json. If we detect that to be the reason for failure,\n  // move on to our custom implementation.\n  try {\n    const depManifest = fs.realpathSync.native(\n      require.resolve(`${dep}/package.json`, {paths: [cwd]}),\n    );\n    return [depManifest, NATIVE_REQUIRE(depManifest)];\n  } catch (err) {\n    // if its an export map issue, move on to our manual resolver.\n    if (err.code !== 'ERR_PACKAGE_PATH_NOT_EXPORTED') {\n      return [null, null];\n    }\n  }\n\n  // Attempt #2: Resolve the dependency manifest manually. This involves resolving\n  // the dep itself to find the entrypoint file, and then haphazardly replacing the\n  // file path within the package with a \"./package.json\" instead. It's not as\n  // thorough as Attempt #1, but it should work well until export maps become more\n  // established & move out of experimental mode.\n  let result = [null, null] as [string | null, any | null];\n  try {\n    const fullPath = fs.realpathSync.native(require.resolve(dep, {paths: [cwd]}));\n    // Strip everything after the package name to get the package root path\n    // NOTE: This find-replace is very gross, replace with something like upath.\n    const searchPath = `${path.sep}node_modules${path.sep}${dep.replace('/', path.sep)}`;\n    const indexOfSearch = fullPath.lastIndexOf(searchPath);\n    if (indexOfSearch >= 0) {\n      const manifestPath =\n        fullPath.substring(0, indexOfSearch + searchPath.length + 1) + 'package.json';\n      result[0] = manifestPath;\n      const manifestStr = fs.readFileSync(manifestPath, {encoding: 'utf8'});\n      result[1] = JSON.parse(manifestStr);\n    }\n  } catch (err) {\n    // ignore\n  } finally {\n    return result;\n  }\n}\n\n/**\n * If Rollup erred parsing a particular file, show suggestions based on its\n * file extension (note: lowercase is fine).\n */\nexport const MISSING_PLUGIN_SUGGESTIONS: {[ext: string]: string} = {\n  '.svelte':\n    'Try installing rollup-plugin-svelte and adding it to Snowpack (https://www.snowpack.dev/tutorials/svelte)',\n  '.vue':\n    'Try installing rollup-plugin-vue and adding it to Snowpack (https://www.snowpack.dev/guides/vue)',\n};\n\nconst appNames = {\n  win32: {\n    brave: 'brave',\n  },\n  darwin: {\n    brave: 'Brave Browser',\n  },\n  linux: {\n    brave: 'brave',\n  },\n};\n\nasync function openInExistingChromeBrowser(url: string) {\n  // see if Chrome process is open; fail if not\n  await execa.command('ps cax | grep \"Google Chrome\"', {\n    shell: true,\n  });\n  // use open Chrome tab if exists; create new Chrome tab if not\n  const openChrome = execa(\n    'osascript ../../assets/openChrome.appleScript \"' + encodeURI(url) + '\"',\n    {\n      cwd: __dirname,\n      stdio: 'ignore',\n      shell: true,\n    },\n  );\n  // if Chrome doesn’t respond within 3s, fall back to opening new tab in default browser\n  let isChromeStalled = setTimeout(() => {\n    openChrome.cancel();\n  }, 3000);\n  try {\n    await openChrome;\n  } catch (err) {\n    if (err.isCanceled) {\n      console.warn(`Chrome not responding to Snowpack after 3s. Opening in new tab.`);\n    } else {\n      console.error(err.toString() || err);\n    }\n    throw err;\n  } finally {\n    clearTimeout(isChromeStalled);\n  }\n}\nexport async function openInBrowser(\n  protocol: string,\n  hostname: string,\n  port: number,\n  browser: string,\n  openUrl?: string,\n): Promise<void> {\n  const url = new URL(openUrl || '', `${protocol}//${hostname}:${port}`).toString();\n  if (/chrome/i.test(browser)) {\n    browser = open.apps.chrome as string;\n  }\n  if (/brave/i.test(browser)) {\n    browser = appNames[process.platform]['brave'];\n  }\n  const isMacChrome =\n    process.platform === 'darwin' &&\n    (/chrome/i.test(browser) ||\n      (/default/i.test(browser) && /chrome/i.test(await getDefaultBrowserId())));\n  if (!isMacChrome) {\n    await (browser === 'default' ? open(url) : open(url, {app: {name: browser}}));\n    return;\n  }\n  try {\n    // If we're on macOS, and we haven't requested a specific browser,\n    // we can try opening Chrome with AppleScript. This lets us reuse an\n    // existing tab when possible instead of creating a new one.\n    await openInExistingChromeBrowser(url);\n  } catch (err) {\n    // if no open Chrome process, just go ahead and open default browser.\n    await open(url);\n  }\n}\n\nexport async function checkLockfileHash(dir: string) {\n  const lockfileLoc = await findUp(['package-lock.json', 'yarn.lock']);\n  if (!lockfileLoc) {\n    return true;\n  }\n  const hashLoc = path.join(dir, LOCKFILE_HASH_FILE);\n  const newLockHash = etag(await fs.promises.readFile(lockfileLoc, 'utf8'));\n  const oldLockHash = await fs.promises.readFile(hashLoc, 'utf8').catch(() => '');\n  return newLockHash === oldLockHash;\n}\n\nexport async function updateLockfileHash(dir: string) {\n  const lockfileLoc = await findUp(['package-lock.json', 'yarn.lock']);\n  if (!lockfileLoc) {\n    return;\n  }\n  const hashLoc = path.join(dir, LOCKFILE_HASH_FILE);\n  const newLockHash = etag(await fs.promises.readFile(lockfileLoc));\n  await mkdirp(path.dirname(hashLoc));\n  await fs.promises.writeFile(hashLoc, newLockHash);\n}\n\nfunction getAliasType(val: string): 'package' | 'path' | 'url' {\n  if (isRemoteUrl(val)) {\n    return 'url';\n  }\n  return !path.isAbsolute(val) ? 'package' : 'path';\n}\n\n/**\n * For the given import specifier, return an alias entry if one is matched.\n */\nexport function findMatchingAliasEntry(\n  config: SnowpackConfig,\n  spec: string,\n): {from: string; to: string; type: 'package' | 'path' | 'url'} | undefined {\n  // Only match bare module specifiers. relative and absolute imports should not match\n  if (isPathImport(spec) || isRemoteUrl(spec)) {\n    return undefined;\n  }\n\n  for (const [from, to] of Object.entries(config.alias)) {\n    const isExactMatch = spec === from;\n    const isDeepMatch = spec.startsWith(addTrailingSlash(from));\n    if (isExactMatch || isDeepMatch) {\n      return {\n        from,\n        to,\n        type: getAliasType(to),\n      };\n    }\n  }\n}\n\n/**\n * Get the most specific file extension match possible.\n */\nexport function getExtensionMatch(\n  fileName: string,\n  extensionMap: Record<string, string[]>,\n): [string, string[]] | undefined {\n  let extensionPartial;\n  let extensionMatch;\n  // If a full URL is given, start at the basename. Otherwise, start at zero.\n  let extensionMatchIndex = Math.max(0, fileName.lastIndexOf('/'), fileName.lastIndexOf('\\\\'));\n  // Grab expanded file extensions, from longest to shortest.\n  while (!extensionMatch && extensionMatchIndex > -1) {\n    extensionMatchIndex++;\n    extensionMatchIndex = fileName.indexOf('.', extensionMatchIndex);\n    extensionPartial = fileName.substr(extensionMatchIndex).toLowerCase();\n    extensionMatch = extensionMap[extensionPartial];\n  }\n  // Return the first match, if one was found. Otherwise, return undefined.\n  return extensionMatch ? [extensionPartial, extensionMatch] : undefined;\n}\n\nexport function isPathImport(spec: string): boolean {\n  return spec[0] === '.' || spec[0] === '/';\n}\n\nexport function isRemoteUrl(val: string): boolean {\n  return val.startsWith('//') || !!url.parse(val).protocol?.startsWith('http');\n}\n\nexport function isImportOfPackage(importUrl: string, packageName: string) {\n  return packageName === importUrl || importUrl.startsWith(packageName + '/');\n}\n\n/**\n * Sanitizes npm packages that end in .js (e.g `tippy.js` -> `tippyjs`).\n * This is necessary because Snowpack can’t create both a file and directory\n * that end in .js.\n */\nexport function sanitizePackageName(filepath: string): string {\n  const dirs = filepath.split('/');\n  const file = dirs.pop() as string;\n  return [...dirs.map((path) => path.replace(/\\.js$/i, 'js')), file].join('/');\n}\n\n// Source Map spec v3: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.lmz475t4mvbx\n\n/** CSS sourceMappingURL */\nexport function cssSourceMappingURL(code: string, sourceMappingURL: string) {\n  return code + `/*# sourceMappingURL=${sourceMappingURL} */`;\n}\n\n/** JS sourceMappingURL */\nexport function jsSourceMappingURL(code: string, sourceMappingURL: string) {\n  return code.replace(/\\n*$/, '') + `\\n//# sourceMappingURL=${sourceMappingURL}\\n`; // strip ending lines & append source map (with linebreaks for safety)\n}\n\n/** URL relative */\nexport function relativeURL(path1: string, path2: string): string {\n  let url = path.relative(path1, path2).replace(/\\\\/g, '/');\n  if (!url.startsWith('./') && !url.startsWith('../')) {\n    url = './' + url;\n  }\n  return url;\n}\n\nconst CLOSING_HEAD_TAG = /<\\s*\\/\\s*head\\s*>/gi;\n\n/** Append HTML before closing </head> tag */\nexport function appendHtmlToHead(doc: string, htmlToAdd: string) {\n  const closingHeadMatch = doc.match(CLOSING_HEAD_TAG);\n  // if no <head> tag found, throw an error (we can’t load your app properly)\n  if (!closingHeadMatch) {\n    throw new Error(`No <head> tag found in HTML (this is needed to optimize your app):\\n${doc}`);\n  }\n  // if multiple <head> tags found, also freak out\n  if (closingHeadMatch.length > 1) {\n    throw new Error(`Multiple <head> tags found in HTML (perhaps commented out?):\\n${doc}`);\n  }\n  return doc.replace(closingHeadMatch[0], htmlToAdd + closingHeadMatch[0]);\n}\n\nexport function isJavaScript(pathname: string): boolean {\n  const ext = path.extname(pathname).toLowerCase();\n  return ext === '.js' || ext === '.mjs' || ext === '.cjs';\n}\n\nexport function getExtension(str: string) {\n  return path.extname(str).toLowerCase();\n}\n\nexport function hasExtension(str: string, ext: string) {\n  return new RegExp(`\\\\${ext}$`, 'i').test(str);\n}\n\nexport function replaceExtension(fileName: string, oldExt: string, newExt: string): string {\n  const extToReplace = new RegExp(`\\\\${oldExt}$`, 'i');\n  return fileName.replace(extToReplace, newExt);\n}\n\nexport function addExtension(fileName: string, newExt: string): string {\n  return fileName + newExt;\n}\n\nexport function removeExtension(fileName: string, oldExt: string): string {\n  return replaceExtension(fileName, oldExt, '');\n}\n\n/** Add / to beginning of string (but don’t double-up) */\nexport function addLeadingSlash(path: string) {\n  return path.replace(/^\\/?/, '/');\n}\n\n/** Add / to the end of string (but don’t double-up) */\nexport function addTrailingSlash(path: string) {\n  return path.replace(/\\/?$/, '/');\n}\n\n/** Remove \\ and / from beginning of string */\nexport function removeLeadingSlash(path: string) {\n  return path.replace(/^[/\\\\]+/, '');\n}\n\n/** Remove \\ and / from end of string */\nexport function removeTrailingSlash(path: string) {\n  return path.replace(/[/\\\\]+$/, '');\n}\n\n/** It's `Array.splice`, but for Strings! */\nexport function spliceString(source: string, withSlice: string, start: number, end: number) {\n  return source.slice(0, start) + (withSlice || '') + source.slice(end);\n}\n\nexport const HMR_CLIENT_CODE = fs.readFileSync(\n  path.resolve(__dirname, '../../assets/hmr-client.js'),\n  'utf8',\n);\nexport const HMR_OVERLAY_CODE = fs.readFileSync(\n  path.resolve(__dirname, '../../assets/hmr-error-overlay.js'),\n  'utf8',\n);\nexport const INIT_TEMPLATE_FILE = fs.readFileSync(\n  path.resolve(__dirname, '../../assets/snowpack-init-file.js'),\n  'utf8',\n);\n"
  },
  {
    "path": "snowpack/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"module\": \"CommonJS\",\n    \"outDir\": \"lib/cjs\"\n  }\n}\n"
  },
  {
    "path": "snowpack/tsconfig.json",
    "content": "{\n  \"include\": [\"src\", \"assets/require-or-import.ts\"],\n  \"exclude\": [\"lib\"],\n  \"compilerOptions\": {\n    \"outDir\": \"lib/esm\",\n    \"module\": \"ESNext\",\n    \"target\": \"es2018\",\n    \"moduleResolution\": \"node\",\n    \"declaration\": true,\n    \"esModuleInterop\": true,\n    \"strict\": true,\n    \"sourceMap\": false,\n    \"noImplicitAny\": false,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"skipLibCheck\": true\n  }\n}\n"
  },
  {
    "path": "test/build/config-loading-esm-package/config-loading-esm-package.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {setupBuildTest} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'TEST_BUILD_OUT');\n\n// Skip tests on node@10.x (expected to fail)\ndescribe = process.version.startsWith('v10') ? describe.skip : describe;\n\ndescribe('config-loading: detects snowpack.config.js inside of \"type\": \"module\" package', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n\n  it('picks up on configured buildOptions.out', () => {\n    const distJSLoc = path.join(cwd, 'src', 'index.js');\n    expect(fs.existsSync(distJSLoc)).toBe(true); // JS file exists\n\n    const snowpackMetaLoc = path.join(cwd, '_snowpack', 'env.js');\n    expect(fs.existsSync(snowpackMetaLoc)).toBe(true); // snowpack meta exists\n  });\n});\n"
  },
  {
    "path": "test/build/config-loading-esm-package/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"name\": \"@snowpack/test-config-loading-esm-package\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"dependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/config-loading-esm-package/snowpack.config.js",
    "content": "export default {\n  buildOptions: {\n    out: 'TEST_BUILD_OUT',\n  },\n};\n"
  },
  {
    "path": "test/build/config-loading-esm-package/src/index.js",
    "content": "console.log(import.meta.env);\n"
  },
  {
    "path": "test/build/config-loading-mjs/config-loading-mjs.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {setupBuildTest} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'TEST_BUILD_OUT');\n\n// Skip tests on node@10.x (expected to fail)\ndescribe = process.version.startsWith('v10') ? describe.skip : describe;\n\ndescribe('config-loading: detects snowpack.config.mjs', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n\n  it('picks up on configured buildOptions.out', () => {\n    const distJSLoc = path.join(cwd, 'src', 'index.js');\n    expect(fs.existsSync(distJSLoc)).toBe(true); // JS file exists\n\n    const snowpackMetaLoc = path.join(cwd, '_snowpack', 'env.js');\n    expect(fs.existsSync(snowpackMetaLoc)).toBe(true); // snowpack meta exists\n  });\n});\n"
  },
  {
    "path": "test/build/config-loading-mjs/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"name\": \"@snowpack/test-config-loading-mjs\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"dependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/config-loading-mjs/snowpack.config.mjs",
    "content": "export default {\n  buildOptions: {\n    \"out\": \"TEST_BUILD_OUT\"\n  }\n}\n"
  },
  {
    "path": "test/build/config-loading-mjs/src/index.js",
    "content": "console.log(import.meta.env);\n"
  },
  {
    "path": "test/build/config-path/config-path.test.js",
    "content": "const path = require('path');\nconst {setupBuildTest, readFiles} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\nlet files = {};\n\ndescribe('snowpack build --config path', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n\n    files = readFiles(cwd);\n  });\n\n  it('loads correctly', () => {\n    expect(files['/index.js']).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/build/config-path/index.js",
    "content": "export default function () {}\n"
  },
  {
    "path": "test/build/config-path/my-config-file.js",
    "content": "module.exports = {};\n"
  },
  {
    "path": "test/build/config-path/package.json",
    "content": "{\n  \"name\": \"@snowpackjs/test-config-path\",\n  \"description\": \"Passing --config\",\n  \"version\": \"1.0.0\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build --config my-config-file.js\"\n  }\n}\n"
  },
  {
    "path": "test/build/entrypoint-ids/entrypoint-ids.test.js",
    "content": "const os = require('os');\nconst path = require('path');\nconst {setupBuildTest, readFiles} = require('../../test-utils');\n\nconst IMPORTS = ['ansi-styles', 'chalk'];\nconst cwd = path.join(__dirname, 'build');\nlet files = {};\n\ndescribe('core: pkg resolution', () => {\n  beforeAll(() => {\n    const capitalize = os.platform() === 'win32'; // for Windows, we capitalize this one directory to see if Snowpack can still resolve\n    setupBuildTest(capitalize ? __dirname.toUpperCase() : __dirname);\n    files = readFiles(cwd);\n  });\n\n  it('resolves pkg without case-sensitivity', () => {\n    IMPORTS.forEach((i) => {\n      expect(files['/_dist_/index.js']).toEqual(\n        expect.stringContaining(`import '../_snowpack/pkg/${i}.js';`),\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "test/build/entrypoint-ids/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"name\": \"@snowpack/test-entrypoint-ids\",\n  \"description\": \"Tests that a non-canonical cwd works on case-insensitive file systems\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"snowpack\": {\n    \"mount\": {\n      \"./src\": \"/_dist_\"\n    }\n  },\n  \"dependencies\": {\n    \"chalk\": \"4.1.0\",\n    \"ansi-styles\": \"*\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/entrypoint-ids/src/index.js",
    "content": "import 'chalk';\nimport 'ansi-styles';\n"
  },
  {
    "path": "test/build/import-assets/import-assets.test.js",
    "content": "const path = require('path');\nconst {setupBuildTest, readFiles} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\nlet files = {};\n\ndescribe('import resource', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n    files = readFiles(cwd);\n  });\n\n  describe('css', () => {\n    it('proxy is created', () => {\n      expect(files['/_dist_/styles.css.proxy.js']).toEqual(\n        expect.stringContaining(`font-family: fantasy;`),\n      );\n    });\n\n    it('proxy is resolved in JS', () => {\n      expect(files['/_dist_/index.js']).toEqual(\n        expect.stringContaining(`import './styles.css.proxy.js';`),\n      );\n    });\n  });\n\n  describe('image', () => {\n    it('proxy is resolved in JS', () => {\n      expect(files['/_dist_/index.js']).toEqual(\n        expect.stringContaining(`import './logo.png.proxy.js';`),\n      );\n    });\n  });\n\n  describe('os compat', () => {\n    // note: this test isn‘t aware of OS; it’s just something to run in multiple environments\n    it('there are no backslashes anywhere in Windows', () => {\n      expect(files['/_dist_/index.js']).not.toEqual(expect.stringContaining(`\\\\`));\n    });\n  });\n});\n"
  },
  {
    "path": "test/build/import-assets/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-import-css\",\n  \"description\": \"A test to make sure that URLs for resources don’t have backslashes on Windows\",\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"testbuild\": \"snowpack build\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/import-assets/snowpack.config.json",
    "content": "{\n  \"mount\": {\n    \"./src\": \"/_dist_\"\n  }\n}\n"
  },
  {
    "path": "test/build/import-assets/src/index.js",
    "content": "import './styles.css';\nimport './logo.png';\n\nconsole.log('loaded');\n"
  },
  {
    "path": "test/build/import-assets/src/styles.css",
    "content": "body {\n  font-family: fantasy;\n}\n"
  },
  {
    "path": "test/build/package-bootstrap/package-bootstrap.test.js",
    "content": "const path = require('path');\nconst {setupBuildTest, readFiles} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\nlet files = {};\n\ndescribe('package: bootstrap', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n\n    files = readFiles(cwd);\n  });\n\n  it('resolves JS', () => {\n    expect(files['/_dist_/index.js']).toEqual(\n      expect.stringContaining(\n        `import '../_snowpack/pkg/bootstrap/dist/css/bootstrap.min.css.proxy.js';`,\n      ),\n    );\n  });\n});\n"
  },
  {
    "path": "test/build/package-bootstrap/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-package-bootstrap\",\n  \"description\": \"Tests that CSS proxy files are properly imported from _snowpack/pkg\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"snowpack\": {\n    \"mount\": {\n      \"./src\": \"/_dist_\"\n    }\n  },\n  \"dependencies\": {\n    \"bootstrap\": \"^4.5.2\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/package-bootstrap/src/index.js",
    "content": "import 'bootstrap/dist/css/bootstrap.min.css';\n\nconsole.log('CSS added to page!');\n"
  },
  {
    "path": "test/build/package-bootstrap/src/styles.css",
    "content": "@import \"bootstrap/dist/css/bootstrap.min.css\";"
  },
  {
    "path": "test/build/package-workspace/package-workspace.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {setupBuildTest} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\n\ndescribe('test workspace linked packages', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n\n  it('builds source files as expected', () => {\n    const jsLoc = path.join(cwd, '_dist_', 'index.svelte.js');\n    expect(fs.existsSync(jsLoc)).toBe(true); // file exists\n    expect(fs.readFileSync(jsLoc, 'utf-8')).toContain(\n      `../_snowpack/link/test-workspace-component/SvelteComponent.svelte.js`,\n    ); // file has expected imports\n    expect(fs.readFileSync(jsLoc, 'utf-8')).toContain(\n      `../_snowpack/link/test-workspace-component/works-without-extension.js`,\n    ); // file has expected imports\n  });\n\n  it('builds workspace package files as expected', () => {\n    expect(\n      fs.existsSync(\n        path.join(\n          cwd,\n          '_snowpack',\n          'link',\n          'test-workspace-component',\n          'SvelteComponent.svelte.js',\n        ),\n      ),\n    ).toBe(true); // import exists\n    expect(\n      fs.existsSync(\n        path.join(\n          cwd,\n          '_snowpack',\n          'link',\n          'test-workspace-component',\n          'SvelteComponent.svelte.css.proxy.js',\n        ),\n      ),\n    ).toBe(true); // import exists\n  });\n});\n"
  },
  {
    "path": "test/build/package-workspace/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-package-workspace\",\n  \"description\": \"A test to make sure linked packages are supported\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  },\n  \"dependencies\": {\n    \"test-workspace-component\": \"^1.0.0\"\n  }\n}\n"
  },
  {
    "path": "test/build/package-workspace/snowpack.config.js",
    "content": "/** @type {import(\"snowpack\").SnowpackUserConfig } */\nmodule.exports = {\n  workspaceRoot: '../',\n  buildOptions: {\n    out: './build',\n  },\n  mount: {\n    src: '/_dist_',\n  },\n  plugins: [['@snowpack/plugin-svelte']],\n};\n"
  },
  {
    "path": "test/build/package-workspace/src/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <script type=\"module\" src=\"%PUBLIC_URL%/_dist_/index.svelte.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "test/build/package-workspace/src/index.svelte",
    "content": "<style>\n    div {\n        color: red;\n    }\n</style>\n<script>\nimport TestComponent from 'test-workspace-component/SvelteComponent.svelte';\nimport * as tsFile from 'test-workspace-component/works-without-extension';\nimport * as main from 'test-workspace-component';\nconsole.log(tsFile, main);\n</script>\n\n<TestComponent />\n"
  },
  {
    "path": "test/build/plugin-build-script/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-plugin-build-script\",\n  \"description\": \"A test to make sure @snowpack/plugin-build-script works\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.10.5\",\n    \"@snowpack/plugin-build-script\": \"^2.0.0\",\n    \"snowpack\": \"^3.8.8\"\n  },\n  \"dependencies\": {\n    \"@babel/preset-typescript\": \"^7.13.0\"\n  }\n}\n"
  },
  {
    "path": "test/build/plugin-build-script/plugin-build-script.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {setupBuildTest} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\n\ndescribe('@snowpack/plugin-build-script', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n\n  it('runs Babel on TS', () => {\n    const jsLoc = path.join(cwd, '_dist_', 'index.js');\n    expect(fs.existsSync(jsLoc)).toBe(true); // file exists\n    expect(fs.readFileSync(jsLoc, 'utf-8')).toBeTruthy(); // file has content\n  });\n\n  it('doesn’t leave TS in build', () => {\n    const tsLoc = path.join(cwd, '_dist_', 'index.ts');\n    expect(fs.existsSync(tsLoc)).not.toBe(true); // file doesn’t exist\n  });\n});\n"
  },
  {
    "path": "test/build/plugin-build-script/snowpack.config.js",
    "content": "module.exports = {\n  mount: {\n    src: '/_dist_',\n  },\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        input: ['.ts'],\n        output: ['.js'],\n        cmd: 'babel --filename $FILE --presets @babel/preset-typescript',\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "test/build/plugin-build-script/src/index.ts",
    "content": "type stringType = string;\nconst msg: stringType = 'I’m a TypeScript file';\nconsole.log(msg);\n"
  },
  {
    "path": "test/build/plugin-hook-optimize/custom-optimize-plugin.js",
    "content": "const fs = require('fs').promises;\nconst path = require('path');\n\nmodule.exports = function () {\n  return {\n    optimize: async ({buildDirectory}) => {\n      await fs.writeFile(path.join(buildDirectory, 'artifact.txt'), 'TEST: Directory optimized!');\n    },\n  };\n};\n"
  },
  {
    "path": "test/build/plugin-hook-optimize/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-plugin-hook-optimize\",\n  \"description\": \"A test to make sure that the plugin optimize() hook is working as expected\",\n  \"scripts\": {\n    \"start\": \"snowpack dev\",\n    \"testbuild\": \"snowpack build\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-optimize\": \"^0.2.0\",\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/plugin-hook-optimize/plugin-hook-optimize.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst glob = require('glob');\nconst {setupBuildTest} = require('../../test-utils');\n\ndescribe('plugin API: optimize()', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n\n  it('generates artifact.txt', () => {\n    // test 1: artifact.txt doesn’t exist in src\n    const files = glob.sync(path.join(__dirname, 'src'), {nodir: true});\n    expect(files.join(',')).not.toEqual(expect.stringContaining('artifact.txt')); // note: this is a simple check if `artifact.txt` occurs in any part of a filename here\n\n    // test 2: artifact.txt is generated by optimize() plugin hook\n    const artifactLoc = path.join(__dirname, 'build', 'artifact.txt');\n    expect(fs.existsSync(artifactLoc)).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/build/plugin-hook-optimize/snowpack.config.json",
    "content": "{\n  \"mount\": {\n    \"./src\": \"/_dist_\"\n  },\n  \"plugins\": [\"./custom-optimize-plugin.js\"]\n}\n"
  },
  {
    "path": "test/build/plugin-hook-optimize/src/index.js",
    "content": "import './styles.css';\nimport './logo.png';\nimport iconComponent from './icon.svg';\n\nconsole.log('loaded');\n"
  },
  {
    "path": "test/build/plugin-hook-optimize/src/styles.css",
    "content": "body {\n  font-family: fantasy;\n}\n"
  },
  {
    "path": "test/build/plugin-run-script/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-plugin-run-script\",\n  \"description\": \"A test to make sure @snowpack/plugin-run-script works\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-run-script\": \"^2.0.0\",\n    \"sass\": \"^1.26.10\",\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/build/plugin-run-script/plugin-run-script.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {setupBuildTest} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\n\ndescribe('@snowpack/plugin-run-script', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n\n  it('generates .scss -> .css', () => {\n    const css = path.join(cwd, 'css', 'index.css');\n    expect(fs.existsSync(css)).toBe(true); // file exists\n    expect(fs.readFileSync(css, 'utf-8')).toBeTruthy(); // file has content\n  });\n});\n"
  },
  {
    "path": "test/build/plugin-run-script/public/css/index.css",
    "content": "body {\n  font-family: \"fantasy\";\n}\n"
  },
  {
    "path": "test/build/plugin-run-script/snowpack.config.js",
    "content": "module.exports = {\n  mount: {\n    public: '/',\n  },\n  plugins: [\n    [\n      '@snowpack/plugin-run-script',\n      {\n        cmd: 'sass src/css:public/css --no-source-map',\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "test/build/plugin-run-script/src/css/index.scss",
    "content": "$body-font: \"fantasy\";\n\nbody {\n  font-family: $body-font;\n}\n"
  },
  {
    "path": "test/build/prepare-external-package/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"name\": \"@snowpack/test-prepare-external-package\",\n  \"description\": \"Test for packageOptions.external as it applies to prepare.\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack prepare\"\n  },\n  \"snowpack\": {\n    \"mount\": {\n      \"./src\": \"/_dist_\"\n    },\n    \"packageOptions\": {\n      \"external\": [\n        \"fs\",\n        \"vue/types\"\n      ],\n      \"source\": \"local\"\n    }\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  },\n  \"dependencies\": {\n    \"array-flatten\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "test/build/prepare-external-package/prepare-external-package.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {setupBuildTest} = require('../../test-utils');\n\ndescribe('prepare: packageOptions.external', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n  });\n  it('prepare external package', () => {\n    expect(\n      fs.existsSync(path.join(__dirname, 'node_modules/.cache/snowpack/build/array-flatten@3.0.0')),\n    ).toEqual(true);\n    expect(fs.existsSync(path.join(__dirname, 'node_modules/.cache/snowpack/build/fs'))).toEqual(\n      false,\n    );\n    expect(\n      fs.existsSync(path.join(__dirname, 'node_modules/.cache/snowpack/build/vue/types')),\n    ).toEqual(false);\n  });\n});\n"
  },
  {
    "path": "test/build/prepare-external-package/src/index.js",
    "content": "import 'fs';\nimport 'array-flatten';\nimport 'vue/types';\n"
  },
  {
    "path": "test/build/react-lazy-bundle/package.json",
    "content": "{\n  \"name\": \"@snowpackjs/test-react-lazy\",\n  \"description\": \"Tests React Lazy component resolution\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"testbuild\": \"snowpack build\"\n  },\n  \"dependencies\": {\n    \"react\": \"^17.0.2\",\n    \"react-dom\": \"^17.0.2\",\n    \"react-router\": \"^5.2.0\",\n    \"react-router-dom\": \"^5.2.0\"\n  },\n  \"devDependencies\": {\n    \"@snowpack/plugin-react-refresh\": \"^2.5.0\",\n    \"@snowpack/plugin-sass\": \"^1.4.0\",\n    \"snowpack\": \"^3.3.2\"\n  }\n}\n"
  },
  {
    "path": "test/build/react-lazy-bundle/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>React Lazy Test</title>\n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <script src=\"/dist/index.js\" type=\"module\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "test/build/react-lazy-bundle/react-lazy.test.js",
    "content": "const path = require('path');\nconst {setupBuildTest, readFiles} = require('../../test-utils');\n\nconst cwd = path.join(__dirname, 'build');\nlet files = {};\n\ndescribe('package: bootstrap', () => {\n  beforeAll(() => {\n    setupBuildTest(__dirname);\n\n    files = readFiles(cwd);\n  });\n\n  it('transforms relative URLs correctly', () => {\n    // The original bug was that when setting bundle: true, URLs were incorrectly transformed.\n    // This tests that `//dist/components//Articles.js` doesn’t happen anymore.\n\n    expect(files['/dist/index.js']).toEqual(\n      expect.stringContaining(`lazy(()=>import(\"./components/Articles.js\")`),\n    );\n  });\n});\n"
  },
  {
    "path": "test/build/react-lazy-bundle/snowpack.config.js",
    "content": "module.exports = {\n  mount: {\n    public: {url: '/', static: true, resolve: false},\n    src: {url: '/dist'},\n  },\n  optimize: {\n    bundle: true,\n    minify: true,\n    sourcemap: true,\n    splitting: true,\n    treeshake: true,\n    target: 'safari11',\n  },\n  plugins: ['@snowpack/plugin-sass', '@snowpack/plugin-react-refresh'],\n};\n"
  },
  {
    "path": "test/build/react-lazy-bundle/src/components/App.jsx",
    "content": "import React from 'react';\n\nfunction App({children}) {\n  return <div id=\"app\">{children}</div>;\n}\nexport default App;\n"
  },
  {
    "path": "test/build/react-lazy-bundle/src/components/Articles.jsx",
    "content": "import React from 'react';\n\nfunction Articles() {\n  return <h1>Articles</h1>;\n}\n\nexport default Articles;\n"
  },
  {
    "path": "test/build/react-lazy-bundle/src/index.jsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {BrowserRouter as Router, Route, Switch} from 'react-router-dom';\nimport App from './components/App';\n\nconst Articles = React.lazy(() => import('./components/Articles'));\n\nReactDOM.render(\n  <React.StrictMode>\n    <Router>\n      <Switch>\n        <Route exact path=\"/\">\n          <App layout=\"fullPage\">\n            <Articles />\n          </App>\n        </Route>\n      </Switch>\n    </Router>\n  </React.StrictMode>,\n  document.querySelector('#app'),\n);\n"
  },
  {
    "path": "test/build/test-workspace-component/Layout.ts",
    "content": "export const bob = 42;\n"
  },
  {
    "path": "test/build/test-workspace-component/README.md",
    "content": "# test-workspace-component\n\nThis is a test component for the workspace that lets us test symlink support. It is private, not published, and should not ever be needed outside of testing."
  },
  {
    "path": "test/build/test-workspace-component/SvelteComponent.svelte",
    "content": "\n<script>\n</script>\n\n<style>\n  div {\n    color: red;\n  }\n</style>\n\n<div class=\"SvelteComponent\">\n  Hello! This is a test component!\n</div>\n"
  },
  {
    "path": "test/build/test-workspace-component/index.mjs",
    "content": "export * from './Layout'\n\nexport function testComponent() {\n  return 42;\n}"
  },
  {
    "path": "test/build/test-workspace-component/package.json",
    "content": "{\n  \"name\": \"test-workspace-component\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"index.mjs\",\n  \"dependencies\": {\n    \"canvas-confetti\": \"^1.2.0\"\n  }\n}\n"
  },
  {
    "path": "test/build/test-workspace-component/works-without-extension.ts",
    "content": "export function testFn() {\n  return 42 as number;\n}\n"
  },
  {
    "path": "test/create-snowpack-app/__snapshots__/create-snowpack-app.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`create-snowpack-app app-template-11ty > build: _snowpack/pkg/canvas-confetti.js 1`] = `\n\"var module = {};\n(function main(global, module2, isWorker, workerSize) {\n  var canUseWorker = !!(global.Worker && global.Blob && global.Promise && global.OffscreenCanvas && global.OffscreenCanvasRenderingContext2D && global.HTMLCanvasElement && global.HTMLCanvasElement.prototype.transferControlToOffscreen && global.URL && global.URL.createObjectURL);\n  function noop() {\n  }\n  function promise(func) {\n    var ModulePromise = module2.exports.Promise;\n    var Prom = ModulePromise !== void 0 ? ModulePromise : global.Promise;\n    if (typeof Prom === \\\\\"function\\\\\") {\n      return new Prom(func);\n    }\n    func(noop, noop);\n    return null;\n  }\n  var raf = function() {\n    var TIME = Math.floor(1e3 / 60);\n    var frame, cancel;\n    var frames = {};\n    var lastFrameTime = 0;\n    if (typeof requestAnimationFrame === \\\\\"function\\\\\" && typeof cancelAnimationFrame === \\\\\"function\\\\\") {\n      frame = function(cb) {\n        var id = Math.random();\n        frames[id] = requestAnimationFrame(function onFrame(time) {\n          if (lastFrameTime === time || lastFrameTime + TIME - 1 < time) {\n            lastFrameTime = time;\n            delete frames[id];\n            cb();\n          } else {\n            frames[id] = requestAnimationFrame(onFrame);\n          }\n        });\n        return id;\n      };\n      cancel = function(id) {\n        if (frames[id]) {\n          cancelAnimationFrame(frames[id]);\n        }\n      };\n    } else {\n      frame = function(cb) {\n        return setTimeout(cb, TIME);\n      };\n      cancel = function(timer) {\n        return clearTimeout(timer);\n      };\n    }\n    return {frame, cancel};\n  }();\n  var getWorker = function() {\n    var worker;\n    var prom;\n    var resolves = {};\n    function decorate(worker2) {\n      function execute(options, callback) {\n        worker2.postMessage({options: options || {}, callback});\n      }\n      worker2.init = function initWorker(canvas) {\n        var offscreen = canvas.transferControlToOffscreen();\n        worker2.postMessage({canvas: offscreen}, [offscreen]);\n      };\n      worker2.fire = function fireWorker(options, size, done) {\n        if (prom) {\n          execute(options, null);\n          return prom;\n        }\n        var id = Math.random().toString(36).slice(2);\n        prom = promise(function(resolve) {\n          function workerDone(msg) {\n            if (msg.data.callback !== id) {\n              return;\n            }\n            delete resolves[id];\n            worker2.removeEventListener(\\\\\"message\\\\\", workerDone);\n            prom = null;\n            done();\n            resolve();\n          }\n          worker2.addEventListener(\\\\\"message\\\\\", workerDone);\n          execute(options, id);\n          resolves[id] = workerDone.bind(null, {data: {callback: id}});\n        });\n        return prom;\n      };\n      worker2.reset = function resetWorker() {\n        worker2.postMessage({reset: true});\n        for (var id in resolves) {\n          resolves[id]();\n          delete resolves[id];\n        }\n      };\n    }\n    return function() {\n      if (worker) {\n        return worker;\n      }\n      if (!isWorker && canUseWorker) {\n        var code = [\n          \\\\\"var CONFETTI, SIZE = {}, module = {};\\\\\",\n          \\\\\"(\\\\\" + main.toString() + \\\\\")(this, module, true, SIZE);\\\\\",\n          \\\\\"onmessage = function(msg) {\\\\\",\n          \\\\\"  if (msg.data.options) {\\\\\",\n          \\\\\"    CONFETTI(msg.data.options).then(function () {\\\\\",\n          \\\\\"      if (msg.data.callback) {\\\\\",\n          \\\\\"        postMessage({ callback: msg.data.callback });\\\\\",\n          \\\\\"      }\\\\\",\n          \\\\\"    });\\\\\",\n          \\\\\"  } else if (msg.data.reset) {\\\\\",\n          \\\\\"    CONFETTI.reset();\\\\\",\n          \\\\\"  } else if (msg.data.resize) {\\\\\",\n          \\\\\"    SIZE.width = msg.data.resize.width;\\\\\",\n          \\\\\"    SIZE.height = msg.data.resize.height;\\\\\",\n          \\\\\"  } else if (msg.data.canvas) {\\\\\",\n          \\\\\"    SIZE.width = msg.data.canvas.width;\\\\\",\n          \\\\\"    SIZE.height = msg.data.canvas.height;\\\\\",\n          \\\\\"    CONFETTI = module.exports.create(msg.data.canvas);\\\\\",\n          \\\\\"  }\\\\\",\n          \\\\\"}\\\\\"\n        ].join(\\\\\"\\\\\");\n        try {\n          worker = new Worker(URL.createObjectURL(new Blob([code])));\n        } catch (e) {\n          typeof console !== void 0 && typeof console.warn === \\\\\"function\\\\\" ? console.warn(\\\\\"🎊 Could not load worker\\\\\", e) : null;\n          return null;\n        }\n        decorate(worker);\n      }\n      return worker;\n    };\n  }();\n  var defaults = {\n    particleCount: 50,\n    angle: 90,\n    spread: 45,\n    startVelocity: 45,\n    decay: 0.9,\n    gravity: 1,\n    drift: 0,\n    ticks: 200,\n    x: 0.5,\n    y: 0.5,\n    shapes: [\\\\\"square\\\\\", \\\\\"circle\\\\\"],\n    zIndex: 100,\n    colors: [\n      \\\\\"#26ccff\\\\\",\n      \\\\\"#a25afd\\\\\",\n      \\\\\"#ff5e7e\\\\\",\n      \\\\\"#88ff5a\\\\\",\n      \\\\\"#fcff42\\\\\",\n      \\\\\"#ffa62d\\\\\",\n      \\\\\"#ff36ff\\\\\"\n    ],\n    disableForReducedMotion: false,\n    scalar: 1\n  };\n  function convert(val, transform) {\n    return transform ? transform(val) : val;\n  }\n  function isOk(val) {\n    return !(val === null || val === void 0);\n  }\n  function prop(options, name, transform) {\n    return convert(options && isOk(options[name]) ? options[name] : defaults[name], transform);\n  }\n  function onlyPositiveInt(number) {\n    return number < 0 ? 0 : Math.floor(number);\n  }\n  function randomInt(min, max) {\n    return Math.floor(Math.random() * (max - min)) + min;\n  }\n  function toDecimal(str) {\n    return parseInt(str, 16);\n  }\n  function colorsToRgb(colors) {\n    return colors.map(hexToRgb);\n  }\n  function hexToRgb(str) {\n    var val = String(str).replace(/[^0-9a-f]/gi, \\\\\"\\\\\");\n    if (val.length < 6) {\n      val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\n    }\n    return {\n      r: toDecimal(val.substring(0, 2)),\n      g: toDecimal(val.substring(2, 4)),\n      b: toDecimal(val.substring(4, 6))\n    };\n  }\n  function getOrigin(options) {\n    var origin = prop(options, \\\\\"origin\\\\\", Object);\n    origin.x = prop(origin, \\\\\"x\\\\\", Number);\n    origin.y = prop(origin, \\\\\"y\\\\\", Number);\n    return origin;\n  }\n  function setCanvasWindowSize(canvas) {\n    canvas.width = document.documentElement.clientWidth;\n    canvas.height = document.documentElement.clientHeight;\n  }\n  function setCanvasRectSize(canvas) {\n    var rect = canvas.getBoundingClientRect();\n    canvas.width = rect.width;\n    canvas.height = rect.height;\n  }\n  function getCanvas(zIndex) {\n    var canvas = document.createElement(\\\\\"canvas\\\\\");\n    canvas.style.position = \\\\\"fixed\\\\\";\n    canvas.style.top = \\\\\"0px\\\\\";\n    canvas.style.left = \\\\\"0px\\\\\";\n    canvas.style.pointerEvents = \\\\\"none\\\\\";\n    canvas.style.zIndex = zIndex;\n    return canvas;\n  }\n  function ellipse(context, x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) {\n    context.save();\n    context.translate(x, y);\n    context.rotate(rotation);\n    context.scale(radiusX, radiusY);\n    context.arc(0, 0, 1, startAngle, endAngle, antiClockwise);\n    context.restore();\n  }\n  function randomPhysics(opts) {\n    var radAngle = opts.angle * (Math.PI / 180);\n    var radSpread = opts.spread * (Math.PI / 180);\n    return {\n      x: opts.x,\n      y: opts.y,\n      wobble: Math.random() * 10,\n      velocity: opts.startVelocity * 0.5 + Math.random() * opts.startVelocity,\n      angle2D: -radAngle + (0.5 * radSpread - Math.random() * radSpread),\n      tiltAngle: Math.random() * Math.PI,\n      color: opts.color,\n      shape: opts.shape,\n      tick: 0,\n      totalTicks: opts.ticks,\n      decay: opts.decay,\n      drift: opts.drift,\n      random: Math.random() + 5,\n      tiltSin: 0,\n      tiltCos: 0,\n      wobbleX: 0,\n      wobbleY: 0,\n      gravity: opts.gravity * 3,\n      ovalScalar: 0.6,\n      scalar: opts.scalar\n    };\n  }\n  function updateFetti(context, fetti) {\n    fetti.x += Math.cos(fetti.angle2D) * fetti.velocity + fetti.drift;\n    fetti.y += Math.sin(fetti.angle2D) * fetti.velocity + fetti.gravity;\n    fetti.wobble += 0.1;\n    fetti.velocity *= fetti.decay;\n    fetti.tiltAngle += 0.1;\n    fetti.tiltSin = Math.sin(fetti.tiltAngle);\n    fetti.tiltCos = Math.cos(fetti.tiltAngle);\n    fetti.random = Math.random() + 5;\n    fetti.wobbleX = fetti.x + 10 * fetti.scalar * Math.cos(fetti.wobble);\n    fetti.wobbleY = fetti.y + 10 * fetti.scalar * Math.sin(fetti.wobble);\n    var progress = fetti.tick++ / fetti.totalTicks;\n    var x1 = fetti.x + fetti.random * fetti.tiltCos;\n    var y1 = fetti.y + fetti.random * fetti.tiltSin;\n    var x2 = fetti.wobbleX + fetti.random * fetti.tiltCos;\n    var y2 = fetti.wobbleY + fetti.random * fetti.tiltSin;\n    context.fillStyle = \\\\\"rgba(\\\\\" + fetti.color.r + \\\\\", \\\\\" + fetti.color.g + \\\\\", \\\\\" + fetti.color.b + \\\\\", \\\\\" + (1 - progress) + \\\\\")\\\\\";\n    context.beginPath();\n    if (fetti.shape === \\\\\"circle\\\\\") {\n      context.ellipse ? context.ellipse(fetti.x, fetti.y, Math.abs(x2 - x1) * fetti.ovalScalar, Math.abs(y2 - y1) * fetti.ovalScalar, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI) : ellipse(context, fetti.x, fetti.y, Math.abs(x2 - x1) * fetti.ovalScalar, Math.abs(y2 - y1) * fetti.ovalScalar, Math.PI / 10 * fetti.wobble, 0, 2 * Math.PI);\n    } else {\n      context.moveTo(Math.floor(fetti.x), Math.floor(fetti.y));\n      context.lineTo(Math.floor(fetti.wobbleX), Math.floor(y1));\n      context.lineTo(Math.floor(x2), Math.floor(y2));\n      context.lineTo(Math.floor(x1), Math.floor(fetti.wobbleY));\n    }\n    context.closePath();\n    context.fill();\n    return fetti.tick < fetti.totalTicks;\n  }\n  function animate(canvas, fettis, resizer, size, done) {\n    var animatingFettis = fettis.slice();\n    var context = canvas.getContext(\\\\\"2d\\\\\");\n    var animationFrame;\n    var destroy;\n    var prom = promise(function(resolve) {\n      function onDone() {\n        animationFrame = destroy = null;\n        context.clearRect(0, 0, size.width, size.height);\n        done();\n        resolve();\n      }\n      function update() {\n        if (isWorker && !(size.width === workerSize.width && size.height === workerSize.height)) {\n          size.width = canvas.width = workerSize.width;\n          size.height = canvas.height = workerSize.height;\n        }\n        if (!size.width && !size.height) {\n          resizer(canvas);\n          size.width = canvas.width;\n          size.height = canvas.height;\n        }\n        context.clearRect(0, 0, size.width, size.height);\n        animatingFettis = animatingFettis.filter(function(fetti) {\n          return updateFetti(context, fetti);\n        });\n        if (animatingFettis.length) {\n          animationFrame = raf.frame(update);\n        } else {\n          onDone();\n        }\n      }\n      animationFrame = raf.frame(update);\n      destroy = onDone;\n    });\n    return {\n      addFettis: function(fettis2) {\n        animatingFettis = animatingFettis.concat(fettis2);\n        return prom;\n      },\n      canvas,\n      promise: prom,\n      reset: function() {\n        if (animationFrame) {\n          raf.cancel(animationFrame);\n        }\n        if (destroy) {\n          destroy();\n        }\n      }\n    };\n  }\n  function confettiCannon(canvas, globalOpts) {\n    var isLibCanvas = !canvas;\n    var allowResize = !!prop(globalOpts || {}, \\\\\"resize\\\\\");\n    var globalDisableForReducedMotion = prop(globalOpts, \\\\\"disableForReducedMotion\\\\\", Boolean);\n    var shouldUseWorker = canUseWorker && !!prop(globalOpts || {}, \\\\\"useWorker\\\\\");\n    var worker = shouldUseWorker ? getWorker() : null;\n    var resizer = isLibCanvas ? setCanvasWindowSize : setCanvasRectSize;\n    var initialized = canvas && worker ? !!canvas.__confetti_initialized : false;\n    var preferLessMotion = typeof matchMedia === \\\\\"function\\\\\" && matchMedia(\\\\\"(prefers-reduced-motion)\\\\\").matches;\n    var animationObj;\n    function fireLocal(options, size, done) {\n      var particleCount = prop(options, \\\\\"particleCount\\\\\", onlyPositiveInt);\n      var angle = prop(options, \\\\\"angle\\\\\", Number);\n      var spread = prop(options, \\\\\"spread\\\\\", Number);\n      var startVelocity = prop(options, \\\\\"startVelocity\\\\\", Number);\n      var decay = prop(options, \\\\\"decay\\\\\", Number);\n      var gravity = prop(options, \\\\\"gravity\\\\\", Number);\n      var drift = prop(options, \\\\\"drift\\\\\", Number);\n      var colors = prop(options, \\\\\"colors\\\\\", colorsToRgb);\n      var ticks = prop(options, \\\\\"ticks\\\\\", Number);\n      var shapes = prop(options, \\\\\"shapes\\\\\");\n      var scalar = prop(options, \\\\\"scalar\\\\\");\n      var origin = getOrigin(options);\n      var temp = particleCount;\n      var fettis = [];\n      var startX = canvas.width * origin.x;\n      var startY = canvas.height * origin.y;\n      while (temp--) {\n        fettis.push(randomPhysics({\n          x: startX,\n          y: startY,\n          angle,\n          spread,\n          startVelocity,\n          color: colors[temp % colors.length],\n          shape: shapes[randomInt(0, shapes.length)],\n          ticks,\n          decay,\n          gravity,\n          drift,\n          scalar\n        }));\n      }\n      if (animationObj) {\n        return animationObj.addFettis(fettis);\n      }\n      animationObj = animate(canvas, fettis, resizer, size, done);\n      return animationObj.promise;\n    }\n    function fire(options) {\n      var disableForReducedMotion = globalDisableForReducedMotion || prop(options, \\\\\"disableForReducedMotion\\\\\", Boolean);\n      var zIndex = prop(options, \\\\\"zIndex\\\\\", Number);\n      if (disableForReducedMotion && preferLessMotion) {\n        return promise(function(resolve) {\n          resolve();\n        });\n      }\n      if (isLibCanvas && animationObj) {\n        canvas = animationObj.canvas;\n      } else if (isLibCanvas && !canvas) {\n        canvas = getCanvas(zIndex);\n        document.body.appendChild(canvas);\n      }\n      if (allowResize && !initialized) {\n        resizer(canvas);\n      }\n      var size = {\n        width: canvas.width,\n        height: canvas.height\n      };\n      if (worker && !initialized) {\n        worker.init(canvas);\n      }\n      initialized = true;\n      if (worker) {\n        canvas.__confetti_initialized = true;\n      }\n      function onResize() {\n        if (worker) {\n          var obj = {\n            getBoundingClientRect: function() {\n              if (!isLibCanvas) {\n                return canvas.getBoundingClientRect();\n              }\n            }\n          };\n          resizer(obj);\n          worker.postMessage({\n            resize: {\n              width: obj.width,\n              height: obj.height\n            }\n          });\n          return;\n        }\n        size.width = size.height = null;\n      }\n      function done() {\n        animationObj = null;\n        if (allowResize) {\n          global.removeEventListener(\\\\\"resize\\\\\", onResize);\n        }\n        if (isLibCanvas && canvas) {\n          document.body.removeChild(canvas);\n          canvas = null;\n          initialized = false;\n        }\n      }\n      if (allowResize) {\n        global.addEventListener(\\\\\"resize\\\\\", onResize, false);\n      }\n      if (worker) {\n        return worker.fire(options, size, done);\n      }\n      return fireLocal(options, size, done);\n    }\n    fire.reset = function() {\n      if (worker) {\n        worker.reset();\n      }\n      if (animationObj) {\n        animationObj.reset();\n      }\n    };\n    return fire;\n  }\n  module2.exports = confettiCannon(null, {useWorker: true, resize: true});\n  module2.exports.create = confettiCannon;\n})(function() {\n  if (typeof window !== \\\\\"undefined\\\\\") {\n    return window;\n  }\n  if (typeof self !== \\\\\"undefined\\\\\") {\n    return self;\n  }\n  return this || {};\n}(), module, false);\nvar __pika_web_default_export_for_treeshaking__ = module.exports;\nvar create = module.exports.create;\nexport default __pika_web_default_export_for_treeshaking__;\"\n`;\n\nexports[`create-snowpack-app app-template-11ty > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"canvas-confetti\\\\\": \\\\\"./canvas-XXXXXXXX.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-11ty > build: about/index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/static/favicon.png\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/static/index.css\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div class=\\\\\"banner\\\\\">\n      <img height=\\\\\"128px\\\\\" style=\\\\\"padding-right: 0\\\\\" id=\\\\\"img\\\\\" src=\\\\\"/static/logo.svg\\\\\" />\n      <svg height=\\\\\"32px\\\\\" aria-hidden=\\\\\"true\\\\\" focusable=\\\\\"false\\\\\" data-prefix=\\\\\"fas\\\\\" data-icon=\\\\\"plus\\\\\" class=\\\\\"svg-inline--fa fa-plus fa-w-14\\\\\" role=\\\\\"img\\\\\" xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 448 512\\\\\"><path fill=\\\\\"currentColor\\\\\" d=\\\\\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\\\\\"></path></svg>\n      <svg height=\\\\\"64px\\\\\" style=\\\\\"padding-left: 8px;\\\\\" viewBox=\\\\\"0 0 640 512\\\\\" version=\\\\\"1.1\\\\\" xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" xmlns:xlink=\\\\\"http://www.w3.org/1999/xlink\\\\\">\n        <g id=\\\\\"Page-1\\\\\" stroke=\\\\\"none\\\\\" stroke-width=\\\\\"1\\\\\" fill=\\\\\"currentColor\\\\\" fill-rule=\\\\\"evenodd\\\\\">\n            <g id=\\\\\"mountain-solid\\\\\" transform=\\\\\"translate(-1.000000, 0.000000)\\\\\" fill-rule=\\\\\"nonzero\\\\\">\n                <path d=\\\\\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\\\\\" id=\\\\\"Shape\\\\\"></path>\n            </g>\n        </g>\n      </svg>\n    </div>\n    <h1>About</h1>\n<p><a href=\\\\\"https://www.11ty.dev/\\\\\">11ty</a>, powered by <a href=\\\\\"http://snowpack.dev/\\\\\">Snowpack</a>.</p>\n<br/>\n<p><a href=\\\\\"/\\\\\">Back to Home</a></p>\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-11ty > build: allFiles 1`] = `\nArray [\n  \"_snowpack/pkg/canvas-confetti.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"about/index.html\",\n  \"dist/index.js\",\n  \"index.html\",\n  \"static/favicon.png\",\n  \"static/index.css\",\n  \"static/logo.svg\",\n]\n`;\n\nexports[`create-snowpack-app app-template-11ty > build: dist/index.js 1`] = `\n\"/**\n * This file is just a silly example to show everything working in the browser.\n * When you're ready to start on your site, clear the file. Happy hacking!\n **/\nimport confetti from '../_snowpack/pkg/canvas-XXXXXXXX.js';\nconfetti.create(document.getElementById('canvas'), {\n  resize: true,\n  useWorker: true,\n})({ particleCount: 200, spread: 200 });\"\n`;\n\nexports[`create-snowpack-app app-template-11ty > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/static/favicon.png\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/static/index.css\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div class=\\\\\"banner\\\\\">\n      <img height=\\\\\"128px\\\\\" style=\\\\\"padding-right: 0\\\\\" id=\\\\\"img\\\\\" src=\\\\\"/static/logo.svg\\\\\" />\n      <svg height=\\\\\"32px\\\\\" aria-hidden=\\\\\"true\\\\\" focusable=\\\\\"false\\\\\" data-prefix=\\\\\"fas\\\\\" data-icon=\\\\\"plus\\\\\" class=\\\\\"svg-inline--fa fa-plus fa-w-14\\\\\" role=\\\\\"img\\\\\" xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 448 512\\\\\"><path fill=\\\\\"currentColor\\\\\" d=\\\\\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\\\\\"></path></svg>\n      <svg height=\\\\\"64px\\\\\" style=\\\\\"padding-left: 8px;\\\\\" viewBox=\\\\\"0 0 640 512\\\\\" version=\\\\\"1.1\\\\\" xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" xmlns:xlink=\\\\\"http://www.w3.org/1999/xlink\\\\\">\n        <g id=\\\\\"Page-1\\\\\" stroke=\\\\\"none\\\\\" stroke-width=\\\\\"1\\\\\" fill=\\\\\"currentColor\\\\\" fill-rule=\\\\\"evenodd\\\\\">\n            <g id=\\\\\"mountain-solid\\\\\" transform=\\\\\"translate(-1.000000, 0.000000)\\\\\" fill-rule=\\\\\"nonzero\\\\\">\n                <path d=\\\\\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\\\\\" id=\\\\\"Shape\\\\\"></path>\n            </g>\n        </g>\n      </svg>\n    </div>\n<canvas id=\\\\\"canvas\\\\\"></canvas>\n<script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n<a href=\\\\\"/about\\\\\">About Page</a>\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-11ty > build: static/index.css 1`] = `\n\"body {\n  background: #222;\n  color: #eee;\n  font-family: Arial, Helvetica, sans-serif;\n  text-align: center;\n}\na {\n  color: #aaa;\n}\n.banner {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.banner img,\n.banner svg {\n  display: block;\n  padding: 1.5rem;\n}\n#canvas {\n  display: block;\n  margin: 0rem auto;\n  width: 720px;\n  height: 420px;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-blank > build: allFiles 1`] = `\nArray [\n  \"dist/index.css\",\n  \"dist/index.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"logo.svg\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-blank > build: dist/index.css 1`] = `\n\"body {\n  font-size: calc(10px + 2vmin);\n  font-family: Arial, Helvetica, sans-serif;\n}\n#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\np {\n  display: block;\n  margin: 1rem auto;\n  text-align: center;\n}\n#counter {\n  background-color: rgb(46, 94, 130);\n  color: white;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\na {\n  color: rgb(46, 94, 130);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-blank > build: dist/index.js 1`] = `\n\"const counter = document.querySelector('#counter');\nlet seconds = 0;\nsetInterval(() => {\n  seconds += 1;\n  counter.textContent = seconds;\n}, 1000);\"\n`;\n\nexports[`create-snowpack-app app-template-blank > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/dist/index.css\\\\\" />\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\" defer></script>\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\\\\\"img\\\\\" src=\\\\\"/logo.svg\\\\\" />\n    <p>Page has been open for <code id=\\\\\"counter\\\\\">0</code> seconds.</p>\n    <p>\n      <a href=\\\\\"https://developer.mozilla.org/en-US/docs/Learn\\\\\">\n        Learn web development\n      </a>\n    </p>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <!--\n      This HTML file is a template.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-blank-typescript > build: allFiles 1`] = `\nArray [\n  \"dist/index.css\",\n  \"dist/index.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"logo.svg\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-blank-typescript > build: dist/index.css 1`] = `\n\"body {\n  font-size: calc(10px + 2vmin);\n  font-family: Arial, Helvetica, sans-serif;\n}\n#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\np {\n  display: block;\n  margin: 1rem auto;\n  text-align: center;\n}\n#counter {\n  background-color: rgb(46, 94, 130);\n  color: white;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\na {\n  color: rgb(46, 94, 130);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-blank-typescript > build: dist/index.js 1`] = `\n\"const counter = document.querySelector(\\\\\"#counter\\\\\");\nlet seconds = 0;\nsetInterval(() => {\n  seconds += 1;\n  counter.textContent = seconds.toString();\n}, 1e3);\nexport {};\"\n`;\n\nexports[`create-snowpack-app app-template-blank-typescript > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/dist/index.css\\\\\" />\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\" defer></script>\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\\\\\"img\\\\\" src=\\\\\"/logo.svg\\\\\" />\n    <p>Page has been open for <code id=\\\\\"counter\\\\\">0</code> seconds.</p>\n    <p>\n      <a href=\\\\\"https://developer.mozilla.org/en-US/docs/Learn\\\\\">\n        Learn web development\n      </a>\n    </p>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <!--\n      This HTML file is a template.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"lit-element\\\\\": \\\\\"./lit-element.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element > build: _snowpack/pkg/lit-element.js 1`] = `\n\"/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * True if the custom elements polyfill is in use.\n */\nconst isCEPolyfill = typeof window !== 'undefined' && window.customElements != null && window.customElements.polyfillWrapFlushCallback !== undefined;\n/**\n * Removes nodes, starting from \\`start\\` (inclusive) to \\`end\\` (exclusive), from\n * \\`container\\`.\n */\nconst removeNodes = (container, start, end = null) => {\n  while (start !== end) {\n    const n = start.nextSibling;\n    container.removeChild(start);\n    start = n;\n  }\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nconst marker = \\`{{lit-\\${String(Math.random()).slice(2)}}}\\`;\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nconst nodeMarker = \\`<!--\\${marker}-->\\`;\nconst markerRegex = new RegExp(\\`\\${marker}|\\${nodeMarker}\\`);\n/**\n * Suffix appended to all bound attribute names.\n */\nconst boundAttributeSuffix = '$lit$';\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nclass Template {\n  constructor(result, element) {\n    this.parts = [];\n    this.element = element;\n    const nodesToRemove = [];\n    const stack = []; // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n    const walker = document.createTreeWalker(element.content, 133\n    , null, false); // Keeps track of the last index associated with a part. We try to delete\n    // unnecessary nodes, but we never want to associate two different parts\n    // to the same index. They must have a constant node between.\n    let lastPartIndex = 0;\n    let index = -1;\n    let partIndex = 0;\n    const {\n      strings,\n      values: {\n        length\n      }\n    } = result;\n    while (partIndex < length) {\n      const node = walker.nextNode();\n      if (node === null) {\n        // We've exhausted the content inside a nested template element.\n        // Because we still have parts (the outer for-loop), we know:\n        // - There is a template in the stack\n        // - The walker will find a nextNode outside the template\n        walker.currentNode = stack.pop();\n        continue;\n      }\n      index++;\n      if (node.nodeType === 1\n      ) {\n          if (node.hasAttributes()) {\n            const attributes = node.attributes;\n            const {\n              length\n            } = attributes; // Per\n            // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n            // attributes are not guaranteed to be returned in document order.\n            // In particular, Edge/IE can return them out of order, so we cannot\n            // assume a correspondence between part index and attribute index.\n            let count = 0;\n            for (let i = 0; i < length; i++) {\n              if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n                count++;\n              }\n            }\n            while (count-- > 0) {\n              // Get the template literal section leading up to the first\n              // expression in this attribute\n              const stringForPart = strings[partIndex]; // Find the attribute name\n              const name = lastAttributeNameRegex.exec(stringForPart)[2]; // Find the corresponding attribute\n              // All bound attributes have had a suffix added in\n              // TemplateResult#getHTML to opt out of special attribute\n              // handling. To look up the attribute value we also need to add\n              // the suffix.\n              const attributeLookupName = name.toLowerCase() + boundAttributeSuffix;\n              const attributeValue = node.getAttribute(attributeLookupName);\n              node.removeAttribute(attributeLookupName);\n              const statics = attributeValue.split(markerRegex);\n              this.parts.push({\n                type: 'attribute',\n                index,\n                name,\n                strings: statics\n              });\n              partIndex += statics.length - 1;\n            }\n          }\n          if (node.tagName === 'TEMPLATE') {\n            stack.push(node);\n            walker.currentNode = node.content;\n          }\n        } else if (node.nodeType === 3\n      ) {\n          const data = node.data;\n          if (data.indexOf(marker) >= 0) {\n            const parent = node.parentNode;\n            const strings = data.split(markerRegex);\n            const lastIndex = strings.length - 1; // Generate a new text node for each literal section\n            // These nodes are also used as the markers for node parts\n            for (let i = 0; i < lastIndex; i++) {\n              let insert;\n              let s = strings[i];\n              if (s === '') {\n                insert = createMarker();\n              } else {\n                const match = lastAttributeNameRegex.exec(s);\n                if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n                  s = s.slice(0, match.index) + match[1] + match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n                }\n                insert = document.createTextNode(s);\n              }\n              parent.insertBefore(insert, node);\n              this.parts.push({\n                type: 'node',\n                index: ++index\n              });\n            } // If there's no text, we must insert a comment to mark our place.\n            // Else, we can trust it will stick around after cloning.\n            if (strings[lastIndex] === '') {\n              parent.insertBefore(createMarker(), node);\n              nodesToRemove.push(node);\n            } else {\n              node.data = strings[lastIndex];\n            } // We have a part for each match found\n            partIndex += lastIndex;\n          }\n        } else if (node.nodeType === 8\n      ) {\n          if (node.data === marker) {\n            const parent = node.parentNode; // Add a new marker node to be the startNode of the Part if any of\n            // the following are true:\n            //  * We don't have a previousSibling\n            //  * The previousSibling is already the start of a previous part\n            if (node.previousSibling === null || index === lastPartIndex) {\n              index++;\n              parent.insertBefore(createMarker(), node);\n            }\n            lastPartIndex = index;\n            this.parts.push({\n              type: 'node',\n              index\n            }); // If we don't have a nextSibling, keep this node so we have an end.\n            // Else, we can remove it to save future costs.\n            if (node.nextSibling === null) {\n              node.data = '';\n            } else {\n              nodesToRemove.push(node);\n              index--;\n            }\n            partIndex++;\n          } else {\n            let i = -1;\n            while ((i = node.data.indexOf(marker, i + 1)) !== -1) {\n              // Comment node has a binding marker inside, make an inactive part\n              // The binding won't work, but subsequent bindings will\n              // TODO (justinfagnani): consider whether it's even worth it to\n              // make bindings in comments work\n              this.parts.push({\n                type: 'node',\n                index: -1\n              });\n              partIndex++;\n            }\n          }\n        }\n    } // Remove text binding nodes after the walk to not disturb the TreeWalker\n    for (const n of nodesToRemove) {\n      n.parentNode.removeChild(n);\n    }\n  }\n}\nconst endsWith = (str, suffix) => {\n  const index = str.length - suffix.length;\n  return index >= 0 && str.slice(index) === suffix;\n};\nconst isTemplatePartActive = part => part.index !== -1; // Allows \\`document.createComment('')\\` to be renamed for a\n// small manual size-savings.\nconst createMarker = () => document.createComment('');\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \\\\\" \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d\\\\\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \\\\\"\\\\\\\\0-\\\\\\\\x1F\\\\\\\\x7F-\\\\\\\\x9F\\\\\" are Unicode control characters, which includes every\n * space character except \\\\\" \\\\\".\n *\n * So an attribute is:\n *  * The name: any character except a control character, space character, ('),\n *    (\\\\\"), \\\\\">\\\\\", \\\\\"=\\\\\", or \\\\\"/\\\\\"\n *  * Followed by zero or more space characters\n *  * Followed by \\\\\"=\\\\\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\\\\\"), \\\\\"<\\\\\", \\\\\">\\\\\", \\\\\"=\\\\\", (\\`), or\n *    * (\\\\\") then any non-(\\\\\"), or\n *    * (') then any non-(')\n */\nconst lastAttributeNameRegex = // eslint-disable-next-line no-control-regex\n/([ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d])([^\\\\\\\\0-\\\\\\\\x1F\\\\\\\\x7F-\\\\\\\\x9F \\\\\"'>=/]+)([ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d]*=[ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d]*(?:[^ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d\\\\\"'\\`<>=]*|\\\\\"[^\\\\\"]*|'[^']*))$/;\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst walkerNodeFilter = 133\n;\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n *   div#1 (remove) <-- start removing (removing node is div#1)\n *     div\n *       div#2 (remove)  <-- continue removing (removing node is still div#1)\n *         div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nfunction removeNodesFromTemplate(template, nodesToRemove) {\n  const {\n    element: {\n      content\n    },\n    parts\n  } = template;\n  const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n  let partIndex = nextActiveIndexInTemplateParts(parts);\n  let part = parts[partIndex];\n  let nodeIndex = -1;\n  let removeCount = 0;\n  const nodesToRemoveInTemplate = [];\n  let currentRemovingNode = null;\n  while (walker.nextNode()) {\n    nodeIndex++;\n    const node = walker.currentNode; // End removal if stepped past the removing node\n    if (node.previousSibling === currentRemovingNode) {\n      currentRemovingNode = null;\n    } // A node to remove was found in the template\n    if (nodesToRemove.has(node)) {\n      nodesToRemoveInTemplate.push(node); // Track node we're removing\n      if (currentRemovingNode === null) {\n        currentRemovingNode = node;\n      }\n    } // When removing, increment count by which to adjust subsequent part indices\n    if (currentRemovingNode !== null) {\n      removeCount++;\n    }\n    while (part !== undefined && part.index === nodeIndex) {\n      // If part is in a removed node deactivate it by setting index to -1 or\n      // adjust the index as needed.\n      part.index = currentRemovingNode !== null ? -1 : part.index - removeCount; // go to the next active part.\n      partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n      part = parts[partIndex];\n    }\n  }\n  nodesToRemoveInTemplate.forEach(n => n.parentNode.removeChild(n));\n}\nconst countNodes = node => {\n  let count = node.nodeType === 11\n  ? 0 : 1;\n  const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n  while (walker.nextNode()) {\n    count++;\n  }\n  return count;\n};\nconst nextActiveIndexInTemplateParts = (parts, startIndex = -1) => {\n  for (let i = startIndex + 1; i < parts.length; i++) {\n    const part = parts[i];\n    if (isTemplatePartActive(part)) {\n      return i;\n    }\n  }\n  return -1;\n};\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nfunction insertNodeIntoTemplate(template, node, refNode = null) {\n  const {\n    element: {\n      content\n    },\n    parts\n  } = template; // If there's no refNode, then put node at end of template.\n  // No part indices need to be shifted in this case.\n  if (refNode === null || refNode === undefined) {\n    content.appendChild(node);\n    return;\n  }\n  const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n  let partIndex = nextActiveIndexInTemplateParts(parts);\n  let insertCount = 0;\n  let walkerIndex = -1;\n  while (walker.nextNode()) {\n    walkerIndex++;\n    const walkerNode = walker.currentNode;\n    if (walkerNode === refNode) {\n      insertCount = countNodes(node);\n      refNode.parentNode.insertBefore(node, refNode);\n    }\n    while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n      // If we've inserted the node, simply adjust all subsequent parts\n      if (insertCount > 0) {\n        while (partIndex !== -1) {\n          parts[partIndex].index += insertCount;\n          partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n        }\n        return;\n      }\n      partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n    }\n  }\n}\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst directives = new WeakMap();\nconst isDirective = o => {\n  return typeof o === 'function' && directives.has(o);\n};\n/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nconst noChange = {};\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nconst nothing = {};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * An instance of a \\`Template\\` that can be attached to the DOM and updated\n * with new values.\n */\nclass TemplateInstance {\n  constructor(template, processor, options) {\n    this.__parts = [];\n    this.template = template;\n    this.processor = processor;\n    this.options = options;\n  }\n  update(values) {\n    let i = 0;\n    for (const part of this.__parts) {\n      if (part !== undefined) {\n        part.setValue(values[i]);\n      }\n      i++;\n    }\n    for (const part of this.__parts) {\n      if (part !== undefined) {\n        part.commit();\n      }\n    }\n  }\n  _clone() {\n    // There are a number of steps in the lifecycle of a template instance's\n    // DOM fragment:\n    //  1. Clone - create the instance fragment\n    //  2. Adopt - adopt into the main document\n    //  3. Process - find part markers and create parts\n    //  4. Upgrade - upgrade custom elements\n    //  5. Update - set node, attribute, property, etc., values\n    //  6. Connect - connect to the document. Optional and outside of this\n    //     method.\n    //\n    // We have a few constraints on the ordering of these steps:\n    //  * We need to upgrade before updating, so that property values will pass\n    //    through any property setters.\n    //  * We would like to process before upgrading so that we're sure that the\n    //    cloned fragment is inert and not disturbed by self-modifying DOM.\n    //  * We want custom elements to upgrade even in disconnected fragments.\n    //\n    // Given these constraints, with full custom elements support we would\n    // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect\n    //\n    // But Safari does not implement CustomElementRegistry#upgrade, so we\n    // can not implement that order and still have upgrade-before-update and\n    // upgrade disconnected fragments. So we instead sacrifice the\n    // process-before-upgrade constraint, since in Custom Elements v1 elements\n    // must not modify their light DOM in the constructor. We still have issues\n    // when co-existing with CEv0 elements like Polymer 1, and with polyfills\n    // that don't strictly adhere to the no-modification rule because shadow\n    // DOM, which may be created in the constructor, is emulated by being placed\n    // in the light DOM.\n    //\n    // The resulting order is on native is: Clone, Adopt, Upgrade, Process,\n    // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade\n    // in one step.\n    //\n    // The Custom Elements v1 polyfill supports upgrade(), so the order when\n    // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update,\n    // Connect.\n    const fragment = isCEPolyfill ? this.template.element.content.cloneNode(true) : document.importNode(this.template.element.content, true);\n    const stack = [];\n    const parts = this.template.parts; // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n    const walker = document.createTreeWalker(fragment, 133\n    , null, false);\n    let partIndex = 0;\n    let nodeIndex = 0;\n    let part;\n    let node = walker.nextNode(); // Loop through all the nodes and parts of a template\n    while (partIndex < parts.length) {\n      part = parts[partIndex];\n      if (!isTemplatePartActive(part)) {\n        this.__parts.push(undefined);\n        partIndex++;\n        continue;\n      } // Progress the tree walker until we find our next part's node.\n      // Note that multiple parts may share the same node (attribute parts\n      // on a single element), so this loop may not run at all.\n      while (nodeIndex < part.index) {\n        nodeIndex++;\n        if (node.nodeName === 'TEMPLATE') {\n          stack.push(node);\n          walker.currentNode = node.content;\n        }\n        if ((node = walker.nextNode()) === null) {\n          // We've exhausted the content inside a nested template element.\n          // Because we still have parts (the outer for-loop), we know:\n          // - There is a template in the stack\n          // - The walker will find a nextNode outside the template\n          walker.currentNode = stack.pop();\n          node = walker.nextNode();\n        }\n      } // We've arrived at our part's node.\n      if (part.type === 'node') {\n        const part = this.processor.handleTextExpression(this.options);\n        part.insertAfterNode(node.previousSibling);\n        this.__parts.push(part);\n      } else {\n        this.__parts.push(...this.processor.handleAttributeExpressions(node, part.name, part.strings, this.options));\n      }\n      partIndex++;\n    }\n    if (isCEPolyfill) {\n      document.adoptNode(fragment);\n      customElements.upgrade(fragment);\n    }\n    return fragment;\n  }\n}\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = window.trustedTypes && trustedTypes.createPolicy('lit-html', {\n  createHTML: s => s\n});\nconst commentMarker = \\` \\${marker} \\`;\n/**\n * The return type of \\`html\\`, which holds a Template and the values from\n * interpolated expressions.\n */\nclass TemplateResult {\n  constructor(strings, values, type, processor) {\n    this.strings = strings;\n    this.values = values;\n    this.type = type;\n    this.processor = processor;\n  }\n  /**\n   * Returns a string of HTML used to create a \\`<template>\\` element.\n   */\n  getHTML() {\n    const l = this.strings.length - 1;\n    let html = '';\n    let isCommentBinding = false;\n    for (let i = 0; i < l; i++) {\n      const s = this.strings[i]; // For each binding we want to determine the kind of marker to insert\n      // into the template source before it's parsed by the browser's HTML\n      // parser. The marker type is based on whether the expression is in an\n      // attribute, text, or comment position.\n      //   * For node-position bindings we insert a comment with the marker\n      //     sentinel as its text content, like <!--{{lit-guid}}-->.\n      //   * For attribute bindings we insert just the marker sentinel for the\n      //     first binding, so that we support unquoted attribute bindings.\n      //     Subsequent bindings can use a comment marker because multi-binding\n      //     attributes must be quoted.\n      //   * For comment bindings we insert just the marker sentinel so we don't\n      //     close the comment.\n      //\n      // The following code scans the template source, but is *not* an HTML\n      // parser. We don't need to track the tree structure of the HTML, only\n      // whether a binding is inside a comment, and if not, if it appears to be\n      // the first binding in an attribute.\n      const commentOpen = s.lastIndexOf('<!--'); // We're in comment position if we have a comment open with no following\n      // comment close. Because <-- can appear in an attribute value there can\n      // be false positives.\n      isCommentBinding = (commentOpen > -1 || isCommentBinding) && s.indexOf('-->', commentOpen + 1) === -1; // Check to see if we have an attribute-like sequence preceding the\n      // expression. This can match \\\\\"name=value\\\\\" like structures in text,\n      // comments, and attribute values, so there can be false-positives.\n      const attributeMatch = lastAttributeNameRegex.exec(s);\n      if (attributeMatch === null) {\n        // We're only in this branch if we don't have a attribute-like\n        // preceding sequence. For comments, this guards against unusual\n        // attribute values like <div foo=\\\\\"<!--\\${'bar'}\\\\\">. Cases like\n        // <!-- foo=\\${'bar'}--> are handled correctly in the attribute branch\n        // below.\n        html += s + (isCommentBinding ? commentMarker : nodeMarker);\n      } else {\n        // For attributes we use just a marker sentinel, and also append a\n        // $lit$ suffix to the name to opt-out of attribute-specific parsing\n        // that IE and Edge do for style and certain SVG attributes.\n        html += s.substr(0, attributeMatch.index) + attributeMatch[1] + attributeMatch[2] + boundAttributeSuffix + attributeMatch[3] + marker;\n      }\n    }\n    html += this.strings[l];\n    return html;\n  }\n  getTemplateElement() {\n    const template = document.createElement('template');\n    let value = this.getHTML();\n    if (policy !== undefined) {\n      // this is secure because \\`this.strings\\` is a TemplateStringsArray.\n      // TODO: validate this when\n      // https://github.com/tc39/proposal-array-is-template-object is\n      // implemented.\n      value = policy.createHTML(value);\n    }\n    template.innerHTML = value;\n    return template;\n  }\n}\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst isPrimitive = value => {\n  return value === null || !(typeof value === 'object' || typeof value === 'function');\n};\nconst isIterable = value => {\n  return Array.isArray(value) || // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  !!(value && value[Symbol.iterator]);\n};\n/**\n * Writes attribute values to the DOM for a group of AttributeParts bound to a\n * single attribute. The value is only set once even if there are multiple parts\n * for an attribute.\n */\nclass AttributeCommitter {\n  constructor(element, name, strings) {\n    this.dirty = true;\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n    this.parts = [];\n    for (let i = 0; i < strings.length - 1; i++) {\n      this.parts[i] = this._createPart();\n    }\n  }\n  /**\n   * Creates a single part. Override this to create a differnt type of part.\n   */\n  _createPart() {\n    return new AttributePart(this);\n  }\n  _getValue() {\n    const strings = this.strings;\n    const l = strings.length - 1;\n    const parts = this.parts; // If we're assigning an attribute via syntax like:\n    //    attr=\\\\\"\\${foo}\\\\\"  or  attr=\\${foo}\n    // but not\n    //    attr=\\\\\"\\${foo} \\${bar}\\\\\" or attr=\\\\\"\\${foo} baz\\\\\"\n    // then we don't want to coerce the attribute value into one long\n    // string. Instead we want to just return the value itself directly,\n    // so that sanitizeDOMValue can get the actual value rather than\n    // String(value)\n    // The exception is if v is an array, in which case we do want to smash\n    // it together into a string without calling String() on the array.\n    //\n    // This also allows trusted values (when using TrustedTypes) being\n    // assigned to DOM sinks without being stringified in the process.\n    if (l === 1 && strings[0] === '' && strings[1] === '') {\n      const v = parts[0].value;\n      if (typeof v === 'symbol') {\n        return String(v);\n      }\n      if (typeof v === 'string' || !isIterable(v)) {\n        return v;\n      }\n    }\n    let text = '';\n    for (let i = 0; i < l; i++) {\n      text += strings[i];\n      const part = parts[i];\n      if (part !== undefined) {\n        const v = part.value;\n        if (isPrimitive(v) || !isIterable(v)) {\n          text += typeof v === 'string' ? v : String(v);\n        } else {\n          for (const t of v) {\n            text += typeof t === 'string' ? t : String(t);\n          }\n        }\n      }\n    }\n    text += strings[l];\n    return text;\n  }\n  commit() {\n    if (this.dirty) {\n      this.dirty = false;\n      this.element.setAttribute(this.name, this._getValue());\n    }\n  }\n}\n/**\n * A Part that controls all or part of an attribute value.\n */\nclass AttributePart {\n  constructor(committer) {\n    this.value = undefined;\n    this.committer = committer;\n  }\n  setValue(value) {\n    if (value !== noChange && (!isPrimitive(value) || value !== this.value)) {\n      this.value = value; // If the value is a not a directive, dirty the committer so that it'll\n      // call setAttribute. If the value is a directive, it'll dirty the\n      // committer if it calls setValue().\n      if (!isDirective(value)) {\n        this.committer.dirty = true;\n      }\n    }\n  }\n  commit() {\n    while (isDirective(this.value)) {\n      const directive = this.value;\n      this.value = noChange;\n      directive(this);\n    }\n    if (this.value === noChange) {\n      return;\n    }\n    this.committer.commit();\n  }\n}\n/**\n * A Part that controls a location within a Node tree. Like a Range, NodePart\n * has start and end locations and can set and update the Nodes between those\n * locations.\n *\n * NodeParts support several value types: primitives, Nodes, TemplateResults,\n * as well as arrays and iterables of those types.\n */\nclass NodePart {\n  constructor(options) {\n    this.value = undefined;\n    this.__pendingValue = undefined;\n    this.options = options;\n  }\n  /**\n   * Appends this part into a container.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendInto(container) {\n    this.startNode = container.appendChild(createMarker());\n    this.endNode = container.appendChild(createMarker());\n  }\n  /**\n   * Inserts this part after the \\`ref\\` node (between \\`ref\\` and \\`ref\\`'s next\n   * sibling). Both \\`ref\\` and its next sibling must be static, unchanging nodes\n   * such as those that appear in a literal section of a template.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterNode(ref) {\n    this.startNode = ref;\n    this.endNode = ref.nextSibling;\n  }\n  /**\n   * Appends this part into a parent part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendIntoPart(part) {\n    part.__insert(this.startNode = createMarker());\n    part.__insert(this.endNode = createMarker());\n  }\n  /**\n   * Inserts this part after the \\`ref\\` part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterPart(ref) {\n    ref.__insert(this.startNode = createMarker());\n    this.endNode = ref.endNode;\n    ref.endNode = this.startNode;\n  }\n  setValue(value) {\n    this.__pendingValue = value;\n  }\n  commit() {\n    if (this.startNode.parentNode === null) {\n      return;\n    }\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    const value = this.__pendingValue;\n    if (value === noChange) {\n      return;\n    }\n    if (isPrimitive(value)) {\n      if (value !== this.value) {\n        this.__commitText(value);\n      }\n    } else if (value instanceof TemplateResult) {\n      this.__commitTemplateResult(value);\n    } else if (value instanceof Node) {\n      this.__commitNode(value);\n    } else if (isIterable(value)) {\n      this.__commitIterable(value);\n    } else if (value === nothing) {\n      this.value = nothing;\n      this.clear();\n    } else {\n      // Fallback, will render the string representation\n      this.__commitText(value);\n    }\n  }\n  __insert(node) {\n    this.endNode.parentNode.insertBefore(node, this.endNode);\n  }\n  __commitNode(value) {\n    if (this.value === value) {\n      return;\n    }\n    this.clear();\n    this.__insert(value);\n    this.value = value;\n  }\n  __commitText(value) {\n    const node = this.startNode.nextSibling;\n    value = value == null ? '' : value; // If \\`value\\` isn't already a string, we explicitly convert it here in case\n    // it can't be implicitly converted - i.e. it's a symbol.\n    const valueAsString = typeof value === 'string' ? value : String(value);\n    if (node === this.endNode.previousSibling && node.nodeType === 3\n    ) {\n        // If we only have a single text node between the markers, we can just\n        // set its value, rather than replacing it.\n        // TODO(justinfagnani): Can we just check if this.value is primitive?\n        node.data = valueAsString;\n      } else {\n      this.__commitNode(document.createTextNode(valueAsString));\n    }\n    this.value = value;\n  }\n  __commitTemplateResult(value) {\n    const template = this.options.templateFactory(value);\n    if (this.value instanceof TemplateInstance && this.value.template === template) {\n      this.value.update(value.values);\n    } else {\n      // Make sure we propagate the template processor from the TemplateResult\n      // so that we use its syntax extension, etc. The template factory comes\n      // from the render function options so that it can control template\n      // caching and preprocessing.\n      const instance = new TemplateInstance(template, value.processor, this.options);\n      const fragment = instance._clone();\n      instance.update(value.values);\n      this.__commitNode(fragment);\n      this.value = instance;\n    }\n  }\n  __commitIterable(value) {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html\\`\\${i}\\`), by reusing existing TemplateInstances.\n    // If _value is an array, then the previous render was of an\n    // iterable and _value will contain the NodeParts from the previous\n    // render. If _value is not an array, clear this part and make a new\n    // array for NodeParts.\n    if (!Array.isArray(this.value)) {\n      this.value = [];\n      this.clear();\n    } // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this.value;\n    let partIndex = 0;\n    let itemPart;\n    for (const item of value) {\n      // Try to reuse an existing part\n      itemPart = itemParts[partIndex]; // If no existing part, create a new one\n      if (itemPart === undefined) {\n        itemPart = new NodePart(this.options);\n        itemParts.push(itemPart);\n        if (partIndex === 0) {\n          itemPart.appendIntoPart(this);\n        } else {\n          itemPart.insertAfterPart(itemParts[partIndex - 1]);\n        }\n      }\n      itemPart.setValue(item);\n      itemPart.commit();\n      partIndex++;\n    }\n    if (partIndex < itemParts.length) {\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n      this.clear(itemPart && itemPart.endNode);\n    }\n  }\n  clear(startNode = this.startNode) {\n    removeNodes(this.startNode.parentNode, startNode.nextSibling, this.endNode);\n  }\n}\n/**\n * Implements a boolean attribute, roughly as defined in the HTML\n * specification.\n *\n * If the value is truthy, then the attribute is present with a value of\n * ''. If the value is falsey, the attribute is removed.\n */\nclass BooleanAttributePart {\n  constructor(element, name, strings) {\n    this.value = undefined;\n    this.__pendingValue = undefined;\n    if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n      throw new Error('Boolean attributes can only contain a single expression');\n    }\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n  }\n  setValue(value) {\n    this.__pendingValue = value;\n  }\n  commit() {\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    if (this.__pendingValue === noChange) {\n      return;\n    }\n    const value = !!this.__pendingValue;\n    if (this.value !== value) {\n      if (value) {\n        this.element.setAttribute(this.name, '');\n      } else {\n        this.element.removeAttribute(this.name);\n      }\n      this.value = value;\n    }\n    this.__pendingValue = noChange;\n  }\n}\n/**\n * Sets attribute values for PropertyParts, so that the value is only set once\n * even if there are multiple parts for a property.\n *\n * If an expression controls the whole property value, then the value is simply\n * assigned to the property under control. If there are string literals or\n * multiple expressions, then the strings are expressions are interpolated into\n * a string first.\n */\nclass PropertyCommitter extends AttributeCommitter {\n  constructor(element, name, strings) {\n    super(element, name, strings);\n    this.single = strings.length === 2 && strings[0] === '' && strings[1] === '';\n  }\n  _createPart() {\n    return new PropertyPart(this);\n  }\n  _getValue() {\n    if (this.single) {\n      return this.parts[0].value;\n    }\n    return super._getValue();\n  }\n  commit() {\n    if (this.dirty) {\n      this.dirty = false; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this.element[this.name] = this._getValue();\n    }\n  }\n}\nclass PropertyPart extends AttributePart {} // Detect event listener options support. If the \\`capture\\` property is read\n// from the options object, then options are supported. If not, then the third\n// argument to add/removeEventListener is interpreted as the boolean capture\n// value so we should only pass the \\`capture\\` property.\nlet eventOptionsSupported = false; // Wrap into an IIFE because MS Edge <= v41 does not support having try/catch\n// blocks right into the body of a module\n(() => {\n  try {\n    const options = {\n      get capture() {\n        eventOptionsSupported = true;\n        return false;\n      }\n    }; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    window.addEventListener('test', options, options); // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    window.removeEventListener('test', options, options);\n  } catch (_e) {// event options not supported\n  }\n})();\nclass EventPart {\n  constructor(element, eventName, eventContext) {\n    this.value = undefined;\n    this.__pendingValue = undefined;\n    this.element = element;\n    this.eventName = eventName;\n    this.eventContext = eventContext;\n    this.__boundHandleEvent = e => this.handleEvent(e);\n  }\n  setValue(value) {\n    this.__pendingValue = value;\n  }\n  commit() {\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    if (this.__pendingValue === noChange) {\n      return;\n    }\n    const newListener = this.__pendingValue;\n    const oldListener = this.value;\n    const shouldRemoveListener = newListener == null || oldListener != null && (newListener.capture !== oldListener.capture || newListener.once !== oldListener.once || newListener.passive !== oldListener.passive);\n    const shouldAddListener = newListener != null && (oldListener == null || shouldRemoveListener);\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n    }\n    if (shouldAddListener) {\n      this.__options = getOptions(newListener);\n      this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n    }\n    this.value = newListener;\n    this.__pendingValue = noChange;\n  }\n  handleEvent(event) {\n    if (typeof this.value === 'function') {\n      this.value.call(this.eventContext || this.element, event);\n    } else {\n      this.value.handleEvent(event);\n    }\n  }\n} // We copy options because of the inconsistent behavior of browsers when reading\n// the third argument of add/removeEventListener. IE11 doesn't support options\n// at all. Chrome 41 only reads \\`capture\\` if the argument is an object.\nconst getOptions = o => o && (eventOptionsSupported ? {\n  capture: o.capture,\n  passive: o.passive,\n  once: o.once\n} : o.capture);\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * The default TemplateFactory which caches Templates keyed on\n * result.type and result.strings.\n */\nfunction templateFactory(result) {\n  let templateCache = templateCaches.get(result.type);\n  if (templateCache === undefined) {\n    templateCache = {\n      stringsArray: new WeakMap(),\n      keyString: new Map()\n    };\n    templateCaches.set(result.type, templateCache);\n  }\n  let template = templateCache.stringsArray.get(result.strings);\n  if (template !== undefined) {\n    return template;\n  } // If the TemplateStringsArray is new, generate a key from the strings\n  // This key is shared between all templates with identical content\n  const key = result.strings.join(marker); // Check if we already have a Template for this key\n  template = templateCache.keyString.get(key);\n  if (template === undefined) {\n    // If we have not seen this key before, create a new Template\n    template = new Template(result, result.getTemplateElement()); // Cache the Template for this key\n    templateCache.keyString.set(key, template);\n  } // Cache all future queries for this TemplateStringsArray\n  templateCache.stringsArray.set(result.strings, template);\n  return template;\n}\nconst templateCaches = new Map();\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst parts = new WeakMap();\n/**\n * Renders a template result or other value to a container.\n *\n * To update a container with new values, reevaluate the template literal and\n * call \\`render\\` with the new result.\n *\n * @param result Any value renderable by NodePart - typically a TemplateResult\n *     created by evaluating a template tag like \\`html\\` or \\`svg\\`.\n * @param container A DOM parent to render to. The entire contents are either\n *     replaced, or efficiently updated if the same result type was previous\n *     rendered there.\n * @param options RenderOptions for the entire render tree rendered to this\n *     container. Render options must *not* change between renders to the same\n *     container, as those changes will not effect previously rendered DOM.\n */\nconst render = (result, container, options) => {\n  let part = parts.get(container);\n  if (part === undefined) {\n    removeNodes(container, container.firstChild);\n    parts.set(container, part = new NodePart(Object.assign({\n      templateFactory\n    }, options)));\n    part.appendInto(container);\n  }\n  part.setValue(result);\n  part.commit();\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * Creates Parts when a template is instantiated.\n */\nclass DefaultTemplateProcessor {\n  /**\n   * Create parts for an attribute-position binding, given the event, attribute\n   * name, and string literals.\n   *\n   * @param element The element containing the binding\n   * @param name  The attribute name\n   * @param strings The string literals. There are always at least two strings,\n   *   event for fully-controlled bindings with a single expression.\n   */\n  handleAttributeExpressions(element, name, strings, options) {\n    const prefix = name[0];\n    if (prefix === '.') {\n      const committer = new PropertyCommitter(element, name.slice(1), strings);\n      return committer.parts;\n    }\n    if (prefix === '@') {\n      return [new EventPart(element, name.slice(1), options.eventContext)];\n    }\n    if (prefix === '?') {\n      return [new BooleanAttributePart(element, name.slice(1), strings)];\n    }\n    const committer = new AttributeCommitter(element, name, strings);\n    return committer.parts;\n  }\n  /**\n   * Create parts for a text-position binding.\n   * @param templateFactory\n   */\n  handleTextExpression(options) {\n    return new NodePart(options);\n  }\n}\nconst defaultTemplateProcessor = new DefaultTemplateProcessor();\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n// This line will be used in regexes to search for lit-html usage.\n// TODO(justinfagnani): inject version number at build time\nif (typeof window !== 'undefined') {\n  (window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.3.0');\n}\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n */\nconst html = (strings, ...values) => new TemplateResult(strings, values, 'html', defaultTemplateProcessor);\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst getTemplateCacheKey = (type, scopeName) => \\`\\${type}--\\${scopeName}\\`;\nlet compatibleShadyCSSVersion = true;\nif (typeof window.ShadyCSS === 'undefined') {\n  compatibleShadyCSSVersion = false;\n} else if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') {\n  console.warn(\\`Incompatible ShadyCSS version detected. \\` + \\`Please update to at least @webcomponents/webcomponentsjs@2.0.2 and \\` + \\`@webcomponents/shadycss@1.3.1.\\`);\n  compatibleShadyCSSVersion = false;\n}\n/**\n * Template factory which scopes template DOM using ShadyCSS.\n * @param scopeName {string}\n */\nconst shadyTemplateFactory = scopeName => result => {\n  const cacheKey = getTemplateCacheKey(result.type, scopeName);\n  let templateCache = templateCaches.get(cacheKey);\n  if (templateCache === undefined) {\n    templateCache = {\n      stringsArray: new WeakMap(),\n      keyString: new Map()\n    };\n    templateCaches.set(cacheKey, templateCache);\n  }\n  let template = templateCache.stringsArray.get(result.strings);\n  if (template !== undefined) {\n    return template;\n  }\n  const key = result.strings.join(marker);\n  template = templateCache.keyString.get(key);\n  if (template === undefined) {\n    const element = result.getTemplateElement();\n    if (compatibleShadyCSSVersion) {\n      window.ShadyCSS.prepareTemplateDom(element, scopeName);\n    }\n    template = new Template(result, element);\n    templateCache.keyString.set(key, template);\n  }\n  templateCache.stringsArray.set(result.strings, template);\n  return template;\n};\nconst TEMPLATE_TYPES = ['html', 'svg'];\n/**\n * Removes all style elements from Templates for the given scopeName.\n */\nconst removeStylesFromLitTemplates = scopeName => {\n  TEMPLATE_TYPES.forEach(type => {\n    const templates = templateCaches.get(getTemplateCacheKey(type, scopeName));\n    if (templates !== undefined) {\n      templates.keyString.forEach(template => {\n        const {\n          element: {\n            content\n          }\n        } = template; // IE 11 doesn't support the iterable param Set constructor\n        const styles = new Set();\n        Array.from(content.querySelectorAll('style')).forEach(s => {\n          styles.add(s);\n        });\n        removeNodesFromTemplate(template, styles);\n      });\n    }\n  });\n};\nconst shadyRenderSet = new Set();\n/**\n * For the given scope name, ensures that ShadyCSS style scoping is performed.\n * This is done just once per scope name so the fragment and template cannot\n * be modified.\n * (1) extracts styles from the rendered fragment and hands them to ShadyCSS\n * to be scoped and appended to the document\n * (2) removes style elements from all lit-html Templates for this scope name.\n *\n * Note, <style> elements can only be placed into templates for the\n * initial rendering of the scope. If <style> elements are included in templates\n * dynamically rendered to the scope (after the first scope render), they will\n * not be scoped and the <style> will be left in the template and rendered\n * output.\n */\nconst prepareTemplateStyles = (scopeName, renderedDOM, template) => {\n  shadyRenderSet.add(scopeName); // If \\`renderedDOM\\` is stamped from a Template, then we need to edit that\n  // Template's underlying template element. Otherwise, we create one here\n  // to give to ShadyCSS, which still requires one while scoping.\n  const templateElement = !!template ? template.element : document.createElement('template'); // Move styles out of rendered DOM and store.\n  const styles = renderedDOM.querySelectorAll('style');\n  const {\n    length\n  } = styles; // If there are no styles, skip unnecessary work\n  if (length === 0) {\n    // Ensure prepareTemplateStyles is called to support adding\n    // styles via \\`prepareAdoptedCssText\\` since that requires that\n    // \\`prepareTemplateStyles\\` is called.\n    //\n    // ShadyCSS will only update styles containing @apply in the template\n    // given to \\`prepareTemplateStyles\\`. If no lit Template was given,\n    // ShadyCSS will not be able to update uses of @apply in any relevant\n    // template. However, this is not a problem because we only create the\n    // template for the purpose of supporting \\`prepareAdoptedCssText\\`,\n    // which doesn't support @apply at all.\n    window.ShadyCSS.prepareTemplateStyles(templateElement, scopeName);\n    return;\n  }\n  const condensedStyle = document.createElement('style'); // Collect styles into a single style. This helps us make sure ShadyCSS\n  // manipulations will not prevent us from being able to fix up template\n  // part indices.\n  // NOTE: collecting styles is inefficient for browsers but ShadyCSS\n  // currently does this anyway. When it does not, this should be changed.\n  for (let i = 0; i < length; i++) {\n    const style = styles[i];\n    style.parentNode.removeChild(style);\n    condensedStyle.textContent += style.textContent;\n  } // Remove styles from nested templates in this scope.\n  removeStylesFromLitTemplates(scopeName); // And then put the condensed style into the \\\\\"root\\\\\" template passed in as\n  // \\`template\\`.\n  const content = templateElement.content;\n  if (!!template) {\n    insertNodeIntoTemplate(template, condensedStyle, content.firstChild);\n  } else {\n    content.insertBefore(condensedStyle, content.firstChild);\n  } // Note, it's important that ShadyCSS gets the template that \\`lit-html\\`\n  // will actually render so that it can update the style inside when\n  // needed (e.g. @apply native Shadow DOM case).\n  window.ShadyCSS.prepareTemplateStyles(templateElement, scopeName);\n  const style = content.querySelector('style');\n  if (window.ShadyCSS.nativeShadow && style !== null) {\n    // When in native Shadow DOM, ensure the style created by ShadyCSS is\n    // included in initially rendered output (\\`renderedDOM\\`).\n    renderedDOM.insertBefore(style.cloneNode(true), renderedDOM.firstChild);\n  } else if (!!template) {\n    // When no style is left in the template, parts will be broken as a\n    // result. To fix this, we put back the style node ShadyCSS removed\n    // and then tell lit to remove that node from the template.\n    // There can be no style in the template in 2 cases (1) when Shady DOM\n    // is in use, ShadyCSS removes all styles, (2) when native Shadow DOM\n    // is in use ShadyCSS removes the style if it contains no content.\n    // NOTE, ShadyCSS creates its own style so we can safely add/remove\n    // \\`condensedStyle\\` here.\n    content.insertBefore(condensedStyle, content.firstChild);\n    const removes = new Set();\n    removes.add(condensedStyle);\n    removeNodesFromTemplate(template, removes);\n  }\n};\n/**\n * Extension to the standard \\`render\\` method which supports rendering\n * to ShadowRoots when the ShadyDOM (https://github.com/webcomponents/shadydom)\n * and ShadyCSS (https://github.com/webcomponents/shadycss) polyfills are used\n * or when the webcomponentsjs\n * (https://github.com/webcomponents/webcomponentsjs) polyfill is used.\n *\n * Adds a \\`scopeName\\` option which is used to scope element DOM and stylesheets\n * when native ShadowDOM is unavailable. The \\`scopeName\\` will be added to\n * the class attribute of all rendered DOM. In addition, any style elements will\n * be automatically re-written with this \\`scopeName\\` selector and moved out\n * of the rendered DOM and into the document \\`<head>\\`.\n *\n * It is common to use this render method in conjunction with a custom element\n * which renders a shadowRoot. When this is done, typically the element's\n * \\`localName\\` should be used as the \\`scopeName\\`.\n *\n * In addition to DOM scoping, ShadyCSS also supports a basic shim for css\n * custom properties (needed only on older browsers like IE11) and a shim for\n * a deprecated feature called \\`@apply\\` that supports applying a set of css\n * custom properties to a given location.\n *\n * Usage considerations:\n *\n * * Part values in \\`<style>\\` elements are only applied the first time a given\n * \\`scopeName\\` renders. Subsequent changes to parts in style elements will have\n * no effect. Because of this, parts in style elements should only be used for\n * values that will never change, for example parts that set scope-wide theme\n * values or parts which render shared style elements.\n *\n * * Note, due to a limitation of the ShadyDOM polyfill, rendering in a\n * custom element's \\`constructor\\` is not supported. Instead rendering should\n * either done asynchronously, for example at microtask timing (for example\n * \\`Promise.resolve()\\`), or be deferred until the first time the element's\n * \\`connectedCallback\\` runs.\n *\n * Usage considerations when using shimmed custom properties or \\`@apply\\`:\n *\n * * Whenever any dynamic changes are made which affect\n * css custom properties, \\`ShadyCSS.styleElement(element)\\` must be called\n * to update the element. There are two cases when this is needed:\n * (1) the element is connected to a new parent, (2) a class is added to the\n * element that causes it to match different custom properties.\n * To address the first case when rendering a custom element, \\`styleElement\\`\n * should be called in the element's \\`connectedCallback\\`.\n *\n * * Shimmed custom properties may only be defined either for an entire\n * shadowRoot (for example, in a \\`:host\\` rule) or via a rule that directly\n * matches an element with a shadowRoot. In other words, instead of flowing from\n * parent to child as do native css custom properties, shimmed custom properties\n * flow only from shadowRoots to nested shadowRoots.\n *\n * * When using \\`@apply\\` mixing css shorthand property names with\n * non-shorthand names (for example \\`border\\` and \\`border-width\\`) is not\n * supported.\n */\nconst render$1 = (result, container, options) => {\n  if (!options || typeof options !== 'object' || !options.scopeName) {\n    throw new Error('The \\`scopeName\\` option is required.');\n  }\n  const scopeName = options.scopeName;\n  const hasRendered = parts.has(container);\n  const needsScoping = compatibleShadyCSSVersion && container.nodeType === 11\n  && !!container.host; // Handle first render to a scope specially...\n  const firstScopeRender = needsScoping && !shadyRenderSet.has(scopeName); // On first scope render, render into a fragment; this cannot be a single\n  // fragment that is reused since nested renders can occur synchronously.\n  const renderContainer = firstScopeRender ? document.createDocumentFragment() : container;\n  render(result, renderContainer, Object.assign({\n    templateFactory: shadyTemplateFactory(scopeName)\n  }, options)); // When performing first scope render,\n  // (1) We've rendered into a fragment so that there's a chance to\n  // \\`prepareTemplateStyles\\` before sub-elements hit the DOM\n  // (which might cause them to render based on a common pattern of\n  // rendering in a custom element's \\`connectedCallback\\`);\n  // (2) Scope the template with ShadyCSS one time only for this scope.\n  // (3) Render the fragment into the container and make sure the\n  // container knows its \\`part\\` is the one we just rendered. This ensures\n  // DOM will be re-used on subsequent renders.\n  if (firstScopeRender) {\n    const part = parts.get(renderContainer);\n    parts.delete(renderContainer); // ShadyCSS might have style sheets (e.g. from \\`prepareAdoptedCssText\\`)\n    // that should apply to \\`renderContainer\\` even if the rendered value is\n    // not a TemplateInstance. However, it will only insert scoped styles\n    // into the document if \\`prepareTemplateStyles\\` has already been called\n    // for the given scope name.\n    const template = part.value instanceof TemplateInstance ? part.value.template : undefined;\n    prepareTemplateStyles(scopeName, renderContainer, template);\n    removeNodes(container, container.firstChild);\n    container.appendChild(renderContainer);\n    parts.set(container, part);\n  } // After elements have hit the DOM, update styling if this is the\n  // initial render to this container.\n  // This is needed whenever dynamic changes are made so it would be\n  // safest to do every render; however, this would regress performance\n  // so we leave it up to the user to call \\`ShadyCSS.styleElement\\`\n  // for dynamic changes.\n  if (!hasRendered && needsScoping) {\n    window.ShadyCSS.styleElement(container.host);\n  }\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nvar _a;\n/**\n * Use this module if you want to create your own base class extending\n * [[UpdatingElement]].\n * @packageDocumentation\n */\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\nwindow.JSCompiler_renameProperty = (prop, _obj) => prop;\nconst defaultConverter = {\n  toAttribute(value, type) {\n    switch (type) {\n      case Boolean:\n        return value ? '' : null;\n      case Object:\n      case Array:\n        // if the value is \\`null\\` or \\`undefined\\` pass this through\n        // to allow removing/no change behavior.\n        return value == null ? value : JSON.stringify(value);\n    }\n    return value;\n  },\n  fromAttribute(value, type) {\n    switch (type) {\n      case Boolean:\n        return value !== null;\n      case Number:\n        return value === null ? null : Number(value);\n      case Object:\n      case Array:\n        return JSON.parse(value);\n    }\n    return value;\n  }\n};\n/**\n * Change function that returns true if \\`value\\` is different from \\`oldValue\\`.\n * This method is used as the default for a property's \\`hasChanged\\` function.\n */\nconst notEqual = (value, old) => {\n  // This ensures (old==NaN, value==NaN) always returns false\n  return old !== value && (old === old || value === value);\n};\nconst defaultPropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  hasChanged: notEqual\n};\nconst STATE_HAS_UPDATED = 1;\nconst STATE_UPDATE_REQUESTED = 1 << 2;\nconst STATE_IS_REFLECTING_TO_ATTRIBUTE = 1 << 3;\nconst STATE_IS_REFLECTING_TO_PROPERTY = 1 << 4;\n/**\n * The Closure JS Compiler doesn't currently have good support for static\n * property semantics where \\\\\"this\\\\\" is dynamic (e.g.\n * https://github.com/google/closure-compiler/issues/3177 and others) so we use\n * this hack to bypass any rewriting by the compiler.\n */\nconst finalized = 'finalized';\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the \\`update\\` method is asynchronously called. This method\n * should be supplied by subclassers to render updates as desired.\n * @noInheritDoc\n */\nclass UpdatingElement extends HTMLElement {\n  constructor() {\n    super();\n    this.initialize();\n  }\n  /**\n   * Returns a list of attributes corresponding to the registered properties.\n   * @nocollapse\n   */\n  static get observedAttributes() {\n    // note: piggy backing on this to ensure we're finalized.\n    this.finalize();\n    const attributes = []; // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    this._classProperties.forEach((v, p) => {\n      const attr = this._attributeNameForProperty(p, v);\n      if (attr !== undefined) {\n        this._attributeToPropertyMap.set(attr, p);\n        attributes.push(attr);\n      }\n    });\n    return attributes;\n  }\n  /**\n   * Ensures the private \\`_classProperties\\` property metadata is created.\n   * In addition to \\`finalize\\` this is also called in \\`createProperty\\` to\n   * ensure the \\`@property\\` decorator can add property metadata.\n   */\n  /** @nocollapse */\n  static _ensureClassProperties() {\n    // ensure private storage for property declarations.\n    if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n      this._classProperties = new Map(); // NOTE: Workaround IE11 not supporting Map constructor argument.\n      const superProperties = Object.getPrototypeOf(this)._classProperties;\n      if (superProperties !== undefined) {\n        superProperties.forEach((v, k) => this._classProperties.set(k, v));\n      }\n    }\n  }\n  /**\n   * Creates a property accessor on the element prototype if one does not exist\n   * and stores a PropertyDeclaration for the property with the given options.\n   * The property setter calls the property's \\`hasChanged\\` property option\n   * or uses a strict identity check to determine whether or not to request\n   * an update.\n   *\n   * This method may be overridden to customize properties; however,\n   * when doing so, it's important to call \\`super.createProperty\\` to ensure\n   * the property is setup correctly. This method calls\n   * \\`getPropertyDescriptor\\` internally to get a descriptor to install.\n   * To customize what properties do when they are get or set, override\n   * \\`getPropertyDescriptor\\`. To customize the options for a property,\n   * implement \\`createProperty\\` like this:\n   *\n   * static createProperty(name, options) {\n   *   options = Object.assign(options, {myOption: true});\n   *   super.createProperty(name, options);\n   * }\n   *\n   * @nocollapse\n   */\n  static createProperty(name, options = defaultPropertyDeclaration) {\n    // Note, since this can be called by the \\`@property\\` decorator which\n    // is called before \\`finalize\\`, we ensure storage exists for property\n    // metadata.\n    this._ensureClassProperties();\n    this._classProperties.set(name, options); // Do not generate an accessor if the prototype already has one, since\n    // it would be lost otherwise and that would never be the user's intention;\n    // Instead, we expect users to call \\`requestUpdate\\` themselves from\n    // user-defined accessors. Note that if the super has an accessor we will\n    // still overwrite it\n    if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n      return;\n    }\n    const key = typeof name === 'symbol' ? Symbol() : \\`__\\${name}\\`;\n    const descriptor = this.getPropertyDescriptor(name, key, options);\n    if (descriptor !== undefined) {\n      Object.defineProperty(this.prototype, name, descriptor);\n    }\n  }\n  /**\n   * Returns a property descriptor to be defined on the given named property.\n   * If no descriptor is returned, the property will not become an accessor.\n   * For example,\n   *\n   *   class MyElement extends LitElement {\n   *     static getPropertyDescriptor(name, key, options) {\n   *       const defaultDescriptor =\n   *           super.getPropertyDescriptor(name, key, options);\n   *       const setter = defaultDescriptor.set;\n   *       return {\n   *         get: defaultDescriptor.get,\n   *         set(value) {\n   *           setter.call(this, value);\n   *           // custom action.\n   *         },\n   *         configurable: true,\n   *         enumerable: true\n   *       }\n   *     }\n   *   }\n   *\n   * @nocollapse\n   */\n  static getPropertyDescriptor(name, key, options) {\n    return {\n      // tslint:disable-next-line:no-any no symbol in index\n      get() {\n        return this[key];\n      },\n      set(value) {\n        const oldValue = this[name];\n        this[key] = value;\n        this.requestUpdateInternal(name, oldValue, options);\n      },\n      configurable: true,\n      enumerable: true\n    };\n  }\n  /**\n   * Returns the property options associated with the given property.\n   * These options are defined with a PropertyDeclaration via the \\`properties\\`\n   * object or the \\`@property\\` decorator and are registered in\n   * \\`createProperty(...)\\`.\n   *\n   * Note, this method should be considered \\\\\"final\\\\\" and not overridden. To\n   * customize the options for a given property, override \\`createProperty\\`.\n   *\n   * @nocollapse\n   * @final\n   */\n  static getPropertyOptions(name) {\n    return this._classProperties && this._classProperties.get(name) || defaultPropertyDeclaration;\n  }\n  /**\n   * Creates property accessors for registered properties and ensures\n   * any superclasses are also finalized.\n   * @nocollapse\n   */\n  static finalize() {\n    // finalize any superclasses\n    const superCtor = Object.getPrototypeOf(this);\n    if (!superCtor.hasOwnProperty(finalized)) {\n      superCtor.finalize();\n    }\n    this[finalized] = true;\n    this._ensureClassProperties(); // initialize Map populated in observedAttributes\n    this._attributeToPropertyMap = new Map(); // make any properties\n    // Note, only process \\\\\"own\\\\\" properties since this element will inherit\n    // any properties defined on the superClass, and finalization ensures\n    // the entire prototype chain is finalized.\n    if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n      const props = this.properties; // support symbols in properties (IE11 does not support this)\n      const propKeys = [...Object.getOwnPropertyNames(props), ...(typeof Object.getOwnPropertySymbols === 'function' ? Object.getOwnPropertySymbols(props) : [])]; // This for/of is ok because propKeys is an array\n      for (const p of propKeys) {\n        // note, use of \\`any\\` is due to TypeSript lack of support for symbol in\n        // index types\n        // tslint:disable-next-line:no-any no symbol in index\n        this.createProperty(p, props[p]);\n      }\n    }\n  }\n  /**\n   * Returns the property name for the given attribute \\`name\\`.\n   * @nocollapse\n   */\n  static _attributeNameForProperty(name, options) {\n    const attribute = options.attribute;\n    return attribute === false ? undefined : typeof attribute === 'string' ? attribute : typeof name === 'string' ? name.toLowerCase() : undefined;\n  }\n  /**\n   * Returns true if a property should request an update.\n   * Called when a property value is set and uses the \\`hasChanged\\`\n   * option for the property if present or a strict identity check.\n   * @nocollapse\n   */\n  static _valueHasChanged(value, old, hasChanged = notEqual) {\n    return hasChanged(value, old);\n  }\n  /**\n   * Returns the property value for the given attribute value.\n   * Called via the \\`attributeChangedCallback\\` and uses the property's\n   * \\`converter\\` or \\`converter.fromAttribute\\` property option.\n   * @nocollapse\n   */\n  static _propertyValueFromAttribute(value, options) {\n    const type = options.type;\n    const converter = options.converter || defaultConverter;\n    const fromAttribute = typeof converter === 'function' ? converter : converter.fromAttribute;\n    return fromAttribute ? fromAttribute(value, type) : value;\n  }\n  /**\n   * Returns the attribute value for the given property value. If this\n   * returns undefined, the property will *not* be reflected to an attribute.\n   * If this returns null, the attribute will be removed, otherwise the\n   * attribute will be set to the value.\n   * This uses the property's \\`reflect\\` and \\`type.toAttribute\\` property options.\n   * @nocollapse\n   */\n  static _propertyValueToAttribute(value, options) {\n    if (options.reflect === undefined) {\n      return;\n    }\n    const type = options.type;\n    const converter = options.converter;\n    const toAttribute = converter && converter.toAttribute || defaultConverter.toAttribute;\n    return toAttribute(value, type);\n  }\n  /**\n   * Performs element initialization. By default captures any pre-set values for\n   * registered properties.\n   */\n  initialize() {\n    this._updateState = 0;\n    this._updatePromise = new Promise(res => this._enableUpdatingResolver = res);\n    this._changedProperties = new Map();\n    this._saveInstanceProperties(); // ensures first update will be caught by an early access of\n    // \\`updateComplete\\`\n    this.requestUpdateInternal();\n  }\n  /**\n   * Fixes any properties set on the instance before upgrade time.\n   * Otherwise these would shadow the accessor and break these properties.\n   * The properties are stored in a Map which is played back after the\n   * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n   * (<=41), properties created for native platform properties like (\\`id\\` or\n   * \\`name\\`) may not have default values set in the element constructor. On\n   * these browsers native properties appear on instances and therefore their\n   * default value will overwrite any element default (e.g. if the element sets\n   * this.id = 'id' in the constructor, the 'id' will become '' since this is\n   * the native platform default).\n   */\n  _saveInstanceProperties() {\n    // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    this.constructor._classProperties.forEach((_v, p) => {\n      if (this.hasOwnProperty(p)) {\n        const value = this[p];\n        delete this[p];\n        if (!this._instanceProperties) {\n          this._instanceProperties = new Map();\n        }\n        this._instanceProperties.set(p, value);\n      }\n    });\n  }\n  /**\n   * Applies previously saved instance properties.\n   */\n  _applyInstanceProperties() {\n    // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    // tslint:disable-next-line:no-any\n    this._instanceProperties.forEach((v, p) => this[p] = v);\n    this._instanceProperties = undefined;\n  }\n  connectedCallback() {\n    // Ensure first connection completes an update. Updates cannot complete\n    // before connection.\n    this.enableUpdating();\n  }\n  enableUpdating() {\n    if (this._enableUpdatingResolver !== undefined) {\n      this._enableUpdatingResolver();\n      this._enableUpdatingResolver = undefined;\n    }\n  }\n  /**\n   * Allows for \\`super.disconnectedCallback()\\` in extensions while\n   * reserving the possibility of making non-breaking feature additions\n   * when disconnecting at some point in the future.\n   */\n  disconnectedCallback() {}\n  /**\n   * Synchronizes property values when attributes change.\n   */\n  attributeChangedCallback(name, old, value) {\n    if (old !== value) {\n      this._attributeToProperty(name, value);\n    }\n  }\n  _propertyToAttribute(name, value, options = defaultPropertyDeclaration) {\n    const ctor = this.constructor;\n    const attr = ctor._attributeNameForProperty(name, options);\n    if (attr !== undefined) {\n      const attrValue = ctor._propertyValueToAttribute(value, options); // an undefined value does not change the attribute.\n      if (attrValue === undefined) {\n        return;\n      } // Track if the property is being reflected to avoid\n      // setting the property again via \\`attributeChangedCallback\\`. Note:\n      // 1. this takes advantage of the fact that the callback is synchronous.\n      // 2. will behave incorrectly if multiple attributes are in the reaction\n      // stack at time of calling. However, since we process attributes\n      // in \\`update\\` this should not be possible (or an extreme corner case\n      // that we'd like to discover).\n      // mark state reflecting\n      this._updateState = this._updateState | STATE_IS_REFLECTING_TO_ATTRIBUTE;\n      if (attrValue == null) {\n        this.removeAttribute(attr);\n      } else {\n        this.setAttribute(attr, attrValue);\n      } // mark state not reflecting\n      this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_ATTRIBUTE;\n    }\n  }\n  _attributeToProperty(name, value) {\n    // Use tracking info to avoid deserializing attribute value if it was\n    // just set from a property setter.\n    if (this._updateState & STATE_IS_REFLECTING_TO_ATTRIBUTE) {\n      return;\n    }\n    const ctor = this.constructor; // Note, hint this as an \\`AttributeMap\\` so closure clearly understands\n    // the type; it has issues with tracking types through statics\n    // tslint:disable-next-line:no-unnecessary-type-assertion\n    const propName = ctor._attributeToPropertyMap.get(name);\n    if (propName !== undefined) {\n      const options = ctor.getPropertyOptions(propName); // mark state reflecting\n      this._updateState = this._updateState | STATE_IS_REFLECTING_TO_PROPERTY;\n      this[propName] = // tslint:disable-next-line:no-any\n      ctor._propertyValueFromAttribute(value, options); // mark state not reflecting\n      this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_PROPERTY;\n    }\n  }\n  /**\n   * This protected version of \\`requestUpdate\\` does not access or return the\n   * \\`updateComplete\\` promise. This promise can be overridden and is therefore\n   * not free to access.\n   */\n  requestUpdateInternal(name, oldValue, options) {\n    let shouldRequestUpdate = true; // If we have a property key, perform property update steps.\n    if (name !== undefined) {\n      const ctor = this.constructor;\n      options = options || ctor.getPropertyOptions(name);\n      if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {\n        if (!this._changedProperties.has(name)) {\n          this._changedProperties.set(name, oldValue);\n        } // Add to reflecting properties set.\n        // Note, it's important that every change has a chance to add the\n        // property to \\`_reflectingProperties\\`. This ensures setting\n        // attribute + property reflects correctly.\n        if (options.reflect === true && !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {\n          if (this._reflectingProperties === undefined) {\n            this._reflectingProperties = new Map();\n          }\n          this._reflectingProperties.set(name, options);\n        }\n      } else {\n        // Abort the request if the property should not be considered changed.\n        shouldRequestUpdate = false;\n      }\n    }\n    if (!this._hasRequestedUpdate && shouldRequestUpdate) {\n      this._updatePromise = this._enqueueUpdate();\n    }\n  }\n  /**\n   * Requests an update which is processed asynchronously. This should\n   * be called when an element should update based on some state not triggered\n   * by setting a property. In this case, pass no arguments. It should also be\n   * called when manually implementing a property setter. In this case, pass the\n   * property \\`name\\` and \\`oldValue\\` to ensure that any configured property\n   * options are honored. Returns the \\`updateComplete\\` Promise which is resolved\n   * when the update completes.\n   *\n   * @param name {PropertyKey} (optional) name of requesting property\n   * @param oldValue {any} (optional) old value of requesting property\n   * @returns {Promise} A Promise that is resolved when the update completes.\n   */\n  requestUpdate(name, oldValue) {\n    this.requestUpdateInternal(name, oldValue);\n    return this.updateComplete;\n  }\n  /**\n   * Sets up the element to asynchronously update.\n   */\n  async _enqueueUpdate() {\n    this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n    try {\n      // Ensure any previous update has resolved before updating.\n      // This \\`await\\` also ensures that property changes are batched.\n      await this._updatePromise;\n    } catch (e) {// Ignore any previous errors. We only care that the previous cycle is\n      // done. Any error should have been handled in the previous update.\n    }\n    const result = this.performUpdate(); // If \\`performUpdate\\` returns a Promise, we await it. This is done to\n    // enable coordinating updates with a scheduler. Note, the result is\n    // checked to avoid delaying an additional microtask unless we need to.\n    if (result != null) {\n      await result;\n    }\n    return !this._hasRequestedUpdate;\n  }\n  get _hasRequestedUpdate() {\n    return this._updateState & STATE_UPDATE_REQUESTED;\n  }\n  get hasUpdated() {\n    return this._updateState & STATE_HAS_UPDATED;\n  }\n  /**\n   * Performs an element update. Note, if an exception is thrown during the\n   * update, \\`firstUpdated\\` and \\`updated\\` will not be called.\n   *\n   * You can override this method to change the timing of updates. If this\n   * method is overridden, \\`super.performUpdate()\\` must be called.\n   *\n   * For instance, to schedule updates to occur just before the next frame:\n   *\n   * \\`\\`\\`\n   * protected async performUpdate(): Promise<unknown> {\n   *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n   *   super.performUpdate();\n   * }\n   * \\`\\`\\`\n   */\n  performUpdate() {\n    // Abort any update if one is not pending when this is called.\n    // This can happen if \\`performUpdate\\` is called early to \\\\\"flush\\\\\"\n    // the update.\n    if (!this._hasRequestedUpdate) {\n      return;\n    } // Mixin instance properties once, if they exist.\n    if (this._instanceProperties) {\n      this._applyInstanceProperties();\n    }\n    let shouldUpdate = false;\n    const changedProperties = this._changedProperties;\n    try {\n      shouldUpdate = this.shouldUpdate(changedProperties);\n      if (shouldUpdate) {\n        this.update(changedProperties);\n      } else {\n        this._markUpdated();\n      }\n    } catch (e) {\n      // Prevent \\`firstUpdated\\` and \\`updated\\` from running when there's an\n      // update exception.\n      shouldUpdate = false; // Ensure element can accept additional updates after an exception.\n      this._markUpdated();\n      throw e;\n    }\n    if (shouldUpdate) {\n      if (!(this._updateState & STATE_HAS_UPDATED)) {\n        this._updateState = this._updateState | STATE_HAS_UPDATED;\n        this.firstUpdated(changedProperties);\n      }\n      this.updated(changedProperties);\n    }\n  }\n  _markUpdated() {\n    this._changedProperties = new Map();\n    this._updateState = this._updateState & ~STATE_UPDATE_REQUESTED;\n  }\n  /**\n   * Returns a Promise that resolves when the element has completed updating.\n   * The Promise value is a boolean that is \\`true\\` if the element completed the\n   * update without triggering another update. The Promise result is \\`false\\` if\n   * a property was set inside \\`updated()\\`. If the Promise is rejected, an\n   * exception was thrown during the update.\n   *\n   * To await additional asynchronous work, override the \\`_getUpdateComplete\\`\n   * method. For example, it is sometimes useful to await a rendered element\n   * before fulfilling this Promise. To do this, first await\n   * \\`super._getUpdateComplete()\\`, then any subsequent state.\n   *\n   * @returns {Promise} The Promise returns a boolean that indicates if the\n   * update resolved without triggering another update.\n   */\n  get updateComplete() {\n    return this._getUpdateComplete();\n  }\n  /**\n   * Override point for the \\`updateComplete\\` promise.\n   *\n   * It is not safe to override the \\`updateComplete\\` getter directly due to a\n   * limitation in TypeScript which means it is not possible to call a\n   * superclass getter (e.g. \\`super.updateComplete.then(...)\\`) when the target\n   * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n   * This method should be overridden instead. For example:\n   *\n   *   class MyElement extends LitElement {\n   *     async _getUpdateComplete() {\n   *       await super._getUpdateComplete();\n   *       await this._myChild.updateComplete;\n   *     }\n   *   }\n   */\n  _getUpdateComplete() {\n    return this._updatePromise;\n  }\n  /**\n   * Controls whether or not \\`update\\` should be called when the element requests\n   * an update. By default, this method always returns \\`true\\`, but this can be\n   * customized to control when to update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  shouldUpdate(_changedProperties) {\n    return true;\n  }\n  /**\n   * Updates the element. This method reflects property values to attributes.\n   * It can be overridden to render and keep updated element DOM.\n   * Setting properties inside this method will *not* trigger\n   * another update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  update(_changedProperties) {\n    if (this._reflectingProperties !== undefined && this._reflectingProperties.size > 0) {\n      // Use forEach so this works even if for/of loops are compiled to for\n      // loops expecting arrays\n      this._reflectingProperties.forEach((v, k) => this._propertyToAttribute(k, this[k], v));\n      this._reflectingProperties = undefined;\n    }\n    this._markUpdated();\n  }\n  /**\n   * Invoked whenever the element is updated. Implement to perform\n   * post-updating tasks via DOM APIs, for example, focusing an element.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  updated(_changedProperties) {}\n  /**\n   * Invoked when the element is first updated. Implement to perform one time\n   * work on the element after update.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  firstUpdated(_changedProperties) {}\n}\n_a = finalized;\n/**\n * Marks class as having finished creating properties.\n */\nUpdatingElement[_a] = true;\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst legacyCustomElement = (tagName, clazz) => {\n  window.customElements.define(tagName, clazz); // Cast as any because TS doesn't recognize the return type as being a\n  // subtype of the decorated class when clazz is typed as\n  // \\`Constructor<HTMLElement>\\` for some reason.\n  // \\`Constructor<HTMLElement>\\` is helpful to make sure the decorator is\n  // applied to elements however.\n  // tslint:disable-next-line:no-any\n  return clazz;\n};\nconst standardCustomElement = (tagName, descriptor) => {\n  const {\n    kind,\n    elements\n  } = descriptor;\n  return {\n    kind,\n    elements,\n    // This callback is called once the class is otherwise fully defined\n    finisher(clazz) {\n      window.customElements.define(tagName, clazz);\n    }\n  };\n};\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * \\`\\`\\`\n * @customElement('my-element')\n * class MyElement {\n *   render() {\n *     return html\\`\\`;\n *   }\n * }\n * \\`\\`\\`\n * @category Decorator\n * @param tagName The name of the custom element to define.\n */\nconst customElement = tagName => classOrDescriptor => typeof classOrDescriptor === 'function' ? legacyCustomElement(tagName, classOrDescriptor) : standardCustomElement(tagName, classOrDescriptor);\nconst standardProperty = (options, element) => {\n  // When decorating an accessor, pass it through and add property metadata.\n  // Note, the \\`hasOwnProperty\\` check in \\`createProperty\\` ensures we don't\n  // stomp over the user's accessor.\n  if (element.kind === 'method' && element.descriptor && !('value' in element.descriptor)) {\n    return Object.assign(Object.assign({}, element), {\n      finisher(clazz) {\n        clazz.createProperty(element.key, options);\n      }\n    });\n  } else {\n    // createProperty() takes care of defining the property, but we still\n    // must return some kind of descriptor, so return a descriptor for an\n    // unused prototype field. The finisher calls createProperty().\n    return {\n      kind: 'field',\n      key: Symbol(),\n      placement: 'own',\n      descriptor: {},\n      // When @babel/plugin-proposal-decorators implements initializers,\n      // do this instead of the initializer below. See:\n      // https://github.com/babel/babel/issues/9260 extras: [\n      //   {\n      //     kind: 'initializer',\n      //     placement: 'own',\n      //     initializer: descriptor.initializer,\n      //   }\n      // ],\n      initializer() {\n        if (typeof element.initializer === 'function') {\n          this[element.key] = element.initializer.call(this);\n        }\n      },\n      finisher(clazz) {\n        clazz.createProperty(element.key, options);\n      }\n    };\n  }\n};\nconst legacyProperty = (options, proto, name) => {\n  proto.constructor.createProperty(name, options);\n};\n/**\n * A property decorator which creates a LitElement property which reflects a\n * corresponding attribute value. A [[\\`PropertyDeclaration\\`]] may optionally be\n * supplied to configure property features.\n *\n * This decorator should only be used for public fields. Private or protected\n * fields should use the [[\\`internalProperty\\`]] decorator.\n *\n * @example\n * \\`\\`\\`ts\n * class MyElement {\n *   @property({ type: Boolean })\n *   clicked = false;\n * }\n * \\`\\`\\`\n * @category Decorator\n * @ExportDecoratedItems\n */\nfunction property(options) {\n  // tslint:disable-next-line:no-any decorator\n  return (protoOrDescriptor, name) => name !== undefined ? legacyProperty(options, protoOrDescriptor, name) : standardProperty(options, protoOrDescriptor);\n}\n/**\n@license\nCopyright (c) 2019 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\n/**\n * Whether the current browser supports \\`adoptedStyleSheets\\`.\n */\nconst supportsAdoptingStyleSheets = window.ShadowRoot && (window.ShadyCSS === undefined || window.ShadyCSS.nativeShadow) && 'adoptedStyleSheets' in Document.prototype && 'replace' in CSSStyleSheet.prototype;\nconst constructionToken = Symbol();\nclass CSSResult {\n  constructor(cssText, safeToken) {\n    if (safeToken !== constructionToken) {\n      throw new Error('CSSResult is not constructable. Use \\`unsafeCSS\\` or \\`css\\` instead.');\n    }\n    this.cssText = cssText;\n  } // Note, this is a getter so that it's lazy. In practice, this means\n  // stylesheets are not created until the first element instance is made.\n  get styleSheet() {\n    if (this._styleSheet === undefined) {\n      // Note, if \\`supportsAdoptingStyleSheets\\` is true then we assume\n      // CSSStyleSheet is constructable.\n      if (supportsAdoptingStyleSheets) {\n        this._styleSheet = new CSSStyleSheet();\n        this._styleSheet.replaceSync(this.cssText);\n      } else {\n        this._styleSheet = null;\n      }\n    }\n    return this._styleSheet;\n  }\n  toString() {\n    return this.cssText;\n  }\n}\n/**\n * Wrap a value for interpolation in a [[\\`css\\`]] tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nconst unsafeCSS = value => {\n  return new CSSResult(String(value), constructionToken);\n};\nconst textFromCSSResult = value => {\n  if (value instanceof CSSResult) {\n    return value.cssText;\n  } else if (typeof value === 'number') {\n    return value;\n  } else {\n    throw new Error(\\`Value passed to 'css' function must be a 'css' function result: \\${value}. Use 'unsafeCSS' to pass non-literal values, but\n            take care to ensure page security.\\`);\n  }\n};\n/**\n * Template tag which which can be used with LitElement's [[LitElement.styles |\n * \\`styles\\`]] property to set element styles. For security reasons, only literal\n * string values may be used. To incorporate non-literal values [[\\`unsafeCSS\\`]]\n * may be used inside a template string part.\n */\nconst css = (strings, ...values) => {\n  const cssText = values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);\n  return new CSSResult(cssText, constructionToken);\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n// This line will be used in regexes to search for LitElement usage.\n// TODO(justinfagnani): inject version number at build time\n(window['litElementVersions'] || (window['litElementVersions'] = [])).push('2.4.0');\n/**\n * Sentinal value used to avoid calling lit-html's render function when\n * subclasses do not implement \\`render\\`\n */\nconst renderNotImplemented = {};\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass \\`LitElement\\` and implement a\n * \\`render\\` method to provide the component's template. Define properties\n * using the [[\\`properties\\`]] property or the [[\\`property\\`]] decorator.\n */\nclass LitElement extends UpdatingElement {\n  /**\n   * Return the array of styles to apply to the element.\n   * Override this method to integrate into a style management system.\n   *\n   * @nocollapse\n   */\n  static getStyles() {\n    return this.styles;\n  }\n  /** @nocollapse */\n  static _getUniqueStyles() {\n    // Only gather styles once per class\n    if (this.hasOwnProperty(JSCompiler_renameProperty('_styles', this))) {\n      return;\n    } // Take care not to call \\`this.getStyles()\\` multiple times since this\n    // generates new CSSResults each time.\n    // TODO(sorvell): Since we do not cache CSSResults by input, any\n    // shared styles will generate new stylesheet objects, which is wasteful.\n    // This should be addressed when a browser ships constructable\n    // stylesheets.\n    const userStyles = this.getStyles();\n    if (Array.isArray(userStyles)) {\n      // De-duplicate styles preserving the _last_ instance in the set.\n      // This is a performance optimization to avoid duplicated styles that can\n      // occur especially when composing via subclassing.\n      // The last item is kept to try to preserve the cascade order with the\n      // assumption that it's most important that last added styles override\n      // previous styles.\n      const addStyles = (styles, set) => styles.reduceRight((set, s) => // Note: On IE set.add() does not return the set\n      Array.isArray(s) ? addStyles(s, set) : (set.add(s), set), set); // Array.from does not work on Set in IE, otherwise return\n      // Array.from(addStyles(userStyles, new Set<CSSResult>())).reverse()\n      const set = addStyles(userStyles, new Set());\n      const styles = [];\n      set.forEach(v => styles.unshift(v));\n      this._styles = styles;\n    } else {\n      this._styles = userStyles === undefined ? [] : [userStyles];\n    } // Ensure that there are no invalid CSSStyleSheet instances here. They are\n    // invalid in two conditions.\n    // (1) the sheet is non-constructible (\\`sheet\\` of a HTMLStyleElement), but\n    //     this is impossible to check except via .replaceSync or use\n    // (2) the ShadyCSS polyfill is enabled (:. supportsAdoptingStyleSheets is\n    //     false)\n    this._styles = this._styles.map(s => {\n      if (s instanceof CSSStyleSheet && !supportsAdoptingStyleSheets) {\n        // Flatten the cssText from the passed constructible stylesheet (or\n        // undetectable non-constructible stylesheet). The user might have\n        // expected to update their stylesheets over time, but the alternative\n        // is a crash.\n        const cssText = Array.prototype.slice.call(s.cssRules).reduce((css, rule) => css + rule.cssText, '');\n        return unsafeCSS(cssText);\n      }\n      return s;\n    });\n  }\n  /**\n   * Performs element initialization. By default this calls\n   * [[\\`createRenderRoot\\`]] to create the element [[\\`renderRoot\\`]] node and\n   * captures any pre-set values for registered properties.\n   */\n  initialize() {\n    super.initialize();\n    this.constructor._getUniqueStyles();\n    this.renderRoot = this.createRenderRoot(); // Note, if renderRoot is not a shadowRoot, styles would/could apply to the\n    // element's getRootNode(). While this could be done, we're choosing not to\n    // support this now since it would require different logic around de-duping.\n    if (window.ShadowRoot && this.renderRoot instanceof window.ShadowRoot) {\n      this.adoptStyles();\n    }\n  }\n  /**\n   * Returns the node into which the element should render and by default\n   * creates and returns an open shadowRoot. Implement to customize where the\n   * element's DOM is rendered. For example, to render into the element's\n   * childNodes, return \\`this\\`.\n   * @returns {Element|DocumentFragment} Returns a node into which to render.\n   */\n  createRenderRoot() {\n    return this.attachShadow({\n      mode: 'open'\n    });\n  }\n  /**\n   * Applies styling to the element shadowRoot using the [[\\`styles\\`]]\n   * property. Styling will apply using \\`shadowRoot.adoptedStyleSheets\\` where\n   * available and will fallback otherwise. When Shadow DOM is polyfilled,\n   * ShadyCSS scopes styles and adds them to the document. When Shadow DOM\n   * is available but \\`adoptedStyleSheets\\` is not, styles are appended to the\n   * end of the \\`shadowRoot\\` to [mimic spec\n   * behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\n   */\n  adoptStyles() {\n    const styles = this.constructor._styles;\n    if (styles.length === 0) {\n      return;\n    } // There are three separate cases here based on Shadow DOM support.\n    // (1) shadowRoot polyfilled: use ShadyCSS\n    // (2) shadowRoot.adoptedStyleSheets available: use it\n    // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n    // rendering\n    if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n      window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s => s.cssText), this.localName);\n    } else if (supportsAdoptingStyleSheets) {\n      this.renderRoot.adoptedStyleSheets = styles.map(s => s instanceof CSSStyleSheet ? s : s.styleSheet);\n    } else {\n      // This must be done after rendering so the actual style insertion is done\n      // in \\`update\\`.\n      this._needsShimAdoptedStyleSheets = true;\n    }\n  }\n  connectedCallback() {\n    super.connectedCallback(); // Note, first update/render handles styleElement so we only call this if\n    // connected after first update.\n    if (this.hasUpdated && window.ShadyCSS !== undefined) {\n      window.ShadyCSS.styleElement(this);\n    }\n  }\n  /**\n   * Updates the element. This method reflects property values to attributes\n   * and calls \\`render\\` to render DOM via lit-html. Setting properties inside\n   * this method will *not* trigger another update.\n   * @param _changedProperties Map of changed properties with old values\n   */\n  update(changedProperties) {\n    // Setting properties in \\`render\\` should not trigger an update. Since\n    // updates are allowed after super.update, it's important to call \\`render\\`\n    // before that.\n    const templateResult = this.render();\n    super.update(changedProperties); // If render is not implemented by the component, don't call lit-html render\n    if (templateResult !== renderNotImplemented) {\n      this.constructor.render(templateResult, this.renderRoot, {\n        scopeName: this.localName,\n        eventContext: this\n      });\n    } // When native Shadow DOM is used but adoptedStyles are not supported,\n    // insert styling after rendering to ensure adoptedStyles have highest\n    // priority.\n    if (this._needsShimAdoptedStyleSheets) {\n      this._needsShimAdoptedStyleSheets = false;\n      this.constructor._styles.forEach(s => {\n        const style = document.createElement('style');\n        style.textContent = s.cssText;\n        this.renderRoot.appendChild(style);\n      });\n    }\n  }\n  /**\n   * Invoked on each update to perform rendering tasks. This method may return\n   * any value renderable by lit-html's \\`NodePart\\` - typically a\n   * \\`TemplateResult\\`. Setting properties inside this method will *not* trigger\n   * the element to update.\n   */\n  render() {\n    return renderNotImplemented;\n  }\n}\n/**\n * Ensure this class is marked as \\`finalized\\` as an optimization ensuring\n * it will not needlessly try to \\`finalize\\`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See updating-element.ts for more information.\n */\nLitElement['finalized'] = true;\n/**\n * Reference to the underlying library method used to render the element's\n * DOM. By default, points to the \\`render\\` method from lit-html's shady-render\n * module.\n *\n * **Most users will never need to touch this property.**\n *\n * This  property should not be confused with the \\`render\\` instance method,\n * which should be overridden to define a template for the element.\n *\n * Advanced users creating a new base class based on LitElement can override\n * this property to point to a custom render method with a signature that\n * matches [shady-render's \\`render\\`\n * method](https://lit-html.polymer-project.org/api/modules/shady_render.html#render).\n *\n * @nocollapse\n */\nLitElement.render = render$1;\nexport { LitElement, css, customElement, html, property };\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element > build: allFiles 1`] = `\nArray [\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/lit-element.js\",\n  \"dist/app-root.js\",\n  \"dist/index.js\",\n  \"favicon.ico\",\n  \"index.css\",\n  \"index.html\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-lit-element > build: dist/app-root.js 1`] = `\n\"function _decorate(decorators, factory, superClass, mixins) { var api = _getDecoratorsApi(); if (mixins) { for (var i = 0; i < mixins.length; i++) { api = mixins[i](api); } } var r = factory(function initialize(O) { api.initializeInstanceElements(O, decorated.elements); }, superClass); var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); api.initializeClassElements(r.F, decorated.elements); return api.runClassFinishers(r.F, decorated.finishers); }\nfunction _getDecoratorsApi() { _getDecoratorsApi = function () { return api; }; var api = { elementsDefinitionOrder: [[\\\\\"method\\\\\"], [\\\\\"field\\\\\"]], initializeInstanceElements: function (O, elements) { [\\\\\"method\\\\\", \\\\\"field\\\\\"].forEach(function (kind) { elements.forEach(function (element) { if (element.kind === kind && element.placement === \\\\\"own\\\\\") { this.defineClassElement(O, element); } }, this); }, this); }, initializeClassElements: function (F, elements) { var proto = F.prototype; [\\\\\"method\\\\\", \\\\\"field\\\\\"].forEach(function (kind) { elements.forEach(function (element) { var placement = element.placement; if (element.kind === kind && (placement === \\\\\"static\\\\\" || placement === \\\\\"prototype\\\\\")) { var receiver = placement === \\\\\"static\\\\\" ? F : proto; this.defineClassElement(receiver, element); } }, this); }, this); }, defineClassElement: function (receiver, element) { var descriptor = element.descriptor; if (element.kind === \\\\\"field\\\\\") { var initializer = element.initializer; descriptor = { enumerable: descriptor.enumerable, writable: descriptor.writable, configurable: descriptor.configurable, value: initializer === void 0 ? void 0 : initializer.call(receiver) }; } Object.defineProperty(receiver, element.key, descriptor); }, decorateClass: function (elements, decorators) { var newElements = []; var finishers = []; var placements = { static: [], prototype: [], own: [] }; elements.forEach(function (element) { this.addElementPlacement(element, placements); }, this); elements.forEach(function (element) { if (!_hasDecorators(element)) return newElements.push(element); var elementFinishersExtras = this.decorateElement(element, placements); newElements.push(elementFinishersExtras.element); newElements.push.apply(newElements, elementFinishersExtras.extras); finishers.push.apply(finishers, elementFinishersExtras.finishers); }, this); if (!decorators) { return { elements: newElements, finishers: finishers }; } var result = this.decorateConstructor(newElements, decorators); finishers.push.apply(finishers, result.finishers); result.finishers = finishers; return result; }, addElementPlacement: function (element, placements, silent) { var keys = placements[element.placement]; if (!silent && keys.indexOf(element.key) !== -1) { throw new TypeError(\\\\\"Duplicated element (\\\\\" + element.key + \\\\\")\\\\\"); } keys.push(element.key); }, decorateElement: function (element, placements) { var extras = []; var finishers = []; for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { var keys = placements[element.placement]; keys.splice(keys.indexOf(element.key), 1); var elementObject = this.fromElementDescriptor(element); var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); element = elementFinisherExtras.element; this.addElementPlacement(element, placements); if (elementFinisherExtras.finisher) { finishers.push(elementFinisherExtras.finisher); } var newExtras = elementFinisherExtras.extras; if (newExtras) { for (var j = 0; j < newExtras.length; j++) { this.addElementPlacement(newExtras[j], placements); } extras.push.apply(extras, newExtras); } } return { element: element, finishers: finishers, extras: extras }; }, decorateConstructor: function (elements, decorators) { var finishers = []; for (var i = decorators.length - 1; i >= 0; i--) { var obj = this.fromClassDescriptor(elements); var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); if (elementsAndFinisher.finisher !== undefined) { finishers.push(elementsAndFinisher.finisher); } if (elementsAndFinisher.elements !== undefined) { elements = elementsAndFinisher.elements; for (var j = 0; j < elements.length - 1; j++) { for (var k = j + 1; k < elements.length; k++) { if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { throw new TypeError(\\\\\"Duplicated element (\\\\\" + elements[j].key + \\\\\")\\\\\"); } } } } } return { elements: elements, finishers: finishers }; }, fromElementDescriptor: function (element) { var obj = { kind: element.kind, key: element.key, placement: element.placement, descriptor: element.descriptor }; var desc = { value: \\\\\"Descriptor\\\\\", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); if (element.kind === \\\\\"field\\\\\") obj.initializer = element.initializer; return obj; }, toElementDescriptors: function (elementObjects) { if (elementObjects === undefined) return; return _toArray(elementObjects).map(function (elementObject) { var element = this.toElementDescriptor(elementObject); this.disallowProperty(elementObject, \\\\\"finisher\\\\\", \\\\\"An element descriptor\\\\\"); this.disallowProperty(elementObject, \\\\\"extras\\\\\", \\\\\"An element descriptor\\\\\"); return element; }, this); }, toElementDescriptor: function (elementObject) { var kind = String(elementObject.kind); if (kind !== \\\\\"method\\\\\" && kind !== \\\\\"field\\\\\") { throw new TypeError('An element descriptor\\\\\\\\'s .kind property must be either \\\\\"method\\\\\" or' + ' \\\\\"field\\\\\", but a decorator created an element descriptor with' + ' .kind \\\\\"' + kind + '\\\\\"'); } var key = _toPropertyKey(elementObject.key); var placement = String(elementObject.placement); if (placement !== \\\\\"static\\\\\" && placement !== \\\\\"prototype\\\\\" && placement !== \\\\\"own\\\\\") { throw new TypeError('An element descriptor\\\\\\\\'s .placement property must be one of \\\\\"static\\\\\",' + ' \\\\\"prototype\\\\\" or \\\\\"own\\\\\", but a decorator created an element descriptor' + ' with .placement \\\\\"' + placement + '\\\\\"'); } var descriptor = elementObject.descriptor; this.disallowProperty(elementObject, \\\\\"elements\\\\\", \\\\\"An element descriptor\\\\\"); var element = { kind: kind, key: key, placement: placement, descriptor: Object.assign({}, descriptor) }; if (kind !== \\\\\"field\\\\\") { this.disallowProperty(elementObject, \\\\\"initializer\\\\\", \\\\\"A method descriptor\\\\\"); } else { this.disallowProperty(descriptor, \\\\\"get\\\\\", \\\\\"The property descriptor of a field descriptor\\\\\"); this.disallowProperty(descriptor, \\\\\"set\\\\\", \\\\\"The property descriptor of a field descriptor\\\\\"); this.disallowProperty(descriptor, \\\\\"value\\\\\", \\\\\"The property descriptor of a field descriptor\\\\\"); element.initializer = elementObject.initializer; } return element; }, toElementFinisherExtras: function (elementObject) { var element = this.toElementDescriptor(elementObject); var finisher = _optionalCallableProperty(elementObject, \\\\\"finisher\\\\\"); var extras = this.toElementDescriptors(elementObject.extras); return { element: element, finisher: finisher, extras: extras }; }, fromClassDescriptor: function (elements) { var obj = { kind: \\\\\"class\\\\\", elements: elements.map(this.fromElementDescriptor, this) }; var desc = { value: \\\\\"Descriptor\\\\\", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); return obj; }, toClassDescriptor: function (obj) { var kind = String(obj.kind); if (kind !== \\\\\"class\\\\\") { throw new TypeError('A class descriptor\\\\\\\\'s .kind property must be \\\\\"class\\\\\", but a decorator' + ' created a class descriptor with .kind \\\\\"' + kind + '\\\\\"'); } this.disallowProperty(obj, \\\\\"key\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"placement\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"descriptor\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"initializer\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"extras\\\\\", \\\\\"A class descriptor\\\\\"); var finisher = _optionalCallableProperty(obj, \\\\\"finisher\\\\\"); var elements = this.toElementDescriptors(obj.elements); return { elements: elements, finisher: finisher }; }, runClassFinishers: function (constructor, finishers) { for (var i = 0; i < finishers.length; i++) { var newConstructor = (0, finishers[i])(constructor); if (newConstructor !== undefined) { if (typeof newConstructor !== \\\\\"function\\\\\") { throw new TypeError(\\\\\"Finishers must return a constructor.\\\\\"); } constructor = newConstructor; } } return constructor; }, disallowProperty: function (obj, name, objectType) { if (obj[name] !== undefined) { throw new TypeError(objectType + \\\\\" can't have a .\\\\\" + name + \\\\\" property.\\\\\"); } } }; return api; }\nfunction _createElementDescriptor(def) { var key = _toPropertyKey(def.key); var descriptor; if (def.kind === \\\\\"method\\\\\") { descriptor = { value: def.value, writable: true, configurable: true, enumerable: false }; } else if (def.kind === \\\\\"get\\\\\") { descriptor = { get: def.value, configurable: true, enumerable: false }; } else if (def.kind === \\\\\"set\\\\\") { descriptor = { set: def.value, configurable: true, enumerable: false }; } else if (def.kind === \\\\\"field\\\\\") { descriptor = { configurable: true, writable: true, enumerable: true }; } var element = { kind: def.kind === \\\\\"field\\\\\" ? \\\\\"field\\\\\" : \\\\\"method\\\\\", key: key, placement: def.static ? \\\\\"static\\\\\" : def.kind === \\\\\"field\\\\\" ? \\\\\"own\\\\\" : \\\\\"prototype\\\\\", descriptor: descriptor }; if (def.decorators) element.decorators = def.decorators; if (def.kind === \\\\\"field\\\\\") element.initializer = def.value; return element; }\nfunction _coalesceGetterSetter(element, other) { if (element.descriptor.get !== undefined) { other.descriptor.get = element.descriptor.get; } else { other.descriptor.set = element.descriptor.set; } }\nfunction _coalesceClassElements(elements) { var newElements = []; var isSameElement = function (other) { return other.kind === \\\\\"method\\\\\" && other.key === element.key && other.placement === element.placement; }; for (var i = 0; i < elements.length; i++) { var element = elements[i]; var other; if (element.kind === \\\\\"method\\\\\" && (other = newElements.find(isSameElement))) { if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { if (_hasDecorators(element) || _hasDecorators(other)) { throw new ReferenceError(\\\\\"Duplicated methods (\\\\\" + element.key + \\\\\") can't be decorated.\\\\\"); } other.descriptor = element.descriptor; } else { if (_hasDecorators(element)) { if (_hasDecorators(other)) { throw new ReferenceError(\\\\\"Decorators can't be placed on different accessors with for \\\\\" + \\\\\"the same property (\\\\\" + element.key + \\\\\").\\\\\"); } other.decorators = element.decorators; } _coalesceGetterSetter(element, other); } } else { newElements.push(element); } } return newElements; }\nfunction _hasDecorators(element) { return element.decorators && element.decorators.length; }\nfunction _isDataDescriptor(desc) { return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); }\nfunction _optionalCallableProperty(obj, name) { var value = obj[name]; if (value !== undefined && typeof value !== \\\\\"function\\\\\") { throw new TypeError(\\\\\"Expected '\\\\\" + name + \\\\\"' to be a function\\\\\"); } return value; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \\\\\"string\\\\\"); return typeof key === \\\\\"symbol\\\\\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \\\\\"object\\\\\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \\\\\"default\\\\\"); if (typeof res !== \\\\\"object\\\\\") return res; throw new TypeError(\\\\\"@@toPrimitive must return a primitive value.\\\\\"); } return (hint === \\\\\"string\\\\\" ? String : Number)(input); }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\\\\\"Invalid attempt to destructure non-iterable instance.In order to be iterable, non-array objects must have a [Symbol.iterator]() method.\\\\\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \\\\\"string\\\\\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \\\\\"Object\\\\\" && o.constructor) n = o.constructor.name; if (n === \\\\\"Map\\\\\" || n === \\\\\"Set\\\\\") return Array.from(o); if (n === \\\\\"Arguments\\\\\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \\\\\"undefined\\\\\" && iter[Symbol.iterator] != null || iter[\\\\\"@@iterator\\\\\"] != null) return Array.from(iter); }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { customElement, property, LitElement, html, css } from '../_snowpack/pkg/lit-element.js';\nexport let AppRoot = _decorate([customElement('app-root')], function (_initialize, _LitElement) {\n  class AppRoot extends _LitElement {\n    constructor(...args) {\n      super(...args);\n      _initialize(this);\n    }\n  }\n  return {\n    F: AppRoot,\n    d: [{\n      kind: \\\\\"field\\\\\",\n      decorators: [property()],\n      key: \\\\\"message\\\\\",\n      value() {\n        return 'Learn LitElement';\n      }\n    }, {\n      kind: \\\\\"get\\\\\",\n      static: true,\n      key: \\\\\"styles\\\\\",\n      value: function styles() {\n        return css\\`\n      h1 {\n        font-size: 4rem;\n      }\n      .wrapper {\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        flex-direction: column;\n        height: 100vh;\n        background-color: #2196f3;\n        background: linear-gradient(315deg, #b4d2ea 0%, #2196f3 100%);\n        font-size: 24px;\n      }\n      .link {\n        color: white;\n      }\n    \\`;\n      }\n    }, {\n      kind: \\\\\"method\\\\\",\n      key: \\\\\"render\\\\\",\n      value: function render() {\n        return html\\`\n      <div class=\\\\\"wrapper\\\\\">\n        <h1>LitElement + Snowpack</h1>\n        <p>Edit <code>src/app-root.js</code> and save to reload.</p>\n        <a\n          class=\\\\\"link\\\\\"\n          href=\\\\\"https://lit-element.polymer-project.org/\\\\\"\n          target=\\\\\"_blank\\\\\"\n          rel=\\\\\"noopener noreferrer\\\\\"\n        >\n          \\${this.message}\n        </a>\n      </div>\n    \\`;\n      }\n    }]\n  };\n}, LitElement);\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element > build: dist/index.js 1`] = `\"import './app-root.js';\"`;\n\nexports[`create-snowpack-app app-template-lit-element > build: index.css 1`] = `\n\"body {\n  font-family: -apple-system, BlinkMacSystemFont, \\\\\"Segoe UI\\\\\", \\\\\"Roboto\\\\\", \\\\\"Oxygen\\\\\", \\\\\"Ubuntu\\\\\", \\\\\"Cantarell\\\\\", \\\\\"Fira Sans\\\\\", \\\\\"Droid Sans\\\\\", \\\\\"Helvetica Neue\\\\\", sans-serif;\n  color: white;\n  margin: 0;\n  padding: 0;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/index.css\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <app-root></app-root>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"lit-element\\\\\": \\\\\"./lit-element.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: _snowpack/pkg/lit-element.js 1`] = `\n\"/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * True if the custom elements polyfill is in use.\n */\nconst isCEPolyfill = typeof window !== 'undefined' && window.customElements != null && window.customElements.polyfillWrapFlushCallback !== undefined;\n/**\n * Removes nodes, starting from \\`start\\` (inclusive) to \\`end\\` (exclusive), from\n * \\`container\\`.\n */\nconst removeNodes = (container, start, end = null) => {\n  while (start !== end) {\n    const n = start.nextSibling;\n    container.removeChild(start);\n    start = n;\n  }\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nconst marker = \\`{{lit-\\${String(Math.random()).slice(2)}}}\\`;\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nconst nodeMarker = \\`<!--\\${marker}-->\\`;\nconst markerRegex = new RegExp(\\`\\${marker}|\\${nodeMarker}\\`);\n/**\n * Suffix appended to all bound attribute names.\n */\nconst boundAttributeSuffix = '$lit$';\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nclass Template {\n  constructor(result, element) {\n    this.parts = [];\n    this.element = element;\n    const nodesToRemove = [];\n    const stack = []; // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n    const walker = document.createTreeWalker(element.content, 133\n    , null, false); // Keeps track of the last index associated with a part. We try to delete\n    // unnecessary nodes, but we never want to associate two different parts\n    // to the same index. They must have a constant node between.\n    let lastPartIndex = 0;\n    let index = -1;\n    let partIndex = 0;\n    const {\n      strings,\n      values: {\n        length\n      }\n    } = result;\n    while (partIndex < length) {\n      const node = walker.nextNode();\n      if (node === null) {\n        // We've exhausted the content inside a nested template element.\n        // Because we still have parts (the outer for-loop), we know:\n        // - There is a template in the stack\n        // - The walker will find a nextNode outside the template\n        walker.currentNode = stack.pop();\n        continue;\n      }\n      index++;\n      if (node.nodeType === 1\n      ) {\n          if (node.hasAttributes()) {\n            const attributes = node.attributes;\n            const {\n              length\n            } = attributes; // Per\n            // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n            // attributes are not guaranteed to be returned in document order.\n            // In particular, Edge/IE can return them out of order, so we cannot\n            // assume a correspondence between part index and attribute index.\n            let count = 0;\n            for (let i = 0; i < length; i++) {\n              if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n                count++;\n              }\n            }\n            while (count-- > 0) {\n              // Get the template literal section leading up to the first\n              // expression in this attribute\n              const stringForPart = strings[partIndex]; // Find the attribute name\n              const name = lastAttributeNameRegex.exec(stringForPart)[2]; // Find the corresponding attribute\n              // All bound attributes have had a suffix added in\n              // TemplateResult#getHTML to opt out of special attribute\n              // handling. To look up the attribute value we also need to add\n              // the suffix.\n              const attributeLookupName = name.toLowerCase() + boundAttributeSuffix;\n              const attributeValue = node.getAttribute(attributeLookupName);\n              node.removeAttribute(attributeLookupName);\n              const statics = attributeValue.split(markerRegex);\n              this.parts.push({\n                type: 'attribute',\n                index,\n                name,\n                strings: statics\n              });\n              partIndex += statics.length - 1;\n            }\n          }\n          if (node.tagName === 'TEMPLATE') {\n            stack.push(node);\n            walker.currentNode = node.content;\n          }\n        } else if (node.nodeType === 3\n      ) {\n          const data = node.data;\n          if (data.indexOf(marker) >= 0) {\n            const parent = node.parentNode;\n            const strings = data.split(markerRegex);\n            const lastIndex = strings.length - 1; // Generate a new text node for each literal section\n            // These nodes are also used as the markers for node parts\n            for (let i = 0; i < lastIndex; i++) {\n              let insert;\n              let s = strings[i];\n              if (s === '') {\n                insert = createMarker();\n              } else {\n                const match = lastAttributeNameRegex.exec(s);\n                if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n                  s = s.slice(0, match.index) + match[1] + match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n                }\n                insert = document.createTextNode(s);\n              }\n              parent.insertBefore(insert, node);\n              this.parts.push({\n                type: 'node',\n                index: ++index\n              });\n            } // If there's no text, we must insert a comment to mark our place.\n            // Else, we can trust it will stick around after cloning.\n            if (strings[lastIndex] === '') {\n              parent.insertBefore(createMarker(), node);\n              nodesToRemove.push(node);\n            } else {\n              node.data = strings[lastIndex];\n            } // We have a part for each match found\n            partIndex += lastIndex;\n          }\n        } else if (node.nodeType === 8\n      ) {\n          if (node.data === marker) {\n            const parent = node.parentNode; // Add a new marker node to be the startNode of the Part if any of\n            // the following are true:\n            //  * We don't have a previousSibling\n            //  * The previousSibling is already the start of a previous part\n            if (node.previousSibling === null || index === lastPartIndex) {\n              index++;\n              parent.insertBefore(createMarker(), node);\n            }\n            lastPartIndex = index;\n            this.parts.push({\n              type: 'node',\n              index\n            }); // If we don't have a nextSibling, keep this node so we have an end.\n            // Else, we can remove it to save future costs.\n            if (node.nextSibling === null) {\n              node.data = '';\n            } else {\n              nodesToRemove.push(node);\n              index--;\n            }\n            partIndex++;\n          } else {\n            let i = -1;\n            while ((i = node.data.indexOf(marker, i + 1)) !== -1) {\n              // Comment node has a binding marker inside, make an inactive part\n              // The binding won't work, but subsequent bindings will\n              // TODO (justinfagnani): consider whether it's even worth it to\n              // make bindings in comments work\n              this.parts.push({\n                type: 'node',\n                index: -1\n              });\n              partIndex++;\n            }\n          }\n        }\n    } // Remove text binding nodes after the walk to not disturb the TreeWalker\n    for (const n of nodesToRemove) {\n      n.parentNode.removeChild(n);\n    }\n  }\n}\nconst endsWith = (str, suffix) => {\n  const index = str.length - suffix.length;\n  return index >= 0 && str.slice(index) === suffix;\n};\nconst isTemplatePartActive = part => part.index !== -1; // Allows \\`document.createComment('')\\` to be renamed for a\n// small manual size-savings.\nconst createMarker = () => document.createComment('');\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \\\\\" \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d\\\\\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \\\\\"\\\\\\\\0-\\\\\\\\x1F\\\\\\\\x7F-\\\\\\\\x9F\\\\\" are Unicode control characters, which includes every\n * space character except \\\\\" \\\\\".\n *\n * So an attribute is:\n *  * The name: any character except a control character, space character, ('),\n *    (\\\\\"), \\\\\">\\\\\", \\\\\"=\\\\\", or \\\\\"/\\\\\"\n *  * Followed by zero or more space characters\n *  * Followed by \\\\\"=\\\\\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\\\\\"), \\\\\"<\\\\\", \\\\\">\\\\\", \\\\\"=\\\\\", (\\`), or\n *    * (\\\\\") then any non-(\\\\\"), or\n *    * (') then any non-(')\n */\nconst lastAttributeNameRegex = // eslint-disable-next-line no-control-regex\n/([ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d])([^\\\\\\\\0-\\\\\\\\x1F\\\\\\\\x7F-\\\\\\\\x9F \\\\\"'>=/]+)([ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d]*=[ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d]*(?:[^ \\\\\\\\x09\\\\\\\\x0a\\\\\\\\x0c\\\\\\\\x0d\\\\\"'\\`<>=]*|\\\\\"[^\\\\\"]*|'[^']*))$/;\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst walkerNodeFilter = 133\n;\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n *   div#1 (remove) <-- start removing (removing node is div#1)\n *     div\n *       div#2 (remove)  <-- continue removing (removing node is still div#1)\n *         div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nfunction removeNodesFromTemplate(template, nodesToRemove) {\n  const {\n    element: {\n      content\n    },\n    parts\n  } = template;\n  const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n  let partIndex = nextActiveIndexInTemplateParts(parts);\n  let part = parts[partIndex];\n  let nodeIndex = -1;\n  let removeCount = 0;\n  const nodesToRemoveInTemplate = [];\n  let currentRemovingNode = null;\n  while (walker.nextNode()) {\n    nodeIndex++;\n    const node = walker.currentNode; // End removal if stepped past the removing node\n    if (node.previousSibling === currentRemovingNode) {\n      currentRemovingNode = null;\n    } // A node to remove was found in the template\n    if (nodesToRemove.has(node)) {\n      nodesToRemoveInTemplate.push(node); // Track node we're removing\n      if (currentRemovingNode === null) {\n        currentRemovingNode = node;\n      }\n    } // When removing, increment count by which to adjust subsequent part indices\n    if (currentRemovingNode !== null) {\n      removeCount++;\n    }\n    while (part !== undefined && part.index === nodeIndex) {\n      // If part is in a removed node deactivate it by setting index to -1 or\n      // adjust the index as needed.\n      part.index = currentRemovingNode !== null ? -1 : part.index - removeCount; // go to the next active part.\n      partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n      part = parts[partIndex];\n    }\n  }\n  nodesToRemoveInTemplate.forEach(n => n.parentNode.removeChild(n));\n}\nconst countNodes = node => {\n  let count = node.nodeType === 11\n  ? 0 : 1;\n  const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n  while (walker.nextNode()) {\n    count++;\n  }\n  return count;\n};\nconst nextActiveIndexInTemplateParts = (parts, startIndex = -1) => {\n  for (let i = startIndex + 1; i < parts.length; i++) {\n    const part = parts[i];\n    if (isTemplatePartActive(part)) {\n      return i;\n    }\n  }\n  return -1;\n};\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nfunction insertNodeIntoTemplate(template, node, refNode = null) {\n  const {\n    element: {\n      content\n    },\n    parts\n  } = template; // If there's no refNode, then put node at end of template.\n  // No part indices need to be shifted in this case.\n  if (refNode === null || refNode === undefined) {\n    content.appendChild(node);\n    return;\n  }\n  const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n  let partIndex = nextActiveIndexInTemplateParts(parts);\n  let insertCount = 0;\n  let walkerIndex = -1;\n  while (walker.nextNode()) {\n    walkerIndex++;\n    const walkerNode = walker.currentNode;\n    if (walkerNode === refNode) {\n      insertCount = countNodes(node);\n      refNode.parentNode.insertBefore(node, refNode);\n    }\n    while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n      // If we've inserted the node, simply adjust all subsequent parts\n      if (insertCount > 0) {\n        while (partIndex !== -1) {\n          parts[partIndex].index += insertCount;\n          partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n        }\n        return;\n      }\n      partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n    }\n  }\n}\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst directives = new WeakMap();\nconst isDirective = o => {\n  return typeof o === 'function' && directives.has(o);\n};\n/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nconst noChange = {};\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nconst nothing = {};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * An instance of a \\`Template\\` that can be attached to the DOM and updated\n * with new values.\n */\nclass TemplateInstance {\n  constructor(template, processor, options) {\n    this.__parts = [];\n    this.template = template;\n    this.processor = processor;\n    this.options = options;\n  }\n  update(values) {\n    let i = 0;\n    for (const part of this.__parts) {\n      if (part !== undefined) {\n        part.setValue(values[i]);\n      }\n      i++;\n    }\n    for (const part of this.__parts) {\n      if (part !== undefined) {\n        part.commit();\n      }\n    }\n  }\n  _clone() {\n    // There are a number of steps in the lifecycle of a template instance's\n    // DOM fragment:\n    //  1. Clone - create the instance fragment\n    //  2. Adopt - adopt into the main document\n    //  3. Process - find part markers and create parts\n    //  4. Upgrade - upgrade custom elements\n    //  5. Update - set node, attribute, property, etc., values\n    //  6. Connect - connect to the document. Optional and outside of this\n    //     method.\n    //\n    // We have a few constraints on the ordering of these steps:\n    //  * We need to upgrade before updating, so that property values will pass\n    //    through any property setters.\n    //  * We would like to process before upgrading so that we're sure that the\n    //    cloned fragment is inert and not disturbed by self-modifying DOM.\n    //  * We want custom elements to upgrade even in disconnected fragments.\n    //\n    // Given these constraints, with full custom elements support we would\n    // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect\n    //\n    // But Safari does not implement CustomElementRegistry#upgrade, so we\n    // can not implement that order and still have upgrade-before-update and\n    // upgrade disconnected fragments. So we instead sacrifice the\n    // process-before-upgrade constraint, since in Custom Elements v1 elements\n    // must not modify their light DOM in the constructor. We still have issues\n    // when co-existing with CEv0 elements like Polymer 1, and with polyfills\n    // that don't strictly adhere to the no-modification rule because shadow\n    // DOM, which may be created in the constructor, is emulated by being placed\n    // in the light DOM.\n    //\n    // The resulting order is on native is: Clone, Adopt, Upgrade, Process,\n    // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade\n    // in one step.\n    //\n    // The Custom Elements v1 polyfill supports upgrade(), so the order when\n    // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update,\n    // Connect.\n    const fragment = isCEPolyfill ? this.template.element.content.cloneNode(true) : document.importNode(this.template.element.content, true);\n    const stack = [];\n    const parts = this.template.parts; // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n    const walker = document.createTreeWalker(fragment, 133\n    , null, false);\n    let partIndex = 0;\n    let nodeIndex = 0;\n    let part;\n    let node = walker.nextNode(); // Loop through all the nodes and parts of a template\n    while (partIndex < parts.length) {\n      part = parts[partIndex];\n      if (!isTemplatePartActive(part)) {\n        this.__parts.push(undefined);\n        partIndex++;\n        continue;\n      } // Progress the tree walker until we find our next part's node.\n      // Note that multiple parts may share the same node (attribute parts\n      // on a single element), so this loop may not run at all.\n      while (nodeIndex < part.index) {\n        nodeIndex++;\n        if (node.nodeName === 'TEMPLATE') {\n          stack.push(node);\n          walker.currentNode = node.content;\n        }\n        if ((node = walker.nextNode()) === null) {\n          // We've exhausted the content inside a nested template element.\n          // Because we still have parts (the outer for-loop), we know:\n          // - There is a template in the stack\n          // - The walker will find a nextNode outside the template\n          walker.currentNode = stack.pop();\n          node = walker.nextNode();\n        }\n      } // We've arrived at our part's node.\n      if (part.type === 'node') {\n        const part = this.processor.handleTextExpression(this.options);\n        part.insertAfterNode(node.previousSibling);\n        this.__parts.push(part);\n      } else {\n        this.__parts.push(...this.processor.handleAttributeExpressions(node, part.name, part.strings, this.options));\n      }\n      partIndex++;\n    }\n    if (isCEPolyfill) {\n      document.adoptNode(fragment);\n      customElements.upgrade(fragment);\n    }\n    return fragment;\n  }\n}\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = window.trustedTypes && trustedTypes.createPolicy('lit-html', {\n  createHTML: s => s\n});\nconst commentMarker = \\` \\${marker} \\`;\n/**\n * The return type of \\`html\\`, which holds a Template and the values from\n * interpolated expressions.\n */\nclass TemplateResult {\n  constructor(strings, values, type, processor) {\n    this.strings = strings;\n    this.values = values;\n    this.type = type;\n    this.processor = processor;\n  }\n  /**\n   * Returns a string of HTML used to create a \\`<template>\\` element.\n   */\n  getHTML() {\n    const l = this.strings.length - 1;\n    let html = '';\n    let isCommentBinding = false;\n    for (let i = 0; i < l; i++) {\n      const s = this.strings[i]; // For each binding we want to determine the kind of marker to insert\n      // into the template source before it's parsed by the browser's HTML\n      // parser. The marker type is based on whether the expression is in an\n      // attribute, text, or comment position.\n      //   * For node-position bindings we insert a comment with the marker\n      //     sentinel as its text content, like <!--{{lit-guid}}-->.\n      //   * For attribute bindings we insert just the marker sentinel for the\n      //     first binding, so that we support unquoted attribute bindings.\n      //     Subsequent bindings can use a comment marker because multi-binding\n      //     attributes must be quoted.\n      //   * For comment bindings we insert just the marker sentinel so we don't\n      //     close the comment.\n      //\n      // The following code scans the template source, but is *not* an HTML\n      // parser. We don't need to track the tree structure of the HTML, only\n      // whether a binding is inside a comment, and if not, if it appears to be\n      // the first binding in an attribute.\n      const commentOpen = s.lastIndexOf('<!--'); // We're in comment position if we have a comment open with no following\n      // comment close. Because <-- can appear in an attribute value there can\n      // be false positives.\n      isCommentBinding = (commentOpen > -1 || isCommentBinding) && s.indexOf('-->', commentOpen + 1) === -1; // Check to see if we have an attribute-like sequence preceding the\n      // expression. This can match \\\\\"name=value\\\\\" like structures in text,\n      // comments, and attribute values, so there can be false-positives.\n      const attributeMatch = lastAttributeNameRegex.exec(s);\n      if (attributeMatch === null) {\n        // We're only in this branch if we don't have a attribute-like\n        // preceding sequence. For comments, this guards against unusual\n        // attribute values like <div foo=\\\\\"<!--\\${'bar'}\\\\\">. Cases like\n        // <!-- foo=\\${'bar'}--> are handled correctly in the attribute branch\n        // below.\n        html += s + (isCommentBinding ? commentMarker : nodeMarker);\n      } else {\n        // For attributes we use just a marker sentinel, and also append a\n        // $lit$ suffix to the name to opt-out of attribute-specific parsing\n        // that IE and Edge do for style and certain SVG attributes.\n        html += s.substr(0, attributeMatch.index) + attributeMatch[1] + attributeMatch[2] + boundAttributeSuffix + attributeMatch[3] + marker;\n      }\n    }\n    html += this.strings[l];\n    return html;\n  }\n  getTemplateElement() {\n    const template = document.createElement('template');\n    let value = this.getHTML();\n    if (policy !== undefined) {\n      // this is secure because \\`this.strings\\` is a TemplateStringsArray.\n      // TODO: validate this when\n      // https://github.com/tc39/proposal-array-is-template-object is\n      // implemented.\n      value = policy.createHTML(value);\n    }\n    template.innerHTML = value;\n    return template;\n  }\n}\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst isPrimitive = value => {\n  return value === null || !(typeof value === 'object' || typeof value === 'function');\n};\nconst isIterable = value => {\n  return Array.isArray(value) || // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  !!(value && value[Symbol.iterator]);\n};\n/**\n * Writes attribute values to the DOM for a group of AttributeParts bound to a\n * single attribute. The value is only set once even if there are multiple parts\n * for an attribute.\n */\nclass AttributeCommitter {\n  constructor(element, name, strings) {\n    this.dirty = true;\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n    this.parts = [];\n    for (let i = 0; i < strings.length - 1; i++) {\n      this.parts[i] = this._createPart();\n    }\n  }\n  /**\n   * Creates a single part. Override this to create a differnt type of part.\n   */\n  _createPart() {\n    return new AttributePart(this);\n  }\n  _getValue() {\n    const strings = this.strings;\n    const l = strings.length - 1;\n    const parts = this.parts; // If we're assigning an attribute via syntax like:\n    //    attr=\\\\\"\\${foo}\\\\\"  or  attr=\\${foo}\n    // but not\n    //    attr=\\\\\"\\${foo} \\${bar}\\\\\" or attr=\\\\\"\\${foo} baz\\\\\"\n    // then we don't want to coerce the attribute value into one long\n    // string. Instead we want to just return the value itself directly,\n    // so that sanitizeDOMValue can get the actual value rather than\n    // String(value)\n    // The exception is if v is an array, in which case we do want to smash\n    // it together into a string without calling String() on the array.\n    //\n    // This also allows trusted values (when using TrustedTypes) being\n    // assigned to DOM sinks without being stringified in the process.\n    if (l === 1 && strings[0] === '' && strings[1] === '') {\n      const v = parts[0].value;\n      if (typeof v === 'symbol') {\n        return String(v);\n      }\n      if (typeof v === 'string' || !isIterable(v)) {\n        return v;\n      }\n    }\n    let text = '';\n    for (let i = 0; i < l; i++) {\n      text += strings[i];\n      const part = parts[i];\n      if (part !== undefined) {\n        const v = part.value;\n        if (isPrimitive(v) || !isIterable(v)) {\n          text += typeof v === 'string' ? v : String(v);\n        } else {\n          for (const t of v) {\n            text += typeof t === 'string' ? t : String(t);\n          }\n        }\n      }\n    }\n    text += strings[l];\n    return text;\n  }\n  commit() {\n    if (this.dirty) {\n      this.dirty = false;\n      this.element.setAttribute(this.name, this._getValue());\n    }\n  }\n}\n/**\n * A Part that controls all or part of an attribute value.\n */\nclass AttributePart {\n  constructor(committer) {\n    this.value = undefined;\n    this.committer = committer;\n  }\n  setValue(value) {\n    if (value !== noChange && (!isPrimitive(value) || value !== this.value)) {\n      this.value = value; // If the value is a not a directive, dirty the committer so that it'll\n      // call setAttribute. If the value is a directive, it'll dirty the\n      // committer if it calls setValue().\n      if (!isDirective(value)) {\n        this.committer.dirty = true;\n      }\n    }\n  }\n  commit() {\n    while (isDirective(this.value)) {\n      const directive = this.value;\n      this.value = noChange;\n      directive(this);\n    }\n    if (this.value === noChange) {\n      return;\n    }\n    this.committer.commit();\n  }\n}\n/**\n * A Part that controls a location within a Node tree. Like a Range, NodePart\n * has start and end locations and can set and update the Nodes between those\n * locations.\n *\n * NodeParts support several value types: primitives, Nodes, TemplateResults,\n * as well as arrays and iterables of those types.\n */\nclass NodePart {\n  constructor(options) {\n    this.value = undefined;\n    this.__pendingValue = undefined;\n    this.options = options;\n  }\n  /**\n   * Appends this part into a container.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendInto(container) {\n    this.startNode = container.appendChild(createMarker());\n    this.endNode = container.appendChild(createMarker());\n  }\n  /**\n   * Inserts this part after the \\`ref\\` node (between \\`ref\\` and \\`ref\\`'s next\n   * sibling). Both \\`ref\\` and its next sibling must be static, unchanging nodes\n   * such as those that appear in a literal section of a template.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterNode(ref) {\n    this.startNode = ref;\n    this.endNode = ref.nextSibling;\n  }\n  /**\n   * Appends this part into a parent part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendIntoPart(part) {\n    part.__insert(this.startNode = createMarker());\n    part.__insert(this.endNode = createMarker());\n  }\n  /**\n   * Inserts this part after the \\`ref\\` part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterPart(ref) {\n    ref.__insert(this.startNode = createMarker());\n    this.endNode = ref.endNode;\n    ref.endNode = this.startNode;\n  }\n  setValue(value) {\n    this.__pendingValue = value;\n  }\n  commit() {\n    if (this.startNode.parentNode === null) {\n      return;\n    }\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    const value = this.__pendingValue;\n    if (value === noChange) {\n      return;\n    }\n    if (isPrimitive(value)) {\n      if (value !== this.value) {\n        this.__commitText(value);\n      }\n    } else if (value instanceof TemplateResult) {\n      this.__commitTemplateResult(value);\n    } else if (value instanceof Node) {\n      this.__commitNode(value);\n    } else if (isIterable(value)) {\n      this.__commitIterable(value);\n    } else if (value === nothing) {\n      this.value = nothing;\n      this.clear();\n    } else {\n      // Fallback, will render the string representation\n      this.__commitText(value);\n    }\n  }\n  __insert(node) {\n    this.endNode.parentNode.insertBefore(node, this.endNode);\n  }\n  __commitNode(value) {\n    if (this.value === value) {\n      return;\n    }\n    this.clear();\n    this.__insert(value);\n    this.value = value;\n  }\n  __commitText(value) {\n    const node = this.startNode.nextSibling;\n    value = value == null ? '' : value; // If \\`value\\` isn't already a string, we explicitly convert it here in case\n    // it can't be implicitly converted - i.e. it's a symbol.\n    const valueAsString = typeof value === 'string' ? value : String(value);\n    if (node === this.endNode.previousSibling && node.nodeType === 3\n    ) {\n        // If we only have a single text node between the markers, we can just\n        // set its value, rather than replacing it.\n        // TODO(justinfagnani): Can we just check if this.value is primitive?\n        node.data = valueAsString;\n      } else {\n      this.__commitNode(document.createTextNode(valueAsString));\n    }\n    this.value = value;\n  }\n  __commitTemplateResult(value) {\n    const template = this.options.templateFactory(value);\n    if (this.value instanceof TemplateInstance && this.value.template === template) {\n      this.value.update(value.values);\n    } else {\n      // Make sure we propagate the template processor from the TemplateResult\n      // so that we use its syntax extension, etc. The template factory comes\n      // from the render function options so that it can control template\n      // caching and preprocessing.\n      const instance = new TemplateInstance(template, value.processor, this.options);\n      const fragment = instance._clone();\n      instance.update(value.values);\n      this.__commitNode(fragment);\n      this.value = instance;\n    }\n  }\n  __commitIterable(value) {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html\\`\\${i}\\`), by reusing existing TemplateInstances.\n    // If _value is an array, then the previous render was of an\n    // iterable and _value will contain the NodeParts from the previous\n    // render. If _value is not an array, clear this part and make a new\n    // array for NodeParts.\n    if (!Array.isArray(this.value)) {\n      this.value = [];\n      this.clear();\n    } // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this.value;\n    let partIndex = 0;\n    let itemPart;\n    for (const item of value) {\n      // Try to reuse an existing part\n      itemPart = itemParts[partIndex]; // If no existing part, create a new one\n      if (itemPart === undefined) {\n        itemPart = new NodePart(this.options);\n        itemParts.push(itemPart);\n        if (partIndex === 0) {\n          itemPart.appendIntoPart(this);\n        } else {\n          itemPart.insertAfterPart(itemParts[partIndex - 1]);\n        }\n      }\n      itemPart.setValue(item);\n      itemPart.commit();\n      partIndex++;\n    }\n    if (partIndex < itemParts.length) {\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n      this.clear(itemPart && itemPart.endNode);\n    }\n  }\n  clear(startNode = this.startNode) {\n    removeNodes(this.startNode.parentNode, startNode.nextSibling, this.endNode);\n  }\n}\n/**\n * Implements a boolean attribute, roughly as defined in the HTML\n * specification.\n *\n * If the value is truthy, then the attribute is present with a value of\n * ''. If the value is falsey, the attribute is removed.\n */\nclass BooleanAttributePart {\n  constructor(element, name, strings) {\n    this.value = undefined;\n    this.__pendingValue = undefined;\n    if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n      throw new Error('Boolean attributes can only contain a single expression');\n    }\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n  }\n  setValue(value) {\n    this.__pendingValue = value;\n  }\n  commit() {\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    if (this.__pendingValue === noChange) {\n      return;\n    }\n    const value = !!this.__pendingValue;\n    if (this.value !== value) {\n      if (value) {\n        this.element.setAttribute(this.name, '');\n      } else {\n        this.element.removeAttribute(this.name);\n      }\n      this.value = value;\n    }\n    this.__pendingValue = noChange;\n  }\n}\n/**\n * Sets attribute values for PropertyParts, so that the value is only set once\n * even if there are multiple parts for a property.\n *\n * If an expression controls the whole property value, then the value is simply\n * assigned to the property under control. If there are string literals or\n * multiple expressions, then the strings are expressions are interpolated into\n * a string first.\n */\nclass PropertyCommitter extends AttributeCommitter {\n  constructor(element, name, strings) {\n    super(element, name, strings);\n    this.single = strings.length === 2 && strings[0] === '' && strings[1] === '';\n  }\n  _createPart() {\n    return new PropertyPart(this);\n  }\n  _getValue() {\n    if (this.single) {\n      return this.parts[0].value;\n    }\n    return super._getValue();\n  }\n  commit() {\n    if (this.dirty) {\n      this.dirty = false; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this.element[this.name] = this._getValue();\n    }\n  }\n}\nclass PropertyPart extends AttributePart {} // Detect event listener options support. If the \\`capture\\` property is read\n// from the options object, then options are supported. If not, then the third\n// argument to add/removeEventListener is interpreted as the boolean capture\n// value so we should only pass the \\`capture\\` property.\nlet eventOptionsSupported = false; // Wrap into an IIFE because MS Edge <= v41 does not support having try/catch\n// blocks right into the body of a module\n(() => {\n  try {\n    const options = {\n      get capture() {\n        eventOptionsSupported = true;\n        return false;\n      }\n    }; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    window.addEventListener('test', options, options); // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    window.removeEventListener('test', options, options);\n  } catch (_e) {// event options not supported\n  }\n})();\nclass EventPart {\n  constructor(element, eventName, eventContext) {\n    this.value = undefined;\n    this.__pendingValue = undefined;\n    this.element = element;\n    this.eventName = eventName;\n    this.eventContext = eventContext;\n    this.__boundHandleEvent = e => this.handleEvent(e);\n  }\n  setValue(value) {\n    this.__pendingValue = value;\n  }\n  commit() {\n    while (isDirective(this.__pendingValue)) {\n      const directive = this.__pendingValue;\n      this.__pendingValue = noChange;\n      directive(this);\n    }\n    if (this.__pendingValue === noChange) {\n      return;\n    }\n    const newListener = this.__pendingValue;\n    const oldListener = this.value;\n    const shouldRemoveListener = newListener == null || oldListener != null && (newListener.capture !== oldListener.capture || newListener.once !== oldListener.once || newListener.passive !== oldListener.passive);\n    const shouldAddListener = newListener != null && (oldListener == null || shouldRemoveListener);\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n    }\n    if (shouldAddListener) {\n      this.__options = getOptions(newListener);\n      this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n    }\n    this.value = newListener;\n    this.__pendingValue = noChange;\n  }\n  handleEvent(event) {\n    if (typeof this.value === 'function') {\n      this.value.call(this.eventContext || this.element, event);\n    } else {\n      this.value.handleEvent(event);\n    }\n  }\n} // We copy options because of the inconsistent behavior of browsers when reading\n// the third argument of add/removeEventListener. IE11 doesn't support options\n// at all. Chrome 41 only reads \\`capture\\` if the argument is an object.\nconst getOptions = o => o && (eventOptionsSupported ? {\n  capture: o.capture,\n  passive: o.passive,\n  once: o.once\n} : o.capture);\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * The default TemplateFactory which caches Templates keyed on\n * result.type and result.strings.\n */\nfunction templateFactory(result) {\n  let templateCache = templateCaches.get(result.type);\n  if (templateCache === undefined) {\n    templateCache = {\n      stringsArray: new WeakMap(),\n      keyString: new Map()\n    };\n    templateCaches.set(result.type, templateCache);\n  }\n  let template = templateCache.stringsArray.get(result.strings);\n  if (template !== undefined) {\n    return template;\n  } // If the TemplateStringsArray is new, generate a key from the strings\n  // This key is shared between all templates with identical content\n  const key = result.strings.join(marker); // Check if we already have a Template for this key\n  template = templateCache.keyString.get(key);\n  if (template === undefined) {\n    // If we have not seen this key before, create a new Template\n    template = new Template(result, result.getTemplateElement()); // Cache the Template for this key\n    templateCache.keyString.set(key, template);\n  } // Cache all future queries for this TemplateStringsArray\n  templateCache.stringsArray.set(result.strings, template);\n  return template;\n}\nconst templateCaches = new Map();\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst parts = new WeakMap();\n/**\n * Renders a template result or other value to a container.\n *\n * To update a container with new values, reevaluate the template literal and\n * call \\`render\\` with the new result.\n *\n * @param result Any value renderable by NodePart - typically a TemplateResult\n *     created by evaluating a template tag like \\`html\\` or \\`svg\\`.\n * @param container A DOM parent to render to. The entire contents are either\n *     replaced, or efficiently updated if the same result type was previous\n *     rendered there.\n * @param options RenderOptions for the entire render tree rendered to this\n *     container. Render options must *not* change between renders to the same\n *     container, as those changes will not effect previously rendered DOM.\n */\nconst render = (result, container, options) => {\n  let part = parts.get(container);\n  if (part === undefined) {\n    removeNodes(container, container.firstChild);\n    parts.set(container, part = new NodePart(Object.assign({\n      templateFactory\n    }, options)));\n    part.appendInto(container);\n  }\n  part.setValue(result);\n  part.commit();\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * Creates Parts when a template is instantiated.\n */\nclass DefaultTemplateProcessor {\n  /**\n   * Create parts for an attribute-position binding, given the event, attribute\n   * name, and string literals.\n   *\n   * @param element The element containing the binding\n   * @param name  The attribute name\n   * @param strings The string literals. There are always at least two strings,\n   *   event for fully-controlled bindings with a single expression.\n   */\n  handleAttributeExpressions(element, name, strings, options) {\n    const prefix = name[0];\n    if (prefix === '.') {\n      const committer = new PropertyCommitter(element, name.slice(1), strings);\n      return committer.parts;\n    }\n    if (prefix === '@') {\n      return [new EventPart(element, name.slice(1), options.eventContext)];\n    }\n    if (prefix === '?') {\n      return [new BooleanAttributePart(element, name.slice(1), strings)];\n    }\n    const committer = new AttributeCommitter(element, name, strings);\n    return committer.parts;\n  }\n  /**\n   * Create parts for a text-position binding.\n   * @param templateFactory\n   */\n  handleTextExpression(options) {\n    return new NodePart(options);\n  }\n}\nconst defaultTemplateProcessor = new DefaultTemplateProcessor();\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n// This line will be used in regexes to search for lit-html usage.\n// TODO(justinfagnani): inject version number at build time\nif (typeof window !== 'undefined') {\n  (window['litHtmlVersions'] || (window['litHtmlVersions'] = [])).push('1.3.0');\n}\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n */\nconst html = (strings, ...values) => new TemplateResult(strings, values, 'html', defaultTemplateProcessor);\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst getTemplateCacheKey = (type, scopeName) => \\`\\${type}--\\${scopeName}\\`;\nlet compatibleShadyCSSVersion = true;\nif (typeof window.ShadyCSS === 'undefined') {\n  compatibleShadyCSSVersion = false;\n} else if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') {\n  console.warn(\\`Incompatible ShadyCSS version detected. \\` + \\`Please update to at least @webcomponents/webcomponentsjs@2.0.2 and \\` + \\`@webcomponents/shadycss@1.3.1.\\`);\n  compatibleShadyCSSVersion = false;\n}\n/**\n * Template factory which scopes template DOM using ShadyCSS.\n * @param scopeName {string}\n */\nconst shadyTemplateFactory = scopeName => result => {\n  const cacheKey = getTemplateCacheKey(result.type, scopeName);\n  let templateCache = templateCaches.get(cacheKey);\n  if (templateCache === undefined) {\n    templateCache = {\n      stringsArray: new WeakMap(),\n      keyString: new Map()\n    };\n    templateCaches.set(cacheKey, templateCache);\n  }\n  let template = templateCache.stringsArray.get(result.strings);\n  if (template !== undefined) {\n    return template;\n  }\n  const key = result.strings.join(marker);\n  template = templateCache.keyString.get(key);\n  if (template === undefined) {\n    const element = result.getTemplateElement();\n    if (compatibleShadyCSSVersion) {\n      window.ShadyCSS.prepareTemplateDom(element, scopeName);\n    }\n    template = new Template(result, element);\n    templateCache.keyString.set(key, template);\n  }\n  templateCache.stringsArray.set(result.strings, template);\n  return template;\n};\nconst TEMPLATE_TYPES = ['html', 'svg'];\n/**\n * Removes all style elements from Templates for the given scopeName.\n */\nconst removeStylesFromLitTemplates = scopeName => {\n  TEMPLATE_TYPES.forEach(type => {\n    const templates = templateCaches.get(getTemplateCacheKey(type, scopeName));\n    if (templates !== undefined) {\n      templates.keyString.forEach(template => {\n        const {\n          element: {\n            content\n          }\n        } = template; // IE 11 doesn't support the iterable param Set constructor\n        const styles = new Set();\n        Array.from(content.querySelectorAll('style')).forEach(s => {\n          styles.add(s);\n        });\n        removeNodesFromTemplate(template, styles);\n      });\n    }\n  });\n};\nconst shadyRenderSet = new Set();\n/**\n * For the given scope name, ensures that ShadyCSS style scoping is performed.\n * This is done just once per scope name so the fragment and template cannot\n * be modified.\n * (1) extracts styles from the rendered fragment and hands them to ShadyCSS\n * to be scoped and appended to the document\n * (2) removes style elements from all lit-html Templates for this scope name.\n *\n * Note, <style> elements can only be placed into templates for the\n * initial rendering of the scope. If <style> elements are included in templates\n * dynamically rendered to the scope (after the first scope render), they will\n * not be scoped and the <style> will be left in the template and rendered\n * output.\n */\nconst prepareTemplateStyles = (scopeName, renderedDOM, template) => {\n  shadyRenderSet.add(scopeName); // If \\`renderedDOM\\` is stamped from a Template, then we need to edit that\n  // Template's underlying template element. Otherwise, we create one here\n  // to give to ShadyCSS, which still requires one while scoping.\n  const templateElement = !!template ? template.element : document.createElement('template'); // Move styles out of rendered DOM and store.\n  const styles = renderedDOM.querySelectorAll('style');\n  const {\n    length\n  } = styles; // If there are no styles, skip unnecessary work\n  if (length === 0) {\n    // Ensure prepareTemplateStyles is called to support adding\n    // styles via \\`prepareAdoptedCssText\\` since that requires that\n    // \\`prepareTemplateStyles\\` is called.\n    //\n    // ShadyCSS will only update styles containing @apply in the template\n    // given to \\`prepareTemplateStyles\\`. If no lit Template was given,\n    // ShadyCSS will not be able to update uses of @apply in any relevant\n    // template. However, this is not a problem because we only create the\n    // template for the purpose of supporting \\`prepareAdoptedCssText\\`,\n    // which doesn't support @apply at all.\n    window.ShadyCSS.prepareTemplateStyles(templateElement, scopeName);\n    return;\n  }\n  const condensedStyle = document.createElement('style'); // Collect styles into a single style. This helps us make sure ShadyCSS\n  // manipulations will not prevent us from being able to fix up template\n  // part indices.\n  // NOTE: collecting styles is inefficient for browsers but ShadyCSS\n  // currently does this anyway. When it does not, this should be changed.\n  for (let i = 0; i < length; i++) {\n    const style = styles[i];\n    style.parentNode.removeChild(style);\n    condensedStyle.textContent += style.textContent;\n  } // Remove styles from nested templates in this scope.\n  removeStylesFromLitTemplates(scopeName); // And then put the condensed style into the \\\\\"root\\\\\" template passed in as\n  // \\`template\\`.\n  const content = templateElement.content;\n  if (!!template) {\n    insertNodeIntoTemplate(template, condensedStyle, content.firstChild);\n  } else {\n    content.insertBefore(condensedStyle, content.firstChild);\n  } // Note, it's important that ShadyCSS gets the template that \\`lit-html\\`\n  // will actually render so that it can update the style inside when\n  // needed (e.g. @apply native Shadow DOM case).\n  window.ShadyCSS.prepareTemplateStyles(templateElement, scopeName);\n  const style = content.querySelector('style');\n  if (window.ShadyCSS.nativeShadow && style !== null) {\n    // When in native Shadow DOM, ensure the style created by ShadyCSS is\n    // included in initially rendered output (\\`renderedDOM\\`).\n    renderedDOM.insertBefore(style.cloneNode(true), renderedDOM.firstChild);\n  } else if (!!template) {\n    // When no style is left in the template, parts will be broken as a\n    // result. To fix this, we put back the style node ShadyCSS removed\n    // and then tell lit to remove that node from the template.\n    // There can be no style in the template in 2 cases (1) when Shady DOM\n    // is in use, ShadyCSS removes all styles, (2) when native Shadow DOM\n    // is in use ShadyCSS removes the style if it contains no content.\n    // NOTE, ShadyCSS creates its own style so we can safely add/remove\n    // \\`condensedStyle\\` here.\n    content.insertBefore(condensedStyle, content.firstChild);\n    const removes = new Set();\n    removes.add(condensedStyle);\n    removeNodesFromTemplate(template, removes);\n  }\n};\n/**\n * Extension to the standard \\`render\\` method which supports rendering\n * to ShadowRoots when the ShadyDOM (https://github.com/webcomponents/shadydom)\n * and ShadyCSS (https://github.com/webcomponents/shadycss) polyfills are used\n * or when the webcomponentsjs\n * (https://github.com/webcomponents/webcomponentsjs) polyfill is used.\n *\n * Adds a \\`scopeName\\` option which is used to scope element DOM and stylesheets\n * when native ShadowDOM is unavailable. The \\`scopeName\\` will be added to\n * the class attribute of all rendered DOM. In addition, any style elements will\n * be automatically re-written with this \\`scopeName\\` selector and moved out\n * of the rendered DOM and into the document \\`<head>\\`.\n *\n * It is common to use this render method in conjunction with a custom element\n * which renders a shadowRoot. When this is done, typically the element's\n * \\`localName\\` should be used as the \\`scopeName\\`.\n *\n * In addition to DOM scoping, ShadyCSS also supports a basic shim for css\n * custom properties (needed only on older browsers like IE11) and a shim for\n * a deprecated feature called \\`@apply\\` that supports applying a set of css\n * custom properties to a given location.\n *\n * Usage considerations:\n *\n * * Part values in \\`<style>\\` elements are only applied the first time a given\n * \\`scopeName\\` renders. Subsequent changes to parts in style elements will have\n * no effect. Because of this, parts in style elements should only be used for\n * values that will never change, for example parts that set scope-wide theme\n * values or parts which render shared style elements.\n *\n * * Note, due to a limitation of the ShadyDOM polyfill, rendering in a\n * custom element's \\`constructor\\` is not supported. Instead rendering should\n * either done asynchronously, for example at microtask timing (for example\n * \\`Promise.resolve()\\`), or be deferred until the first time the element's\n * \\`connectedCallback\\` runs.\n *\n * Usage considerations when using shimmed custom properties or \\`@apply\\`:\n *\n * * Whenever any dynamic changes are made which affect\n * css custom properties, \\`ShadyCSS.styleElement(element)\\` must be called\n * to update the element. There are two cases when this is needed:\n * (1) the element is connected to a new parent, (2) a class is added to the\n * element that causes it to match different custom properties.\n * To address the first case when rendering a custom element, \\`styleElement\\`\n * should be called in the element's \\`connectedCallback\\`.\n *\n * * Shimmed custom properties may only be defined either for an entire\n * shadowRoot (for example, in a \\`:host\\` rule) or via a rule that directly\n * matches an element with a shadowRoot. In other words, instead of flowing from\n * parent to child as do native css custom properties, shimmed custom properties\n * flow only from shadowRoots to nested shadowRoots.\n *\n * * When using \\`@apply\\` mixing css shorthand property names with\n * non-shorthand names (for example \\`border\\` and \\`border-width\\`) is not\n * supported.\n */\nconst render$1 = (result, container, options) => {\n  if (!options || typeof options !== 'object' || !options.scopeName) {\n    throw new Error('The \\`scopeName\\` option is required.');\n  }\n  const scopeName = options.scopeName;\n  const hasRendered = parts.has(container);\n  const needsScoping = compatibleShadyCSSVersion && container.nodeType === 11\n  && !!container.host; // Handle first render to a scope specially...\n  const firstScopeRender = needsScoping && !shadyRenderSet.has(scopeName); // On first scope render, render into a fragment; this cannot be a single\n  // fragment that is reused since nested renders can occur synchronously.\n  const renderContainer = firstScopeRender ? document.createDocumentFragment() : container;\n  render(result, renderContainer, Object.assign({\n    templateFactory: shadyTemplateFactory(scopeName)\n  }, options)); // When performing first scope render,\n  // (1) We've rendered into a fragment so that there's a chance to\n  // \\`prepareTemplateStyles\\` before sub-elements hit the DOM\n  // (which might cause them to render based on a common pattern of\n  // rendering in a custom element's \\`connectedCallback\\`);\n  // (2) Scope the template with ShadyCSS one time only for this scope.\n  // (3) Render the fragment into the container and make sure the\n  // container knows its \\`part\\` is the one we just rendered. This ensures\n  // DOM will be re-used on subsequent renders.\n  if (firstScopeRender) {\n    const part = parts.get(renderContainer);\n    parts.delete(renderContainer); // ShadyCSS might have style sheets (e.g. from \\`prepareAdoptedCssText\\`)\n    // that should apply to \\`renderContainer\\` even if the rendered value is\n    // not a TemplateInstance. However, it will only insert scoped styles\n    // into the document if \\`prepareTemplateStyles\\` has already been called\n    // for the given scope name.\n    const template = part.value instanceof TemplateInstance ? part.value.template : undefined;\n    prepareTemplateStyles(scopeName, renderContainer, template);\n    removeNodes(container, container.firstChild);\n    container.appendChild(renderContainer);\n    parts.set(container, part);\n  } // After elements have hit the DOM, update styling if this is the\n  // initial render to this container.\n  // This is needed whenever dynamic changes are made so it would be\n  // safest to do every render; however, this would regress performance\n  // so we leave it up to the user to call \\`ShadyCSS.styleElement\\`\n  // for dynamic changes.\n  if (!hasRendered && needsScoping) {\n    window.ShadyCSS.styleElement(container.host);\n  }\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nvar _a;\n/**\n * Use this module if you want to create your own base class extending\n * [[UpdatingElement]].\n * @packageDocumentation\n */\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\nwindow.JSCompiler_renameProperty = (prop, _obj) => prop;\nconst defaultConverter = {\n  toAttribute(value, type) {\n    switch (type) {\n      case Boolean:\n        return value ? '' : null;\n      case Object:\n      case Array:\n        // if the value is \\`null\\` or \\`undefined\\` pass this through\n        // to allow removing/no change behavior.\n        return value == null ? value : JSON.stringify(value);\n    }\n    return value;\n  },\n  fromAttribute(value, type) {\n    switch (type) {\n      case Boolean:\n        return value !== null;\n      case Number:\n        return value === null ? null : Number(value);\n      case Object:\n      case Array:\n        return JSON.parse(value);\n    }\n    return value;\n  }\n};\n/**\n * Change function that returns true if \\`value\\` is different from \\`oldValue\\`.\n * This method is used as the default for a property's \\`hasChanged\\` function.\n */\nconst notEqual = (value, old) => {\n  // This ensures (old==NaN, value==NaN) always returns false\n  return old !== value && (old === old || value === value);\n};\nconst defaultPropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  hasChanged: notEqual\n};\nconst STATE_HAS_UPDATED = 1;\nconst STATE_UPDATE_REQUESTED = 1 << 2;\nconst STATE_IS_REFLECTING_TO_ATTRIBUTE = 1 << 3;\nconst STATE_IS_REFLECTING_TO_PROPERTY = 1 << 4;\n/**\n * The Closure JS Compiler doesn't currently have good support for static\n * property semantics where \\\\\"this\\\\\" is dynamic (e.g.\n * https://github.com/google/closure-compiler/issues/3177 and others) so we use\n * this hack to bypass any rewriting by the compiler.\n */\nconst finalized = 'finalized';\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the \\`update\\` method is asynchronously called. This method\n * should be supplied by subclassers to render updates as desired.\n * @noInheritDoc\n */\nclass UpdatingElement extends HTMLElement {\n  constructor() {\n    super();\n    this.initialize();\n  }\n  /**\n   * Returns a list of attributes corresponding to the registered properties.\n   * @nocollapse\n   */\n  static get observedAttributes() {\n    // note: piggy backing on this to ensure we're finalized.\n    this.finalize();\n    const attributes = []; // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    this._classProperties.forEach((v, p) => {\n      const attr = this._attributeNameForProperty(p, v);\n      if (attr !== undefined) {\n        this._attributeToPropertyMap.set(attr, p);\n        attributes.push(attr);\n      }\n    });\n    return attributes;\n  }\n  /**\n   * Ensures the private \\`_classProperties\\` property metadata is created.\n   * In addition to \\`finalize\\` this is also called in \\`createProperty\\` to\n   * ensure the \\`@property\\` decorator can add property metadata.\n   */\n  /** @nocollapse */\n  static _ensureClassProperties() {\n    // ensure private storage for property declarations.\n    if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n      this._classProperties = new Map(); // NOTE: Workaround IE11 not supporting Map constructor argument.\n      const superProperties = Object.getPrototypeOf(this)._classProperties;\n      if (superProperties !== undefined) {\n        superProperties.forEach((v, k) => this._classProperties.set(k, v));\n      }\n    }\n  }\n  /**\n   * Creates a property accessor on the element prototype if one does not exist\n   * and stores a PropertyDeclaration for the property with the given options.\n   * The property setter calls the property's \\`hasChanged\\` property option\n   * or uses a strict identity check to determine whether or not to request\n   * an update.\n   *\n   * This method may be overridden to customize properties; however,\n   * when doing so, it's important to call \\`super.createProperty\\` to ensure\n   * the property is setup correctly. This method calls\n   * \\`getPropertyDescriptor\\` internally to get a descriptor to install.\n   * To customize what properties do when they are get or set, override\n   * \\`getPropertyDescriptor\\`. To customize the options for a property,\n   * implement \\`createProperty\\` like this:\n   *\n   * static createProperty(name, options) {\n   *   options = Object.assign(options, {myOption: true});\n   *   super.createProperty(name, options);\n   * }\n   *\n   * @nocollapse\n   */\n  static createProperty(name, options = defaultPropertyDeclaration) {\n    // Note, since this can be called by the \\`@property\\` decorator which\n    // is called before \\`finalize\\`, we ensure storage exists for property\n    // metadata.\n    this._ensureClassProperties();\n    this._classProperties.set(name, options); // Do not generate an accessor if the prototype already has one, since\n    // it would be lost otherwise and that would never be the user's intention;\n    // Instead, we expect users to call \\`requestUpdate\\` themselves from\n    // user-defined accessors. Note that if the super has an accessor we will\n    // still overwrite it\n    if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n      return;\n    }\n    const key = typeof name === 'symbol' ? Symbol() : \\`__\\${name}\\`;\n    const descriptor = this.getPropertyDescriptor(name, key, options);\n    if (descriptor !== undefined) {\n      Object.defineProperty(this.prototype, name, descriptor);\n    }\n  }\n  /**\n   * Returns a property descriptor to be defined on the given named property.\n   * If no descriptor is returned, the property will not become an accessor.\n   * For example,\n   *\n   *   class MyElement extends LitElement {\n   *     static getPropertyDescriptor(name, key, options) {\n   *       const defaultDescriptor =\n   *           super.getPropertyDescriptor(name, key, options);\n   *       const setter = defaultDescriptor.set;\n   *       return {\n   *         get: defaultDescriptor.get,\n   *         set(value) {\n   *           setter.call(this, value);\n   *           // custom action.\n   *         },\n   *         configurable: true,\n   *         enumerable: true\n   *       }\n   *     }\n   *   }\n   *\n   * @nocollapse\n   */\n  static getPropertyDescriptor(name, key, options) {\n    return {\n      // tslint:disable-next-line:no-any no symbol in index\n      get() {\n        return this[key];\n      },\n      set(value) {\n        const oldValue = this[name];\n        this[key] = value;\n        this.requestUpdateInternal(name, oldValue, options);\n      },\n      configurable: true,\n      enumerable: true\n    };\n  }\n  /**\n   * Returns the property options associated with the given property.\n   * These options are defined with a PropertyDeclaration via the \\`properties\\`\n   * object or the \\`@property\\` decorator and are registered in\n   * \\`createProperty(...)\\`.\n   *\n   * Note, this method should be considered \\\\\"final\\\\\" and not overridden. To\n   * customize the options for a given property, override \\`createProperty\\`.\n   *\n   * @nocollapse\n   * @final\n   */\n  static getPropertyOptions(name) {\n    return this._classProperties && this._classProperties.get(name) || defaultPropertyDeclaration;\n  }\n  /**\n   * Creates property accessors for registered properties and ensures\n   * any superclasses are also finalized.\n   * @nocollapse\n   */\n  static finalize() {\n    // finalize any superclasses\n    const superCtor = Object.getPrototypeOf(this);\n    if (!superCtor.hasOwnProperty(finalized)) {\n      superCtor.finalize();\n    }\n    this[finalized] = true;\n    this._ensureClassProperties(); // initialize Map populated in observedAttributes\n    this._attributeToPropertyMap = new Map(); // make any properties\n    // Note, only process \\\\\"own\\\\\" properties since this element will inherit\n    // any properties defined on the superClass, and finalization ensures\n    // the entire prototype chain is finalized.\n    if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n      const props = this.properties; // support symbols in properties (IE11 does not support this)\n      const propKeys = [...Object.getOwnPropertyNames(props), ...(typeof Object.getOwnPropertySymbols === 'function' ? Object.getOwnPropertySymbols(props) : [])]; // This for/of is ok because propKeys is an array\n      for (const p of propKeys) {\n        // note, use of \\`any\\` is due to TypeSript lack of support for symbol in\n        // index types\n        // tslint:disable-next-line:no-any no symbol in index\n        this.createProperty(p, props[p]);\n      }\n    }\n  }\n  /**\n   * Returns the property name for the given attribute \\`name\\`.\n   * @nocollapse\n   */\n  static _attributeNameForProperty(name, options) {\n    const attribute = options.attribute;\n    return attribute === false ? undefined : typeof attribute === 'string' ? attribute : typeof name === 'string' ? name.toLowerCase() : undefined;\n  }\n  /**\n   * Returns true if a property should request an update.\n   * Called when a property value is set and uses the \\`hasChanged\\`\n   * option for the property if present or a strict identity check.\n   * @nocollapse\n   */\n  static _valueHasChanged(value, old, hasChanged = notEqual) {\n    return hasChanged(value, old);\n  }\n  /**\n   * Returns the property value for the given attribute value.\n   * Called via the \\`attributeChangedCallback\\` and uses the property's\n   * \\`converter\\` or \\`converter.fromAttribute\\` property option.\n   * @nocollapse\n   */\n  static _propertyValueFromAttribute(value, options) {\n    const type = options.type;\n    const converter = options.converter || defaultConverter;\n    const fromAttribute = typeof converter === 'function' ? converter : converter.fromAttribute;\n    return fromAttribute ? fromAttribute(value, type) : value;\n  }\n  /**\n   * Returns the attribute value for the given property value. If this\n   * returns undefined, the property will *not* be reflected to an attribute.\n   * If this returns null, the attribute will be removed, otherwise the\n   * attribute will be set to the value.\n   * This uses the property's \\`reflect\\` and \\`type.toAttribute\\` property options.\n   * @nocollapse\n   */\n  static _propertyValueToAttribute(value, options) {\n    if (options.reflect === undefined) {\n      return;\n    }\n    const type = options.type;\n    const converter = options.converter;\n    const toAttribute = converter && converter.toAttribute || defaultConverter.toAttribute;\n    return toAttribute(value, type);\n  }\n  /**\n   * Performs element initialization. By default captures any pre-set values for\n   * registered properties.\n   */\n  initialize() {\n    this._updateState = 0;\n    this._updatePromise = new Promise(res => this._enableUpdatingResolver = res);\n    this._changedProperties = new Map();\n    this._saveInstanceProperties(); // ensures first update will be caught by an early access of\n    // \\`updateComplete\\`\n    this.requestUpdateInternal();\n  }\n  /**\n   * Fixes any properties set on the instance before upgrade time.\n   * Otherwise these would shadow the accessor and break these properties.\n   * The properties are stored in a Map which is played back after the\n   * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n   * (<=41), properties created for native platform properties like (\\`id\\` or\n   * \\`name\\`) may not have default values set in the element constructor. On\n   * these browsers native properties appear on instances and therefore their\n   * default value will overwrite any element default (e.g. if the element sets\n   * this.id = 'id' in the constructor, the 'id' will become '' since this is\n   * the native platform default).\n   */\n  _saveInstanceProperties() {\n    // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    this.constructor._classProperties.forEach((_v, p) => {\n      if (this.hasOwnProperty(p)) {\n        const value = this[p];\n        delete this[p];\n        if (!this._instanceProperties) {\n          this._instanceProperties = new Map();\n        }\n        this._instanceProperties.set(p, value);\n      }\n    });\n  }\n  /**\n   * Applies previously saved instance properties.\n   */\n  _applyInstanceProperties() {\n    // Use forEach so this works even if for/of loops are compiled to for loops\n    // expecting arrays\n    // tslint:disable-next-line:no-any\n    this._instanceProperties.forEach((v, p) => this[p] = v);\n    this._instanceProperties = undefined;\n  }\n  connectedCallback() {\n    // Ensure first connection completes an update. Updates cannot complete\n    // before connection.\n    this.enableUpdating();\n  }\n  enableUpdating() {\n    if (this._enableUpdatingResolver !== undefined) {\n      this._enableUpdatingResolver();\n      this._enableUpdatingResolver = undefined;\n    }\n  }\n  /**\n   * Allows for \\`super.disconnectedCallback()\\` in extensions while\n   * reserving the possibility of making non-breaking feature additions\n   * when disconnecting at some point in the future.\n   */\n  disconnectedCallback() {}\n  /**\n   * Synchronizes property values when attributes change.\n   */\n  attributeChangedCallback(name, old, value) {\n    if (old !== value) {\n      this._attributeToProperty(name, value);\n    }\n  }\n  _propertyToAttribute(name, value, options = defaultPropertyDeclaration) {\n    const ctor = this.constructor;\n    const attr = ctor._attributeNameForProperty(name, options);\n    if (attr !== undefined) {\n      const attrValue = ctor._propertyValueToAttribute(value, options); // an undefined value does not change the attribute.\n      if (attrValue === undefined) {\n        return;\n      } // Track if the property is being reflected to avoid\n      // setting the property again via \\`attributeChangedCallback\\`. Note:\n      // 1. this takes advantage of the fact that the callback is synchronous.\n      // 2. will behave incorrectly if multiple attributes are in the reaction\n      // stack at time of calling. However, since we process attributes\n      // in \\`update\\` this should not be possible (or an extreme corner case\n      // that we'd like to discover).\n      // mark state reflecting\n      this._updateState = this._updateState | STATE_IS_REFLECTING_TO_ATTRIBUTE;\n      if (attrValue == null) {\n        this.removeAttribute(attr);\n      } else {\n        this.setAttribute(attr, attrValue);\n      } // mark state not reflecting\n      this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_ATTRIBUTE;\n    }\n  }\n  _attributeToProperty(name, value) {\n    // Use tracking info to avoid deserializing attribute value if it was\n    // just set from a property setter.\n    if (this._updateState & STATE_IS_REFLECTING_TO_ATTRIBUTE) {\n      return;\n    }\n    const ctor = this.constructor; // Note, hint this as an \\`AttributeMap\\` so closure clearly understands\n    // the type; it has issues with tracking types through statics\n    // tslint:disable-next-line:no-unnecessary-type-assertion\n    const propName = ctor._attributeToPropertyMap.get(name);\n    if (propName !== undefined) {\n      const options = ctor.getPropertyOptions(propName); // mark state reflecting\n      this._updateState = this._updateState | STATE_IS_REFLECTING_TO_PROPERTY;\n      this[propName] = // tslint:disable-next-line:no-any\n      ctor._propertyValueFromAttribute(value, options); // mark state not reflecting\n      this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_PROPERTY;\n    }\n  }\n  /**\n   * This protected version of \\`requestUpdate\\` does not access or return the\n   * \\`updateComplete\\` promise. This promise can be overridden and is therefore\n   * not free to access.\n   */\n  requestUpdateInternal(name, oldValue, options) {\n    let shouldRequestUpdate = true; // If we have a property key, perform property update steps.\n    if (name !== undefined) {\n      const ctor = this.constructor;\n      options = options || ctor.getPropertyOptions(name);\n      if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {\n        if (!this._changedProperties.has(name)) {\n          this._changedProperties.set(name, oldValue);\n        } // Add to reflecting properties set.\n        // Note, it's important that every change has a chance to add the\n        // property to \\`_reflectingProperties\\`. This ensures setting\n        // attribute + property reflects correctly.\n        if (options.reflect === true && !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {\n          if (this._reflectingProperties === undefined) {\n            this._reflectingProperties = new Map();\n          }\n          this._reflectingProperties.set(name, options);\n        }\n      } else {\n        // Abort the request if the property should not be considered changed.\n        shouldRequestUpdate = false;\n      }\n    }\n    if (!this._hasRequestedUpdate && shouldRequestUpdate) {\n      this._updatePromise = this._enqueueUpdate();\n    }\n  }\n  /**\n   * Requests an update which is processed asynchronously. This should\n   * be called when an element should update based on some state not triggered\n   * by setting a property. In this case, pass no arguments. It should also be\n   * called when manually implementing a property setter. In this case, pass the\n   * property \\`name\\` and \\`oldValue\\` to ensure that any configured property\n   * options are honored. Returns the \\`updateComplete\\` Promise which is resolved\n   * when the update completes.\n   *\n   * @param name {PropertyKey} (optional) name of requesting property\n   * @param oldValue {any} (optional) old value of requesting property\n   * @returns {Promise} A Promise that is resolved when the update completes.\n   */\n  requestUpdate(name, oldValue) {\n    this.requestUpdateInternal(name, oldValue);\n    return this.updateComplete;\n  }\n  /**\n   * Sets up the element to asynchronously update.\n   */\n  async _enqueueUpdate() {\n    this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n    try {\n      // Ensure any previous update has resolved before updating.\n      // This \\`await\\` also ensures that property changes are batched.\n      await this._updatePromise;\n    } catch (e) {// Ignore any previous errors. We only care that the previous cycle is\n      // done. Any error should have been handled in the previous update.\n    }\n    const result = this.performUpdate(); // If \\`performUpdate\\` returns a Promise, we await it. This is done to\n    // enable coordinating updates with a scheduler. Note, the result is\n    // checked to avoid delaying an additional microtask unless we need to.\n    if (result != null) {\n      await result;\n    }\n    return !this._hasRequestedUpdate;\n  }\n  get _hasRequestedUpdate() {\n    return this._updateState & STATE_UPDATE_REQUESTED;\n  }\n  get hasUpdated() {\n    return this._updateState & STATE_HAS_UPDATED;\n  }\n  /**\n   * Performs an element update. Note, if an exception is thrown during the\n   * update, \\`firstUpdated\\` and \\`updated\\` will not be called.\n   *\n   * You can override this method to change the timing of updates. If this\n   * method is overridden, \\`super.performUpdate()\\` must be called.\n   *\n   * For instance, to schedule updates to occur just before the next frame:\n   *\n   * \\`\\`\\`\n   * protected async performUpdate(): Promise<unknown> {\n   *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n   *   super.performUpdate();\n   * }\n   * \\`\\`\\`\n   */\n  performUpdate() {\n    // Abort any update if one is not pending when this is called.\n    // This can happen if \\`performUpdate\\` is called early to \\\\\"flush\\\\\"\n    // the update.\n    if (!this._hasRequestedUpdate) {\n      return;\n    } // Mixin instance properties once, if they exist.\n    if (this._instanceProperties) {\n      this._applyInstanceProperties();\n    }\n    let shouldUpdate = false;\n    const changedProperties = this._changedProperties;\n    try {\n      shouldUpdate = this.shouldUpdate(changedProperties);\n      if (shouldUpdate) {\n        this.update(changedProperties);\n      } else {\n        this._markUpdated();\n      }\n    } catch (e) {\n      // Prevent \\`firstUpdated\\` and \\`updated\\` from running when there's an\n      // update exception.\n      shouldUpdate = false; // Ensure element can accept additional updates after an exception.\n      this._markUpdated();\n      throw e;\n    }\n    if (shouldUpdate) {\n      if (!(this._updateState & STATE_HAS_UPDATED)) {\n        this._updateState = this._updateState | STATE_HAS_UPDATED;\n        this.firstUpdated(changedProperties);\n      }\n      this.updated(changedProperties);\n    }\n  }\n  _markUpdated() {\n    this._changedProperties = new Map();\n    this._updateState = this._updateState & ~STATE_UPDATE_REQUESTED;\n  }\n  /**\n   * Returns a Promise that resolves when the element has completed updating.\n   * The Promise value is a boolean that is \\`true\\` if the element completed the\n   * update without triggering another update. The Promise result is \\`false\\` if\n   * a property was set inside \\`updated()\\`. If the Promise is rejected, an\n   * exception was thrown during the update.\n   *\n   * To await additional asynchronous work, override the \\`_getUpdateComplete\\`\n   * method. For example, it is sometimes useful to await a rendered element\n   * before fulfilling this Promise. To do this, first await\n   * \\`super._getUpdateComplete()\\`, then any subsequent state.\n   *\n   * @returns {Promise} The Promise returns a boolean that indicates if the\n   * update resolved without triggering another update.\n   */\n  get updateComplete() {\n    return this._getUpdateComplete();\n  }\n  /**\n   * Override point for the \\`updateComplete\\` promise.\n   *\n   * It is not safe to override the \\`updateComplete\\` getter directly due to a\n   * limitation in TypeScript which means it is not possible to call a\n   * superclass getter (e.g. \\`super.updateComplete.then(...)\\`) when the target\n   * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n   * This method should be overridden instead. For example:\n   *\n   *   class MyElement extends LitElement {\n   *     async _getUpdateComplete() {\n   *       await super._getUpdateComplete();\n   *       await this._myChild.updateComplete;\n   *     }\n   *   }\n   */\n  _getUpdateComplete() {\n    return this._updatePromise;\n  }\n  /**\n   * Controls whether or not \\`update\\` should be called when the element requests\n   * an update. By default, this method always returns \\`true\\`, but this can be\n   * customized to control when to update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  shouldUpdate(_changedProperties) {\n    return true;\n  }\n  /**\n   * Updates the element. This method reflects property values to attributes.\n   * It can be overridden to render and keep updated element DOM.\n   * Setting properties inside this method will *not* trigger\n   * another update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  update(_changedProperties) {\n    if (this._reflectingProperties !== undefined && this._reflectingProperties.size > 0) {\n      // Use forEach so this works even if for/of loops are compiled to for\n      // loops expecting arrays\n      this._reflectingProperties.forEach((v, k) => this._propertyToAttribute(k, this[k], v));\n      this._reflectingProperties = undefined;\n    }\n    this._markUpdated();\n  }\n  /**\n   * Invoked whenever the element is updated. Implement to perform\n   * post-updating tasks via DOM APIs, for example, focusing an element.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  updated(_changedProperties) {}\n  /**\n   * Invoked when the element is first updated. Implement to perform one time\n   * work on the element after update.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   */\n  firstUpdated(_changedProperties) {}\n}\n_a = finalized;\n/**\n * Marks class as having finished creating properties.\n */\nUpdatingElement[_a] = true;\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst legacyCustomElement = (tagName, clazz) => {\n  window.customElements.define(tagName, clazz); // Cast as any because TS doesn't recognize the return type as being a\n  // subtype of the decorated class when clazz is typed as\n  // \\`Constructor<HTMLElement>\\` for some reason.\n  // \\`Constructor<HTMLElement>\\` is helpful to make sure the decorator is\n  // applied to elements however.\n  // tslint:disable-next-line:no-any\n  return clazz;\n};\nconst standardCustomElement = (tagName, descriptor) => {\n  const {\n    kind,\n    elements\n  } = descriptor;\n  return {\n    kind,\n    elements,\n    // This callback is called once the class is otherwise fully defined\n    finisher(clazz) {\n      window.customElements.define(tagName, clazz);\n    }\n  };\n};\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * \\`\\`\\`\n * @customElement('my-element')\n * class MyElement {\n *   render() {\n *     return html\\`\\`;\n *   }\n * }\n * \\`\\`\\`\n * @category Decorator\n * @param tagName The name of the custom element to define.\n */\nconst customElement = tagName => classOrDescriptor => typeof classOrDescriptor === 'function' ? legacyCustomElement(tagName, classOrDescriptor) : standardCustomElement(tagName, classOrDescriptor);\nconst standardProperty = (options, element) => {\n  // When decorating an accessor, pass it through and add property metadata.\n  // Note, the \\`hasOwnProperty\\` check in \\`createProperty\\` ensures we don't\n  // stomp over the user's accessor.\n  if (element.kind === 'method' && element.descriptor && !('value' in element.descriptor)) {\n    return Object.assign(Object.assign({}, element), {\n      finisher(clazz) {\n        clazz.createProperty(element.key, options);\n      }\n    });\n  } else {\n    // createProperty() takes care of defining the property, but we still\n    // must return some kind of descriptor, so return a descriptor for an\n    // unused prototype field. The finisher calls createProperty().\n    return {\n      kind: 'field',\n      key: Symbol(),\n      placement: 'own',\n      descriptor: {},\n      // When @babel/plugin-proposal-decorators implements initializers,\n      // do this instead of the initializer below. See:\n      // https://github.com/babel/babel/issues/9260 extras: [\n      //   {\n      //     kind: 'initializer',\n      //     placement: 'own',\n      //     initializer: descriptor.initializer,\n      //   }\n      // ],\n      initializer() {\n        if (typeof element.initializer === 'function') {\n          this[element.key] = element.initializer.call(this);\n        }\n      },\n      finisher(clazz) {\n        clazz.createProperty(element.key, options);\n      }\n    };\n  }\n};\nconst legacyProperty = (options, proto, name) => {\n  proto.constructor.createProperty(name, options);\n};\n/**\n * A property decorator which creates a LitElement property which reflects a\n * corresponding attribute value. A [[\\`PropertyDeclaration\\`]] may optionally be\n * supplied to configure property features.\n *\n * This decorator should only be used for public fields. Private or protected\n * fields should use the [[\\`internalProperty\\`]] decorator.\n *\n * @example\n * \\`\\`\\`ts\n * class MyElement {\n *   @property({ type: Boolean })\n *   clicked = false;\n * }\n * \\`\\`\\`\n * @category Decorator\n * @ExportDecoratedItems\n */\nfunction property(options) {\n  // tslint:disable-next-line:no-any decorator\n  return (protoOrDescriptor, name) => name !== undefined ? legacyProperty(options, protoOrDescriptor, name) : standardProperty(options, protoOrDescriptor);\n}\n/**\n@license\nCopyright (c) 2019 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\n/**\n * Whether the current browser supports \\`adoptedStyleSheets\\`.\n */\nconst supportsAdoptingStyleSheets = window.ShadowRoot && (window.ShadyCSS === undefined || window.ShadyCSS.nativeShadow) && 'adoptedStyleSheets' in Document.prototype && 'replace' in CSSStyleSheet.prototype;\nconst constructionToken = Symbol();\nclass CSSResult {\n  constructor(cssText, safeToken) {\n    if (safeToken !== constructionToken) {\n      throw new Error('CSSResult is not constructable. Use \\`unsafeCSS\\` or \\`css\\` instead.');\n    }\n    this.cssText = cssText;\n  } // Note, this is a getter so that it's lazy. In practice, this means\n  // stylesheets are not created until the first element instance is made.\n  get styleSheet() {\n    if (this._styleSheet === undefined) {\n      // Note, if \\`supportsAdoptingStyleSheets\\` is true then we assume\n      // CSSStyleSheet is constructable.\n      if (supportsAdoptingStyleSheets) {\n        this._styleSheet = new CSSStyleSheet();\n        this._styleSheet.replaceSync(this.cssText);\n      } else {\n        this._styleSheet = null;\n      }\n    }\n    return this._styleSheet;\n  }\n  toString() {\n    return this.cssText;\n  }\n}\n/**\n * Wrap a value for interpolation in a [[\\`css\\`]] tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nconst unsafeCSS = value => {\n  return new CSSResult(String(value), constructionToken);\n};\nconst textFromCSSResult = value => {\n  if (value instanceof CSSResult) {\n    return value.cssText;\n  } else if (typeof value === 'number') {\n    return value;\n  } else {\n    throw new Error(\\`Value passed to 'css' function must be a 'css' function result: \\${value}. Use 'unsafeCSS' to pass non-literal values, but\n            take care to ensure page security.\\`);\n  }\n};\n/**\n * Template tag which which can be used with LitElement's [[LitElement.styles |\n * \\`styles\\`]] property to set element styles. For security reasons, only literal\n * string values may be used. To incorporate non-literal values [[\\`unsafeCSS\\`]]\n * may be used inside a template string part.\n */\nconst css = (strings, ...values) => {\n  const cssText = values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);\n  return new CSSResult(cssText, constructionToken);\n};\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n// This line will be used in regexes to search for LitElement usage.\n// TODO(justinfagnani): inject version number at build time\n(window['litElementVersions'] || (window['litElementVersions'] = [])).push('2.4.0');\n/**\n * Sentinal value used to avoid calling lit-html's render function when\n * subclasses do not implement \\`render\\`\n */\nconst renderNotImplemented = {};\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass \\`LitElement\\` and implement a\n * \\`render\\` method to provide the component's template. Define properties\n * using the [[\\`properties\\`]] property or the [[\\`property\\`]] decorator.\n */\nclass LitElement extends UpdatingElement {\n  /**\n   * Return the array of styles to apply to the element.\n   * Override this method to integrate into a style management system.\n   *\n   * @nocollapse\n   */\n  static getStyles() {\n    return this.styles;\n  }\n  /** @nocollapse */\n  static _getUniqueStyles() {\n    // Only gather styles once per class\n    if (this.hasOwnProperty(JSCompiler_renameProperty('_styles', this))) {\n      return;\n    } // Take care not to call \\`this.getStyles()\\` multiple times since this\n    // generates new CSSResults each time.\n    // TODO(sorvell): Since we do not cache CSSResults by input, any\n    // shared styles will generate new stylesheet objects, which is wasteful.\n    // This should be addressed when a browser ships constructable\n    // stylesheets.\n    const userStyles = this.getStyles();\n    if (Array.isArray(userStyles)) {\n      // De-duplicate styles preserving the _last_ instance in the set.\n      // This is a performance optimization to avoid duplicated styles that can\n      // occur especially when composing via subclassing.\n      // The last item is kept to try to preserve the cascade order with the\n      // assumption that it's most important that last added styles override\n      // previous styles.\n      const addStyles = (styles, set) => styles.reduceRight((set, s) => // Note: On IE set.add() does not return the set\n      Array.isArray(s) ? addStyles(s, set) : (set.add(s), set), set); // Array.from does not work on Set in IE, otherwise return\n      // Array.from(addStyles(userStyles, new Set<CSSResult>())).reverse()\n      const set = addStyles(userStyles, new Set());\n      const styles = [];\n      set.forEach(v => styles.unshift(v));\n      this._styles = styles;\n    } else {\n      this._styles = userStyles === undefined ? [] : [userStyles];\n    } // Ensure that there are no invalid CSSStyleSheet instances here. They are\n    // invalid in two conditions.\n    // (1) the sheet is non-constructible (\\`sheet\\` of a HTMLStyleElement), but\n    //     this is impossible to check except via .replaceSync or use\n    // (2) the ShadyCSS polyfill is enabled (:. supportsAdoptingStyleSheets is\n    //     false)\n    this._styles = this._styles.map(s => {\n      if (s instanceof CSSStyleSheet && !supportsAdoptingStyleSheets) {\n        // Flatten the cssText from the passed constructible stylesheet (or\n        // undetectable non-constructible stylesheet). The user might have\n        // expected to update their stylesheets over time, but the alternative\n        // is a crash.\n        const cssText = Array.prototype.slice.call(s.cssRules).reduce((css, rule) => css + rule.cssText, '');\n        return unsafeCSS(cssText);\n      }\n      return s;\n    });\n  }\n  /**\n   * Performs element initialization. By default this calls\n   * [[\\`createRenderRoot\\`]] to create the element [[\\`renderRoot\\`]] node and\n   * captures any pre-set values for registered properties.\n   */\n  initialize() {\n    super.initialize();\n    this.constructor._getUniqueStyles();\n    this.renderRoot = this.createRenderRoot(); // Note, if renderRoot is not a shadowRoot, styles would/could apply to the\n    // element's getRootNode(). While this could be done, we're choosing not to\n    // support this now since it would require different logic around de-duping.\n    if (window.ShadowRoot && this.renderRoot instanceof window.ShadowRoot) {\n      this.adoptStyles();\n    }\n  }\n  /**\n   * Returns the node into which the element should render and by default\n   * creates and returns an open shadowRoot. Implement to customize where the\n   * element's DOM is rendered. For example, to render into the element's\n   * childNodes, return \\`this\\`.\n   * @returns {Element|DocumentFragment} Returns a node into which to render.\n   */\n  createRenderRoot() {\n    return this.attachShadow({\n      mode: 'open'\n    });\n  }\n  /**\n   * Applies styling to the element shadowRoot using the [[\\`styles\\`]]\n   * property. Styling will apply using \\`shadowRoot.adoptedStyleSheets\\` where\n   * available and will fallback otherwise. When Shadow DOM is polyfilled,\n   * ShadyCSS scopes styles and adds them to the document. When Shadow DOM\n   * is available but \\`adoptedStyleSheets\\` is not, styles are appended to the\n   * end of the \\`shadowRoot\\` to [mimic spec\n   * behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\n   */\n  adoptStyles() {\n    const styles = this.constructor._styles;\n    if (styles.length === 0) {\n      return;\n    } // There are three separate cases here based on Shadow DOM support.\n    // (1) shadowRoot polyfilled: use ShadyCSS\n    // (2) shadowRoot.adoptedStyleSheets available: use it\n    // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n    // rendering\n    if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n      window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s => s.cssText), this.localName);\n    } else if (supportsAdoptingStyleSheets) {\n      this.renderRoot.adoptedStyleSheets = styles.map(s => s instanceof CSSStyleSheet ? s : s.styleSheet);\n    } else {\n      // This must be done after rendering so the actual style insertion is done\n      // in \\`update\\`.\n      this._needsShimAdoptedStyleSheets = true;\n    }\n  }\n  connectedCallback() {\n    super.connectedCallback(); // Note, first update/render handles styleElement so we only call this if\n    // connected after first update.\n    if (this.hasUpdated && window.ShadyCSS !== undefined) {\n      window.ShadyCSS.styleElement(this);\n    }\n  }\n  /**\n   * Updates the element. This method reflects property values to attributes\n   * and calls \\`render\\` to render DOM via lit-html. Setting properties inside\n   * this method will *not* trigger another update.\n   * @param _changedProperties Map of changed properties with old values\n   */\n  update(changedProperties) {\n    // Setting properties in \\`render\\` should not trigger an update. Since\n    // updates are allowed after super.update, it's important to call \\`render\\`\n    // before that.\n    const templateResult = this.render();\n    super.update(changedProperties); // If render is not implemented by the component, don't call lit-html render\n    if (templateResult !== renderNotImplemented) {\n      this.constructor.render(templateResult, this.renderRoot, {\n        scopeName: this.localName,\n        eventContext: this\n      });\n    } // When native Shadow DOM is used but adoptedStyles are not supported,\n    // insert styling after rendering to ensure adoptedStyles have highest\n    // priority.\n    if (this._needsShimAdoptedStyleSheets) {\n      this._needsShimAdoptedStyleSheets = false;\n      this.constructor._styles.forEach(s => {\n        const style = document.createElement('style');\n        style.textContent = s.cssText;\n        this.renderRoot.appendChild(style);\n      });\n    }\n  }\n  /**\n   * Invoked on each update to perform rendering tasks. This method may return\n   * any value renderable by lit-html's \\`NodePart\\` - typically a\n   * \\`TemplateResult\\`. Setting properties inside this method will *not* trigger\n   * the element to update.\n   */\n  render() {\n    return renderNotImplemented;\n  }\n}\n/**\n * Ensure this class is marked as \\`finalized\\` as an optimization ensuring\n * it will not needlessly try to \\`finalize\\`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See updating-element.ts for more information.\n */\nLitElement['finalized'] = true;\n/**\n * Reference to the underlying library method used to render the element's\n * DOM. By default, points to the \\`render\\` method from lit-html's shady-render\n * module.\n *\n * **Most users will never need to touch this property.**\n *\n * This  property should not be confused with the \\`render\\` instance method,\n * which should be overridden to define a template for the element.\n *\n * Advanced users creating a new base class based on LitElement can override\n * this property to point to a custom render method with a signature that\n * matches [shady-render's \\`render\\`\n * method](https://lit-html.polymer-project.org/api/modules/shady_render.html#render).\n *\n * @nocollapse\n */\nLitElement.render = render$1;\nexport { LitElement, css, customElement, html, property };\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: allFiles 1`] = `\nArray [\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/lit-element.js\",\n  \"dist/app-root.js\",\n  \"dist/index.js\",\n  \"favicon.ico\",\n  \"index.css\",\n  \"index.html\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: dist/app-root.js 1`] = `\n\"function _decorate(decorators, factory, superClass, mixins) { var api = _getDecoratorsApi(); if (mixins) { for (var i = 0; i < mixins.length; i++) { api = mixins[i](api); } } var r = factory(function initialize(O) { api.initializeInstanceElements(O, decorated.elements); }, superClass); var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); api.initializeClassElements(r.F, decorated.elements); return api.runClassFinishers(r.F, decorated.finishers); }\nfunction _getDecoratorsApi() { _getDecoratorsApi = function () { return api; }; var api = { elementsDefinitionOrder: [[\\\\\"method\\\\\"], [\\\\\"field\\\\\"]], initializeInstanceElements: function (O, elements) { [\\\\\"method\\\\\", \\\\\"field\\\\\"].forEach(function (kind) { elements.forEach(function (element) { if (element.kind === kind && element.placement === \\\\\"own\\\\\") { this.defineClassElement(O, element); } }, this); }, this); }, initializeClassElements: function (F, elements) { var proto = F.prototype; [\\\\\"method\\\\\", \\\\\"field\\\\\"].forEach(function (kind) { elements.forEach(function (element) { var placement = element.placement; if (element.kind === kind && (placement === \\\\\"static\\\\\" || placement === \\\\\"prototype\\\\\")) { var receiver = placement === \\\\\"static\\\\\" ? F : proto; this.defineClassElement(receiver, element); } }, this); }, this); }, defineClassElement: function (receiver, element) { var descriptor = element.descriptor; if (element.kind === \\\\\"field\\\\\") { var initializer = element.initializer; descriptor = { enumerable: descriptor.enumerable, writable: descriptor.writable, configurable: descriptor.configurable, value: initializer === void 0 ? void 0 : initializer.call(receiver) }; } Object.defineProperty(receiver, element.key, descriptor); }, decorateClass: function (elements, decorators) { var newElements = []; var finishers = []; var placements = { static: [], prototype: [], own: [] }; elements.forEach(function (element) { this.addElementPlacement(element, placements); }, this); elements.forEach(function (element) { if (!_hasDecorators(element)) return newElements.push(element); var elementFinishersExtras = this.decorateElement(element, placements); newElements.push(elementFinishersExtras.element); newElements.push.apply(newElements, elementFinishersExtras.extras); finishers.push.apply(finishers, elementFinishersExtras.finishers); }, this); if (!decorators) { return { elements: newElements, finishers: finishers }; } var result = this.decorateConstructor(newElements, decorators); finishers.push.apply(finishers, result.finishers); result.finishers = finishers; return result; }, addElementPlacement: function (element, placements, silent) { var keys = placements[element.placement]; if (!silent && keys.indexOf(element.key) !== -1) { throw new TypeError(\\\\\"Duplicated element (\\\\\" + element.key + \\\\\")\\\\\"); } keys.push(element.key); }, decorateElement: function (element, placements) { var extras = []; var finishers = []; for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { var keys = placements[element.placement]; keys.splice(keys.indexOf(element.key), 1); var elementObject = this.fromElementDescriptor(element); var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); element = elementFinisherExtras.element; this.addElementPlacement(element, placements); if (elementFinisherExtras.finisher) { finishers.push(elementFinisherExtras.finisher); } var newExtras = elementFinisherExtras.extras; if (newExtras) { for (var j = 0; j < newExtras.length; j++) { this.addElementPlacement(newExtras[j], placements); } extras.push.apply(extras, newExtras); } } return { element: element, finishers: finishers, extras: extras }; }, decorateConstructor: function (elements, decorators) { var finishers = []; for (var i = decorators.length - 1; i >= 0; i--) { var obj = this.fromClassDescriptor(elements); var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); if (elementsAndFinisher.finisher !== undefined) { finishers.push(elementsAndFinisher.finisher); } if (elementsAndFinisher.elements !== undefined) { elements = elementsAndFinisher.elements; for (var j = 0; j < elements.length - 1; j++) { for (var k = j + 1; k < elements.length; k++) { if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { throw new TypeError(\\\\\"Duplicated element (\\\\\" + elements[j].key + \\\\\")\\\\\"); } } } } } return { elements: elements, finishers: finishers }; }, fromElementDescriptor: function (element) { var obj = { kind: element.kind, key: element.key, placement: element.placement, descriptor: element.descriptor }; var desc = { value: \\\\\"Descriptor\\\\\", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); if (element.kind === \\\\\"field\\\\\") obj.initializer = element.initializer; return obj; }, toElementDescriptors: function (elementObjects) { if (elementObjects === undefined) return; return _toArray(elementObjects).map(function (elementObject) { var element = this.toElementDescriptor(elementObject); this.disallowProperty(elementObject, \\\\\"finisher\\\\\", \\\\\"An element descriptor\\\\\"); this.disallowProperty(elementObject, \\\\\"extras\\\\\", \\\\\"An element descriptor\\\\\"); return element; }, this); }, toElementDescriptor: function (elementObject) { var kind = String(elementObject.kind); if (kind !== \\\\\"method\\\\\" && kind !== \\\\\"field\\\\\") { throw new TypeError('An element descriptor\\\\\\\\'s .kind property must be either \\\\\"method\\\\\" or' + ' \\\\\"field\\\\\", but a decorator created an element descriptor with' + ' .kind \\\\\"' + kind + '\\\\\"'); } var key = _toPropertyKey(elementObject.key); var placement = String(elementObject.placement); if (placement !== \\\\\"static\\\\\" && placement !== \\\\\"prototype\\\\\" && placement !== \\\\\"own\\\\\") { throw new TypeError('An element descriptor\\\\\\\\'s .placement property must be one of \\\\\"static\\\\\",' + ' \\\\\"prototype\\\\\" or \\\\\"own\\\\\", but a decorator created an element descriptor' + ' with .placement \\\\\"' + placement + '\\\\\"'); } var descriptor = elementObject.descriptor; this.disallowProperty(elementObject, \\\\\"elements\\\\\", \\\\\"An element descriptor\\\\\"); var element = { kind: kind, key: key, placement: placement, descriptor: Object.assign({}, descriptor) }; if (kind !== \\\\\"field\\\\\") { this.disallowProperty(elementObject, \\\\\"initializer\\\\\", \\\\\"A method descriptor\\\\\"); } else { this.disallowProperty(descriptor, \\\\\"get\\\\\", \\\\\"The property descriptor of a field descriptor\\\\\"); this.disallowProperty(descriptor, \\\\\"set\\\\\", \\\\\"The property descriptor of a field descriptor\\\\\"); this.disallowProperty(descriptor, \\\\\"value\\\\\", \\\\\"The property descriptor of a field descriptor\\\\\"); element.initializer = elementObject.initializer; } return element; }, toElementFinisherExtras: function (elementObject) { var element = this.toElementDescriptor(elementObject); var finisher = _optionalCallableProperty(elementObject, \\\\\"finisher\\\\\"); var extras = this.toElementDescriptors(elementObject.extras); return { element: element, finisher: finisher, extras: extras }; }, fromClassDescriptor: function (elements) { var obj = { kind: \\\\\"class\\\\\", elements: elements.map(this.fromElementDescriptor, this) }; var desc = { value: \\\\\"Descriptor\\\\\", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); return obj; }, toClassDescriptor: function (obj) { var kind = String(obj.kind); if (kind !== \\\\\"class\\\\\") { throw new TypeError('A class descriptor\\\\\\\\'s .kind property must be \\\\\"class\\\\\", but a decorator' + ' created a class descriptor with .kind \\\\\"' + kind + '\\\\\"'); } this.disallowProperty(obj, \\\\\"key\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"placement\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"descriptor\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"initializer\\\\\", \\\\\"A class descriptor\\\\\"); this.disallowProperty(obj, \\\\\"extras\\\\\", \\\\\"A class descriptor\\\\\"); var finisher = _optionalCallableProperty(obj, \\\\\"finisher\\\\\"); var elements = this.toElementDescriptors(obj.elements); return { elements: elements, finisher: finisher }; }, runClassFinishers: function (constructor, finishers) { for (var i = 0; i < finishers.length; i++) { var newConstructor = (0, finishers[i])(constructor); if (newConstructor !== undefined) { if (typeof newConstructor !== \\\\\"function\\\\\") { throw new TypeError(\\\\\"Finishers must return a constructor.\\\\\"); } constructor = newConstructor; } } return constructor; }, disallowProperty: function (obj, name, objectType) { if (obj[name] !== undefined) { throw new TypeError(objectType + \\\\\" can't have a .\\\\\" + name + \\\\\" property.\\\\\"); } } }; return api; }\nfunction _createElementDescriptor(def) { var key = _toPropertyKey(def.key); var descriptor; if (def.kind === \\\\\"method\\\\\") { descriptor = { value: def.value, writable: true, configurable: true, enumerable: false }; } else if (def.kind === \\\\\"get\\\\\") { descriptor = { get: def.value, configurable: true, enumerable: false }; } else if (def.kind === \\\\\"set\\\\\") { descriptor = { set: def.value, configurable: true, enumerable: false }; } else if (def.kind === \\\\\"field\\\\\") { descriptor = { configurable: true, writable: true, enumerable: true }; } var element = { kind: def.kind === \\\\\"field\\\\\" ? \\\\\"field\\\\\" : \\\\\"method\\\\\", key: key, placement: def.static ? \\\\\"static\\\\\" : def.kind === \\\\\"field\\\\\" ? \\\\\"own\\\\\" : \\\\\"prototype\\\\\", descriptor: descriptor }; if (def.decorators) element.decorators = def.decorators; if (def.kind === \\\\\"field\\\\\") element.initializer = def.value; return element; }\nfunction _coalesceGetterSetter(element, other) { if (element.descriptor.get !== undefined) { other.descriptor.get = element.descriptor.get; } else { other.descriptor.set = element.descriptor.set; } }\nfunction _coalesceClassElements(elements) { var newElements = []; var isSameElement = function (other) { return other.kind === \\\\\"method\\\\\" && other.key === element.key && other.placement === element.placement; }; for (var i = 0; i < elements.length; i++) { var element = elements[i]; var other; if (element.kind === \\\\\"method\\\\\" && (other = newElements.find(isSameElement))) { if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { if (_hasDecorators(element) || _hasDecorators(other)) { throw new ReferenceError(\\\\\"Duplicated methods (\\\\\" + element.key + \\\\\") can't be decorated.\\\\\"); } other.descriptor = element.descriptor; } else { if (_hasDecorators(element)) { if (_hasDecorators(other)) { throw new ReferenceError(\\\\\"Decorators can't be placed on different accessors with for \\\\\" + \\\\\"the same property (\\\\\" + element.key + \\\\\").\\\\\"); } other.decorators = element.decorators; } _coalesceGetterSetter(element, other); } } else { newElements.push(element); } } return newElements; }\nfunction _hasDecorators(element) { return element.decorators && element.decorators.length; }\nfunction _isDataDescriptor(desc) { return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); }\nfunction _optionalCallableProperty(obj, name) { var value = obj[name]; if (value !== undefined && typeof value !== \\\\\"function\\\\\") { throw new TypeError(\\\\\"Expected '\\\\\" + name + \\\\\"' to be a function\\\\\"); } return value; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \\\\\"string\\\\\"); return typeof key === \\\\\"symbol\\\\\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \\\\\"object\\\\\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \\\\\"default\\\\\"); if (typeof res !== \\\\\"object\\\\\") return res; throw new TypeError(\\\\\"@@toPrimitive must return a primitive value.\\\\\"); } return (hint === \\\\\"string\\\\\" ? String : Number)(input); }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\\\\\"Invalid attempt to destructure non-iterable instance.In order to be iterable, non-array objects must have a [Symbol.iterator]() method.\\\\\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \\\\\"string\\\\\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \\\\\"Object\\\\\" && o.constructor) n = o.constructor.name; if (n === \\\\\"Map\\\\\" || n === \\\\\"Set\\\\\") return Array.from(o); if (n === \\\\\"Arguments\\\\\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \\\\\"undefined\\\\\" && iter[Symbol.iterator] != null || iter[\\\\\"@@iterator\\\\\"] != null) return Array.from(iter); }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { customElement, property, LitElement, html, css } from '../_snowpack/pkg/lit-element.js';\nexport let AppRoot = _decorate([customElement('app-root')], function (_initialize, _LitElement) {\n  class AppRoot extends _LitElement {\n    constructor(...args) {\n      super(...args);\n      _initialize(this);\n    }\n  }\n  return {\n    F: AppRoot,\n    d: [{\n      kind: \\\\\"field\\\\\",\n      decorators: [property()],\n      key: \\\\\"message\\\\\",\n      value() {\n        return 'Learn LitElement';\n      }\n    }, {\n      kind: \\\\\"get\\\\\",\n      static: true,\n      key: \\\\\"styles\\\\\",\n      value: function styles() {\n        return css\\`\n      h1 {\n        font-size: 4rem;\n      }\n      .wrapper {\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        flex-direction: column;\n        height: 100vh;\n        background-color: #2196f3;\n        background: linear-gradient(315deg, #b4d2ea 0%, #2196f3 100%);\n        font-size: 24px;\n      }\n      .link {\n        color: white;\n      }\n    \\`;\n      }\n    }, {\n      kind: \\\\\"method\\\\\",\n      key: \\\\\"render\\\\\",\n      value: function render() {\n        return html\\`\n      <div class=\\\\\"wrapper\\\\\">\n        <h1>LitElement + Snowpack</h1>\n        <p>Edit <code>src/app-root.ts</code> and save to reload.</p>\n        <a\n          class=\\\\\"link\\\\\"\n          href=\\\\\"https://lit-element.polymer-project.org/\\\\\"\n          target=\\\\\"_blank\\\\\"\n          rel=\\\\\"noopener noreferrer\\\\\"\n        >\n          \\${this.message}\n        </a>\n      </div>\n    \\`;\n      }\n    }]\n  };\n}, LitElement);\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: dist/index.js 1`] = `\"import './app-root.js';\"`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: index.css 1`] = `\n\"body {\n  font-family: -apple-system, BlinkMacSystemFont, \\\\\"Segoe UI\\\\\", \\\\\"Roboto\\\\\", \\\\\"Oxygen\\\\\", \\\\\"Ubuntu\\\\\", \\\\\"Cantarell\\\\\", \\\\\"Fira Sans\\\\\", \\\\\"Droid Sans\\\\\", \\\\\"Helvetica Neue\\\\\", sans-serif;\n  color: white;\n  margin: 0;\n  padding: 0;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-lit-element-typescript > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/index.css\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <app-root></app-root>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-minimal > build: allFiles 1`] = `\nArray [\n  \"index.css\",\n  \"index.html\",\n  \"index.js\",\n  \"package.json\",\n  \"README.md\",\n  \"snowpack.config.js\",\n]\n`;\n\nexports[`create-snowpack-app app-template-minimal > build: index.css 1`] = `\n\"/* Add CSS styles here! */\nbody {\n  font-family: sans-serif;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-minimal > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Starter Snowpack App\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/index.css\\\\\" />\n    <title>Starter Snowpack App</title>\n  </head>\n  <body>\n    <h1>Welcome to Snowpack!</h1>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/index.js\\\\\"></script>\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-minimal > build: index.js 1`] = `\n\"/* Add JavaScript code here! */\nconsole.log('Hello World! You did it! Welcome to Snowpack :D');\"\n`;\n\nexports[`create-snowpack-app app-template-minimal > build: package.json 1`] = `\n\"{\n  \\\\\"name\\\\\": \\\\\"@snowpack/app-template-minimal\\\\\",\n  \\\\\"description\\\\\": \\\\\"A preconfigured minimal template for Snowpack\\\\\",\n  \\\\\"version\\\\\": \\\\\"2.1.1\\\\\",\n  \\\\\"license\\\\\": \\\\\"MIT\\\\\",\n  \\\\\"homepage\\\\\": \\\\\"https://github.com/withastro/snowpack/tree/main/create-snowpack-app/app-template-preact#readme\\\\\",\n  \\\\\"repository\\\\\": {\n    \\\\\"type\\\\\": \\\\\"git\\\\\",\n    \\\\\"url\\\\\": \\\\\"https://github.com/withastro/snowpack.git\\\\\",\n    \\\\\"directory\\\\\": \\\\\"create-snowpack-app/app-template-minimal\\\\\"\n  },\n  \\\\\"keywords\\\\\": [\n    \\\\\"csa-template\\\\\"\n  ],\n  \\\\\"main\\\\\": \\\\\"index.js\\\\\",\n  \\\\\"scripts\\\\\": {\n    \\\\\"start\\\\\": \\\\\"snowpack dev\\\\\",\n    \\\\\"build\\\\\": \\\\\"snowpack build\\\\\",\n    \\\\\"test\\\\\": \\\\\"echo \\\\\\\\\\\\\"This template does not include a test runner by default.\\\\\\\\\\\\\" && exit 1\\\\\"\n  },\n  \\\\\"devDependencies\\\\\": {\n    \\\\\"snowpack\\\\\": \\\\\"^3.3.7\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-minimal > build: snowpack.config.js 1`] = `\n\"export default {\n  mount: {},\n  plugins: [],\n  routes: [],\n  optimize: {},\n  packageOptions: {},\n  devOptions: {},\n  buildOptions: {}\n};\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"preact\\\\\": \\\\\"./preact.js\\\\\",\n    \\\\\"preact/devtools\\\\\": \\\\\"./preact/devtools.js\\\\\",\n    \\\\\"preact/hooks\\\\\": \\\\\"./preact/hooks.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: _snowpack/pkg/preact.js 1`] = `\"export { a as h, N as render } from './common/preact.module-XXXXXXXX.js';\"`;\n\nexports[`create-snowpack-app app-template-preact > build: _snowpack/pkg/preact/devtools.js 1`] = `\n\"import { n, y, p } from '../common/preact.module-XXXXXXXX.js';\nfunction t(o,e){return n.__a&&n.__a(e),o}\\\\\"undefined\\\\\"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact(\\\\\"10.5.13\\\\\",n,{Fragment:y,Component:p});\nexport { t as addHookName };\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: _snowpack/pkg/preact/hooks.js 1`] = `\n\"import { n } from '../common/preact.module-XXXXXXXX.js';\nvar t,u,r,o=0,i=[],c=n.__b,f=n.__r,e=n.diffed,a=n.__c,v=n.unmount;function m(t,r){n.__h&&n.__h(u,t,o||r),o=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function l(n){return o=1,p(w,n)}function p(n,r,o){var i=m(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=m(t++,3);!n.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function x(){i.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g),t.__H.__h.forEach(j),t.__H.__h=[];}catch(u){t.__H.__h=[],n.__e(u,t.__v);}}),i=[];}n.__b=function(n){u=null,c&&c(n);},n.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g),r.__h.forEach(j),r.__h=[]);},n.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===n.requestAnimationFrame||((r=n.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x)),u=void 0;},n.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g),t.__h=t.__h.filter(function(n){return !n.__||j(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],n.__e(r,t.__v);}}),a&&a(t,u);},n.unmount=function(t){v&&v(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g);}catch(t){n.__e(t,u.__v);}};var b=\\\\\"function\\\\\"==typeof requestAnimationFrame;function g(n){var t=u;\\\\\"function\\\\\"==typeof n.__c&&n.__c(),u=t;}function j(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w(n,t){return \\\\\"function\\\\\"==typeof t?t(n):t}\nexport { y as useEffect, l as useState };\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: allFiles 1`] = `\nArray [\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/preact.js\",\n  \"_snowpack/pkg/preact/devtools.js\",\n  \"_snowpack/pkg/preact/hooks.js\",\n  \"dist/App.css\",\n  \"dist/App.css.proxy.js\",\n  \"dist/App.js\",\n  \"dist/index.css\",\n  \"dist/index.css.proxy.js\",\n  \"dist/index.js\",\n  \"dist/logo.png\",\n  \"dist/logo.png.proxy.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/App.css 1`] = `\n\".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n.App-link {\n  color: #61dafb;\n}\n.App-logo {\n  height: 36vmin;\n  pointer-events: none;\n  margin-bottom: 3rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/App.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\".App {  text-align: center;}.App code {  background: #FFF3;  padding: 4px 8px;  border-radius: 4px;}.App p {  margin: 0.4rem;}.App-header {  background-color: #282c34;  min-height: 100vh;  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  font-size: calc(10px + 2vmin);  color: white;}.App-link {  color: #61dafb;}.App-logo {  height: 36vmin;  pointer-events: none;  margin-bottom: 3rem;  animation: App-logo-spin infinite 1.6s ease-in-out alternate;}@keyframes App-logo-spin {  from {    transform: scale(1);  }  to {    transform: scale(1.06);  }}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/App.js 1`] = `\n\"import {h} from \\\\\"../_snowpack/pkg/preact.js\\\\\";\nimport {useState, useEffect} from \\\\\"../_snowpack/pkg/preact/hooks.js\\\\\";\nimport logo from \\\\\"./logo.png.proxy.js\\\\\";\nimport \\\\\"./App.css.proxy.js\\\\\";\nfunction App() {\n  const [count, setCount] = useState(0);\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1e3);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  return /* @__PURE__ */ h(\\\\\"div\\\\\", {\n    className: \\\\\"App\\\\\"\n  }, /* @__PURE__ */ h(\\\\\"header\\\\\", {\n    className: \\\\\"App-header\\\\\"\n  }, /* @__PURE__ */ h(\\\\\"img\\\\\", {\n    src: logo,\n    className: \\\\\"App-logo\\\\\",\n    alt: \\\\\"logo\\\\\"\n  }), /* @__PURE__ */ h(\\\\\"p\\\\\", null, \\\\\"Edit \\\\\", /* @__PURE__ */ h(\\\\\"code\\\\\", null, \\\\\"src/App.jsx\\\\\"), \\\\\" and save to reload.\\\\\"), /* @__PURE__ */ h(\\\\\"p\\\\\", null, \\\\\"Page has been open for \\\\\", /* @__PURE__ */ h(\\\\\"code\\\\\", null, count), \\\\\" seconds.\\\\\"), /* @__PURE__ */ h(\\\\\"p\\\\\", null, /* @__PURE__ */ h(\\\\\"a\\\\\", {\n    className: \\\\\"App-link\\\\\",\n    href: \\\\\"https://preactjs.com\\\\\",\n    target: \\\\\"_blank\\\\\",\n    rel: \\\\\"noopener noreferrer\\\\\"\n  }, \\\\\"Learn Preact\\\\\"))));\n}\nexport default App;\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/index.css 1`] = `\n\"body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/index.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\"body {  margin: 0;  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',    sans-serif;  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;}code {  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',    monospace;}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/index.js 1`] = `\n\"import {h, render} from \\\\\"../_snowpack/pkg/preact.js\\\\\";\nimport \\\\\"../_snowpack/pkg/preact/devtools.js\\\\\";\nimport App from \\\\\"./App.js\\\\\";\nimport \\\\\"./index.css.proxy.js\\\\\";\nrender(/* @__PURE__ */ h(App, null), document.getElementById(\\\\\"root\\\\\"));\"\n`;\n\nexports[`create-snowpack-app app-template-preact > build: dist/logo.png.proxy.js 1`] = `\"export default \\\\\"/dist/logo.png\\\\\";\"`;\n\nexports[`create-snowpack-app app-template-preact > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"preact\\\\\": \\\\\"./preact.js\\\\\",\n    \\\\\"preact/devtools\\\\\": \\\\\"./preact/devtools.js\\\\\",\n    \\\\\"preact/hooks\\\\\": \\\\\"./preact/hooks.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: _snowpack/pkg/preact.js 1`] = `\"export { a as h, N as render } from './common/preact.module-XXXXXXXX.js';\"`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: _snowpack/pkg/preact/devtools.js 1`] = `\n\"import { n, y, p } from '../common/preact.module-XXXXXXXX.js';\nfunction t(o,e){return n.__a&&n.__a(e),o}\\\\\"undefined\\\\\"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact(\\\\\"10.5.13\\\\\",n,{Fragment:y,Component:p});\nexport { t as addHookName };\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: _snowpack/pkg/preact/hooks.js 1`] = `\n\"import { n } from '../common/preact.module-XXXXXXXX.js';\nvar t,u,r,o=0,i=[],c=n.__b,f=n.__r,e=n.diffed,a=n.__c,v=n.unmount;function m(t,r){n.__h&&n.__h(u,t,o||r),o=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function l(n){return o=1,p(w,n)}function p(n,r,o){var i=m(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=m(t++,3);!n.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function x(){i.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g),t.__H.__h.forEach(j),t.__H.__h=[];}catch(u){t.__H.__h=[],n.__e(u,t.__v);}}),i=[];}n.__b=function(n){u=null,c&&c(n);},n.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g),r.__h.forEach(j),r.__h=[]);},n.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===n.requestAnimationFrame||((r=n.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x)),u=void 0;},n.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g),t.__h=t.__h.filter(function(n){return !n.__||j(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],n.__e(r,t.__v);}}),a&&a(t,u);},n.unmount=function(t){v&&v(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g);}catch(t){n.__e(t,u.__v);}};var b=\\\\\"function\\\\\"==typeof requestAnimationFrame;function g(n){var t=u;\\\\\"function\\\\\"==typeof n.__c&&n.__c(),u=t;}function j(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w(n,t){return \\\\\"function\\\\\"==typeof t?t(n):t}\nexport { y as useEffect, l as useState };\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: allFiles 1`] = `\nArray [\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/preact.js\",\n  \"_snowpack/pkg/preact/devtools.js\",\n  \"_snowpack/pkg/preact/hooks.js\",\n  \"dist/App.css\",\n  \"dist/App.css.proxy.js\",\n  \"dist/App.js\",\n  \"dist/index.css\",\n  \"dist/index.css.proxy.js\",\n  \"dist/index.js\",\n  \"dist/logo.png\",\n  \"dist/logo.png.proxy.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/App.css 1`] = `\n\".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n.App-link {\n  color: #61dafb;\n}\n.App-logo {\n  height: 36vmin;\n  pointer-events: none;\n  margin-bottom: 3rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: scale(1);\n  }\n  to {\n    transform: scale(1.06);\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/App.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\".App {  text-align: center;}.App code {  background: #FFF3;  padding: 4px 8px;  border-radius: 4px;}.App p {  margin: 0.4rem;}.App-header {  background-color: #282c34;  min-height: 100vh;  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  font-size: calc(10px + 2vmin);  color: white;}.App-link {  color: #61dafb;}.App-logo {  height: 36vmin;  pointer-events: none;  margin-bottom: 3rem;  animation: App-logo-spin infinite 1.6s ease-in-out alternate;}@keyframes App-logo-spin {  from {    transform: scale(1);  }  to {    transform: scale(1.06);  }}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/App.js 1`] = `\n\"import {h} from \\\\\"../_snowpack/pkg/preact.js\\\\\";\nimport {useState, useEffect} from \\\\\"../_snowpack/pkg/preact/hooks.js\\\\\";\nimport logo from \\\\\"./logo.png.proxy.js\\\\\";\nimport \\\\\"./App.css.proxy.js\\\\\";\nfunction App() {\n  const [count, setCount] = useState(0);\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1e3);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  return /* @__PURE__ */ h(\\\\\"div\\\\\", {\n    className: \\\\\"App\\\\\"\n  }, /* @__PURE__ */ h(\\\\\"header\\\\\", {\n    className: \\\\\"App-header\\\\\"\n  }, /* @__PURE__ */ h(\\\\\"img\\\\\", {\n    src: logo,\n    className: \\\\\"App-logo\\\\\",\n    alt: \\\\\"logo\\\\\"\n  }), /* @__PURE__ */ h(\\\\\"p\\\\\", null, \\\\\"Edit \\\\\", /* @__PURE__ */ h(\\\\\"code\\\\\", null, \\\\\"src/App.jsx\\\\\"), \\\\\" and save to reload.\\\\\"), /* @__PURE__ */ h(\\\\\"p\\\\\", null, \\\\\"Page has been open for \\\\\", /* @__PURE__ */ h(\\\\\"code\\\\\", null, count), \\\\\" seconds.\\\\\"), /* @__PURE__ */ h(\\\\\"p\\\\\", null, /* @__PURE__ */ h(\\\\\"a\\\\\", {\n    className: \\\\\"App-link\\\\\",\n    href: \\\\\"https://preactjs.com\\\\\",\n    target: \\\\\"_blank\\\\\",\n    rel: \\\\\"noopener noreferrer\\\\\"\n  }, \\\\\"Learn Preact\\\\\"))));\n}\nexport default App;\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/index.css 1`] = `\n\"body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/index.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\"body {  margin: 0;  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',    sans-serif;  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;}code {  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',    monospace;}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/index.js 1`] = `\n\"import {h, render} from \\\\\"../_snowpack/pkg/preact.js\\\\\";\nimport \\\\\"../_snowpack/pkg/preact/devtools.js\\\\\";\nimport App from \\\\\"./App.js\\\\\";\nimport \\\\\"./index.css.proxy.js\\\\\";\nconst root = document.getElementById(\\\\\"root\\\\\");\nif (root) {\n  render(/* @__PURE__ */ h(App, null), root);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: dist/logo.png.proxy.js 1`] = `\"export default \\\\\"/dist/logo.png\\\\\";\"`;\n\nexports[`create-snowpack-app app-template-preact-typescript > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: _snowpack/env.js 1`] = `\n\"export const MODE = \\\\\"production\\\\\";\nexport const NODE_ENV = \\\\\"production\\\\\";\nexport const SSR = false;\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"react\\\\\": \\\\\"./react.js\\\\\",\n    \\\\\"react-dom\\\\\": \\\\\"./react-dom.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: _snowpack/pkg/react.js 1`] = `\n\"import { r as react } from './common/index-XXXXXXXX.js';\nexport { r as default } from './common/index-XXXXXXXX.js';\nvar useEffect = react.useEffect;\nvar useState = react.useState;\nexport { useEffect, useState };\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: _snowpack/pkg/react-dom.js 1`] = `\n\"import { c as createCommonjsModule, r as react, o as objectAssign } from './common/index-XXXXXXXX.js';\nvar scheduler_production_min = createCommonjsModule(function (module, exports) {\nvar f,g,h,k;if(\\\\\"object\\\\\"===typeof performance&&\\\\\"function\\\\\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q};}\nif(\\\\\"undefined\\\\\"===typeof window||\\\\\"function\\\\\"!==typeof MessageChannel){var t=null,u=null,w=function(){if(null!==t)try{var a=exports.unstable_now();t(!0,a);t=null;}catch(b){throw setTimeout(w,0),b;}};f=function(a){null!==t?setTimeout(f,0,a):(t=a,setTimeout(w,0));};g=function(a,b){u=setTimeout(a,b);};h=function(){clearTimeout(u);};exports.unstable_shouldYield=function(){return !1};k=exports.unstable_forceFrameRate=function(){};}else {var x=window.setTimeout,y=window.clearTimeout;if(\\\\\"undefined\\\\\"!==typeof console){var z=\nwindow.cancelAnimationFrame;\\\\\"function\\\\\"!==typeof window.requestAnimationFrame&&console.error(\\\\\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\\\\\");\\\\\"function\\\\\"!==typeof z&&console.error(\\\\\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\\\\\");}var A=!1,B=null,C=-1,D=5,E=0;exports.unstable_shouldYield=function(){return exports.unstable_now()>=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error(\\\\\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\\\\\"):D=0<a?Math.floor(1E3/a):5;};var F=new MessageChannel,G=F.port2;F.port1.onmessage=function(){if(null!==B){var a=exports.unstable_now();E=a+D;try{B(!0,a)?G.postMessage(null):(A=!1,B=null);}catch(b){throw G.postMessage(null),b;}}else A=!1;};f=function(a){B=a;A||(A=!0,G.postMessage(null));};g=function(a,b){C=\nx(function(){a(exports.unstable_now());},b);};h=function(){y(C);C=-1;};}function H(a,b){var c=a.length;a.push(b);a:for(;;){var d=c-1>>>1,e=a[d];if(void 0!==e&&0<I(e,b))a[d]=b,a[c]=e,c=d;else break a}}function J(a){a=a[0];return void 0===a?null:a}\nfunction K(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M);}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else {var b=J(M);null!==b&&g(U,b.startTime-a);}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\\\\\"function\\\\\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\\\\\"function\\\\\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b);}else K(L);O=J(L);}if(null!==O)var m=!0;else {var n=J(M);null!==n&&g(U,n.startTime-b);m=!1;}return m}finally{O=null,P=c,Q=!1;}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null;};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V));};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P;}var c=P;P=b;try{return a()}finally{P=c;}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=P;P=a;try{return b()}finally{P=c;}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\\\\\"object\\\\\"===typeof c&&null!==c?(c=c.delay,c=\\\\\"number\\\\\"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3;}e=c+e;a={id:N++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c;}}};\n});\nvar scheduler = createCommonjsModule(function (module) {\n{\n  module.exports = scheduler_production_min;\n}\n});\nfunction y(a){for(var b=\\\\\"https://reactjs.org/docs/error-decoder.html?invariant=\\\\\"+a,c=1;c<arguments.length;c++)b+=\\\\\"&args[]=\\\\\"+encodeURIComponent(arguments[c]);return \\\\\"Minified React error #\\\\\"+a+\\\\\"; visit \\\\\"+b+\\\\\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\\\\\"}if(!react)throw Error(y(227));var ba=new Set,ca={};function da(a,b){ea(a,b);ea(a+\\\\\"Capture\\\\\",b);}\nfunction ea(a,b){ca[a]=b;for(a=0;a<b.length;a++)ba.add(b[a]);}\nvar fa=!(\\\\\"undefined\\\\\"===typeof window||\\\\\"undefined\\\\\"===typeof window.document||\\\\\"undefined\\\\\"===typeof window.document.createElement),ha=/^[:A-Z_a-z\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02FF\\\\\\\\u0370-\\\\\\\\u037D\\\\\\\\u037F-\\\\\\\\u1FFF\\\\\\\\u200C-\\\\\\\\u200D\\\\\\\\u2070-\\\\\\\\u218F\\\\\\\\u2C00-\\\\\\\\u2FEF\\\\\\\\u3001-\\\\\\\\uD7FF\\\\\\\\uF900-\\\\\\\\uFDCF\\\\\\\\uFDF0-\\\\\\\\uFFFD][:A-Z_a-z\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02FF\\\\\\\\u0370-\\\\\\\\u037D\\\\\\\\u037F-\\\\\\\\u1FFF\\\\\\\\u200C-\\\\\\\\u200D\\\\\\\\u2070-\\\\\\\\u218F\\\\\\\\u2C00-\\\\\\\\u2FEF\\\\\\\\u3001-\\\\\\\\uD7FF\\\\\\\\uF900-\\\\\\\\uFDCF\\\\\\\\uFDF0-\\\\\\\\uFFFD\\\\\\\\-.0-9\\\\\\\\u00B7\\\\\\\\u0300-\\\\\\\\u036F\\\\\\\\u203F-\\\\\\\\u2040]*$/,ia=Object.prototype.hasOwnProperty,\nja={},ka={};function la(a){if(ia.call(ka,a))return !0;if(ia.call(ja,a))return !1;if(ha.test(a))return ka[a]=!0;ja[a]=!0;return !1}function ma(a,b,c,d){if(null!==c&&0===c.type)return !1;switch(typeof b){case \\\\\"function\\\\\":case \\\\\"symbol\\\\\":return !0;case \\\\\"boolean\\\\\":if(d)return !1;if(null!==c)return !c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return \\\\\"data-\\\\\"!==a&&\\\\\"aria-\\\\\"!==a;default:return !1}}\nfunction na(a,b,c,d){if(null===b||\\\\\"undefined\\\\\"===typeof b||ma(a,b,c,d))return !0;if(d)return !1;if(null!==c)switch(c.type){case 3:return !b;case 4:return !1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return !1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g;}var D={};\n\\\\\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\\\\\".split(\\\\\" \\\\\").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1);});[[\\\\\"acceptCharset\\\\\",\\\\\"accept-charset\\\\\"],[\\\\\"className\\\\\",\\\\\"class\\\\\"],[\\\\\"htmlFor\\\\\",\\\\\"for\\\\\"],[\\\\\"httpEquiv\\\\\",\\\\\"http-equiv\\\\\"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1);});[\\\\\"contentEditable\\\\\",\\\\\"draggable\\\\\",\\\\\"spellCheck\\\\\",\\\\\"value\\\\\"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1);});\n[\\\\\"autoReverse\\\\\",\\\\\"externalResourcesRequired\\\\\",\\\\\"focusable\\\\\",\\\\\"preserveAlpha\\\\\"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1);});\\\\\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\\\\\".split(\\\\\" \\\\\").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1);});\n[\\\\\"checked\\\\\",\\\\\"multiple\\\\\",\\\\\"muted\\\\\",\\\\\"selected\\\\\"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1);});[\\\\\"capture\\\\\",\\\\\"download\\\\\"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1);});[\\\\\"cols\\\\\",\\\\\"rows\\\\\",\\\\\"size\\\\\",\\\\\"span\\\\\"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1);});[\\\\\"rowSpan\\\\\",\\\\\"start\\\\\"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1);});var oa=/[\\\\\\\\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()}\n\\\\\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\\\\\".split(\\\\\" \\\\\").forEach(function(a){var b=a.replace(oa,\npa);D[b]=new B(b,1,!1,a,null,!1,!1);});\\\\\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\\\\\".split(\\\\\" \\\\\").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\\\\\"http://www.w3.org/1999/xlink\\\\\",!1,!1);});[\\\\\"xml:base\\\\\",\\\\\"xml:lang\\\\\",\\\\\"xml:space\\\\\"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\\\\\"http://www.w3.org/XML/1998/namespace\\\\\",!1,!1);});[\\\\\"tabIndex\\\\\",\\\\\"crossOrigin\\\\\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1);});\nD.xlinkHref=new B(\\\\\"xlinkHref\\\\\",1,!1,\\\\\"xlink:href\\\\\",\\\\\"http://www.w3.org/1999/xlink\\\\\",!0,!1);[\\\\\"src\\\\\",\\\\\"href\\\\\",\\\\\"action\\\\\",\\\\\"formAction\\\\\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0);});\nfunction qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||\\\\\"o\\\\\"!==b[0]&&\\\\\"O\\\\\"!==b[0]||\\\\\"n\\\\\"!==b[1]&&\\\\\"N\\\\\"!==b[1]?!1:!0;f||(na(b,c,e,d)&&(c=null),d||null===e?la(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,\\\\\"\\\\\"+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:\\\\\"\\\\\":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?\\\\\"\\\\\":\\\\\"\\\\\"+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))));}\nvar ra=react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sa=60103,ta=60106,ua=60107,wa=60108,xa=60114,ya=60109,za=60110,Aa=60112,Ba=60113,Ca=60120,Da=60115,Ea=60116,Fa=60121,Ga=60128,Ha=60129,Ia=60130,Ja=60131;\nif(\\\\\"function\\\\\"===typeof Symbol&&Symbol.for){var E=Symbol.for;sa=E(\\\\\"react.element\\\\\");ta=E(\\\\\"react.portal\\\\\");ua=E(\\\\\"react.fragment\\\\\");wa=E(\\\\\"react.strict_mode\\\\\");xa=E(\\\\\"react.profiler\\\\\");ya=E(\\\\\"react.provider\\\\\");za=E(\\\\\"react.context\\\\\");Aa=E(\\\\\"react.forward_ref\\\\\");Ba=E(\\\\\"react.suspense\\\\\");Ca=E(\\\\\"react.suspense_list\\\\\");Da=E(\\\\\"react.memo\\\\\");Ea=E(\\\\\"react.lazy\\\\\");Fa=E(\\\\\"react.block\\\\\");E(\\\\\"react.scope\\\\\");Ga=E(\\\\\"react.opaque.id\\\\\");Ha=E(\\\\\"react.debug_trace_mode\\\\\");Ia=E(\\\\\"react.offscreen\\\\\");Ja=E(\\\\\"react.legacy_hidden\\\\\");}\nvar Ka=\\\\\"function\\\\\"===typeof Symbol&&Symbol.iterator;function La(a){if(null===a||\\\\\"object\\\\\"!==typeof a)return null;a=Ka&&a[Ka]||a[\\\\\"@@iterator\\\\\"];return \\\\\"function\\\\\"===typeof a?a:null}var Ma;function Na(a){if(void 0===Ma)try{throw Error();}catch(c){var b=c.stack.trim().match(/( *(at )?)/);Ma=b&&b[1]||\\\\\"\\\\\";}return \\\\\"\\\\\"+Ma+a}var Oa=!1;\nfunction Pa(a,b){if(!a||Oa)return \\\\\"\\\\\";Oa=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,\\\\\"props\\\\\",{set:function(){throw Error();}}),\\\\\"object\\\\\"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[]);}catch(k){var d=k;}Reflect.construct(a,[],b);}else {try{b.call();}catch(k){d=k;}a.call(b.prototype);}else {try{throw Error();}catch(k){d=k;}a();}}catch(k){if(k&&d&&\\\\\"string\\\\\"===typeof k.stack){for(var e=k.stack.split(\\\\\"\\\\\"),\nf=d.stack.split(\\\\\"\\\\\"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h])return \\\\\"\\\\\"+e[g].replace(\\\\\" at new \\\\\",\\\\\" at \\\\\");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c;}return (a=a?a.displayName||a.name:\\\\\"\\\\\")?Na(a):\\\\\"\\\\\"}\nfunction Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na(\\\\\"Lazy\\\\\");case 13:return Na(\\\\\"Suspense\\\\\");case 19:return Na(\\\\\"SuspenseList\\\\\");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return \\\\\"\\\\\"}}\nfunction Ra(a){if(null==a)return null;if(\\\\\"function\\\\\"===typeof a)return a.displayName||a.name||null;if(\\\\\"string\\\\\"===typeof a)return a;switch(a){case ua:return \\\\\"Fragment\\\\\";case ta:return \\\\\"Portal\\\\\";case xa:return \\\\\"Profiler\\\\\";case wa:return \\\\\"StrictMode\\\\\";case Ba:return \\\\\"Suspense\\\\\";case Ca:return \\\\\"SuspenseList\\\\\"}if(\\\\\"object\\\\\"===typeof a)switch(a.$$typeof){case za:return (a.displayName||\\\\\"Context\\\\\")+\\\\\".Consumer\\\\\";case ya:return (a._context.displayName||\\\\\"Context\\\\\")+\\\\\".Provider\\\\\";case Aa:var b=a.render;b=b.displayName||b.name||\\\\\"\\\\\";\nreturn a.displayName||(\\\\\"\\\\\"!==b?\\\\\"ForwardRef(\\\\\"+b+\\\\\")\\\\\":\\\\\"ForwardRef\\\\\");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case \\\\\"boolean\\\\\":case \\\\\"number\\\\\":case \\\\\"object\\\\\":case \\\\\"string\\\\\":case \\\\\"undefined\\\\\":return a;default:return \\\\\"\\\\\"}}function Ta(a){var b=a.type;return (a=a.nodeName)&&\\\\\"input\\\\\"===a.toLowerCase()&&(\\\\\"checkbox\\\\\"===b||\\\\\"radio\\\\\"===b)}\nfunction Ua(a){var b=Ta(a)?\\\\\"checked\\\\\":\\\\\"value\\\\\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\\\\\"\\\\\"+a[b];if(!a.hasOwnProperty(b)&&\\\\\"undefined\\\\\"!==typeof c&&\\\\\"function\\\\\"===typeof c.get&&\\\\\"function\\\\\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\\\\\"\\\\\"+a;f.call(this,a);}});Object.defineProperty(a,b,{enumerable:c.enumerable});return {getValue:function(){return d},setValue:function(a){d=\\\\\"\\\\\"+a;},stopTracking:function(){a._valueTracker=\nnull;delete a[b];}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a));}function Wa(a){if(!a)return !1;var b=a._valueTracker;if(!b)return !0;var c=b.getValue();var d=\\\\\"\\\\\";a&&(d=Ta(a)?a.checked?\\\\\"true\\\\\":\\\\\"false\\\\\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\\\\\"undefined\\\\\"!==typeof document?document:void 0);if(\\\\\"undefined\\\\\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return objectAssign({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\\\\\"\\\\\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\\\\\"checkbox\\\\\"===b.type||\\\\\"radio\\\\\"===b.type?null!=b.checked:null!=b.value};}function $a(a,b){b=b.checked;null!=b&&qa(a,\\\\\"checked\\\\\",b,!1);}\nfunction ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\\\\\"number\\\\\"===d){if(0===c&&\\\\\"\\\\\"===a.value||a.value!=c)a.value=\\\\\"\\\\\"+c;}else a.value!==\\\\\"\\\\\"+c&&(a.value=\\\\\"\\\\\"+c);else if(\\\\\"submit\\\\\"===d||\\\\\"reset\\\\\"===d){a.removeAttribute(\\\\\"value\\\\\");return}b.hasOwnProperty(\\\\\"value\\\\\")?bb(a,b.type,c):b.hasOwnProperty(\\\\\"defaultValue\\\\\")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked);}\nfunction cb(a,b,c){if(b.hasOwnProperty(\\\\\"value\\\\\")||b.hasOwnProperty(\\\\\"defaultValue\\\\\")){var d=b.type;if(!(\\\\\"submit\\\\\"!==d&&\\\\\"reset\\\\\"!==d||void 0!==b.value&&null!==b.value))return;b=\\\\\"\\\\\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b;}c=a.name;\\\\\"\\\\\"!==c&&(a.name=\\\\\"\\\\\");a.defaultChecked=!!a._wrapperState.initialChecked;\\\\\"\\\\\"!==c&&(a.name=c);}\nfunction bb(a,b,c){if(\\\\\"number\\\\\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\\\\\"\\\\\"+a._wrapperState.initialValue:a.defaultValue!==\\\\\"\\\\\"+c&&(a.defaultValue=\\\\\"\\\\\"+c);}function db(a){var b=\\\\\"\\\\\";react.Children.forEach(a,function(a){null!=a&&(b+=a);});return b}function eb(a,b){a=objectAssign({children:void 0},b);if(b=db(b.children))a.children=b;return a}\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b[\\\\\"$\\\\\"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty(\\\\\"$\\\\\"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0);}else {c=\\\\\"\\\\\"+Sa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e]);}null!==b&&(b.selected=!0);}}\nfunction gb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(y(91));return objectAssign({},b,{value:void 0,defaultValue:void 0,children:\\\\\"\\\\\"+a._wrapperState.initialValue})}function hb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(y(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(y(93));c=c[0];}b=c;}null==b&&(b=\\\\\"\\\\\");c=b;}a._wrapperState={initialValue:Sa(c)};}\nfunction ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=\\\\\"\\\\\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\\\\\"\\\\\"+d);}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\\\\\"\\\\\"!==b&&null!==b&&(a.value=b);}var kb={html:\\\\\"http://www.w3.org/1999/xhtml\\\\\",mathml:\\\\\"http://www.w3.org/1998/Math/MathML\\\\\",svg:\\\\\"http://www.w3.org/2000/svg\\\\\"};\nfunction lb(a){switch(a){case \\\\\"svg\\\\\":return \\\\\"http://www.w3.org/2000/svg\\\\\";case \\\\\"math\\\\\":return \\\\\"http://www.w3.org/1998/Math/MathML\\\\\";default:return \\\\\"http://www.w3.org/1999/xhtml\\\\\"}}function mb(a,b){return null==a||\\\\\"http://www.w3.org/1999/xhtml\\\\\"===a?lb(b):\\\\\"http://www.w3.org/2000/svg\\\\\"===a&&\\\\\"foreignObject\\\\\"===b?\\\\\"http://www.w3.org/1999/xhtml\\\\\":a}\nvar nb,ob=function(a){return \\\\\"undefined\\\\\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==kb.svg||\\\\\"innerHTML\\\\\"in a)a.innerHTML=b;else {nb=nb||document.createElement(\\\\\"div\\\\\");nb.innerHTML=\\\\\"<svg>\\\\\"+b.valueOf().toString()+\\\\\"</svg>\\\\\";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}});\nfunction pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;}\nvar qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=[\\\\\"Webkit\\\\\",\\\\\"ms\\\\\",\\\\\"Moz\\\\\",\\\\\"O\\\\\"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a];});});function sb(a,b,c){return null==b||\\\\\"boolean\\\\\"===typeof b||\\\\\"\\\\\"===b?\\\\\"\\\\\":c||\\\\\"number\\\\\"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(\\\\\"\\\\\"+b).trim():b+\\\\\"px\\\\\"}\nfunction tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\\\\\"--\\\\\"),e=sb(c,b[c],d);\\\\\"float\\\\\"===c&&(c=\\\\\"cssFloat\\\\\");d?a.setProperty(c,e):a[c]=e;}}var ub=objectAssign({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!(\\\\\"object\\\\\"===typeof b.dangerouslySetInnerHTML&&\\\\\"__html\\\\\"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&\\\\\"object\\\\\"!==typeof b.style)throw Error(y(62));}}\nfunction wb(a,b){if(-1===a.indexOf(\\\\\"-\\\\\"))return \\\\\"string\\\\\"===typeof b.is;switch(a){case \\\\\"annotation-xml\\\\\":case \\\\\"color-profile\\\\\":case \\\\\"font-face\\\\\":case \\\\\"font-face-src\\\\\":case \\\\\"font-face-uri\\\\\":case \\\\\"font-face-format\\\\\":case \\\\\"font-face-name\\\\\":case \\\\\"missing-glyph\\\\\":return !1;default:return !0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\\\\\"function\\\\\"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b));}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a;}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a<b.length;a++)Bb(b[a]);}}function Gb(a,b){return a(b)}function Hb(a,b,c,d,e){return a(b,c,d,e)}function Ib(){}var Jb=Gb,Kb=!1,Lb=!1;function Mb(){if(null!==zb||null!==Ab)Ib(),Fb();}\nfunction Nb(a,b,c){if(Lb)return a(b,c);Lb=!0;try{return Jb(a,b,c)}finally{Lb=!1,Mb();}}\nfunction Ob(a,b){var c=a.stateNode;if(null===c)return null;var d=Db(c);if(null===d)return null;c=d[b];a:switch(b){case \\\\\"onClick\\\\\":case \\\\\"onClickCapture\\\\\":case \\\\\"onDoubleClick\\\\\":case \\\\\"onDoubleClickCapture\\\\\":case \\\\\"onMouseDown\\\\\":case \\\\\"onMouseDownCapture\\\\\":case \\\\\"onMouseMove\\\\\":case \\\\\"onMouseMoveCapture\\\\\":case \\\\\"onMouseUp\\\\\":case \\\\\"onMouseUpCapture\\\\\":case \\\\\"onMouseEnter\\\\\":(d=!d.disabled)||(a=a.type,d=!(\\\\\"button\\\\\"===a||\\\\\"input\\\\\"===a||\\\\\"select\\\\\"===a||\\\\\"textarea\\\\\"===a));a=!d;break a;default:a=!1;}if(a)return null;if(c&&\\\\\"function\\\\\"!==\ntypeof c)throw Error(y(231,b,typeof c));return c}var Pb=!1;if(fa)try{var Qb={};Object.defineProperty(Qb,\\\\\"passive\\\\\",{get:function(){Pb=!0;}});window.addEventListener(\\\\\"test\\\\\",Qb,Qb);window.removeEventListener(\\\\\"test\\\\\",Qb,Qb);}catch(a){Pb=!1;}function Rb(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l);}catch(n){this.onError(n);}}var Sb=!1,Tb=null,Ub=!1,Vb=null,Wb={onError:function(a){Sb=!0;Tb=a;}};function Xb(a,b,c,d,e,f,g,h,k){Sb=!1;Tb=null;Rb.apply(Wb,arguments);}\nfunction Yb(a,b,c,d,e,f,g,h,k){Xb.apply(this,arguments);if(Sb){if(Sb){var l=Tb;Sb=!1;Tb=null;}else throw Error(y(198));Ub||(Ub=!0,Vb=l);}}function Zb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else {a=b;do b=a,0!==(b.flags&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function $b(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function ac(a){if(Zb(a)!==a)throw Error(y(188));}\nfunction bc(a){var b=a.alternate;if(!b){b=Zb(a);if(null===b)throw Error(y(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return ac(e),a;if(f===d)return ac(e),b;f=f.sibling;}throw Error(y(188));}if(c.return!==d.return)c=e,d=f;else {for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling;}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling;}if(!g)throw Error(y(189));}}if(c.alternate!==d)throw Error(y(190));}if(3!==c.tag)throw Error(y(188));return c.stateNode.current===c?a:b}function cc(a){a=bc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else {if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}}return null}\nfunction dc(a,b){for(var c=a.alternate;null!==b;){if(b===a||b===c)return !0;b=b.return;}return !1}var ec,fc,gc,hc,ic=!1,jc=[],kc=null,lc=null,mc=null,nc=new Map,oc=new Map,pc=[],qc=\\\\\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit\\\\\".split(\\\\\" \\\\\");\nfunction rc(a,b,c,d,e){return {blockedOn:a,domEventName:b,eventSystemFlags:c|16,nativeEvent:e,targetContainers:[d]}}function sc(a,b){switch(a){case \\\\\"focusin\\\\\":case \\\\\"focusout\\\\\":kc=null;break;case \\\\\"dragenter\\\\\":case \\\\\"dragleave\\\\\":lc=null;break;case \\\\\"mouseover\\\\\":case \\\\\"mouseout\\\\\":mc=null;break;case \\\\\"pointerover\\\\\":case \\\\\"pointerout\\\\\":nc.delete(b.pointerId);break;case \\\\\"gotpointercapture\\\\\":case \\\\\"lostpointercapture\\\\\":oc.delete(b.pointerId);}}\nfunction tc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a=rc(b,c,d,e,f),null!==b&&(b=Cb(b),null!==b&&fc(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}\nfunction uc(a,b,c,d,e){switch(b){case \\\\\"focusin\\\\\":return kc=tc(kc,a,b,c,d,e),!0;case \\\\\"dragenter\\\\\":return lc=tc(lc,a,b,c,d,e),!0;case \\\\\"mouseover\\\\\":return mc=tc(mc,a,b,c,d,e),!0;case \\\\\"pointerover\\\\\":var f=e.pointerId;nc.set(f,tc(nc.get(f)||null,a,b,c,d,e));return !0;case \\\\\"gotpointercapture\\\\\":return f=e.pointerId,oc.set(f,tc(oc.get(f)||null,a,b,c,d,e)),!0}return !1}\nfunction vc(a){var b=wc(a.target);if(null!==b){var c=Zb(b);if(null!==c)if(b=c.tag,13===b){if(b=$b(c),null!==b){a.blockedOn=b;hc(a.lanePriority,function(){scheduler.unstable_runWithPriority(a.priority,function(){gc(c);});});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null;}\nfunction xc(a){if(null!==a.blockedOn)return !1;for(var b=a.targetContainers;0<b.length;){var c=yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c)return b=Cb(c),null!==b&&fc(b),a.blockedOn=c,!1;b.shift();}return !0}function zc(a,b,c){xc(a)&&c.delete(b);}\nfunction Ac(){for(ic=!1;0<jc.length;){var a=jc[0];if(null!==a.blockedOn){a=Cb(a.blockedOn);null!==a&&ec(a);break}for(var b=a.targetContainers;0<b.length;){var c=yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c){a.blockedOn=c;break}b.shift();}null===a.blockedOn&&jc.shift();}null!==kc&&xc(kc)&&(kc=null);null!==lc&&xc(lc)&&(lc=null);null!==mc&&xc(mc)&&(mc=null);nc.forEach(zc);oc.forEach(zc);}\nfunction Bc(a,b){a.blockedOn===b&&(a.blockedOn=null,ic||(ic=!0,scheduler.unstable_scheduleCallback(scheduler.unstable_NormalPriority,Ac)));}\nfunction Cc(a){function b(b){return Bc(b,a)}if(0<jc.length){Bc(jc[0],a);for(var c=1;c<jc.length;c++){var d=jc[c];d.blockedOn===a&&(d.blockedOn=null);}}null!==kc&&Bc(kc,a);null!==lc&&Bc(lc,a);null!==mc&&Bc(mc,a);nc.forEach(b);oc.forEach(b);for(c=0;c<pc.length;c++)d=pc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<pc.length&&(c=pc[0],null===c.blockedOn);)vc(c),null===c.blockedOn&&pc.shift();}\nfunction Dc(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\\\\\"Webkit\\\\\"+a]=\\\\\"webkit\\\\\"+b;c[\\\\\"Moz\\\\\"+a]=\\\\\"moz\\\\\"+b;return c}var Ec={animationend:Dc(\\\\\"Animation\\\\\",\\\\\"AnimationEnd\\\\\"),animationiteration:Dc(\\\\\"Animation\\\\\",\\\\\"AnimationIteration\\\\\"),animationstart:Dc(\\\\\"Animation\\\\\",\\\\\"AnimationStart\\\\\"),transitionend:Dc(\\\\\"Transition\\\\\",\\\\\"TransitionEnd\\\\\")},Fc={},Gc={};\nfa&&(Gc=document.createElement(\\\\\"div\\\\\").style,\\\\\"AnimationEvent\\\\\"in window||(delete Ec.animationend.animation,delete Ec.animationiteration.animation,delete Ec.animationstart.animation),\\\\\"TransitionEvent\\\\\"in window||delete Ec.transitionend.transition);function Hc(a){if(Fc[a])return Fc[a];if(!Ec[a])return a;var b=Ec[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Gc)return Fc[a]=b[c];return a}\nvar Ic=Hc(\\\\\"animationend\\\\\"),Jc=Hc(\\\\\"animationiteration\\\\\"),Kc=Hc(\\\\\"animationstart\\\\\"),Lc=Hc(\\\\\"transitionend\\\\\"),Mc=new Map,Nc=new Map,Oc=[\\\\\"abort\\\\\",\\\\\"abort\\\\\",Ic,\\\\\"animationEnd\\\\\",Jc,\\\\\"animationIteration\\\\\",Kc,\\\\\"animationStart\\\\\",\\\\\"canplay\\\\\",\\\\\"canPlay\\\\\",\\\\\"canplaythrough\\\\\",\\\\\"canPlayThrough\\\\\",\\\\\"durationchange\\\\\",\\\\\"durationChange\\\\\",\\\\\"emptied\\\\\",\\\\\"emptied\\\\\",\\\\\"encrypted\\\\\",\\\\\"encrypted\\\\\",\\\\\"ended\\\\\",\\\\\"ended\\\\\",\\\\\"error\\\\\",\\\\\"error\\\\\",\\\\\"gotpointercapture\\\\\",\\\\\"gotPointerCapture\\\\\",\\\\\"load\\\\\",\\\\\"load\\\\\",\\\\\"loadeddata\\\\\",\\\\\"loadedData\\\\\",\\\\\"loadedmetadata\\\\\",\\\\\"loadedMetadata\\\\\",\\\\\"loadstart\\\\\",\\\\\"loadStart\\\\\",\n\\\\\"lostpointercapture\\\\\",\\\\\"lostPointerCapture\\\\\",\\\\\"playing\\\\\",\\\\\"playing\\\\\",\\\\\"progress\\\\\",\\\\\"progress\\\\\",\\\\\"seeking\\\\\",\\\\\"seeking\\\\\",\\\\\"stalled\\\\\",\\\\\"stalled\\\\\",\\\\\"suspend\\\\\",\\\\\"suspend\\\\\",\\\\\"timeupdate\\\\\",\\\\\"timeUpdate\\\\\",Lc,\\\\\"transitionEnd\\\\\",\\\\\"waiting\\\\\",\\\\\"waiting\\\\\"];function Pc(a,b){for(var c=0;c<a.length;c+=2){var d=a[c],e=a[c+1];e=\\\\\"on\\\\\"+(e[0].toUpperCase()+e.slice(1));Nc.set(d,b);Mc.set(d,e);da(e,[d]);}}var Qc=scheduler.unstable_now;Qc();var F=8;\nfunction Rc(a){if(0!==(1&a))return F=15,1;if(0!==(2&a))return F=14,2;if(0!==(4&a))return F=13,4;var b=24&a;if(0!==b)return F=12,b;if(0!==(a&32))return F=11,32;b=192&a;if(0!==b)return F=10,b;if(0!==(a&256))return F=9,256;b=3584&a;if(0!==b)return F=8,b;if(0!==(a&4096))return F=7,4096;b=4186112&a;if(0!==b)return F=6,b;b=62914560&a;if(0!==b)return F=5,b;if(a&67108864)return F=4,67108864;if(0!==(a&134217728))return F=3,134217728;b=805306368&a;if(0!==b)return F=2,b;if(0!==(1073741824&a))return F=1,1073741824;\nF=8;return a}function Sc(a){switch(a){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function Tc(a){switch(a){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(y(358,a));}}\nfunction Uc(a,b){var c=a.pendingLanes;if(0===c)return F=0;var d=0,e=0,f=a.expiredLanes,g=a.suspendedLanes,h=a.pingedLanes;if(0!==f)d=f,e=F=15;else if(f=c&134217727,0!==f){var k=f&~g;0!==k?(d=Rc(k),e=F):(h&=f,0!==h&&(d=Rc(h),e=F));}else f=c&~g,0!==f?(d=Rc(f),e=F):0!==h&&(d=Rc(h),e=F);if(0===d)return 0;d=31-Vc(d);d=c&((0>d?0:1<<d)<<1)-1;if(0!==b&&b!==d&&0===(b&g)){Rc(b);if(e<=F)return b;F=e;}b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-Vc(b),e=1<<c,d|=a[c],b&=~e;return d}\nfunction Wc(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function Xc(a,b){switch(a){case 15:return 1;case 14:return 2;case 12:return a=Yc(24&~b),0===a?Xc(10,b):a;case 10:return a=Yc(192&~b),0===a?Xc(8,b):a;case 8:return a=Yc(3584&~b),0===a&&(a=Yc(4186112&~b),0===a&&(a=512)),a;case 2:return b=Yc(805306368&~b),0===b&&(b=268435456),b}throw Error(y(358,a));}function Yc(a){return a&-a}function Zc(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}\nfunction $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c;}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=scheduler.unstable_UserBlockingPriority,ed=scheduler.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d);}finally{(Kb=f)||Mb();}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d));}\nfunction hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0<jc.length&&-1<qc.indexOf(a))a=rc(null,a,b,c,d),jc.push(a);else {var f=yc(a,b,c,d);if(null===f)e&&sc(a,d);else {if(e){if(-1<qc.indexOf(a)){a=rc(f,a,b,c,d);jc.push(a);return}if(uc(f,a,b,c,d))return;sc(a,d);}jd(a,b,d,null,c);}}}}\nfunction yc(a,b,c,d){var e=xb(d);e=wc(e);if(null!==e){var f=Zb(e);if(null===f)e=null;else {var g=f.tag;if(13===g){e=$b(f);if(null!==e)return e;e=null;}else if(3===g){if(f.stateNode.hydrate)return 3===f.tag?f.stateNode.containerInfo:null;e=null;}else f!==e&&(e=null);}}jd(a,b,d,e,c);return null}var kd=null,ld=null,md=null;\nfunction nd(){if(md)return md;var a,b=ld,c=b.length,d,e=\\\\\"value\\\\\"in kd?kd.value:kd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return md=e.slice(a,1<d?1-d:void 0)}function od(a){var b=a.keyCode;\\\\\"charCode\\\\\"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function pd(){return !0}function qd(){return !1}\nfunction rd(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?pd:qd;this.isPropagationStopped=qd;return this}objectAssign(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():\\\\\"unknown\\\\\"!==typeof a.returnValue&&\n(a.returnValue=!1),this.isDefaultPrevented=pd);},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():\\\\\"unknown\\\\\"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=pd);},persist:function(){},isPersistent:pd});return b}\nvar sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=objectAssign({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=objectAssign({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if(\\\\\"movementX\\\\\"in\na)return a.movementX;a!==yd&&(yd&&\\\\\"mousemove\\\\\"===a.type?(wd=a.screenX-yd.screenX,xd=a.screenY-yd.screenY):xd=wd=0,yd=a);return wd},movementY:function(a){return \\\\\"movementY\\\\\"in a?a.movementY:xd}}),Bd=rd(Ad),Cd=objectAssign({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=objectAssign({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=objectAssign({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=objectAssign({},sd,{clipboardData:function(a){return \\\\\"clipboardData\\\\\"in a?a.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=objectAssign({},sd,{data:0}),Ld=rd(Kd),Md={Esc:\\\\\"Escape\\\\\",\nSpacebar:\\\\\" \\\\\",Left:\\\\\"ArrowLeft\\\\\",Up:\\\\\"ArrowUp\\\\\",Right:\\\\\"ArrowRight\\\\\",Down:\\\\\"ArrowDown\\\\\",Del:\\\\\"Delete\\\\\",Win:\\\\\"OS\\\\\",Menu:\\\\\"ContextMenu\\\\\",Apps:\\\\\"ContextMenu\\\\\",Scroll:\\\\\"ScrollLock\\\\\",MozPrintableKey:\\\\\"Unidentified\\\\\"},Nd={8:\\\\\"Backspace\\\\\",9:\\\\\"Tab\\\\\",12:\\\\\"Clear\\\\\",13:\\\\\"Enter\\\\\",16:\\\\\"Shift\\\\\",17:\\\\\"Control\\\\\",18:\\\\\"Alt\\\\\",19:\\\\\"Pause\\\\\",20:\\\\\"CapsLock\\\\\",27:\\\\\"Escape\\\\\",32:\\\\\" \\\\\",33:\\\\\"PageUp\\\\\",34:\\\\\"PageDown\\\\\",35:\\\\\"End\\\\\",36:\\\\\"Home\\\\\",37:\\\\\"ArrowLeft\\\\\",38:\\\\\"ArrowUp\\\\\",39:\\\\\"ArrowRight\\\\\",40:\\\\\"ArrowDown\\\\\",45:\\\\\"Insert\\\\\",46:\\\\\"Delete\\\\\",112:\\\\\"F1\\\\\",113:\\\\\"F2\\\\\",114:\\\\\"F3\\\\\",115:\\\\\"F4\\\\\",116:\\\\\"F5\\\\\",117:\\\\\"F6\\\\\",118:\\\\\"F7\\\\\",\n119:\\\\\"F8\\\\\",120:\\\\\"F9\\\\\",121:\\\\\"F10\\\\\",122:\\\\\"F11\\\\\",123:\\\\\"F12\\\\\",144:\\\\\"NumLock\\\\\",145:\\\\\"ScrollLock\\\\\",224:\\\\\"Meta\\\\\"},Od={Alt:\\\\\"altKey\\\\\",Control:\\\\\"ctrlKey\\\\\",Meta:\\\\\"metaKey\\\\\",Shift:\\\\\"shiftKey\\\\\"};function Pd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Od[a])?!!b[a]:!1}function zd(){return Pd}\nvar Qd=objectAssign({},ud,{key:function(a){if(a.key){var b=Md[a.key]||a.key;if(\\\\\"Unidentified\\\\\"!==b)return b}return \\\\\"keypress\\\\\"===a.type?(a=od(a),13===a?\\\\\"Enter\\\\\":String.fromCharCode(a)):\\\\\"keydown\\\\\"===a.type||\\\\\"keyup\\\\\"===a.type?Nd[a.keyCode]||\\\\\"Unidentified\\\\\":\\\\\"\\\\\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(a){return \\\\\"keypress\\\\\"===a.type?od(a):0},keyCode:function(a){return \\\\\"keydown\\\\\"===a.type||\\\\\"keyup\\\\\"===a.type?a.keyCode:0},which:function(a){return \\\\\"keypress\\\\\"===\na.type?od(a):\\\\\"keydown\\\\\"===a.type||\\\\\"keyup\\\\\"===a.type?a.keyCode:0}}),Rd=rd(Qd),Sd=objectAssign({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=objectAssign({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=objectAssign({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=objectAssign({},Ad,{deltaX:function(a){return \\\\\"deltaX\\\\\"in a?a.deltaX:\\\\\"wheelDeltaX\\\\\"in a?-a.wheelDeltaX:0},\ndeltaY:function(a){return \\\\\"deltaY\\\\\"in a?a.deltaY:\\\\\"wheelDeltaY\\\\\"in a?-a.wheelDeltaY:\\\\\"wheelDelta\\\\\"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=fa&&\\\\\"CompositionEvent\\\\\"in window,be=null;fa&&\\\\\"documentMode\\\\\"in document&&(be=document.documentMode);var ce=fa&&\\\\\"TextEvent\\\\\"in window&&!be,de=fa&&(!ae||be&&8<be&&11>=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \\\\\"keyup\\\\\":return -1!==$d.indexOf(b.keyCode);case \\\\\"keydown\\\\\":return 229!==b.keyCode;case \\\\\"keypress\\\\\":case \\\\\"mousedown\\\\\":case \\\\\"focusout\\\\\":return !0;default:return !1}}function he(a){a=a.detail;return \\\\\"object\\\\\"===typeof a&&\\\\\"data\\\\\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \\\\\"compositionend\\\\\":return he(b);case \\\\\"keypress\\\\\":if(32!==b.which)return null;fe=!0;return ee;case \\\\\"textInput\\\\\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return \\\\\"compositionend\\\\\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \\\\\"paste\\\\\":return null;case \\\\\"keypress\\\\\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case \\\\\"compositionend\\\\\":return de&&\\\\\"ko\\\\\"!==b.locale?null:b.data;default:return null}}\nvar le={color:!0,date:!0,datetime:!0,\\\\\"datetime-local\\\\\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return \\\\\"input\\\\\"===b?!!le[a.type]:\\\\\"textarea\\\\\"===b?!0:!1}function ne(a,b,c,d){Eb(d);b=oe(b,\\\\\"onChange\\\\\");0<b.length&&(c=new td(\\\\\"onChange\\\\\",\\\\\"change\\\\\",null,c,d),a.push({event:c,listeners:b}));}var pe=null,qe=null;function re(a){se(a,0);}function te(a){var b=ue(a);if(Wa(b))return a}\nfunction ve(a,b){if(\\\\\"change\\\\\"===a)return b}var we=!1;if(fa){var xe;if(fa){var ye=\\\\\"oninput\\\\\"in document;if(!ye){var ze=document.createElement(\\\\\"div\\\\\");ze.setAttribute(\\\\\"oninput\\\\\",\\\\\"return;\\\\\");ye=\\\\\"function\\\\\"===typeof ze.oninput;}xe=ye;}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode);}function Ae(){pe&&(pe.detachEvent(\\\\\"onpropertychange\\\\\",Be),qe=pe=null);}function Be(a){if(\\\\\"value\\\\\"===a.propertyName&&te(qe)){var b=[];ne(b,qe,a,xb(a));a=re;if(Kb)a(b);else {Kb=!0;try{Gb(a,b);}finally{Kb=!1,Mb();}}}}\nfunction Ce(a,b,c){\\\\\"focusin\\\\\"===a?(Ae(),pe=b,qe=c,pe.attachEvent(\\\\\"onpropertychange\\\\\",Be)):\\\\\"focusout\\\\\"===a&&Ae();}function De(a){if(\\\\\"selectionchange\\\\\"===a||\\\\\"keyup\\\\\"===a||\\\\\"keydown\\\\\"===a)return te(qe)}function Ee(a,b){if(\\\\\"click\\\\\"===a)return te(b)}function Fe(a,b){if(\\\\\"input\\\\\"===a||\\\\\"change\\\\\"===a)return te(b)}function Ge(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var He=\\\\\"function\\\\\"===typeof Object.is?Object.is:Ge,Ie=Object.prototype.hasOwnProperty;\nfunction Je(a,b){if(He(a,b))return !0;if(\\\\\"object\\\\\"!==typeof a||null===a||\\\\\"object\\\\\"!==typeof b||null===b)return !1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return !1;for(d=0;d<c.length;d++)if(!Ie.call(b,c[d])||!He(a[c[d]],b[c[d]]))return !1;return !0}function Ke(a){for(;a&&a.firstChild;)a=a.firstChild;return a}\nfunction Le(a,b){var c=Ke(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return {node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=Ke(c);}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):\\\\\"contains\\\\\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\\\\\"string\\\\\"===typeof b.contentWindow.location.href;}catch(d){c=!1;}if(c)a=b.contentWindow;else break;b=Xa(a.document);}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\\\\\"input\\\\\"===b&&(\\\\\"text\\\\\"===a.type||\\\\\"search\\\\\"===a.type||\\\\\"tel\\\\\"===a.type||\\\\\"url\\\\\"===a.type||\\\\\"password\\\\\"===a.type)||\\\\\"textarea\\\\\"===b||\\\\\"true\\\\\"===a.contentEditable)}\nvar Pe=fa&&\\\\\"documentMode\\\\\"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\\\\\"selectionStart\\\\\"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,\\\\\"onSelect\\\\\"),0<d.length&&(b=new td(\\\\\"onSelect\\\\\",\\\\\"select\\\\\",null,b,c),a.push({event:b,listeners:d}),b.target=Qe)));}\nPc(\\\\\"cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange\\\\\".split(\\\\\" \\\\\"),\n0);Pc(\\\\\"drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel\\\\\".split(\\\\\" \\\\\"),1);Pc(Oc,2);for(var Ve=\\\\\"change selectionchange textInput compositionstart compositionend compositionupdate\\\\\".split(\\\\\" \\\\\"),We=0;We<Ve.length;We++)Nc.set(Ve[We],0);ea(\\\\\"onMouseEnter\\\\\",[\\\\\"mouseout\\\\\",\\\\\"mouseover\\\\\"]);\nea(\\\\\"onMouseLeave\\\\\",[\\\\\"mouseout\\\\\",\\\\\"mouseover\\\\\"]);ea(\\\\\"onPointerEnter\\\\\",[\\\\\"pointerout\\\\\",\\\\\"pointerover\\\\\"]);ea(\\\\\"onPointerLeave\\\\\",[\\\\\"pointerout\\\\\",\\\\\"pointerover\\\\\"]);da(\\\\\"onChange\\\\\",\\\\\"change click focusin focusout input keydown keyup selectionchange\\\\\".split(\\\\\" \\\\\"));da(\\\\\"onSelect\\\\\",\\\\\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\\\\\".split(\\\\\" \\\\\"));da(\\\\\"onBeforeInput\\\\\",[\\\\\"compositionend\\\\\",\\\\\"keypress\\\\\",\\\\\"textInput\\\\\",\\\\\"paste\\\\\"]);da(\\\\\"onCompositionEnd\\\\\",\\\\\"compositionend focusout keydown keypress keyup mousedown\\\\\".split(\\\\\" \\\\\"));\nda(\\\\\"onCompositionStart\\\\\",\\\\\"compositionstart focusout keydown keypress keyup mousedown\\\\\".split(\\\\\" \\\\\"));da(\\\\\"onCompositionUpdate\\\\\",\\\\\"compositionupdate focusout keydown keypress keyup mousedown\\\\\".split(\\\\\" \\\\\"));var Xe=\\\\\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\\\\\".split(\\\\\" \\\\\"),Ye=new Set(\\\\\"cancel close invalid load scroll toggle\\\\\".split(\\\\\" \\\\\").concat(Xe));\nfunction Ze(a,b,c){var d=a.type||\\\\\"unknown-event\\\\\";a.currentTarget=c;Yb(d,b,void 0,a);a.currentTarget=null;}\nfunction se(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;Ze(e,h,l);f=k;}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;Ze(e,h,l);f=k;}}}if(Ub)throw a=Vb,Ub=!1,Vb=null,a;}\nfunction G(a,b){var c=$e(b),d=a+\\\\\"__bubble\\\\\";c.has(d)||(af(b,a,2,!1),c.add(d));}var bf=\\\\\"_reactListening\\\\\"+Math.random().toString(36).slice(2);function cf(a){a[bf]||(a[bf]=!0,ba.forEach(function(b){Ye.has(b)||df(b,!1,a,null);df(b,!0,a,null);}));}\nfunction df(a,b,c,d){var e=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,f=c;\\\\\"selectionchange\\\\\"===a&&9!==c.nodeType&&(f=c.ownerDocument);if(null!==d&&!b&&Ye.has(a)){if(\\\\\"scroll\\\\\"!==a)return;e|=2;f=d;}var g=$e(f),h=a+\\\\\"__\\\\\"+(b?\\\\\"capture\\\\\":\\\\\"bubble\\\\\");g.has(h)||(b&&(e|=4),af(f,a,e,b),g.add(h));}\nfunction af(a,b,c,d){var e=Nc.get(b);switch(void 0===e?2:e){case 0:e=gd;break;case 1:e=id;break;default:e=hd;}c=e.bind(null,b,c,a);e=void 0;!Pb||\\\\\"touchstart\\\\\"!==b&&\\\\\"touchmove\\\\\"!==b&&\\\\\"wheel\\\\\"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1);}\nfunction jd(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return;}for(;null!==h;){g=wc(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode;}}d=d.return;}Nb(function(){var d=f,e=xb(c),g=[];\na:{var h=Mc.get(a);if(void 0!==h){var k=td,x=a;switch(a){case \\\\\"keypress\\\\\":if(0===od(c))break a;case \\\\\"keydown\\\\\":case \\\\\"keyup\\\\\":k=Rd;break;case \\\\\"focusin\\\\\":x=\\\\\"focus\\\\\";k=Fd;break;case \\\\\"focusout\\\\\":x=\\\\\"blur\\\\\";k=Fd;break;case \\\\\"beforeblur\\\\\":case \\\\\"afterblur\\\\\":k=Fd;break;case \\\\\"click\\\\\":if(2===c.button)break a;case \\\\\"auxclick\\\\\":case \\\\\"dblclick\\\\\":case \\\\\"mousedown\\\\\":case \\\\\"mousemove\\\\\":case \\\\\"mouseup\\\\\":case \\\\\"mouseout\\\\\":case \\\\\"mouseover\\\\\":case \\\\\"contextmenu\\\\\":k=Bd;break;case \\\\\"drag\\\\\":case \\\\\"dragend\\\\\":case \\\\\"dragenter\\\\\":case \\\\\"dragexit\\\\\":case \\\\\"dragleave\\\\\":case \\\\\"dragover\\\\\":case \\\\\"dragstart\\\\\":case \\\\\"drop\\\\\":k=\nDd;break;case \\\\\"touchcancel\\\\\":case \\\\\"touchend\\\\\":case \\\\\"touchmove\\\\\":case \\\\\"touchstart\\\\\":k=Vd;break;case Ic:case Jc:case Kc:k=Hd;break;case Lc:k=Xd;break;case \\\\\"scroll\\\\\":k=vd;break;case \\\\\"wheel\\\\\":k=Zd;break;case \\\\\"copy\\\\\":case \\\\\"cut\\\\\":case \\\\\"paste\\\\\":k=Jd;break;case \\\\\"gotpointercapture\\\\\":case \\\\\"lostpointercapture\\\\\":case \\\\\"pointercancel\\\\\":case \\\\\"pointerdown\\\\\":case \\\\\"pointermove\\\\\":case \\\\\"pointerout\\\\\":case \\\\\"pointerover\\\\\":case \\\\\"pointerup\\\\\":k=Td;}var w=0!==(b&4),z=!w&&\\\\\"scroll\\\\\"===a,u=w?null!==h?h+\\\\\"Capture\\\\\":null:h;w=[];for(var t=d,q;null!==\nt;){q=t;var v=q.stateNode;5===q.tag&&null!==v&&(q=v,null!==u&&(v=Ob(t,u),null!=v&&w.push(ef(t,v,q))));if(z)break;t=t.return;}0<w.length&&(h=new k(h,x,null,c,e),g.push({event:h,listeners:w}));}}if(0===(b&7)){a:{h=\\\\\"mouseover\\\\\"===a||\\\\\"pointerover\\\\\"===a;k=\\\\\"mouseout\\\\\"===a||\\\\\"pointerout\\\\\"===a;if(h&&0===(b&16)&&(x=c.relatedTarget||c.fromElement)&&(wc(x)||x[ff]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(x=c.relatedTarget||c.toElement,k=d,x=x?wc(x):null,null!==\nx&&(z=Zb(x),x!==z||5!==x.tag&&6!==x.tag))x=null;}else k=null,x=d;if(k!==x){w=Bd;v=\\\\\"onMouseLeave\\\\\";u=\\\\\"onMouseEnter\\\\\";t=\\\\\"mouse\\\\\";if(\\\\\"pointerout\\\\\"===a||\\\\\"pointerover\\\\\"===a)w=Td,v=\\\\\"onPointerLeave\\\\\",u=\\\\\"onPointerEnter\\\\\",t=\\\\\"pointer\\\\\";z=null==k?h:ue(k);q=null==x?h:ue(x);h=new w(v,t+\\\\\"leave\\\\\",k,c,e);h.target=z;h.relatedTarget=q;v=null;wc(e)===d&&(w=new w(u,t+\\\\\"enter\\\\\",x,c,e),w.target=q,w.relatedTarget=z,v=w);z=v;if(k&&x)b:{w=k;u=x;t=0;for(q=w;q;q=gf(q))t++;q=0;for(v=u;v;v=gf(v))q++;for(;0<t-q;)w=gf(w),t--;for(;0<q-t;)u=\ngf(u),q--;for(;t--;){if(w===u||null!==u&&w===u.alternate)break b;w=gf(w);u=gf(u);}w=null;}else w=null;null!==k&&hf(g,h,k,w,!1);null!==x&&null!==z&&hf(g,z,x,w,!0);}}}a:{h=d?ue(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if(\\\\\"select\\\\\"===k||\\\\\"input\\\\\"===k&&\\\\\"file\\\\\"===h.type)var J=ve;else if(me(h))if(we)J=Fe;else {J=De;var K=Ce;}else (k=h.nodeName)&&\\\\\"input\\\\\"===k.toLowerCase()&&(\\\\\"checkbox\\\\\"===h.type||\\\\\"radio\\\\\"===h.type)&&(J=Ee);if(J&&(J=J(a,d))){ne(g,J,c,e);break a}K&&K(a,h,d);\\\\\"focusout\\\\\"===a&&(K=h._wrapperState)&&\nK.controlled&&\\\\\"number\\\\\"===h.type&&bb(h,\\\\\"number\\\\\",h.value);}K=d?ue(d):window;switch(a){case \\\\\"focusin\\\\\":if(me(K)||\\\\\"true\\\\\"===K.contentEditable)Qe=K,Re=d,Se=null;break;case \\\\\"focusout\\\\\":Se=Re=Qe=null;break;case \\\\\"mousedown\\\\\":Te=!0;break;case \\\\\"contextmenu\\\\\":case \\\\\"mouseup\\\\\":case \\\\\"dragend\\\\\":Te=!1;Ue(g,c,e);break;case \\\\\"selectionchange\\\\\":if(Pe)break;case \\\\\"keydown\\\\\":case \\\\\"keyup\\\\\":Ue(g,c,e);}var Q;if(ae)b:{switch(a){case \\\\\"compositionstart\\\\\":var L=\\\\\"onCompositionStart\\\\\";break b;case \\\\\"compositionend\\\\\":L=\\\\\"onCompositionEnd\\\\\";break b;\ncase \\\\\"compositionupdate\\\\\":L=\\\\\"onCompositionUpdate\\\\\";break b}L=void 0;}else ie?ge(a,c)&&(L=\\\\\"onCompositionEnd\\\\\"):\\\\\"keydown\\\\\"===a&&229===c.keyCode&&(L=\\\\\"onCompositionStart\\\\\");L&&(de&&\\\\\"ko\\\\\"!==c.locale&&(ie||\\\\\"onCompositionStart\\\\\"!==L?\\\\\"onCompositionEnd\\\\\"===L&&ie&&(Q=nd()):(kd=e,ld=\\\\\"value\\\\\"in kd?kd.value:kd.textContent,ie=!0)),K=oe(d,L),0<K.length&&(L=new Ld(L,a,null,c,e),g.push({event:L,listeners:K}),Q?L.data=Q:(Q=he(c),null!==Q&&(L.data=Q))));if(Q=ce?je(a,c):ke(a,c))d=oe(d,\\\\\"onBeforeInput\\\\\"),0<d.length&&(e=new Ld(\\\\\"onBeforeInput\\\\\",\n\\\\\"beforeinput\\\\\",null,c,e),g.push({event:e,listeners:d}),e.data=Q);}se(g,b);});}function ef(a,b,c){return {instance:a,listener:b,currentTarget:c}}function oe(a,b){for(var c=b+\\\\\"Capture\\\\\",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Ob(a,c),null!=f&&d.unshift(ef(a,f,e)),f=Ob(a,b),null!=f&&d.push(ef(a,f,e)));a=a.return;}return d}function gf(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction hf(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,l=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==l&&(h=l,e?(k=Ob(c,f),null!=k&&g.unshift(ef(c,k,h))):e||(k=Ob(c,f),null!=k&&g.push(ef(c,k,h))));c=c.return;}0!==g.length&&a.push({event:b,listeners:g});}function jf(){}var kf=null,lf=null;function mf(a,b){switch(a){case \\\\\"button\\\\\":case \\\\\"input\\\\\":case \\\\\"select\\\\\":case \\\\\"textarea\\\\\":return !!b.autoFocus}return !1}\nfunction nf(a,b){return \\\\\"textarea\\\\\"===a||\\\\\"option\\\\\"===a||\\\\\"noscript\\\\\"===a||\\\\\"string\\\\\"===typeof b.children||\\\\\"number\\\\\"===typeof b.children||\\\\\"object\\\\\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var of=\\\\\"function\\\\\"===typeof setTimeout?setTimeout:void 0,pf=\\\\\"function\\\\\"===typeof clearTimeout?clearTimeout:void 0;function qf(a){1===a.nodeType?a.textContent=\\\\\"\\\\\":9===a.nodeType&&(a=a.body,null!=a&&(a.textContent=\\\\\"\\\\\"));}\nfunction rf(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}function sf(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(\\\\\"$\\\\\"===c||\\\\\"$!\\\\\"===c||\\\\\"$?\\\\\"===c){if(0===b)return a;b--;}else \\\\\"/$\\\\\"===c&&b++;}a=a.previousSibling;}return null}var tf=0;function uf(a){return {$$typeof:Ga,toString:a,valueOf:a}}var vf=Math.random().toString(36).slice(2),wf=\\\\\"__reactFiber$\\\\\"+vf,xf=\\\\\"__reactProps$\\\\\"+vf,ff=\\\\\"__reactContainer$\\\\\"+vf,yf=\\\\\"__reactEvents$\\\\\"+vf;\nfunction wc(a){var b=a[wf];if(b)return b;for(var c=a.parentNode;c;){if(b=c[ff]||c[wf]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=sf(a);null!==a;){if(c=a[wf])return c;a=sf(a);}return b}a=c;c=a.parentNode;}return null}function Cb(a){a=a[wf]||a[ff];return !a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function ue(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(y(33));}function Db(a){return a[xf]||null}\nfunction $e(a){var b=a[yf];void 0===b&&(b=a[yf]=new Set);return b}var zf=[],Af=-1;function Bf(a){return {current:a}}function H(a){0>Af||(a.current=zf[Af],zf[Af]=null,Af--);}function I(a,b){Af++;zf[Af]=a.current;a.current=b;}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf;\nfunction Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M);}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c);}\nfunction If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\\\\\"function\\\\\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||\\\\\"Unknown\\\\\",e));return objectAssign({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return !0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c);}\nvar Lf=null,Mf=null,Nf=scheduler.unstable_runWithPriority,Of=scheduler.unstable_scheduleCallback,Pf=scheduler.unstable_cancelCallback,Qf=scheduler.unstable_shouldYield,Rf=scheduler.unstable_requestPaint,Sf=scheduler.unstable_now,Tf=scheduler.unstable_getCurrentPriorityLevel,Uf=scheduler.unstable_ImmediatePriority,Vf=scheduler.unstable_UserBlockingPriority,Wf=scheduler.unstable_NormalPriority,Xf=scheduler.unstable_LowPriority,Yf=scheduler.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg};\nfunction eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a);}jg();}\nfunction jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});ag=null;}catch(c){throw null!==ag&&(ag=ag.slice(a+1)),Of(Uf,ig),c;}finally{cg=!1;}}}var kg=ra.ReactCurrentBatchConfig;function lg(a,b){if(a&&a.defaultProps){b=objectAssign({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}var mg=Bf(null),ng=null,og=null,pg=null;function qg(){pg=og=ng=null;}\nfunction rg(a){var b=mg.current;H(mg);a.type._context._currentValue=b;}function sg(a,b){for(;null!==a;){var c=a.alternate;if((a.childLanes&b)===b)if(null===c||(c.childLanes&b)===b)break;else c.childLanes|=b;else a.childLanes|=b,null!==c&&(c.childLanes|=b);a=a.return;}}function tg(a,b){ng=a;pg=og=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(ug=!0),a.firstContext=null);}\nfunction vg(a,b){if(pg!==a&&!1!==b&&0!==b){if(\\\\\"number\\\\\"!==typeof b||1073741823===b)pg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===og){if(null===ng)throw Error(y(308));og=b;ng.dependencies={lanes:0,firstContext:b,responders:null};}else og=og.next=b;}return a._currentValue}var wg=!1;function xg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null};}\nfunction yg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects});}function zg(a,b){return {eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}function Ag(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b;}}\nfunction Bg(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next;}while(null!==c);null===f?e=f=b:f=f.next=b;}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b;}\nfunction Cg(a,b,c,d){var e=a.updateQueue;wg=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var n=a.alternate;if(null!==n){n=n.updateQueue;var A=n.lastBaseUpdate;A!==g&&(null===A?n.firstBaseUpdate=l:A.next=l,n.lastBaseUpdate=k);}}if(null!==f){A=e.baseState;g=0;n=l=k=null;do{h=f.lane;var p=f.eventTime;if((d&h)===h){null!==n&&(n=n.next={eventTime:p,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,\nnext:null});a:{var C=a,x=f;h=b;p=c;switch(x.tag){case 1:C=x.payload;if(\\\\\"function\\\\\"===typeof C){A=C.call(p,A,h);break a}A=C;break a;case 3:C.flags=C.flags&-4097|64;case 0:C=x.payload;h=\\\\\"function\\\\\"===typeof C?C.call(p,A,h):C;if(null===h||void 0===h)break a;A=objectAssign({},A,h);break a;case 2:wg=!0;}}null!==f.callback&&(a.flags|=32,h=e.effects,null===h?e.effects=[f]:h.push(f));}else p={eventTime:p,lane:h,tag:f.tag,payload:f.payload,callback:f.callback,next:null},null===n?(l=n=p,k=A):n=n.next=p,g|=h;f=f.next;if(null===\nf)if(h=e.shared.pending,null===h)break;else f=h.next,h.next=null,e.lastBaseUpdate=h,e.shared.pending=null;}while(1);null===n&&(k=A);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=n;Dg|=g;a.lanes=g;a.memoizedState=A;}}function Eg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if(\\\\\"function\\\\\"!==typeof e)throw Error(y(191,e));e.call(d);}}}var Fg=(new react.Component).refs;\nfunction Gg(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:objectAssign({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c);}\nvar Kg={isMounted:function(a){return (a=a._reactInternals)?Zb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=Hg(),e=Ig(a),f=zg(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ag(a,f);Jg(a,e,d);},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=Hg(),e=Ig(a),f=zg(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ag(a,f);Jg(a,e,d);},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=Hg(),d=Ig(a),e=zg(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=\nb);Ag(a,e);Jg(a,d,c);}};function Lg(a,b,c,d,e,f,g){a=a.stateNode;return \\\\\"function\\\\\"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Je(c,d)||!Je(e,f):!0}\nfunction Mg(a,b,c){var d=!1,e=Cf;var f=b.contextType;\\\\\"object\\\\\"===typeof f&&null!==f?f=vg(f):(e=Ff(b)?Df:M.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Ef(a,e):Cf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Kg;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}\nfunction Ng(a,b,c,d){a=b.state;\\\\\"function\\\\\"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);\\\\\"function\\\\\"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Kg.enqueueReplaceState(b,b.state,null);}\nfunction Og(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Fg;xg(a);var f=b.contextType;\\\\\"object\\\\\"===typeof f&&null!==f?e.context=vg(f):(f=Ff(b)?Df:M.current,e.context=Ef(a,f));Cg(a,c,e,d);e.state=a.memoizedState;f=b.getDerivedStateFromProps;\\\\\"function\\\\\"===typeof f&&(Gg(a,b,f,c),e.state=a.memoizedState);\\\\\"function\\\\\"===typeof b.getDerivedStateFromProps||\\\\\"function\\\\\"===typeof e.getSnapshotBeforeUpdate||\\\\\"function\\\\\"!==typeof e.UNSAFE_componentWillMount&&\\\\\"function\\\\\"!==typeof e.componentWillMount||\n(b=e.state,\\\\\"function\\\\\"===typeof e.componentWillMount&&e.componentWillMount(),\\\\\"function\\\\\"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Kg.enqueueReplaceState(e,e.state,null),Cg(a,c,e,d),e.state=a.memoizedState);\\\\\"function\\\\\"===typeof e.componentDidMount&&(a.flags|=4);}var Pg=Array.isArray;\nfunction Qg(a,b,c){a=c.ref;if(null!==a&&\\\\\"function\\\\\"!==typeof a&&\\\\\"object\\\\\"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(y(309));var d=c.stateNode;}if(!d)throw Error(y(147,a));var e=\\\\\"\\\\\"+a;if(null!==b&&null!==b.ref&&\\\\\"function\\\\\"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Fg&&(b=d.refs={});null===a?delete b[e]:b[e]=a;};b._stringRef=e;return b}if(\\\\\"string\\\\\"!==typeof a)throw Error(y(284));if(!c._owner)throw Error(y(290,a));}return a}\nfunction Rg(a,b){if(\\\\\"textarea\\\\\"!==a.type)throw Error(y(31,\\\\\"[object Object]\\\\\"===Object.prototype.toString.call(b)?\\\\\"object with keys {\\\\\"+Object.keys(b).join(\\\\\", \\\\\")+\\\\\"}\\\\\":b));}\nfunction Sg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.flags=8;}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Tg(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags=2,\nc):d;b.flags=2;return c}function g(b){a&&null===b.alternate&&(b.flags=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Ug(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props),d.ref=Qg(a,b,c),d.return=a,d;d=Vg(c.type,c.key,c.props,null,a.mode,d);d.ref=Qg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=\nWg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function n(a,b,c,d,f){if(null===b||7!==b.tag)return b=Xg(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function A(a,b,c){if(\\\\\"string\\\\\"===typeof b||\\\\\"number\\\\\"===typeof b)return b=Ug(\\\\\"\\\\\"+b,a.mode,c),b.return=a,b;if(\\\\\"object\\\\\"===typeof b&&null!==b){switch(b.$$typeof){case sa:return c=Vg(b.type,b.key,b.props,null,a.mode,c),c.ref=Qg(a,null,b),c.return=a,c;case ta:return b=Wg(b,a.mode,c),b.return=a,b}if(Pg(b)||La(b))return b=Xg(b,\na.mode,c,null),b.return=a,b;Rg(a,b);}return null}function p(a,b,c,d){var e=null!==b?b.key:null;if(\\\\\"string\\\\\"===typeof c||\\\\\"number\\\\\"===typeof c)return null!==e?null:h(a,b,\\\\\"\\\\\"+c,d);if(\\\\\"object\\\\\"===typeof c&&null!==c){switch(c.$$typeof){case sa:return c.key===e?c.type===ua?n(a,b,c.props.children,d,e):k(a,b,c,d):null;case ta:return c.key===e?l(a,b,c,d):null}if(Pg(c)||La(c))return null!==e?null:n(a,b,c,d,null);Rg(a,c);}return null}function C(a,b,c,d,e){if(\\\\\"string\\\\\"===typeof d||\\\\\"number\\\\\"===typeof d)return a=a.get(c)||\nnull,h(b,a,\\\\\"\\\\\"+d,e);if(\\\\\"object\\\\\"===typeof d&&null!==d){switch(d.$$typeof){case sa:return a=a.get(null===d.key?c:d.key)||null,d.type===ua?n(b,a,d.props.children,e,d.key):k(b,a,d,e);case ta:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(Pg(d)||La(d))return a=a.get(c)||null,n(b,a,d,e,null);Rg(b,d);}return null}function x(e,g,h,k){for(var l=null,t=null,u=g,z=g=0,q=null;null!==u&&z<h.length;z++){u.index>z?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null===\nn.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q;}if(z===h.length)return c(e,u),l;if(null===u){for(;z<h.length;z++)u=A(e,h[z],k),null!==u&&(g=f(u,g,z),null===t?l=u:t.sibling=u,t=u);return l}for(u=d(e,u);z<h.length;z++)q=C(u,e,z,h[z],k),null!==q&&(a&&null!==q.alternate&&u.delete(null===q.key?z:q.key),g=f(q,g,z),null===t?l=q:t.sibling=q,t=q);a&&u.forEach(function(a){return b(e,a)});return l}function w(e,g,h,k){var l=La(h);if(\\\\\"function\\\\\"!==typeof l)throw Error(y(150));h=l.call(h);if(null==\nh)throw Error(y(151));for(var t=l=null,u=g,z=g=0,q=null,n=h.next();null!==u&&!n.done;z++,n=h.next()){u.index>z?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q;}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&&\nu.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\\\\\"object\\\\\"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l=\\\\\"object\\\\\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling);\nd=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling;}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h);}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else {c(a,d);break}else b(a,d);d=d.sibling;}d=\nWg(f,a.mode,h);d.return=a;a=d;}return g(a)}if(\\\\\"string\\\\\"===typeof f||\\\\\"number\\\\\"===typeof f)return f=\\\\\"\\\\\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if(\\\\\"undefined\\\\\"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||\\\\\"Component\\\\\"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g);\nfunction dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,\\\\\"\\\\\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a);}H(ah);I(ah,b);}function fh(){H(ah);H(bh);H(ch);}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c));}function hh(a){bh.current===a&&(H(ah),H(bh));}var P=Bf(0);\nfunction ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\\\\\"$?\\\\\"===c.data||\\\\\"$!\\\\\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}return null}var jh=null,kh=null,lh=!1;\nfunction mh(a,b){var c=nh(5,null,null,0);c.elementType=\\\\\"DELETED\\\\\";c.type=\\\\\"DELETED\\\\\";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c;}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\\\\\"\\\\\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return !1;default:return !1}}\nfunction ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c);}jh=a;kh=rf(b.firstChild);}else a.flags=a.flags&-1025|2,lh=!1,jh=a;}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a;}\nfunction rh(a){if(a!==jh)return !1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||\\\\\"head\\\\\"!==b&&\\\\\"body\\\\\"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(\\\\\"/$\\\\\"===c){if(0===b){kh=rf(a.nextSibling);break a}b--;}else \\\\\"$\\\\\"!==c&&\\\\\"$!\\\\\"!==c&&\\\\\"$?\\\\\"!==c||b++;}a=a.nextSibling;}kh=null;}}else kh=jh?rf(a.stateNode.nextSibling):null;return !0}\nfunction sh(){kh=jh=null;lh=!1;}var th=[];function uh(){for(var a=0;a<th.length;a++)th[a]._workInProgressVersionPrimary=null;th.length=0;}var vh=ra.ReactCurrentDispatcher,wh=ra.ReactCurrentBatchConfig,xh=0,R=null,S=null,T=null,yh=!1,zh=!1;function Ah(){throw Error(y(321));}function Bh(a,b){if(null===b)return !1;for(var c=0;c<b.length&&c<a.length;c++)if(!He(a[c],b[c]))return !1;return !0}\nfunction Ch(a,b,c,d,e,f){xh=f;R=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;vh.current=null===a||null===a.memoizedState?Dh:Eh;a=c(d,e);if(zh){f=0;do{zh=!1;if(!(25>f))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e);}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T}\nfunction Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null;}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else {if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a;}return T}function Jh(a,b){return \\\\\"function\\\\\"===typeof b?b(a):b}\nfunction Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g;}d.baseQueue=e=f;c.pending=null;}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else {var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,\neagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l;}k=k.next;}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d;}return [b.memoizedState,c.dispatch]}\nfunction Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f;}return [f,d]}\nfunction Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));}\nfunction Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=\ne.entanglements,h=a;0<h;){var k=31-Vc(h),v=1<<k;d[k]|=a;h&=~v;}}},[c,b,d]);h.useEffect(function(){return d(b._source,function(){var a=p.getSnapshot,c=p.setSnapshot;try{c(a(b._source));var d=Ig(w);e.mutableReadLanes|=d&e.pendingLanes;}catch(q){c(function(){throw q;});}})},[b,d]);He(C,c)&&He(x,b)&&He(A,d)||(a={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:n},a.dispatch=l=Oh.bind(null,R,a),k.queue=a,k.baseQueue=null,n=Mh(e,b,c),k.memoizedState=k.baseState=n);return n}\nfunction Ph(a,b,c){var d=Ih();return Nh(d,a,b,c)}function Qh(a){var b=Hh();\\\\\"function\\\\\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:a};a=a.dispatch=Oh.bind(null,R,a);return [b.memoizedState,a]}\nfunction Rh(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=R.updateQueue;null===b?(b={lastEffect:null},R.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function Sh(a){var b=Hh();a={current:a};return b.memoizedState=a}function Th(){return Ih().memoizedState}function Uh(a,b,c,d){var e=Hh();R.flags|=a;e.memoizedState=Rh(1|b,c,void 0,void 0===d?null:d);}\nfunction Vh(a,b,c,d){var e=Ih();d=void 0===d?null:d;var f=void 0;if(null!==S){var g=S.memoizedState;f=g.destroy;if(null!==d&&Bh(d,g.deps)){Rh(b,c,f,d);return}}R.flags|=a;e.memoizedState=Rh(1|b,c,f,d);}function Wh(a,b){return Uh(516,4,a,b)}function Xh(a,b){return Vh(516,4,a,b)}function Yh(a,b){return Vh(4,2,a,b)}function Zh(a,b){if(\\\\\"function\\\\\"===typeof b)return a=a(),b(a),function(){b(null);};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null;}}\nfunction $h(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Vh(4,2,Zh.bind(null,b,a),c)}function ai(){}function bi(a,b){var c=Ih();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Bh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}function ci(a,b){var c=Ih();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Bh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}\nfunction di(a,b){var c=eg();gg(98>c?98:c,function(){a(!0);});gg(97<c?97:c,function(){var c=wh.transition;wh.transition=1;try{a(!1),b();}finally{wh.transition=c;}});}\nfunction Oh(a,b,c){var d=Hg(),e=Ig(a),f={lane:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.pending;null===g?f.next=f:(f.next=g.next,g.next=f);b.pending=f;g=a.alternate;if(a===R||null!==g&&g===R)zh=yh=!0;else {if(0===a.lanes&&(null===g||0===g.lanes)&&(g=b.lastRenderedReducer,null!==g))try{var h=b.lastRenderedState,k=g(h,c);f.eagerReducer=g;f.eagerState=k;if(He(k,h))return}catch(l){}finally{}Jg(a,e,d);}}\nvar Gh={readContext:vg,useCallback:Ah,useContext:Ah,useEffect:Ah,useImperativeHandle:Ah,useLayoutEffect:Ah,useMemo:Ah,useReducer:Ah,useRef:Ah,useState:Ah,useDebugValue:Ah,useDeferredValue:Ah,useTransition:Ah,useMutableSource:Ah,useOpaqueIdentifier:Ah,unstable_isNewReconciler:!1},Dh={readContext:vg,useCallback:function(a,b){Hh().memoizedState=[a,void 0===b?null:b];return a},useContext:vg,useEffect:Wh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Uh(4,2,Zh.bind(null,\nb,a),c)},useLayoutEffect:function(a,b){return Uh(4,2,a,b)},useMemo:function(a,b){var c=Hh();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Hh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={pending:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Oh.bind(null,R,a);return [d.memoizedState,a]},useRef:Sh,useState:Qh,useDebugValue:ai,useDeferredValue:function(a){var b=Qh(a),c=b[0],d=b[1];Wh(function(){var b=wh.transition;\nwh.transition=1;try{d(a);}finally{wh.transition=b;}},[a]);return c},useTransition:function(){var a=Qh(!1),b=a[0];a=di.bind(null,a[1]);Sh(a);return [a,b]},useMutableSource:function(a,b,c){var d=Hh();d.memoizedState={refs:{getSnapshot:b,setSnapshot:null},source:a,subscribe:c};return Nh(d,a,b,c)},useOpaqueIdentifier:function(){if(lh){var a=!1,b=uf(function(){a||(a=!0,c(\\\\\"r:\\\\\"+(tf++).toString(36)));throw Error(y(355));}),c=Qh(b)[1];0===(R.mode&2)&&(R.flags|=516,Rh(5,function(){c(\\\\\"r:\\\\\"+(tf++).toString(36));},\nvoid 0,null));return b}b=\\\\\"r:\\\\\"+(tf++).toString(36);Qh(b);return b},unstable_isNewReconciler:!1},Eh={readContext:vg,useCallback:bi,useContext:vg,useEffect:Xh,useImperativeHandle:$h,useLayoutEffect:Yh,useMemo:ci,useReducer:Kh,useRef:Th,useState:function(){return Kh(Jh)},useDebugValue:ai,useDeferredValue:function(a){var b=Kh(Jh),c=b[0],d=b[1];Xh(function(){var b=wh.transition;wh.transition=1;try{d(a);}finally{wh.transition=b;}},[a]);return c},useTransition:function(){var a=Kh(Jh)[0];return [Th().current,\na]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Kh(Jh)[0]},unstable_isNewReconciler:!1},Fh={readContext:vg,useCallback:bi,useContext:vg,useEffect:Xh,useImperativeHandle:$h,useLayoutEffect:Yh,useMemo:ci,useReducer:Lh,useRef:Th,useState:function(){return Lh(Jh)},useDebugValue:ai,useDeferredValue:function(a){var b=Lh(Jh),c=b[0],d=b[1];Xh(function(){var b=wh.transition;wh.transition=1;try{d(a);}finally{wh.transition=b;}},[a]);return c},useTransition:function(){var a=Lh(Jh)[0];return [Th().current,\na]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Lh(Jh)[0]},unstable_isNewReconciler:!1},ei=ra.ReactCurrentOwner,ug=!1;function fi(a,b,c,d){b.child=null===a?Zg(b,null,c,d):Yg(b,a.child,c,d);}function gi(a,b,c,d,e){c=c.render;var f=b.ref;tg(b,e);d=Ch(a,b,c,d,f,e);if(null!==a&&!ug)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,hi(a,b,e);b.flags|=1;fi(a,b,d,e);return b.child}\nfunction ii(a,b,c,d,e,f){if(null===a){var g=c.type;if(\\\\\"function\\\\\"===typeof g&&!ji(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,ki(a,b,g,d,e,f);a=Vg(c.type,null,d,b,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(0===(e&f)&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:Je,c(e,d)&&a.ref===b.ref))return hi(a,b,f);b.flags|=1;a=Tg(g,d);a.ref=b.ref;a.return=b;return b.child=a}\nfunction ki(a,b,c,d,e,f){if(null!==a&&Je(a.memoizedProps,d)&&a.ref===b.ref)if(ug=!1,0!==(f&e))0!==(a.flags&16384)&&(ug=!0);else return b.lanes=a.lanes,hi(a,b,f);return li(a,b,c,d,f)}\nfunction mi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if(\\\\\"hidden\\\\\"===d.mode||\\\\\"unstable-defer-without-hiding\\\\\"===d.mode)if(0===(b.mode&4))b.memoizedState={baseLanes:0},ni(b,c);else if(0!==(c&1073741824))b.memoizedState={baseLanes:0},ni(b,null!==f?f.baseLanes:c);else return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a},ni(b,a),null;else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,ni(b,d);fi(a,b,e,c);return b.child}\nfunction oi(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=128;}function li(a,b,c,d,e){var f=Ff(c)?Df:M.current;f=Ef(b,f);tg(b,e);c=Ch(a,b,c,d,f,e);if(null!==a&&!ug)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,hi(a,b,e);b.flags|=1;fi(a,b,c,e);return b.child}\nfunction pi(a,b,c,d,e){if(Ff(c)){var f=!0;Jf(b);}else f=!1;tg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),Mg(b,c,d),Og(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;\\\\\"object\\\\\"===typeof l&&null!==l?l=vg(l):(l=Ff(c)?Df:M.current,l=Ef(b,l));var n=c.getDerivedStateFromProps,A=\\\\\"function\\\\\"===typeof n||\\\\\"function\\\\\"===typeof g.getSnapshotBeforeUpdate;A||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillReceiveProps&&\n\\\\\"function\\\\\"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Ng(b,g,d,l);wg=!1;var p=b.memoizedState;g.state=p;Cg(b,d,g,e);k=b.memoizedState;h!==d||p!==k||N.current||wg?(\\\\\"function\\\\\"===typeof n&&(Gg(b,c,n,d),k=b.memoizedState),(h=wg||Lg(b,c,h,d,p,k,l))?(A||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillMount&&\\\\\"function\\\\\"!==typeof g.componentWillMount||(\\\\\"function\\\\\"===typeof g.componentWillMount&&g.componentWillMount(),\\\\\"function\\\\\"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),\\\\\"function\\\\\"===\ntypeof g.componentDidMount&&(b.flags|=4)):(\\\\\"function\\\\\"===typeof g.componentDidMount&&(b.flags|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):(\\\\\"function\\\\\"===typeof g.componentDidMount&&(b.flags|=4),d=!1);}else {g=b.stateNode;yg(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:lg(b.type,h);g.props=l;A=b.pendingProps;p=g.context;k=c.contextType;\\\\\"object\\\\\"===typeof k&&null!==k?k=vg(k):(k=Ff(c)?Df:M.current,k=Ef(b,k));var C=c.getDerivedStateFromProps;(n=\\\\\"function\\\\\"===typeof C||\n\\\\\"function\\\\\"===typeof g.getSnapshotBeforeUpdate)||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillReceiveProps&&\\\\\"function\\\\\"!==typeof g.componentWillReceiveProps||(h!==A||p!==k)&&Ng(b,g,d,k);wg=!1;p=b.memoizedState;g.state=p;Cg(b,d,g,e);var x=b.memoizedState;h!==A||p!==x||N.current||wg?(\\\\\"function\\\\\"===typeof C&&(Gg(b,c,C,d),x=b.memoizedState),(l=wg||Lg(b,c,l,d,p,x,k))?(n||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillUpdate&&\\\\\"function\\\\\"!==typeof g.componentWillUpdate||(\\\\\"function\\\\\"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,\nx,k),\\\\\"function\\\\\"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),\\\\\"function\\\\\"===typeof g.componentDidUpdate&&(b.flags|=4),\\\\\"function\\\\\"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=256)):(\\\\\"function\\\\\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=4),\\\\\"function\\\\\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=256),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=l):(\\\\\"function\\\\\"!==typeof g.componentDidUpdate||\nh===a.memoizedProps&&p===a.memoizedState||(b.flags|=4),\\\\\"function\\\\\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=256),d=!1);}return qi(a,b,c,d,f,e)}\nfunction qi(a,b,c,d,e,f){oi(a,b);var g=0!==(b.flags&64);if(!d&&!g)return e&&Kf(b,c,!1),hi(a,b,f);d=b.stateNode;ei.current=b;var h=g&&\\\\\"function\\\\\"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Yg(b,a.child,null,f),b.child=Yg(b,null,h,f)):fi(a,b,h,f);b.memoizedState=d.state;e&&Kf(b,c,!0);return b.child}function ri(a){var b=a.stateNode;b.pendingContext?Hf(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Hf(a,b.context,!1);eh(a,b.containerInfo);}\nvar si={dehydrated:null,retryLane:0};\nfunction ti(a,b,c){var d=b.pendingProps,e=P.current,f=!1,g;(g=0!==(b.flags&64))||(g=null!==a&&null===a.memoizedState?!1:0!==(e&2));g?(f=!0,b.flags&=-65):null!==a&&null===a.memoizedState||void 0===d.fallback||!0===d.unstable_avoidThisFallback||(e|=1);I(P,e&1);if(null===a){void 0!==d.fallback&&ph(b);a=d.children;e=d.fallback;if(f)return a=ui(b,a,e,c),b.child.memoizedState={baseLanes:c},b.memoizedState=si,a;if(\\\\\"number\\\\\"===typeof d.unstable_expectedLoadTime)return a=ui(b,a,e,c),b.child.memoizedState={baseLanes:c},\nb.memoizedState=si,b.lanes=33554432,a;c=vi({mode:\\\\\"visible\\\\\",children:a},b.mode,c,null);c.return=b;return b.child=c}if(null!==a.memoizedState){if(f)return d=wi(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=si,d;c=xi(a,b,d.children,c);b.memoizedState=null;return c}if(f)return d=wi(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:\n{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=si,d;c=xi(a,b,d.children,c);b.memoizedState=null;return c}function ui(a,b,c,d){var e=a.mode,f=a.child;b={mode:\\\\\"hidden\\\\\",children:b};0===(e&2)&&null!==f?(f.childLanes=0,f.pendingProps=b):f=vi(b,e,0,null);c=Xg(c,e,d,null);f.return=a;c.return=a;f.sibling=c;a.child=f;return c}\nfunction xi(a,b,c,d){var e=a.child;a=e.sibling;c=Tg(e,{mode:\\\\\"visible\\\\\",children:c});0===(b.mode&2)&&(c.lanes=d);c.return=b;c.sibling=null;null!==a&&(a.nextEffect=null,a.flags=8,b.firstEffect=b.lastEffect=a);return b.child=c}\nfunction wi(a,b,c,d,e){var f=b.mode,g=a.child;a=g.sibling;var h={mode:\\\\\"hidden\\\\\",children:c};0===(f&2)&&b.child!==g?(c=b.child,c.childLanes=0,c.pendingProps=h,g=c.lastEffect,null!==g?(b.firstEffect=c.firstEffect,b.lastEffect=g,g.nextEffect=null):b.firstEffect=b.lastEffect=null):c=Tg(g,h);null!==a?d=Tg(a,d):(d=Xg(d,f,e,null),d.flags|=2);d.return=b;c.return=b;c.sibling=d;b.child=c;return d}function yi(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);sg(a.return,b);}\nfunction zi(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=c,g.tailMode=e,g.lastEffect=f);}\nfunction Ai(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;fi(a,b,d.children,c);d=P.current;if(0!==(d&2))d=d&1|2,b.flags|=64;else {if(null!==a&&0!==(a.flags&64))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&yi(a,c);else if(19===a.tag)yi(a,c);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return;}a.sibling.return=a.return;a=a.sibling;}d&=1;}I(P,d);if(0===(b.mode&2))b.memoizedState=\nnull;else switch(e){case \\\\\"forwards\\\\\":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===ih(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);zi(b,!1,e,c,f,b.lastEffect);break;case \\\\\"backwards\\\\\":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===ih(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a;}zi(b,!0,c,null,f,b.lastEffect);break;case \\\\\"together\\\\\":zi(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null;}return b.child}\nfunction hi(a,b,c){null!==a&&(b.dependencies=a.dependencies);Dg|=b.lanes;if(0!==(c&b.childLanes)){if(null!==a&&b.child!==a.child)throw Error(y(153));if(null!==b.child){a=b.child;c=Tg(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Tg(a,a.pendingProps),c.return=b;c.sibling=null;}return b.child}return null}var Bi,Ci,Di,Ei;\nBi=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;}c.sibling.return=c.return;c=c.sibling;}};Ci=function(){};\nDi=function(a,b,c,d){var e=a.memoizedProps;if(e!==d){a=b.stateNode;dh(ah.current);var f=null;switch(c){case \\\\\"input\\\\\":e=Ya(a,e);d=Ya(a,d);f=[];break;case \\\\\"option\\\\\":e=eb(a,e);d=eb(a,d);f=[];break;case \\\\\"select\\\\\":e=objectAssign({},e,{value:void 0});d=objectAssign({},d,{value:void 0});f=[];break;case \\\\\"textarea\\\\\":e=gb(a,e);d=gb(a,d);f=[];break;default:\\\\\"function\\\\\"!==typeof e.onClick&&\\\\\"function\\\\\"===typeof d.onClick&&(a.onclick=jf);}vb(c,d);var g;c=null;for(l in e)if(!d.hasOwnProperty(l)&&e.hasOwnProperty(l)&&null!=e[l])if(\\\\\"style\\\\\"===\nl){var h=e[l];for(g in h)h.hasOwnProperty(g)&&(c||(c={}),c[g]=\\\\\"\\\\\");}else \\\\\"dangerouslySetInnerHTML\\\\\"!==l&&\\\\\"children\\\\\"!==l&&\\\\\"suppressContentEditableWarning\\\\\"!==l&&\\\\\"suppressHydrationWarning\\\\\"!==l&&\\\\\"autoFocus\\\\\"!==l&&(ca.hasOwnProperty(l)?f||(f=[]):(f=f||[]).push(l,null));for(l in d){var k=d[l];h=null!=e?e[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if(\\\\\"style\\\\\"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]=\\\\\"\\\\\");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||\n(c={}),c[g]=k[g]);}else c||(f||(f=[]),f.push(l,c)),c=k;else \\\\\"dangerouslySetInnerHTML\\\\\"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(f=f||[]).push(l,k)):\\\\\"children\\\\\"===l?\\\\\"string\\\\\"!==typeof k&&\\\\\"number\\\\\"!==typeof k||(f=f||[]).push(l,\\\\\"\\\\\"+k):\\\\\"suppressContentEditableWarning\\\\\"!==l&&\\\\\"suppressHydrationWarning\\\\\"!==l&&(ca.hasOwnProperty(l)?(null!=k&&\\\\\"onScroll\\\\\"===l&&G(\\\\\"scroll\\\\\",a),f||h===k||(f=[])):\\\\\"object\\\\\"===typeof k&&null!==k&&k.$$typeof===Ga?k.toString():(f=f||[]).push(l,k));}c&&(f=f||[]).push(\\\\\"style\\\\\",\nc);var l=f;if(b.updateQueue=l)b.flags|=4;}};Ei=function(a,b,c,d){c!==d&&(b.flags|=4);};function Fi(a,b){if(!lh)switch(a.tailMode){case \\\\\"hidden\\\\\":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case \\\\\"collapsed\\\\\":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null;}}\nfunction Gi(a,b,c){var d=b.pendingProps;switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Ff(b.type)&&Gf(),null;case 3:fh();H(N);H(M);uh();d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)rh(b)?b.flags|=4:d.hydrate||(b.flags|=256);Ci(b);return null;case 5:hh(b);var e=dh(ch.current);c=b.type;if(null!==a&&null!=b.stateNode)Di(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=128);else {if(!d){if(null===\nb.stateNode)throw Error(y(166));return null}a=dh(ah.current);if(rh(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[wf]=b;d[xf]=f;switch(c){case \\\\\"dialog\\\\\":G(\\\\\"cancel\\\\\",d);G(\\\\\"close\\\\\",d);break;case \\\\\"iframe\\\\\":case \\\\\"object\\\\\":case \\\\\"embed\\\\\":G(\\\\\"load\\\\\",d);break;case \\\\\"video\\\\\":case \\\\\"audio\\\\\":for(a=0;a<Xe.length;a++)G(Xe[a],d);break;case \\\\\"source\\\\\":G(\\\\\"error\\\\\",d);break;case \\\\\"img\\\\\":case \\\\\"image\\\\\":case \\\\\"link\\\\\":G(\\\\\"error\\\\\",d);G(\\\\\"load\\\\\",d);break;case \\\\\"details\\\\\":G(\\\\\"toggle\\\\\",d);break;case \\\\\"input\\\\\":Za(d,f);G(\\\\\"invalid\\\\\",d);break;case \\\\\"select\\\\\":d._wrapperState=\n{wasMultiple:!!f.multiple};G(\\\\\"invalid\\\\\",d);break;case \\\\\"textarea\\\\\":hb(d,f),G(\\\\\"invalid\\\\\",d);}vb(c,f);a=null;for(var g in f)f.hasOwnProperty(g)&&(e=f[g],\\\\\"children\\\\\"===g?\\\\\"string\\\\\"===typeof e?d.textContent!==e&&(a=[\\\\\"children\\\\\",e]):\\\\\"number\\\\\"===typeof e&&d.textContent!==\\\\\"\\\\\"+e&&(a=[\\\\\"children\\\\\",\\\\\"\\\\\"+e]):ca.hasOwnProperty(g)&&null!=e&&\\\\\"onScroll\\\\\"===g&&G(\\\\\"scroll\\\\\",d));switch(c){case \\\\\"input\\\\\":Va(d);cb(d,f,!0);break;case \\\\\"textarea\\\\\":Va(d);jb(d);break;case \\\\\"select\\\\\":case \\\\\"option\\\\\":break;default:\\\\\"function\\\\\"===typeof f.onClick&&(d.onclick=\njf);}d=a;b.updateQueue=d;null!==d&&(b.flags|=4);}else {g=9===e.nodeType?e:e.ownerDocument;a===kb.html&&(a=lb(c));a===kb.html?\\\\\"script\\\\\"===c?(a=g.createElement(\\\\\"div\\\\\"),a.innerHTML=\\\\\"<script>\\\\\\\\x3c/script>\\\\\",a=a.removeChild(a.firstChild)):\\\\\"string\\\\\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\\\\\"select\\\\\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case \\\\\"dialog\\\\\":G(\\\\\"cancel\\\\\",a);G(\\\\\"close\\\\\",a);\ne=d;break;case \\\\\"iframe\\\\\":case \\\\\"object\\\\\":case \\\\\"embed\\\\\":G(\\\\\"load\\\\\",a);e=d;break;case \\\\\"video\\\\\":case \\\\\"audio\\\\\":for(e=0;e<Xe.length;e++)G(Xe[e],a);e=d;break;case \\\\\"source\\\\\":G(\\\\\"error\\\\\",a);e=d;break;case \\\\\"img\\\\\":case \\\\\"image\\\\\":case \\\\\"link\\\\\":G(\\\\\"error\\\\\",a);G(\\\\\"load\\\\\",a);e=d;break;case \\\\\"details\\\\\":G(\\\\\"toggle\\\\\",a);e=d;break;case \\\\\"input\\\\\":Za(a,d);e=Ya(a,d);G(\\\\\"invalid\\\\\",a);break;case \\\\\"option\\\\\":e=eb(a,d);break;case \\\\\"select\\\\\":a._wrapperState={wasMultiple:!!d.multiple};e=objectAssign({},d,{value:void 0});G(\\\\\"invalid\\\\\",a);break;case \\\\\"textarea\\\\\":hb(a,d);e=\ngb(a,d);G(\\\\\"invalid\\\\\",a);break;default:e=d;}vb(c,e);var h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];\\\\\"style\\\\\"===f?tb(a,k):\\\\\"dangerouslySetInnerHTML\\\\\"===f?(k=k?k.__html:void 0,null!=k&&ob(a,k)):\\\\\"children\\\\\"===f?\\\\\"string\\\\\"===typeof k?(\\\\\"textarea\\\\\"!==c||\\\\\"\\\\\"!==k)&&pb(a,k):\\\\\"number\\\\\"===typeof k&&pb(a,\\\\\"\\\\\"+k):\\\\\"suppressContentEditableWarning\\\\\"!==f&&\\\\\"suppressHydrationWarning\\\\\"!==f&&\\\\\"autoFocus\\\\\"!==f&&(ca.hasOwnProperty(f)?null!=k&&\\\\\"onScroll\\\\\"===f&&G(\\\\\"scroll\\\\\",a):null!=k&&qa(a,f,k,g));}switch(c){case \\\\\"input\\\\\":Va(a);cb(a,d,!1);\nbreak;case \\\\\"textarea\\\\\":Va(a);jb(a);break;case \\\\\"option\\\\\":null!=d.value&&a.setAttribute(\\\\\"value\\\\\",\\\\\"\\\\\"+Sa(d.value));break;case \\\\\"select\\\\\":a.multiple=!!d.multiple;f=d.value;null!=f?fb(a,!!d.multiple,f,!1):null!=d.defaultValue&&fb(a,!!d.multiple,d.defaultValue,!0);break;default:\\\\\"function\\\\\"===typeof e.onClick&&(a.onclick=jf);}mf(c,d)&&(b.flags|=4);}null!==b.ref&&(b.flags|=128);}return null;case 6:if(a&&null!=b.stateNode)Ei(a,b,a.memoizedProps,d);else {if(\\\\\"string\\\\\"!==typeof d&&null===b.stateNode)throw Error(y(166));\nc=dh(ch.current);dh(ah.current);rh(b)?(d=b.stateNode,c=b.memoizedProps,d[wf]=b,d.nodeValue!==c&&(b.flags|=4)):(d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[wf]=b,b.stateNode=d);}return null;case 13:H(P);d=b.memoizedState;if(0!==(b.flags&64))return b.lanes=c,b;d=null!==d;c=!1;null===a?void 0!==b.memoizedProps.fallback&&rh(b):c=null!==a.memoizedState;if(d&&!c&&0!==(b.mode&2))if(null===a&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(P.current&1))0===V&&(V=3);else {if(0===V||3===V)V=\n4;null===U||0===(Dg&134217727)&&0===(Hi&134217727)||Ii(U,W);}if(d||c)b.flags|=4;return null;case 4:return fh(),Ci(b),null===a&&cf(b.stateNode.containerInfo),null;case 10:return rg(b),null;case 17:return Ff(b.type)&&Gf(),null;case 19:H(P);d=b.memoizedState;if(null===d)return null;f=0!==(b.flags&64);g=d.rendering;if(null===g)if(f)Fi(d,!1);else {if(0!==V||null!==a&&0!==(a.flags&64))for(a=b.child;null!==a;){g=ih(a);if(null!==g){b.flags|=64;Fi(d,!1);f=g.updateQueue;null!==f&&(b.updateQueue=f,b.flags|=4);\nnull===d.lastEffect&&(b.firstEffect=null);b.lastEffect=d.lastEffect;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=2,f.nextEffect=null,f.firstEffect=null,f.lastEffect=null,g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,\nf.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;I(P,P.current&1|2);return b.child}a=a.sibling;}null!==d.tail&&O()>Ji&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432);}else {if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&\\\\\"hidden\\\\\"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|=\n64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g);}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&\\\\\"unstable-defer-without-hiding\\\\\"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));}\nfunction Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}}\nfunction Mi(a,b){try{var c=\\\\\"\\\\\",d=b;do c+=Qa(d),d=d.return;while(d);var e=c;}catch(f){e=\\\\\"Error generating stack: \\\\\"+f.message+\\\\\"\\\\\"+f.stack;}return {value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value);}catch(c){setTimeout(function(){throw c;});}}var Oi=\\\\\"function\\\\\"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b);};return c}\nfunction Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if(\\\\\"function\\\\\"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)};}var f=a.stateNode;null!==f&&\\\\\"function\\\\\"===typeof f.componentDidCatch&&(c.callback=function(){\\\\\"function\\\\\"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\\\\\"\\\\\"});});return c}var Ui=\\\\\"function\\\\\"===typeof WeakSet?WeakSet:Set;\nfunction Vi(a){var b=a.ref;if(null!==b)if(\\\\\"function\\\\\"===typeof b)try{b(null);}catch(c){Wi(a,c);}else b.current=null;}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b;}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));}\nfunction Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d();}a=a.next;}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d;}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d,\nb.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode;}Eg(c,b,a);}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c))));\nreturn;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));}\nfunction aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,\\\\\"function\\\\\"===typeof d.setProperty?d.setProperty(\\\\\"display\\\\\",\\\\\"none\\\\\",\\\\\"important\\\\\"):d.display=\\\\\"none\\\\\";else {d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty(\\\\\"display\\\\\")?e.display:null;d.style.display=sb(\\\\\"display\\\\\",e);}}else if(6===c.tag)c.stateNode.nodeValue=b?\\\\\"\\\\\":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===\na)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return;}c.sibling.return=c.return;c=c.sibling;}}\nfunction bj(a,b){if(Mf&&\\\\\"function\\\\\"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b);}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else {d=b;try{e();}catch(f){Wi(d,f);}}c=c.next;}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if(\\\\\"function\\\\\"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount();}catch(f){Wi(b,\nf);}break;case 5:Vi(b);break;case 4:cj(a,b);}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null;}function ej(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return;}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,\\\\\"\\\\\"),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return;}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===\nc.child||4===c.tag)continue b;else c.child.return=c,c=c.child;}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b);}\nfunction gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling;}\nfunction hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling;}\nfunction cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return;}d=!0;}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else {if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return;}k.sibling.return=k.return;k=k.sibling;}f?(g=e,h=c.stateNode,\n8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode);}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1);}c.sibling.return=c.return;c=c.sibling;}}\nfunction ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;\\\\\"input\\\\\"===a&&\\\\\"radio\\\\\"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;e<f.length;e+=\n2){var g=f[e],h=f[e+1];\\\\\"style\\\\\"===g?tb(c,h):\\\\\"dangerouslySetInnerHTML\\\\\"===g?ob(c,h):\\\\\"children\\\\\"===g?pb(c,h):qa(c,g,h,b);}switch(a){case \\\\\"input\\\\\":ab(c,d);break;case \\\\\"textarea\\\\\":ib(c,d);break;case \\\\\"select\\\\\":a=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,f=d.value,null!=f?fb(c,!!d.multiple,f,!1):a!==!!d.multiple&&(null!=d.defaultValue?fb(c,!!d.multiple,d.defaultValue,!0):fb(c,!!d.multiple,d.multiple?[]:\\\\\"\\\\\",!1));}}}return;case 6:if(null===b.stateNode)throw Error(y(162));b.stateNode.nodeValue=\nb.memoizedProps;return;case 3:c=b.stateNode;c.hydrate&&(c.hydrate=!1,Cc(c.containerInfo));return;case 12:return;case 13:null!==b.memoizedState&&(jj=O(),aj(b.child,!0));kj(b);return;case 19:kj(b);return;case 17:return;case 23:case 24:aj(b,null!==b.memoizedState);return}throw Error(y(163));}function kj(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Ui);b.forEach(function(b){var d=lj.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d));});}}\nfunction mj(a,b){return null!==a&&(a=a.memoizedState,null===a||null!==a.dehydrated)?(b=b.memoizedState,null!==b&&null===b.dehydrated):!1}var nj=Math.ceil,oj=ra.ReactCurrentDispatcher,pj=ra.ReactCurrentOwner,X=0,U=null,Y=null,W=0,qj=0,rj=Bf(0),V=0,sj=null,tj=0,Dg=0,Hi=0,uj=0,vj=null,jj=0,Ji=Infinity;function wj(){Ji=O()+500;}var Z=null,Qi=!1,Ri=null,Ti=null,xj=!1,yj=null,zj=90,Aj=[],Bj=[],Cj=null,Dj=0,Ej=null,Fj=-1,Gj=0,Hj=0,Ij=null,Jj=!1;function Hg(){return 0!==(X&48)?O():-1!==Fj?Fj:Fj=O()}\nfunction Ig(a){a=a.mode;if(0===(a&2))return 1;if(0===(a&4))return 99===eg()?1:2;0===Gj&&(Gj=tj);if(0!==kg.transition){0!==Hj&&(Hj=null!==vj?vj.pendingLanes:0);a=Gj;var b=4186112&~Hj;b&=-b;0===b&&(a=4186112&~a,b=a&-a,0===b&&(b=8192));return b}a=eg();0!==(X&4)&&98===a?a=Xc(12,Gj):(a=Sc(a),a=Xc(a,Gj));return a}\nfunction Jg(a,b,c){if(50<Dj)throw Dj=0,Ej=null,Error(y(185));a=Kj(a,b);if(null===a)return null;$c(a,b,c);a===U&&(Hi|=b,4===V&&Ii(a,W));var d=eg();1===b?0!==(X&8)&&0===(X&48)?Lj(a):(Mj(a,c),0===X&&(wj(),ig())):(0===(X&4)||98!==d&&99!==d||(null===Cj?Cj=new Set([a]):Cj.add(a)),Mj(a,c));vj=a;}function Kj(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}\nfunction Mj(a,b){for(var c=a.callbackNode,d=a.suspendedLanes,e=a.pingedLanes,f=a.expirationTimes,g=a.pendingLanes;0<g;){var h=31-Vc(g),k=1<<h,l=f[h];if(-1===l){if(0===(k&d)||0!==(k&e)){l=b;Rc(k);var n=F;f[h]=10<=n?l+250:6<=n?l+5E3:-1;}}else l<=b&&(a.expiredLanes|=k);g&=~k;}d=Uc(a,a===U?W:0);b=F;if(0===d)null!==c&&(c!==Zf&&Pf(c),a.callbackNode=null,a.callbackPriority=0);else {if(null!==c){if(a.callbackPriority===b)return;c!==Zf&&Pf(c);}15===b?(c=Lj.bind(null,a),null===ag?(ag=[c],bg=Of(Uf,jg)):ag.push(c),\nc=Zf):14===b?c=hg(99,Lj.bind(null,a)):(c=Tc(b),c=hg(c,Nj.bind(null,a)));a.callbackPriority=b;a.callbackNode=c;}}\nfunction Nj(a){Fj=-1;Hj=Gj=0;if(0!==(X&48))throw Error(y(327));var b=a.callbackNode;if(Oj()&&a.callbackNode!==b)return null;var c=Uc(a,a===U?W:0);if(0===c)return null;var d=c;var e=X;X|=16;var f=Pj();if(U!==a||W!==d)wj(),Qj(a,d);do try{Rj();break}catch(h){Sj(a,h);}while(1);qg();oj.current=f;X=e;null!==Y?d=0:(U=null,W=0,d=V);if(0!==(tj&Hi))Qj(a,0);else if(0!==d){2===d&&(X|=64,a.hydrate&&(a.hydrate=!1,qf(a.containerInfo)),c=Wc(a),0!==c&&(d=Tj(a,c)));if(1===d)throw b=sj,Qj(a,0),Ii(a,c),Mj(a,O()),b;a.finishedWork=\na.current.alternate;a.finishedLanes=c;switch(d){case 0:case 1:throw Error(y(345));case 2:Uj(a);break;case 3:Ii(a,c);if((c&62914560)===c&&(d=jj+500-O(),10<d)){if(0!==Uc(a,0))break;e=a.suspendedLanes;if((e&c)!==c){Hg();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=of(Uj.bind(null,a),d);break}Uj(a);break;case 4:Ii(a,c);if((c&4186112)===c)break;d=a.eventTimes;for(e=-1;0<c;){var g=31-Vc(c);f=1<<g;g=d[g];g>e&&(e=g);c&=~f;}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>\nc?4320:1960*nj(c/1960))-c;if(10<c){a.timeoutHandle=of(Uj.bind(null,a),c);break}Uj(a);break;case 5:Uj(a);break;default:throw Error(y(329));}}Mj(a,O());return a.callbackNode===b?Nj.bind(null,a):null}function Ii(a,b){b&=~uj;b&=~Hi;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-Vc(b),d=1<<c;a[c]=-1;b&=~d;}}\nfunction Lj(a){if(0!==(X&48))throw Error(y(327));Oj();if(a===U&&0!==(a.expiredLanes&W)){var b=W;var c=Tj(a,b);0!==(tj&Hi)&&(b=Uc(a,b),c=Tj(a,b));}else b=Uc(a,0),c=Tj(a,b);0!==a.tag&&2===c&&(X|=64,a.hydrate&&(a.hydrate=!1,qf(a.containerInfo)),b=Wc(a),0!==b&&(c=Tj(a,b)));if(1===c)throw c=sj,Qj(a,0),Ii(a,b),Mj(a,O()),c;a.finishedWork=a.current.alternate;a.finishedLanes=b;Uj(a);Mj(a,O());return null}\nfunction Vj(){if(null!==Cj){var a=Cj;Cj=null;a.forEach(function(a){a.expiredLanes|=24&a.pendingLanes;Mj(a,O());});}ig();}function Wj(a,b){var c=X;X|=1;try{return a(b)}finally{X=c,0===X&&(wj(),ig());}}function Xj(a,b){var c=X;X&=-2;X|=8;try{return a(b)}finally{X=c,0===X&&(wj(),ig());}}function ni(a,b){I(rj,qj);qj|=b;tj|=b;}function Ki(){qj=rj.current;H(rj);}\nfunction Qj(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,pf(c));if(null!==Y)for(c=Y.return;null!==c;){var d=c;switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&Gf();break;case 3:fh();H(N);H(M);uh();break;case 5:hh(d);break;case 4:fh();break;case 13:H(P);break;case 19:H(P);break;case 10:rg(d);break;case 23:case 24:Ki();}c=c.return;}U=a;Y=Tg(a.current,null);W=qj=tj=b;V=0;sj=null;uj=Hi=Dg=0;}\nfunction Sj(a,b){do{var c=Y;try{qg();vh.current=Gh;if(yh){for(var d=R.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next;}yh=!1;}xh=0;T=S=R=null;zh=!1;pj.current=null;if(null===c||null===c.return){V=1;sj=b;Y=null;break}a:{var f=a,g=c.return,h=c,k=b;b=W;h.flags|=2048;h.firstEffect=h.lastEffect=null;if(null!==k&&\\\\\"object\\\\\"===typeof k&&\\\\\"function\\\\\"===typeof k.then){var l=k;if(0===(h.mode&2)){var n=h.alternate;n?(h.updateQueue=n.updateQueue,h.memoizedState=n.memoizedState,h.lanes=n.lanes):\n(h.updateQueue=null,h.memoizedState=null);}var A=0!==(P.current&1),p=g;do{var C;if(C=13===p.tag){var x=p.memoizedState;if(null!==x)C=null!==x.dehydrated?!0:!1;else {var w=p.memoizedProps;C=void 0===w.fallback?!1:!0!==w.unstable_avoidThisFallback?!0:A?!1:!0;}}if(C){var z=p.updateQueue;if(null===z){var u=new Set;u.add(l);p.updateQueue=u;}else z.add(l);if(0===(p.mode&2)){p.flags|=64;h.flags|=16384;h.flags&=-2981;if(1===h.tag)if(null===h.alternate)h.tag=17;else {var t=zg(-1,1);t.tag=2;Ag(h,t);}h.lanes|=1;break a}k=\nvoid 0;h=b;var q=f.pingCache;null===q?(q=f.pingCache=new Oi,k=new Set,q.set(l,k)):(k=q.get(l),void 0===k&&(k=new Set,q.set(l,k)));if(!k.has(h)){k.add(h);var v=Yj.bind(null,f,l,h);l.then(v,v);}p.flags|=4096;p.lanes=b;break a}p=p.return;}while(null!==p);k=Error((Ra(h.type)||\\\\\"A React component\\\\\")+\\\\\" suspended while rendering, but no fallback UI was specified.Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.\\\\\");}5!==V&&(V=2);k=Mi(k,h);p=\ng;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&(\\\\\"function\\\\\"===typeof K.getDerivedStateFromError||null!==Q&&\\\\\"function\\\\\"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return;}while(null!==p)}Zj(c);}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}\nfunction Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e);}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y);}function Rj(){for(;null!==Y&&!Qf();)bk(Y);}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null;}\nfunction Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d;}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1<b.flags&&(null!==\na.lastEffect?a.lastEffect.nextEffect=b:a.firstEffect=b,a.lastEffect=b));}else {c=Li(b);if(null!==c){c.flags&=2047;Y=c;return}null!==a&&(a.firstEffect=a.lastEffect=null,a.flags|=2048);}b=b.sibling;if(null!==b){Y=b;return}Y=b=a;}while(null!==b);0===V&&(V=5);}function Uj(a){var b=eg();gg(99,dk.bind(null,a,b));return null}\nfunction dk(a,b){do Oj();while(null!==yj);if(0!==(X&48))throw Error(y(327));var c=a.finishedWork;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(y(177));a.callbackNode=null;var d=c.lanes|c.childLanes,e=d,f=a.pendingLanes&~e;a.pendingLanes=e;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=e;a.mutableReadLanes&=e;a.entangledLanes&=e;e=a.entanglements;for(var g=a.eventTimes,h=a.expirationTimes;0<f;){var k=31-Vc(f),l=1<<k;e[k]=0;g[k]=-1;h[k]=-1;f&=~l;}null!==\nCj&&0===(d&24)&&Cj.has(a)&&Cj.delete(a);a===U&&(Y=U=null,W=0);1<c.flags?null!==c.lastEffect?(c.lastEffect.nextEffect=c,d=c.firstEffect):d=c:d=c.firstEffect;if(null!==d){e=X;X|=32;pj.current=null;kf=fd;g=Ne();if(Oe(g)){if(\\\\\"selectionStart\\\\\"in g)h={start:g.selectionStart,end:g.selectionEnd};else a:if(h=(h=g.ownerDocument)&&h.defaultView||window,(l=h.getSelection&&h.getSelection())&&0!==l.rangeCount){h=l.anchorNode;f=l.anchorOffset;k=l.focusNode;l=l.focusOffset;try{h.nodeType,k.nodeType;}catch(va){h=null;\nbreak a}var n=0,A=-1,p=-1,C=0,x=0,w=g,z=null;b:for(;;){for(var u;;){w!==h||0!==f&&3!==w.nodeType||(A=n+f);w!==k||0!==l&&3!==w.nodeType||(p=n+l);3===w.nodeType&&(n+=w.nodeValue.length);if(null===(u=w.firstChild))break;z=w;w=u;}for(;;){if(w===g)break b;z===h&&++C===f&&(A=n);z===k&&++x===l&&(p=n);if(null!==(u=w.nextSibling))break;w=z;z=w.parentNode;}w=u;}h=-1===A||-1===p?null:{start:A,end:p};}else h=null;h=h||{start:0,end:0};}else h=null;lf={focusedElem:g,selectionRange:h};fd=!1;Ij=null;Jj=!1;Z=d;do try{ek();}catch(va){if(null===\nZ)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect;}while(null!==Z);Ij=null;Z=d;do try{for(g=a;null!==Z;){var t=Z.flags;t&16&&pb(Z.stateNode,\\\\\"\\\\\");if(t&128){var q=Z.alternate;if(null!==q){var v=q.ref;null!==v&&(\\\\\"function\\\\\"===typeof v?v(null):v.current=null);}}switch(t&1038){case 2:fj(Z);Z.flags&=-3;break;case 6:fj(Z);Z.flags&=-3;ij(Z.alternate,Z);break;case 1024:Z.flags&=-1025;break;case 1028:Z.flags&=-1025;ij(Z.alternate,Z);break;case 4:ij(Z.alternate,Z);break;case 8:h=Z;cj(g,h);var J=h.alternate;dj(h);null!==\nJ&&dj(J);}Z=Z.nextEffect;}}catch(va){if(null===Z)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect;}while(null!==Z);v=lf;q=Ne();t=v.focusedElem;g=v.selectionRange;if(q!==t&&t&&t.ownerDocument&&Me(t.ownerDocument.documentElement,t)){null!==g&&Oe(t)&&(q=g.start,v=g.end,void 0===v&&(v=q),\\\\\"selectionStart\\\\\"in t?(t.selectionStart=q,t.selectionEnd=Math.min(v,t.value.length)):(v=(q=t.ownerDocument||document)&&q.defaultView||window,v.getSelection&&(v=v.getSelection(),h=t.textContent.length,J=Math.min(g.start,h),g=void 0===\ng.end?J:Math.min(g.end,h),!v.extend&&J>g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});\\\\\"function\\\\\"===typeof t.focus&&t.focus();for(t=\n0;t<q.length;t++)v=q[t],v.element.scrollLeft=v.left,v.element.scrollTop=v.top;}fd=!!kf;lf=kf=null;a.current=c;Z=d;do try{for(t=a;null!==Z;){var K=Z.flags;K&36&&Yi(t,Z.alternate,Z);if(K&128){q=void 0;var Q=Z.ref;if(null!==Q){var L=Z.stateNode;switch(Z.tag){case 5:q=L;break;default:q=L;}\\\\\"function\\\\\"===typeof Q?Q(q):Q.current=q;}}Z=Z.nextEffect;}}catch(va){if(null===Z)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect;}while(null!==Z);Z=null;$f();X=e;}else a.current=c;if(xj)xj=!1,yj=a,zj=b;else for(Z=d;null!==Z;)b=\nZ.nextEffect,Z.nextEffect=null,Z.flags&8&&(K=Z,K.sibling=null,K.stateNode=null),Z=b;d=a.pendingLanes;0===d&&(Ti=null);1===d?a===Ej?Dj++:(Dj=0,Ej=a):Dj=0;c=c.stateNode;if(Mf&&\\\\\"function\\\\\"===typeof Mf.onCommitFiberRoot)try{Mf.onCommitFiberRoot(Lf,c,void 0,64===(c.current.flags&64));}catch(va){}Mj(a,O());if(Qi)throw Qi=!1,a=Ri,Ri=null,a;if(0!==(X&8))return null;ig();return null}\nfunction ek(){for(;null!==Z;){var a=Z.alternate;Jj||null===Ij||(0!==(Z.flags&8)?dc(Z,Ij)&&(Jj=!0):13===Z.tag&&mj(a,Z)&&dc(Z,Ij)&&(Jj=!0));var b=Z.flags;0!==(b&256)&&Xi(a,Z);0===(b&512)||xj||(xj=!0,hg(97,function(){Oj();return null}));Z=Z.nextEffect;}}function Oj(){if(90!==zj){var a=97<zj?97:zj;zj=90;return gg(a,fk)}return !1}function $i(a,b){Aj.push(b,a);xj||(xj=!0,hg(97,function(){Oj();return null}));}function Zi(a,b){Bj.push(b,a);xj||(xj=!0,hg(97,function(){Oj();return null}));}\nfunction fk(){if(null===yj)return !1;var a=yj;yj=null;if(0!==(X&48))throw Error(y(331));var b=X;X|=32;var c=Bj;Bj=[];for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],g=e.destroy;e.destroy=void 0;if(\\\\\"function\\\\\"===typeof g)try{g();}catch(k){if(null===f)throw Error(y(330));Wi(f,k);}}c=Aj;Aj=[];for(d=0;d<c.length;d+=2){e=c[d];f=c[d+1];try{var h=e.create;e.destroy=h();}catch(k){if(null===f)throw Error(y(330));Wi(f,k);}}for(h=a.current.firstEffect;null!==h;)a=h.nextEffect,h.nextEffect=null,h.flags&8&&(h.sibling=\nnull,h.stateNode=null),h=a;X=b;ig();return !0}function gk(a,b,c){b=Mi(c,b);b=Pi(a,b,1);Ag(a,b);b=Hg();a=Kj(a,1);null!==a&&($c(a,1,b),Mj(a,b));}\nfunction Wi(a,b){if(3===a.tag)gk(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){gk(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if(\\\\\"function\\\\\"===typeof c.type.getDerivedStateFromError||\\\\\"function\\\\\"===typeof d.componentDidCatch&&(null===Ti||!Ti.has(d))){a=Mi(b,a);var e=Si(c,a,1);Ag(c,e);e=Hg();c=Kj(c,1);if(null!==c)$c(c,1,e),Mj(c,e);else if(\\\\\"function\\\\\"===typeof d.componentDidCatch&&(null===Ti||!Ti.has(d)))try{d.componentDidCatch(b,a);}catch(f){}break}}c=c.return;}}\nfunction Yj(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=Hg();a.pingedLanes|=a.suspendedLanes&c;U===a&&(W&c)===c&&(4===V||3===V&&(W&62914560)===W&&500>O()-jj?Qj(a,0):uj|=c);Mj(a,b);}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c));}var ck;\nck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else {ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!==\nb?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64;}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if(\\\\\"object\\\\\"===\ntypeof e&&null!==e&&\\\\\"function\\\\\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b);}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;\\\\\"function\\\\\"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c);}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);\na=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,\\\\\"\\\\\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282));\nd=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else {e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e<a.length;e+=2)f=a[e],f._workInProgressVersionPrimary=a[e+1],th.push(f);c=Zg(b,null,d,c);for(b.child=c;c;)c.flags=c.flags&-3|1024,c=c.sibling;}else fi(a,b,d,c),sh();b=b.child;}return b;case 5:return gh(b),null===a&&\nph(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,nf(d,e)?g=null:null!==f&&nf(d,f)&&(b.flags|=16),oi(a,b),fi(a,b,g,c),b.child;case 6:return null===a&&ph(b),null;case 13:return ti(a,b,c);case 4:return eh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Yg(b,null,d,c):fi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),gi(a,b,d,e,c);case 7:return fi(a,b,b.pendingProps,c),b.child;case 8:return fi(a,b,b.pendingProps.children,\nc),b.child;case 12:return fi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(mg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=He(h,f)?0:(\\\\\"function\\\\\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!N.current){b=hi(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=\nk.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=zg(-1,c&-c),l.tag=2,Ag(h,l));h.lanes|=c;l=h.alternate;null!==l&&(l.lanes|=c);sg(h.return,c);k.lanes|=c;break}l=l.next;}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return;}h=g;}fi(a,b,e.children,c);b=b.child;}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,tg(b,c),e=vg(e,\nf.unstable_observedBits),d=d(e),b.flags|=1,fi(a,b,d,c),b.child;case 14:return e=b.type,f=lg(e,b.pendingProps),f=lg(e.type,f),ii(a,b,e,f,d,c);case 15:return ki(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),b.tag=1,Ff(d)?(a=!0,Jf(b)):a=!1,tg(b,c),Mg(b,d,e),Og(b,d,e,c),qi(null,b,d,!0,a,c);case 19:return Ai(a,b,c);case 23:return mi(a,b,c);case 24:return mi(a,b,c)}throw Error(y(156,b.tag));\n};function ik(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.flags=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childLanes=this.lanes=0;this.alternate=null;}function nh(a,b,c,d){return new ik(a,b,c,d)}function ji(a){a=a.prototype;return !(!a||!a.isReactComponent)}\nfunction hk(a){if(\\\\\"function\\\\\"===typeof a)return ji(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Aa)return 11;if(a===Da)return 14}return 2}\nfunction Tg(a,b){var c=a.alternate;null===c?(c=nh(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Vg(a,b,c,d,e,f){var g=2;d=a;if(\\\\\"function\\\\\"===typeof a)ji(a)&&(g=1);else if(\\\\\"string\\\\\"===typeof a)g=5;else a:switch(a){case ua:return Xg(c.children,e,f,b);case Ha:g=8;e|=16;break;case wa:g=8;e|=1;break;case xa:return a=nh(12,c,b,e|8),a.elementType=xa,a.type=xa,a.lanes=f,a;case Ba:return a=nh(13,c,b,e),a.type=Ba,a.elementType=Ba,a.lanes=f,a;case Ca:return a=nh(19,c,b,e),a.elementType=Ca,a.lanes=f,a;case Ia:return vi(c,e,f,b);case Ja:return a=nh(24,c,b,e),a.elementType=Ja,a.lanes=f,a;default:if(\\\\\"object\\\\\"===\ntypeof a&&null!==a)switch(a.$$typeof){case ya:g=10;break a;case za:g=9;break a;case Aa:g=11;break a;case Da:g=14;break a;case Ea:g=16;d=null;break a;case Fa:g=22;break a}throw Error(y(130,null==a?a:typeof a,\\\\\"\\\\\"));}b=nh(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Xg(a,b,c,d){a=nh(7,a,d,b);a.lanes=c;return a}function vi(a,b,c,d){a=nh(23,a,d,b);a.elementType=Ia;a.lanes=c;return a}function Ug(a,b,c){a=nh(6,a,null,b);a.lanes=c;return a}\nfunction Wg(a,b,c){b=nh(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction jk(a,b,c){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode=null;this.callbackPriority=0;this.eventTimes=Zc(0);this.expirationTimes=Zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=Zc(0);this.mutableSourceEagerHydrationData=null;}\nfunction kk(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return {$$typeof:ta,key:null==d?null:\\\\\"\\\\\"+d,children:a,containerInfo:b,implementation:c}}\nfunction lk(a,b,c,d){var e=b.current,f=Hg(),g=Ig(e);a:if(c){c=c._reactInternals;b:{if(Zb(c)!==c||1!==c.tag)throw Error(y(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(Ff(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return;}while(null!==h);throw Error(y(171));}if(1===c.tag){var k=c.type;if(Ff(k)){c=If(c,k,h);break a}}c=h;}else c=Cf;null===b.context?b.context=c:b.pendingContext=c;b=zg(f,g);b.payload={element:a};d=void 0===d?null:d;null!==\nd&&(b.callback=d);Ag(e,b);Jg(e,g,f);return g}function mk(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function nk(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b;}}function ok(a,b){nk(a,b);(a=a.alternate)&&nk(a,b);}function pk(){return null}\nfunction qk(a,b,c){var d=null!=c&&null!=c.hydrationOptions&&c.hydrationOptions.mutableSources||null;c=new jk(a,b,null!=c&&!0===c.hydrate);b=nh(3,null,null,2===b?7:1===b?3:0);c.current=b;b.stateNode=c;xg(b);a[ff]=c.current;cf(8===a.nodeType?a.parentNode:a);if(d)for(a=0;a<d.length;a++){b=d[a];var e=b._getVersion;e=e(b._source);null==c.mutableSourceEagerHydrationData?c.mutableSourceEagerHydrationData=[b,e]:c.mutableSourceEagerHydrationData.push(b,e);}this._internalRoot=c;}\nqk.prototype.render=function(a){lk(a,this._internalRoot,null,null);};qk.prototype.unmount=function(){var a=this._internalRoot,b=a.containerInfo;lk(null,a,null,function(){b[ff]=null;});};function rk(a){return !(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||\\\\\" react-mount-point-unstable \\\\\"!==a.nodeValue))}\nfunction sk(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute(\\\\\"data-reactroot\\\\\")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new qk(a,0,b?{hydrate:!0}:void 0)}\nfunction tk(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if(\\\\\"function\\\\\"===typeof e){var h=e;e=function(){var a=mk(g);h.call(a);};}lk(b,g,a,e);}else {f=c._reactRootContainer=sk(c,d);g=f._internalRoot;if(\\\\\"function\\\\\"===typeof e){var k=e;e=function(){var a=mk(g);k.call(a);};}Xj(function(){lk(b,g,a,e);});}return mk(g)}ec=function(a){if(13===a.tag){var b=Hg();Jg(a,4,b);ok(a,4);}};fc=function(a){if(13===a.tag){var b=Hg();Jg(a,67108864,b);ok(a,67108864);}};\ngc=function(a){if(13===a.tag){var b=Hg(),c=Ig(a);Jg(a,c,b);ok(a,c);}};hc=function(a,b){return b()};\nyb=function(a,b,c){switch(b){case \\\\\"input\\\\\":ab(a,c);b=c.name;if(\\\\\"radio\\\\\"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll(\\\\\"input[name=\\\\\"+JSON.stringify(\\\\\"\\\\\"+b)+'][type=\\\\\"radio\\\\\"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Db(d);if(!e)throw Error(y(90));Wa(d);ab(d,e);}}}break;case \\\\\"textarea\\\\\":ib(a,c);break;case \\\\\"select\\\\\":b=c.value,null!=b&&fb(a,!!c.multiple,b,!1);}};Gb=Wj;\nHb=function(a,b,c,d,e){var f=X;X|=4;try{return gg(98,a.bind(null,b,c,d,e))}finally{X=f,0===X&&(wj(),ig());}};Ib=function(){0===(X&49)&&(Vj(),Oj());};Jb=function(a,b){var c=X;X|=2;try{return a(b)}finally{X=c,0===X&&(wj(),ig());}};function uk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!rk(b))throw Error(y(200));return kk(a,b,null,c)}var vk={Events:[Cb,ue,Db,Eb,Fb,Oj,{current:!1}]},wk={findFiberByHostInstance:wc,bundleType:0,version:\\\\\"17.0.2\\\\\",rendererPackageName:\\\\\"react-dom\\\\\"};\nvar xk={bundleType:wk.bundleType,version:wk.version,rendererPackageName:wk.rendererPackageName,rendererConfig:wk.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ra.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=cc(a);return null===a?null:a.stateNode},findFiberByHostInstance:wk.findFiberByHostInstance||\npk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(\\\\\"undefined\\\\\"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yk=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yk.isDisabled&&yk.supportsFiber)try{Lf=yk.inject(xk),Mf=yk;}catch(a){}}var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vk;var createPortal=uk;\nvar findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if(\\\\\"function\\\\\"===typeof a.render)throw Error(y(188));throw Error(y(268,Object.keys(a)));}a=cc(b);a=null===a?null:a.stateNode;return a};var flushSync=function(a,b){var c=X;if(0!==(c&48))return a(b);X|=1;try{if(a)return gg(99,a.bind(null,b))}finally{X=c,ig();}};var hydrate=function(a,b,c){if(!rk(b))throw Error(y(200));return tk(null,a,b,!0,c)};\nvar render=function(a,b,c){if(!rk(b))throw Error(y(200));return tk(null,a,b,!1,c)};var unmountComponentAtNode=function(a){if(!rk(a))throw Error(y(40));return a._reactRootContainer?(Xj(function(){tk(null,null,a,!1,function(){a._reactRootContainer=null;a[ff]=null;});}),!0):!1};var unstable_batchedUpdates=Wj;var unstable_createPortal=function(a,b){return uk(a,b,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)};\nvar unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!rk(c))throw Error(y(200));if(null==a||void 0===a._reactInternals)throw Error(y(38));return tk(a,b,c,!1,d)};var version=\\\\\"17.0.2\\\\\";\nvar reactDom_production_min = {\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n\tcreatePortal: createPortal,\n\tfindDOMNode: findDOMNode,\n\tflushSync: flushSync,\n\thydrate: hydrate,\n\trender: render,\n\tunmountComponentAtNode: unmountComponentAtNode,\n\tunstable_batchedUpdates: unstable_batchedUpdates,\n\tunstable_createPortal: unstable_createPortal,\n\tunstable_renderSubtreeIntoContainer: unstable_renderSubtreeIntoContainer,\n\tversion: version\n};\nvar reactDom = createCommonjsModule(function (module) {\nfunction checkDCE() {\n  if (\n    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n  ) {\n    return;\n  }\n  try {\n    // Verify that the code above has been dead code eliminated (DCE'd).\n    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n  } catch (err) {\n    // DevTools shouldn't crash React, no matter what.\n    // We should still report in case we break this code.\n    console.error(err);\n  }\n}\n{\n  // DCE check should happen before ReactDOM bundle executes so that\n  // DevTools can report bad minification during injection.\n  checkDCE();\n  module.exports = reactDom_production_min;\n}\n});\nexport default reactDom;\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: allFiles 1`] = `\nArray [\n  \"_snowpack/env.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/react-dom.js\",\n  \"_snowpack/pkg/react.js\",\n  \"dist/App.css\",\n  \"dist/App.css.proxy.js\",\n  \"dist/App.js\",\n  \"dist/index.css\",\n  \"dist/index.css.proxy.js\",\n  \"dist/index.js\",\n  \"dist/logo.svg\",\n  \"dist/logo.svg.proxy.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/App.css 1`] = `\n\".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n.App-link {\n  color: #61dafb;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/App.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\".App {  text-align: center;}.App code {  background: #FFF3;  padding: 4px 8px;  border-radius: 4px;}.App p {  margin: 0.4rem;}.App-logo {  height: 40vmin;  pointer-events: none;}@media (prefers-reduced-motion: no-preference) {  .App-logo {    animation: App-logo-spin infinite 20s linear;  }}.App-header {  background-color: #282c34;  min-height: 100vh;  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  font-size: calc(10px + 2vmin);  color: white;}.App-link {  color: #61dafb;}@keyframes App-logo-spin {  from {    transform: rotate(0deg);  }  to {    transform: rotate(360deg);  }}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/App.js 1`] = `\n\"import React, {useState, useEffect} from \\\\\"../_snowpack/pkg/react.js\\\\\";\nimport logo from \\\\\"./logo.svg.proxy.js\\\\\";\nimport \\\\\"./App.css.proxy.js\\\\\";\nfunction App() {\n  const [count, setCount] = useState(0);\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1e3);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  return /* @__PURE__ */ React.createElement(\\\\\"div\\\\\", {\n    className: \\\\\"App\\\\\"\n  }, /* @__PURE__ */ React.createElement(\\\\\"header\\\\\", {\n    className: \\\\\"App-header\\\\\"\n  }, /* @__PURE__ */ React.createElement(\\\\\"img\\\\\", {\n    src: logo,\n    className: \\\\\"App-logo\\\\\",\n    alt: \\\\\"logo\\\\\"\n  }), /* @__PURE__ */ React.createElement(\\\\\"p\\\\\", null, \\\\\"Edit \\\\\", /* @__PURE__ */ React.createElement(\\\\\"code\\\\\", null, \\\\\"src/App.jsx\\\\\"), \\\\\" and save to reload.\\\\\"), /* @__PURE__ */ React.createElement(\\\\\"p\\\\\", null, \\\\\"Page has been open for \\\\\", /* @__PURE__ */ React.createElement(\\\\\"code\\\\\", null, count), \\\\\" seconds.\\\\\"), /* @__PURE__ */ React.createElement(\\\\\"p\\\\\", null, /* @__PURE__ */ React.createElement(\\\\\"a\\\\\", {\n    className: \\\\\"App-link\\\\\",\n    href: \\\\\"https://reactjs.org\\\\\",\n    target: \\\\\"_blank\\\\\",\n    rel: \\\\\"noopener noreferrer\\\\\"\n  }, \\\\\"Learn React\\\\\"))));\n}\nexport default App;\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/index.css 1`] = `\n\"body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/index.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\"body {  margin: 0;  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',    sans-serif;  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;}code {  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',    monospace;}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/index.js 1`] = `\n\"import * as __SNOWPACK_ENV__ from '../_snowpack/env.js';\nimport.meta.env = __SNOWPACK_ENV__;\nimport React from \\\\\"../_snowpack/pkg/react.js\\\\\";\nimport ReactDOM from \\\\\"../_snowpack/pkg/react-dom.js\\\\\";\nimport App from \\\\\"./App.js\\\\\";\nimport \\\\\"./index.css.proxy.js\\\\\";\nReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App, null)), document.getElementById(\\\\\"root\\\\\"));\nif (undefined /* [snowpack] import.meta.hot */ ) {\n  undefined /* [snowpack] import.meta.hot */ .accept();\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react > build: dist/logo.svg.proxy.js 1`] = `\"export default \\\\\"/dist/logo.svg\\\\\";\"`;\n\nexports[`create-snowpack-app app-template-react > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: _snowpack/env.js 1`] = `\n\"export const MODE = \\\\\"production\\\\\";\nexport const NODE_ENV = \\\\\"production\\\\\";\nexport const SSR = false;\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"react\\\\\": \\\\\"./react.js\\\\\",\n    \\\\\"react-dom\\\\\": \\\\\"./react-dom.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: _snowpack/pkg/react.js 1`] = `\n\"import { r as react } from './common/index-XXXXXXXX.js';\nexport { r as default } from './common/index-XXXXXXXX.js';\nvar useEffect = react.useEffect;\nvar useState = react.useState;\nexport { useEffect, useState };\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: _snowpack/pkg/react-dom.js 1`] = `\n\"import { c as createCommonjsModule, r as react, o as objectAssign } from './common/index-XXXXXXXX.js';\nvar scheduler_production_min = createCommonjsModule(function (module, exports) {\nvar f,g,h,k;if(\\\\\"object\\\\\"===typeof performance&&\\\\\"function\\\\\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q};}\nif(\\\\\"undefined\\\\\"===typeof window||\\\\\"function\\\\\"!==typeof MessageChannel){var t=null,u=null,w=function(){if(null!==t)try{var a=exports.unstable_now();t(!0,a);t=null;}catch(b){throw setTimeout(w,0),b;}};f=function(a){null!==t?setTimeout(f,0,a):(t=a,setTimeout(w,0));};g=function(a,b){u=setTimeout(a,b);};h=function(){clearTimeout(u);};exports.unstable_shouldYield=function(){return !1};k=exports.unstable_forceFrameRate=function(){};}else {var x=window.setTimeout,y=window.clearTimeout;if(\\\\\"undefined\\\\\"!==typeof console){var z=\nwindow.cancelAnimationFrame;\\\\\"function\\\\\"!==typeof window.requestAnimationFrame&&console.error(\\\\\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\\\\\");\\\\\"function\\\\\"!==typeof z&&console.error(\\\\\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\\\\\");}var A=!1,B=null,C=-1,D=5,E=0;exports.unstable_shouldYield=function(){return exports.unstable_now()>=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error(\\\\\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\\\\\"):D=0<a?Math.floor(1E3/a):5;};var F=new MessageChannel,G=F.port2;F.port1.onmessage=function(){if(null!==B){var a=exports.unstable_now();E=a+D;try{B(!0,a)?G.postMessage(null):(A=!1,B=null);}catch(b){throw G.postMessage(null),b;}}else A=!1;};f=function(a){B=a;A||(A=!0,G.postMessage(null));};g=function(a,b){C=\nx(function(){a(exports.unstable_now());},b);};h=function(){y(C);C=-1;};}function H(a,b){var c=a.length;a.push(b);a:for(;;){var d=c-1>>>1,e=a[d];if(void 0!==e&&0<I(e,b))a[d]=b,a[c]=e,c=d;else break a}}function J(a){a=a[0];return void 0===a?null:a}\nfunction K(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M);}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else {var b=J(M);null!==b&&g(U,b.startTime-a);}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\\\\\"function\\\\\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\\\\\"function\\\\\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b);}else K(L);O=J(L);}if(null!==O)var m=!0;else {var n=J(M);null!==n&&g(U,n.startTime-b);m=!1;}return m}finally{O=null,P=c,Q=!1;}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null;};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V));};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P;}var c=P;P=b;try{return a()}finally{P=c;}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=P;P=a;try{return b()}finally{P=c;}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\\\\\"object\\\\\"===typeof c&&null!==c?(c=c.delay,c=\\\\\"number\\\\\"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3;}e=c+e;a={id:N++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c;}}};\n});\nvar scheduler = createCommonjsModule(function (module) {\n{\n  module.exports = scheduler_production_min;\n}\n});\nfunction y(a){for(var b=\\\\\"https://reactjs.org/docs/error-decoder.html?invariant=\\\\\"+a,c=1;c<arguments.length;c++)b+=\\\\\"&args[]=\\\\\"+encodeURIComponent(arguments[c]);return \\\\\"Minified React error #\\\\\"+a+\\\\\"; visit \\\\\"+b+\\\\\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\\\\\"}if(!react)throw Error(y(227));var ba=new Set,ca={};function da(a,b){ea(a,b);ea(a+\\\\\"Capture\\\\\",b);}\nfunction ea(a,b){ca[a]=b;for(a=0;a<b.length;a++)ba.add(b[a]);}\nvar fa=!(\\\\\"undefined\\\\\"===typeof window||\\\\\"undefined\\\\\"===typeof window.document||\\\\\"undefined\\\\\"===typeof window.document.createElement),ha=/^[:A-Z_a-z\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02FF\\\\\\\\u0370-\\\\\\\\u037D\\\\\\\\u037F-\\\\\\\\u1FFF\\\\\\\\u200C-\\\\\\\\u200D\\\\\\\\u2070-\\\\\\\\u218F\\\\\\\\u2C00-\\\\\\\\u2FEF\\\\\\\\u3001-\\\\\\\\uD7FF\\\\\\\\uF900-\\\\\\\\uFDCF\\\\\\\\uFDF0-\\\\\\\\uFFFD][:A-Z_a-z\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02FF\\\\\\\\u0370-\\\\\\\\u037D\\\\\\\\u037F-\\\\\\\\u1FFF\\\\\\\\u200C-\\\\\\\\u200D\\\\\\\\u2070-\\\\\\\\u218F\\\\\\\\u2C00-\\\\\\\\u2FEF\\\\\\\\u3001-\\\\\\\\uD7FF\\\\\\\\uF900-\\\\\\\\uFDCF\\\\\\\\uFDF0-\\\\\\\\uFFFD\\\\\\\\-.0-9\\\\\\\\u00B7\\\\\\\\u0300-\\\\\\\\u036F\\\\\\\\u203F-\\\\\\\\u2040]*$/,ia=Object.prototype.hasOwnProperty,\nja={},ka={};function la(a){if(ia.call(ka,a))return !0;if(ia.call(ja,a))return !1;if(ha.test(a))return ka[a]=!0;ja[a]=!0;return !1}function ma(a,b,c,d){if(null!==c&&0===c.type)return !1;switch(typeof b){case \\\\\"function\\\\\":case \\\\\"symbol\\\\\":return !0;case \\\\\"boolean\\\\\":if(d)return !1;if(null!==c)return !c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return \\\\\"data-\\\\\"!==a&&\\\\\"aria-\\\\\"!==a;default:return !1}}\nfunction na(a,b,c,d){if(null===b||\\\\\"undefined\\\\\"===typeof b||ma(a,b,c,d))return !0;if(d)return !1;if(null!==c)switch(c.type){case 3:return !b;case 4:return !1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return !1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g;}var D={};\n\\\\\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\\\\\".split(\\\\\" \\\\\").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1);});[[\\\\\"acceptCharset\\\\\",\\\\\"accept-charset\\\\\"],[\\\\\"className\\\\\",\\\\\"class\\\\\"],[\\\\\"htmlFor\\\\\",\\\\\"for\\\\\"],[\\\\\"httpEquiv\\\\\",\\\\\"http-equiv\\\\\"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1);});[\\\\\"contentEditable\\\\\",\\\\\"draggable\\\\\",\\\\\"spellCheck\\\\\",\\\\\"value\\\\\"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1);});\n[\\\\\"autoReverse\\\\\",\\\\\"externalResourcesRequired\\\\\",\\\\\"focusable\\\\\",\\\\\"preserveAlpha\\\\\"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1);});\\\\\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\\\\\".split(\\\\\" \\\\\").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1);});\n[\\\\\"checked\\\\\",\\\\\"multiple\\\\\",\\\\\"muted\\\\\",\\\\\"selected\\\\\"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1);});[\\\\\"capture\\\\\",\\\\\"download\\\\\"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1);});[\\\\\"cols\\\\\",\\\\\"rows\\\\\",\\\\\"size\\\\\",\\\\\"span\\\\\"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1);});[\\\\\"rowSpan\\\\\",\\\\\"start\\\\\"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1);});var oa=/[\\\\\\\\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()}\n\\\\\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\\\\\".split(\\\\\" \\\\\").forEach(function(a){var b=a.replace(oa,\npa);D[b]=new B(b,1,!1,a,null,!1,!1);});\\\\\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\\\\\".split(\\\\\" \\\\\").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\\\\\"http://www.w3.org/1999/xlink\\\\\",!1,!1);});[\\\\\"xml:base\\\\\",\\\\\"xml:lang\\\\\",\\\\\"xml:space\\\\\"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\\\\\"http://www.w3.org/XML/1998/namespace\\\\\",!1,!1);});[\\\\\"tabIndex\\\\\",\\\\\"crossOrigin\\\\\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1);});\nD.xlinkHref=new B(\\\\\"xlinkHref\\\\\",1,!1,\\\\\"xlink:href\\\\\",\\\\\"http://www.w3.org/1999/xlink\\\\\",!0,!1);[\\\\\"src\\\\\",\\\\\"href\\\\\",\\\\\"action\\\\\",\\\\\"formAction\\\\\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0);});\nfunction qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||\\\\\"o\\\\\"!==b[0]&&\\\\\"O\\\\\"!==b[0]||\\\\\"n\\\\\"!==b[1]&&\\\\\"N\\\\\"!==b[1]?!1:!0;f||(na(b,c,e,d)&&(c=null),d||null===e?la(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,\\\\\"\\\\\"+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:\\\\\"\\\\\":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?\\\\\"\\\\\":\\\\\"\\\\\"+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))));}\nvar ra=react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sa=60103,ta=60106,ua=60107,wa=60108,xa=60114,ya=60109,za=60110,Aa=60112,Ba=60113,Ca=60120,Da=60115,Ea=60116,Fa=60121,Ga=60128,Ha=60129,Ia=60130,Ja=60131;\nif(\\\\\"function\\\\\"===typeof Symbol&&Symbol.for){var E=Symbol.for;sa=E(\\\\\"react.element\\\\\");ta=E(\\\\\"react.portal\\\\\");ua=E(\\\\\"react.fragment\\\\\");wa=E(\\\\\"react.strict_mode\\\\\");xa=E(\\\\\"react.profiler\\\\\");ya=E(\\\\\"react.provider\\\\\");za=E(\\\\\"react.context\\\\\");Aa=E(\\\\\"react.forward_ref\\\\\");Ba=E(\\\\\"react.suspense\\\\\");Ca=E(\\\\\"react.suspense_list\\\\\");Da=E(\\\\\"react.memo\\\\\");Ea=E(\\\\\"react.lazy\\\\\");Fa=E(\\\\\"react.block\\\\\");E(\\\\\"react.scope\\\\\");Ga=E(\\\\\"react.opaque.id\\\\\");Ha=E(\\\\\"react.debug_trace_mode\\\\\");Ia=E(\\\\\"react.offscreen\\\\\");Ja=E(\\\\\"react.legacy_hidden\\\\\");}\nvar Ka=\\\\\"function\\\\\"===typeof Symbol&&Symbol.iterator;function La(a){if(null===a||\\\\\"object\\\\\"!==typeof a)return null;a=Ka&&a[Ka]||a[\\\\\"@@iterator\\\\\"];return \\\\\"function\\\\\"===typeof a?a:null}var Ma;function Na(a){if(void 0===Ma)try{throw Error();}catch(c){var b=c.stack.trim().match(/( *(at )?)/);Ma=b&&b[1]||\\\\\"\\\\\";}return \\\\\"\\\\\"+Ma+a}var Oa=!1;\nfunction Pa(a,b){if(!a||Oa)return \\\\\"\\\\\";Oa=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,\\\\\"props\\\\\",{set:function(){throw Error();}}),\\\\\"object\\\\\"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[]);}catch(k){var d=k;}Reflect.construct(a,[],b);}else {try{b.call();}catch(k){d=k;}a.call(b.prototype);}else {try{throw Error();}catch(k){d=k;}a();}}catch(k){if(k&&d&&\\\\\"string\\\\\"===typeof k.stack){for(var e=k.stack.split(\\\\\"\\\\\"),\nf=d.stack.split(\\\\\"\\\\\"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h])return \\\\\"\\\\\"+e[g].replace(\\\\\" at new \\\\\",\\\\\" at \\\\\");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c;}return (a=a?a.displayName||a.name:\\\\\"\\\\\")?Na(a):\\\\\"\\\\\"}\nfunction Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na(\\\\\"Lazy\\\\\");case 13:return Na(\\\\\"Suspense\\\\\");case 19:return Na(\\\\\"SuspenseList\\\\\");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return \\\\\"\\\\\"}}\nfunction Ra(a){if(null==a)return null;if(\\\\\"function\\\\\"===typeof a)return a.displayName||a.name||null;if(\\\\\"string\\\\\"===typeof a)return a;switch(a){case ua:return \\\\\"Fragment\\\\\";case ta:return \\\\\"Portal\\\\\";case xa:return \\\\\"Profiler\\\\\";case wa:return \\\\\"StrictMode\\\\\";case Ba:return \\\\\"Suspense\\\\\";case Ca:return \\\\\"SuspenseList\\\\\"}if(\\\\\"object\\\\\"===typeof a)switch(a.$$typeof){case za:return (a.displayName||\\\\\"Context\\\\\")+\\\\\".Consumer\\\\\";case ya:return (a._context.displayName||\\\\\"Context\\\\\")+\\\\\".Provider\\\\\";case Aa:var b=a.render;b=b.displayName||b.name||\\\\\"\\\\\";\nreturn a.displayName||(\\\\\"\\\\\"!==b?\\\\\"ForwardRef(\\\\\"+b+\\\\\")\\\\\":\\\\\"ForwardRef\\\\\");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case \\\\\"boolean\\\\\":case \\\\\"number\\\\\":case \\\\\"object\\\\\":case \\\\\"string\\\\\":case \\\\\"undefined\\\\\":return a;default:return \\\\\"\\\\\"}}function Ta(a){var b=a.type;return (a=a.nodeName)&&\\\\\"input\\\\\"===a.toLowerCase()&&(\\\\\"checkbox\\\\\"===b||\\\\\"radio\\\\\"===b)}\nfunction Ua(a){var b=Ta(a)?\\\\\"checked\\\\\":\\\\\"value\\\\\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\\\\\"\\\\\"+a[b];if(!a.hasOwnProperty(b)&&\\\\\"undefined\\\\\"!==typeof c&&\\\\\"function\\\\\"===typeof c.get&&\\\\\"function\\\\\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\\\\\"\\\\\"+a;f.call(this,a);}});Object.defineProperty(a,b,{enumerable:c.enumerable});return {getValue:function(){return d},setValue:function(a){d=\\\\\"\\\\\"+a;},stopTracking:function(){a._valueTracker=\nnull;delete a[b];}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a));}function Wa(a){if(!a)return !1;var b=a._valueTracker;if(!b)return !0;var c=b.getValue();var d=\\\\\"\\\\\";a&&(d=Ta(a)?a.checked?\\\\\"true\\\\\":\\\\\"false\\\\\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\\\\\"undefined\\\\\"!==typeof document?document:void 0);if(\\\\\"undefined\\\\\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return objectAssign({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\\\\\"\\\\\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\\\\\"checkbox\\\\\"===b.type||\\\\\"radio\\\\\"===b.type?null!=b.checked:null!=b.value};}function $a(a,b){b=b.checked;null!=b&&qa(a,\\\\\"checked\\\\\",b,!1);}\nfunction ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\\\\\"number\\\\\"===d){if(0===c&&\\\\\"\\\\\"===a.value||a.value!=c)a.value=\\\\\"\\\\\"+c;}else a.value!==\\\\\"\\\\\"+c&&(a.value=\\\\\"\\\\\"+c);else if(\\\\\"submit\\\\\"===d||\\\\\"reset\\\\\"===d){a.removeAttribute(\\\\\"value\\\\\");return}b.hasOwnProperty(\\\\\"value\\\\\")?bb(a,b.type,c):b.hasOwnProperty(\\\\\"defaultValue\\\\\")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked);}\nfunction cb(a,b,c){if(b.hasOwnProperty(\\\\\"value\\\\\")||b.hasOwnProperty(\\\\\"defaultValue\\\\\")){var d=b.type;if(!(\\\\\"submit\\\\\"!==d&&\\\\\"reset\\\\\"!==d||void 0!==b.value&&null!==b.value))return;b=\\\\\"\\\\\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b;}c=a.name;\\\\\"\\\\\"!==c&&(a.name=\\\\\"\\\\\");a.defaultChecked=!!a._wrapperState.initialChecked;\\\\\"\\\\\"!==c&&(a.name=c);}\nfunction bb(a,b,c){if(\\\\\"number\\\\\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\\\\\"\\\\\"+a._wrapperState.initialValue:a.defaultValue!==\\\\\"\\\\\"+c&&(a.defaultValue=\\\\\"\\\\\"+c);}function db(a){var b=\\\\\"\\\\\";react.Children.forEach(a,function(a){null!=a&&(b+=a);});return b}function eb(a,b){a=objectAssign({children:void 0},b);if(b=db(b.children))a.children=b;return a}\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b[\\\\\"$\\\\\"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty(\\\\\"$\\\\\"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0);}else {c=\\\\\"\\\\\"+Sa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e]);}null!==b&&(b.selected=!0);}}\nfunction gb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(y(91));return objectAssign({},b,{value:void 0,defaultValue:void 0,children:\\\\\"\\\\\"+a._wrapperState.initialValue})}function hb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(y(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(y(93));c=c[0];}b=c;}null==b&&(b=\\\\\"\\\\\");c=b;}a._wrapperState={initialValue:Sa(c)};}\nfunction ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=\\\\\"\\\\\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\\\\\"\\\\\"+d);}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\\\\\"\\\\\"!==b&&null!==b&&(a.value=b);}var kb={html:\\\\\"http://www.w3.org/1999/xhtml\\\\\",mathml:\\\\\"http://www.w3.org/1998/Math/MathML\\\\\",svg:\\\\\"http://www.w3.org/2000/svg\\\\\"};\nfunction lb(a){switch(a){case \\\\\"svg\\\\\":return \\\\\"http://www.w3.org/2000/svg\\\\\";case \\\\\"math\\\\\":return \\\\\"http://www.w3.org/1998/Math/MathML\\\\\";default:return \\\\\"http://www.w3.org/1999/xhtml\\\\\"}}function mb(a,b){return null==a||\\\\\"http://www.w3.org/1999/xhtml\\\\\"===a?lb(b):\\\\\"http://www.w3.org/2000/svg\\\\\"===a&&\\\\\"foreignObject\\\\\"===b?\\\\\"http://www.w3.org/1999/xhtml\\\\\":a}\nvar nb,ob=function(a){return \\\\\"undefined\\\\\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==kb.svg||\\\\\"innerHTML\\\\\"in a)a.innerHTML=b;else {nb=nb||document.createElement(\\\\\"div\\\\\");nb.innerHTML=\\\\\"<svg>\\\\\"+b.valueOf().toString()+\\\\\"</svg>\\\\\";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}});\nfunction pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;}\nvar qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=[\\\\\"Webkit\\\\\",\\\\\"ms\\\\\",\\\\\"Moz\\\\\",\\\\\"O\\\\\"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a];});});function sb(a,b,c){return null==b||\\\\\"boolean\\\\\"===typeof b||\\\\\"\\\\\"===b?\\\\\"\\\\\":c||\\\\\"number\\\\\"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(\\\\\"\\\\\"+b).trim():b+\\\\\"px\\\\\"}\nfunction tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\\\\\"--\\\\\"),e=sb(c,b[c],d);\\\\\"float\\\\\"===c&&(c=\\\\\"cssFloat\\\\\");d?a.setProperty(c,e):a[c]=e;}}var ub=objectAssign({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!(\\\\\"object\\\\\"===typeof b.dangerouslySetInnerHTML&&\\\\\"__html\\\\\"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&\\\\\"object\\\\\"!==typeof b.style)throw Error(y(62));}}\nfunction wb(a,b){if(-1===a.indexOf(\\\\\"-\\\\\"))return \\\\\"string\\\\\"===typeof b.is;switch(a){case \\\\\"annotation-xml\\\\\":case \\\\\"color-profile\\\\\":case \\\\\"font-face\\\\\":case \\\\\"font-face-src\\\\\":case \\\\\"font-face-uri\\\\\":case \\\\\"font-face-format\\\\\":case \\\\\"font-face-name\\\\\":case \\\\\"missing-glyph\\\\\":return !1;default:return !0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\\\\\"function\\\\\"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b));}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a;}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a<b.length;a++)Bb(b[a]);}}function Gb(a,b){return a(b)}function Hb(a,b,c,d,e){return a(b,c,d,e)}function Ib(){}var Jb=Gb,Kb=!1,Lb=!1;function Mb(){if(null!==zb||null!==Ab)Ib(),Fb();}\nfunction Nb(a,b,c){if(Lb)return a(b,c);Lb=!0;try{return Jb(a,b,c)}finally{Lb=!1,Mb();}}\nfunction Ob(a,b){var c=a.stateNode;if(null===c)return null;var d=Db(c);if(null===d)return null;c=d[b];a:switch(b){case \\\\\"onClick\\\\\":case \\\\\"onClickCapture\\\\\":case \\\\\"onDoubleClick\\\\\":case \\\\\"onDoubleClickCapture\\\\\":case \\\\\"onMouseDown\\\\\":case \\\\\"onMouseDownCapture\\\\\":case \\\\\"onMouseMove\\\\\":case \\\\\"onMouseMoveCapture\\\\\":case \\\\\"onMouseUp\\\\\":case \\\\\"onMouseUpCapture\\\\\":case \\\\\"onMouseEnter\\\\\":(d=!d.disabled)||(a=a.type,d=!(\\\\\"button\\\\\"===a||\\\\\"input\\\\\"===a||\\\\\"select\\\\\"===a||\\\\\"textarea\\\\\"===a));a=!d;break a;default:a=!1;}if(a)return null;if(c&&\\\\\"function\\\\\"!==\ntypeof c)throw Error(y(231,b,typeof c));return c}var Pb=!1;if(fa)try{var Qb={};Object.defineProperty(Qb,\\\\\"passive\\\\\",{get:function(){Pb=!0;}});window.addEventListener(\\\\\"test\\\\\",Qb,Qb);window.removeEventListener(\\\\\"test\\\\\",Qb,Qb);}catch(a){Pb=!1;}function Rb(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l);}catch(n){this.onError(n);}}var Sb=!1,Tb=null,Ub=!1,Vb=null,Wb={onError:function(a){Sb=!0;Tb=a;}};function Xb(a,b,c,d,e,f,g,h,k){Sb=!1;Tb=null;Rb.apply(Wb,arguments);}\nfunction Yb(a,b,c,d,e,f,g,h,k){Xb.apply(this,arguments);if(Sb){if(Sb){var l=Tb;Sb=!1;Tb=null;}else throw Error(y(198));Ub||(Ub=!0,Vb=l);}}function Zb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else {a=b;do b=a,0!==(b.flags&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function $b(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function ac(a){if(Zb(a)!==a)throw Error(y(188));}\nfunction bc(a){var b=a.alternate;if(!b){b=Zb(a);if(null===b)throw Error(y(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return ac(e),a;if(f===d)return ac(e),b;f=f.sibling;}throw Error(y(188));}if(c.return!==d.return)c=e,d=f;else {for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling;}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling;}if(!g)throw Error(y(189));}}if(c.alternate!==d)throw Error(y(190));}if(3!==c.tag)throw Error(y(188));return c.stateNode.current===c?a:b}function cc(a){a=bc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else {if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}}return null}\nfunction dc(a,b){for(var c=a.alternate;null!==b;){if(b===a||b===c)return !0;b=b.return;}return !1}var ec,fc,gc,hc,ic=!1,jc=[],kc=null,lc=null,mc=null,nc=new Map,oc=new Map,pc=[],qc=\\\\\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit\\\\\".split(\\\\\" \\\\\");\nfunction rc(a,b,c,d,e){return {blockedOn:a,domEventName:b,eventSystemFlags:c|16,nativeEvent:e,targetContainers:[d]}}function sc(a,b){switch(a){case \\\\\"focusin\\\\\":case \\\\\"focusout\\\\\":kc=null;break;case \\\\\"dragenter\\\\\":case \\\\\"dragleave\\\\\":lc=null;break;case \\\\\"mouseover\\\\\":case \\\\\"mouseout\\\\\":mc=null;break;case \\\\\"pointerover\\\\\":case \\\\\"pointerout\\\\\":nc.delete(b.pointerId);break;case \\\\\"gotpointercapture\\\\\":case \\\\\"lostpointercapture\\\\\":oc.delete(b.pointerId);}}\nfunction tc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a=rc(b,c,d,e,f),null!==b&&(b=Cb(b),null!==b&&fc(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}\nfunction uc(a,b,c,d,e){switch(b){case \\\\\"focusin\\\\\":return kc=tc(kc,a,b,c,d,e),!0;case \\\\\"dragenter\\\\\":return lc=tc(lc,a,b,c,d,e),!0;case \\\\\"mouseover\\\\\":return mc=tc(mc,a,b,c,d,e),!0;case \\\\\"pointerover\\\\\":var f=e.pointerId;nc.set(f,tc(nc.get(f)||null,a,b,c,d,e));return !0;case \\\\\"gotpointercapture\\\\\":return f=e.pointerId,oc.set(f,tc(oc.get(f)||null,a,b,c,d,e)),!0}return !1}\nfunction vc(a){var b=wc(a.target);if(null!==b){var c=Zb(b);if(null!==c)if(b=c.tag,13===b){if(b=$b(c),null!==b){a.blockedOn=b;hc(a.lanePriority,function(){scheduler.unstable_runWithPriority(a.priority,function(){gc(c);});});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null;}\nfunction xc(a){if(null!==a.blockedOn)return !1;for(var b=a.targetContainers;0<b.length;){var c=yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c)return b=Cb(c),null!==b&&fc(b),a.blockedOn=c,!1;b.shift();}return !0}function zc(a,b,c){xc(a)&&c.delete(b);}\nfunction Ac(){for(ic=!1;0<jc.length;){var a=jc[0];if(null!==a.blockedOn){a=Cb(a.blockedOn);null!==a&&ec(a);break}for(var b=a.targetContainers;0<b.length;){var c=yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c){a.blockedOn=c;break}b.shift();}null===a.blockedOn&&jc.shift();}null!==kc&&xc(kc)&&(kc=null);null!==lc&&xc(lc)&&(lc=null);null!==mc&&xc(mc)&&(mc=null);nc.forEach(zc);oc.forEach(zc);}\nfunction Bc(a,b){a.blockedOn===b&&(a.blockedOn=null,ic||(ic=!0,scheduler.unstable_scheduleCallback(scheduler.unstable_NormalPriority,Ac)));}\nfunction Cc(a){function b(b){return Bc(b,a)}if(0<jc.length){Bc(jc[0],a);for(var c=1;c<jc.length;c++){var d=jc[c];d.blockedOn===a&&(d.blockedOn=null);}}null!==kc&&Bc(kc,a);null!==lc&&Bc(lc,a);null!==mc&&Bc(mc,a);nc.forEach(b);oc.forEach(b);for(c=0;c<pc.length;c++)d=pc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<pc.length&&(c=pc[0],null===c.blockedOn);)vc(c),null===c.blockedOn&&pc.shift();}\nfunction Dc(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\\\\\"Webkit\\\\\"+a]=\\\\\"webkit\\\\\"+b;c[\\\\\"Moz\\\\\"+a]=\\\\\"moz\\\\\"+b;return c}var Ec={animationend:Dc(\\\\\"Animation\\\\\",\\\\\"AnimationEnd\\\\\"),animationiteration:Dc(\\\\\"Animation\\\\\",\\\\\"AnimationIteration\\\\\"),animationstart:Dc(\\\\\"Animation\\\\\",\\\\\"AnimationStart\\\\\"),transitionend:Dc(\\\\\"Transition\\\\\",\\\\\"TransitionEnd\\\\\")},Fc={},Gc={};\nfa&&(Gc=document.createElement(\\\\\"div\\\\\").style,\\\\\"AnimationEvent\\\\\"in window||(delete Ec.animationend.animation,delete Ec.animationiteration.animation,delete Ec.animationstart.animation),\\\\\"TransitionEvent\\\\\"in window||delete Ec.transitionend.transition);function Hc(a){if(Fc[a])return Fc[a];if(!Ec[a])return a;var b=Ec[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Gc)return Fc[a]=b[c];return a}\nvar Ic=Hc(\\\\\"animationend\\\\\"),Jc=Hc(\\\\\"animationiteration\\\\\"),Kc=Hc(\\\\\"animationstart\\\\\"),Lc=Hc(\\\\\"transitionend\\\\\"),Mc=new Map,Nc=new Map,Oc=[\\\\\"abort\\\\\",\\\\\"abort\\\\\",Ic,\\\\\"animationEnd\\\\\",Jc,\\\\\"animationIteration\\\\\",Kc,\\\\\"animationStart\\\\\",\\\\\"canplay\\\\\",\\\\\"canPlay\\\\\",\\\\\"canplaythrough\\\\\",\\\\\"canPlayThrough\\\\\",\\\\\"durationchange\\\\\",\\\\\"durationChange\\\\\",\\\\\"emptied\\\\\",\\\\\"emptied\\\\\",\\\\\"encrypted\\\\\",\\\\\"encrypted\\\\\",\\\\\"ended\\\\\",\\\\\"ended\\\\\",\\\\\"error\\\\\",\\\\\"error\\\\\",\\\\\"gotpointercapture\\\\\",\\\\\"gotPointerCapture\\\\\",\\\\\"load\\\\\",\\\\\"load\\\\\",\\\\\"loadeddata\\\\\",\\\\\"loadedData\\\\\",\\\\\"loadedmetadata\\\\\",\\\\\"loadedMetadata\\\\\",\\\\\"loadstart\\\\\",\\\\\"loadStart\\\\\",\n\\\\\"lostpointercapture\\\\\",\\\\\"lostPointerCapture\\\\\",\\\\\"playing\\\\\",\\\\\"playing\\\\\",\\\\\"progress\\\\\",\\\\\"progress\\\\\",\\\\\"seeking\\\\\",\\\\\"seeking\\\\\",\\\\\"stalled\\\\\",\\\\\"stalled\\\\\",\\\\\"suspend\\\\\",\\\\\"suspend\\\\\",\\\\\"timeupdate\\\\\",\\\\\"timeUpdate\\\\\",Lc,\\\\\"transitionEnd\\\\\",\\\\\"waiting\\\\\",\\\\\"waiting\\\\\"];function Pc(a,b){for(var c=0;c<a.length;c+=2){var d=a[c],e=a[c+1];e=\\\\\"on\\\\\"+(e[0].toUpperCase()+e.slice(1));Nc.set(d,b);Mc.set(d,e);da(e,[d]);}}var Qc=scheduler.unstable_now;Qc();var F=8;\nfunction Rc(a){if(0!==(1&a))return F=15,1;if(0!==(2&a))return F=14,2;if(0!==(4&a))return F=13,4;var b=24&a;if(0!==b)return F=12,b;if(0!==(a&32))return F=11,32;b=192&a;if(0!==b)return F=10,b;if(0!==(a&256))return F=9,256;b=3584&a;if(0!==b)return F=8,b;if(0!==(a&4096))return F=7,4096;b=4186112&a;if(0!==b)return F=6,b;b=62914560&a;if(0!==b)return F=5,b;if(a&67108864)return F=4,67108864;if(0!==(a&134217728))return F=3,134217728;b=805306368&a;if(0!==b)return F=2,b;if(0!==(1073741824&a))return F=1,1073741824;\nF=8;return a}function Sc(a){switch(a){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function Tc(a){switch(a){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(y(358,a));}}\nfunction Uc(a,b){var c=a.pendingLanes;if(0===c)return F=0;var d=0,e=0,f=a.expiredLanes,g=a.suspendedLanes,h=a.pingedLanes;if(0!==f)d=f,e=F=15;else if(f=c&134217727,0!==f){var k=f&~g;0!==k?(d=Rc(k),e=F):(h&=f,0!==h&&(d=Rc(h),e=F));}else f=c&~g,0!==f?(d=Rc(f),e=F):0!==h&&(d=Rc(h),e=F);if(0===d)return 0;d=31-Vc(d);d=c&((0>d?0:1<<d)<<1)-1;if(0!==b&&b!==d&&0===(b&g)){Rc(b);if(e<=F)return b;F=e;}b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-Vc(b),e=1<<c,d|=a[c],b&=~e;return d}\nfunction Wc(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function Xc(a,b){switch(a){case 15:return 1;case 14:return 2;case 12:return a=Yc(24&~b),0===a?Xc(10,b):a;case 10:return a=Yc(192&~b),0===a?Xc(8,b):a;case 8:return a=Yc(3584&~b),0===a&&(a=Yc(4186112&~b),0===a&&(a=512)),a;case 2:return b=Yc(805306368&~b),0===b&&(b=268435456),b}throw Error(y(358,a));}function Yc(a){return a&-a}function Zc(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}\nfunction $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c;}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=scheduler.unstable_UserBlockingPriority,ed=scheduler.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d);}finally{(Kb=f)||Mb();}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d));}\nfunction hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0<jc.length&&-1<qc.indexOf(a))a=rc(null,a,b,c,d),jc.push(a);else {var f=yc(a,b,c,d);if(null===f)e&&sc(a,d);else {if(e){if(-1<qc.indexOf(a)){a=rc(f,a,b,c,d);jc.push(a);return}if(uc(f,a,b,c,d))return;sc(a,d);}jd(a,b,d,null,c);}}}}\nfunction yc(a,b,c,d){var e=xb(d);e=wc(e);if(null!==e){var f=Zb(e);if(null===f)e=null;else {var g=f.tag;if(13===g){e=$b(f);if(null!==e)return e;e=null;}else if(3===g){if(f.stateNode.hydrate)return 3===f.tag?f.stateNode.containerInfo:null;e=null;}else f!==e&&(e=null);}}jd(a,b,d,e,c);return null}var kd=null,ld=null,md=null;\nfunction nd(){if(md)return md;var a,b=ld,c=b.length,d,e=\\\\\"value\\\\\"in kd?kd.value:kd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return md=e.slice(a,1<d?1-d:void 0)}function od(a){var b=a.keyCode;\\\\\"charCode\\\\\"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function pd(){return !0}function qd(){return !1}\nfunction rd(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?pd:qd;this.isPropagationStopped=qd;return this}objectAssign(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():\\\\\"unknown\\\\\"!==typeof a.returnValue&&\n(a.returnValue=!1),this.isDefaultPrevented=pd);},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():\\\\\"unknown\\\\\"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=pd);},persist:function(){},isPersistent:pd});return b}\nvar sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=objectAssign({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=objectAssign({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if(\\\\\"movementX\\\\\"in\na)return a.movementX;a!==yd&&(yd&&\\\\\"mousemove\\\\\"===a.type?(wd=a.screenX-yd.screenX,xd=a.screenY-yd.screenY):xd=wd=0,yd=a);return wd},movementY:function(a){return \\\\\"movementY\\\\\"in a?a.movementY:xd}}),Bd=rd(Ad),Cd=objectAssign({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=objectAssign({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=objectAssign({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=objectAssign({},sd,{clipboardData:function(a){return \\\\\"clipboardData\\\\\"in a?a.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=objectAssign({},sd,{data:0}),Ld=rd(Kd),Md={Esc:\\\\\"Escape\\\\\",\nSpacebar:\\\\\" \\\\\",Left:\\\\\"ArrowLeft\\\\\",Up:\\\\\"ArrowUp\\\\\",Right:\\\\\"ArrowRight\\\\\",Down:\\\\\"ArrowDown\\\\\",Del:\\\\\"Delete\\\\\",Win:\\\\\"OS\\\\\",Menu:\\\\\"ContextMenu\\\\\",Apps:\\\\\"ContextMenu\\\\\",Scroll:\\\\\"ScrollLock\\\\\",MozPrintableKey:\\\\\"Unidentified\\\\\"},Nd={8:\\\\\"Backspace\\\\\",9:\\\\\"Tab\\\\\",12:\\\\\"Clear\\\\\",13:\\\\\"Enter\\\\\",16:\\\\\"Shift\\\\\",17:\\\\\"Control\\\\\",18:\\\\\"Alt\\\\\",19:\\\\\"Pause\\\\\",20:\\\\\"CapsLock\\\\\",27:\\\\\"Escape\\\\\",32:\\\\\" \\\\\",33:\\\\\"PageUp\\\\\",34:\\\\\"PageDown\\\\\",35:\\\\\"End\\\\\",36:\\\\\"Home\\\\\",37:\\\\\"ArrowLeft\\\\\",38:\\\\\"ArrowUp\\\\\",39:\\\\\"ArrowRight\\\\\",40:\\\\\"ArrowDown\\\\\",45:\\\\\"Insert\\\\\",46:\\\\\"Delete\\\\\",112:\\\\\"F1\\\\\",113:\\\\\"F2\\\\\",114:\\\\\"F3\\\\\",115:\\\\\"F4\\\\\",116:\\\\\"F5\\\\\",117:\\\\\"F6\\\\\",118:\\\\\"F7\\\\\",\n119:\\\\\"F8\\\\\",120:\\\\\"F9\\\\\",121:\\\\\"F10\\\\\",122:\\\\\"F11\\\\\",123:\\\\\"F12\\\\\",144:\\\\\"NumLock\\\\\",145:\\\\\"ScrollLock\\\\\",224:\\\\\"Meta\\\\\"},Od={Alt:\\\\\"altKey\\\\\",Control:\\\\\"ctrlKey\\\\\",Meta:\\\\\"metaKey\\\\\",Shift:\\\\\"shiftKey\\\\\"};function Pd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Od[a])?!!b[a]:!1}function zd(){return Pd}\nvar Qd=objectAssign({},ud,{key:function(a){if(a.key){var b=Md[a.key]||a.key;if(\\\\\"Unidentified\\\\\"!==b)return b}return \\\\\"keypress\\\\\"===a.type?(a=od(a),13===a?\\\\\"Enter\\\\\":String.fromCharCode(a)):\\\\\"keydown\\\\\"===a.type||\\\\\"keyup\\\\\"===a.type?Nd[a.keyCode]||\\\\\"Unidentified\\\\\":\\\\\"\\\\\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(a){return \\\\\"keypress\\\\\"===a.type?od(a):0},keyCode:function(a){return \\\\\"keydown\\\\\"===a.type||\\\\\"keyup\\\\\"===a.type?a.keyCode:0},which:function(a){return \\\\\"keypress\\\\\"===\na.type?od(a):\\\\\"keydown\\\\\"===a.type||\\\\\"keyup\\\\\"===a.type?a.keyCode:0}}),Rd=rd(Qd),Sd=objectAssign({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=objectAssign({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=objectAssign({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=objectAssign({},Ad,{deltaX:function(a){return \\\\\"deltaX\\\\\"in a?a.deltaX:\\\\\"wheelDeltaX\\\\\"in a?-a.wheelDeltaX:0},\ndeltaY:function(a){return \\\\\"deltaY\\\\\"in a?a.deltaY:\\\\\"wheelDeltaY\\\\\"in a?-a.wheelDeltaY:\\\\\"wheelDelta\\\\\"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=fa&&\\\\\"CompositionEvent\\\\\"in window,be=null;fa&&\\\\\"documentMode\\\\\"in document&&(be=document.documentMode);var ce=fa&&\\\\\"TextEvent\\\\\"in window&&!be,de=fa&&(!ae||be&&8<be&&11>=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \\\\\"keyup\\\\\":return -1!==$d.indexOf(b.keyCode);case \\\\\"keydown\\\\\":return 229!==b.keyCode;case \\\\\"keypress\\\\\":case \\\\\"mousedown\\\\\":case \\\\\"focusout\\\\\":return !0;default:return !1}}function he(a){a=a.detail;return \\\\\"object\\\\\"===typeof a&&\\\\\"data\\\\\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \\\\\"compositionend\\\\\":return he(b);case \\\\\"keypress\\\\\":if(32!==b.which)return null;fe=!0;return ee;case \\\\\"textInput\\\\\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return \\\\\"compositionend\\\\\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \\\\\"paste\\\\\":return null;case \\\\\"keypress\\\\\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case \\\\\"compositionend\\\\\":return de&&\\\\\"ko\\\\\"!==b.locale?null:b.data;default:return null}}\nvar le={color:!0,date:!0,datetime:!0,\\\\\"datetime-local\\\\\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return \\\\\"input\\\\\"===b?!!le[a.type]:\\\\\"textarea\\\\\"===b?!0:!1}function ne(a,b,c,d){Eb(d);b=oe(b,\\\\\"onChange\\\\\");0<b.length&&(c=new td(\\\\\"onChange\\\\\",\\\\\"change\\\\\",null,c,d),a.push({event:c,listeners:b}));}var pe=null,qe=null;function re(a){se(a,0);}function te(a){var b=ue(a);if(Wa(b))return a}\nfunction ve(a,b){if(\\\\\"change\\\\\"===a)return b}var we=!1;if(fa){var xe;if(fa){var ye=\\\\\"oninput\\\\\"in document;if(!ye){var ze=document.createElement(\\\\\"div\\\\\");ze.setAttribute(\\\\\"oninput\\\\\",\\\\\"return;\\\\\");ye=\\\\\"function\\\\\"===typeof ze.oninput;}xe=ye;}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode);}function Ae(){pe&&(pe.detachEvent(\\\\\"onpropertychange\\\\\",Be),qe=pe=null);}function Be(a){if(\\\\\"value\\\\\"===a.propertyName&&te(qe)){var b=[];ne(b,qe,a,xb(a));a=re;if(Kb)a(b);else {Kb=!0;try{Gb(a,b);}finally{Kb=!1,Mb();}}}}\nfunction Ce(a,b,c){\\\\\"focusin\\\\\"===a?(Ae(),pe=b,qe=c,pe.attachEvent(\\\\\"onpropertychange\\\\\",Be)):\\\\\"focusout\\\\\"===a&&Ae();}function De(a){if(\\\\\"selectionchange\\\\\"===a||\\\\\"keyup\\\\\"===a||\\\\\"keydown\\\\\"===a)return te(qe)}function Ee(a,b){if(\\\\\"click\\\\\"===a)return te(b)}function Fe(a,b){if(\\\\\"input\\\\\"===a||\\\\\"change\\\\\"===a)return te(b)}function Ge(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var He=\\\\\"function\\\\\"===typeof Object.is?Object.is:Ge,Ie=Object.prototype.hasOwnProperty;\nfunction Je(a,b){if(He(a,b))return !0;if(\\\\\"object\\\\\"!==typeof a||null===a||\\\\\"object\\\\\"!==typeof b||null===b)return !1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return !1;for(d=0;d<c.length;d++)if(!Ie.call(b,c[d])||!He(a[c[d]],b[c[d]]))return !1;return !0}function Ke(a){for(;a&&a.firstChild;)a=a.firstChild;return a}\nfunction Le(a,b){var c=Ke(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return {node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=Ke(c);}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):\\\\\"contains\\\\\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\\\\\"string\\\\\"===typeof b.contentWindow.location.href;}catch(d){c=!1;}if(c)a=b.contentWindow;else break;b=Xa(a.document);}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\\\\\"input\\\\\"===b&&(\\\\\"text\\\\\"===a.type||\\\\\"search\\\\\"===a.type||\\\\\"tel\\\\\"===a.type||\\\\\"url\\\\\"===a.type||\\\\\"password\\\\\"===a.type)||\\\\\"textarea\\\\\"===b||\\\\\"true\\\\\"===a.contentEditable)}\nvar Pe=fa&&\\\\\"documentMode\\\\\"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\\\\\"selectionStart\\\\\"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,\\\\\"onSelect\\\\\"),0<d.length&&(b=new td(\\\\\"onSelect\\\\\",\\\\\"select\\\\\",null,b,c),a.push({event:b,listeners:d}),b.target=Qe)));}\nPc(\\\\\"cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange\\\\\".split(\\\\\" \\\\\"),\n0);Pc(\\\\\"drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel\\\\\".split(\\\\\" \\\\\"),1);Pc(Oc,2);for(var Ve=\\\\\"change selectionchange textInput compositionstart compositionend compositionupdate\\\\\".split(\\\\\" \\\\\"),We=0;We<Ve.length;We++)Nc.set(Ve[We],0);ea(\\\\\"onMouseEnter\\\\\",[\\\\\"mouseout\\\\\",\\\\\"mouseover\\\\\"]);\nea(\\\\\"onMouseLeave\\\\\",[\\\\\"mouseout\\\\\",\\\\\"mouseover\\\\\"]);ea(\\\\\"onPointerEnter\\\\\",[\\\\\"pointerout\\\\\",\\\\\"pointerover\\\\\"]);ea(\\\\\"onPointerLeave\\\\\",[\\\\\"pointerout\\\\\",\\\\\"pointerover\\\\\"]);da(\\\\\"onChange\\\\\",\\\\\"change click focusin focusout input keydown keyup selectionchange\\\\\".split(\\\\\" \\\\\"));da(\\\\\"onSelect\\\\\",\\\\\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\\\\\".split(\\\\\" \\\\\"));da(\\\\\"onBeforeInput\\\\\",[\\\\\"compositionend\\\\\",\\\\\"keypress\\\\\",\\\\\"textInput\\\\\",\\\\\"paste\\\\\"]);da(\\\\\"onCompositionEnd\\\\\",\\\\\"compositionend focusout keydown keypress keyup mousedown\\\\\".split(\\\\\" \\\\\"));\nda(\\\\\"onCompositionStart\\\\\",\\\\\"compositionstart focusout keydown keypress keyup mousedown\\\\\".split(\\\\\" \\\\\"));da(\\\\\"onCompositionUpdate\\\\\",\\\\\"compositionupdate focusout keydown keypress keyup mousedown\\\\\".split(\\\\\" \\\\\"));var Xe=\\\\\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\\\\\".split(\\\\\" \\\\\"),Ye=new Set(\\\\\"cancel close invalid load scroll toggle\\\\\".split(\\\\\" \\\\\").concat(Xe));\nfunction Ze(a,b,c){var d=a.type||\\\\\"unknown-event\\\\\";a.currentTarget=c;Yb(d,b,void 0,a);a.currentTarget=null;}\nfunction se(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;Ze(e,h,l);f=k;}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;Ze(e,h,l);f=k;}}}if(Ub)throw a=Vb,Ub=!1,Vb=null,a;}\nfunction G(a,b){var c=$e(b),d=a+\\\\\"__bubble\\\\\";c.has(d)||(af(b,a,2,!1),c.add(d));}var bf=\\\\\"_reactListening\\\\\"+Math.random().toString(36).slice(2);function cf(a){a[bf]||(a[bf]=!0,ba.forEach(function(b){Ye.has(b)||df(b,!1,a,null);df(b,!0,a,null);}));}\nfunction df(a,b,c,d){var e=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,f=c;\\\\\"selectionchange\\\\\"===a&&9!==c.nodeType&&(f=c.ownerDocument);if(null!==d&&!b&&Ye.has(a)){if(\\\\\"scroll\\\\\"!==a)return;e|=2;f=d;}var g=$e(f),h=a+\\\\\"__\\\\\"+(b?\\\\\"capture\\\\\":\\\\\"bubble\\\\\");g.has(h)||(b&&(e|=4),af(f,a,e,b),g.add(h));}\nfunction af(a,b,c,d){var e=Nc.get(b);switch(void 0===e?2:e){case 0:e=gd;break;case 1:e=id;break;default:e=hd;}c=e.bind(null,b,c,a);e=void 0;!Pb||\\\\\"touchstart\\\\\"!==b&&\\\\\"touchmove\\\\\"!==b&&\\\\\"wheel\\\\\"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1);}\nfunction jd(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return;}for(;null!==h;){g=wc(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode;}}d=d.return;}Nb(function(){var d=f,e=xb(c),g=[];\na:{var h=Mc.get(a);if(void 0!==h){var k=td,x=a;switch(a){case \\\\\"keypress\\\\\":if(0===od(c))break a;case \\\\\"keydown\\\\\":case \\\\\"keyup\\\\\":k=Rd;break;case \\\\\"focusin\\\\\":x=\\\\\"focus\\\\\";k=Fd;break;case \\\\\"focusout\\\\\":x=\\\\\"blur\\\\\";k=Fd;break;case \\\\\"beforeblur\\\\\":case \\\\\"afterblur\\\\\":k=Fd;break;case \\\\\"click\\\\\":if(2===c.button)break a;case \\\\\"auxclick\\\\\":case \\\\\"dblclick\\\\\":case \\\\\"mousedown\\\\\":case \\\\\"mousemove\\\\\":case \\\\\"mouseup\\\\\":case \\\\\"mouseout\\\\\":case \\\\\"mouseover\\\\\":case \\\\\"contextmenu\\\\\":k=Bd;break;case \\\\\"drag\\\\\":case \\\\\"dragend\\\\\":case \\\\\"dragenter\\\\\":case \\\\\"dragexit\\\\\":case \\\\\"dragleave\\\\\":case \\\\\"dragover\\\\\":case \\\\\"dragstart\\\\\":case \\\\\"drop\\\\\":k=\nDd;break;case \\\\\"touchcancel\\\\\":case \\\\\"touchend\\\\\":case \\\\\"touchmove\\\\\":case \\\\\"touchstart\\\\\":k=Vd;break;case Ic:case Jc:case Kc:k=Hd;break;case Lc:k=Xd;break;case \\\\\"scroll\\\\\":k=vd;break;case \\\\\"wheel\\\\\":k=Zd;break;case \\\\\"copy\\\\\":case \\\\\"cut\\\\\":case \\\\\"paste\\\\\":k=Jd;break;case \\\\\"gotpointercapture\\\\\":case \\\\\"lostpointercapture\\\\\":case \\\\\"pointercancel\\\\\":case \\\\\"pointerdown\\\\\":case \\\\\"pointermove\\\\\":case \\\\\"pointerout\\\\\":case \\\\\"pointerover\\\\\":case \\\\\"pointerup\\\\\":k=Td;}var w=0!==(b&4),z=!w&&\\\\\"scroll\\\\\"===a,u=w?null!==h?h+\\\\\"Capture\\\\\":null:h;w=[];for(var t=d,q;null!==\nt;){q=t;var v=q.stateNode;5===q.tag&&null!==v&&(q=v,null!==u&&(v=Ob(t,u),null!=v&&w.push(ef(t,v,q))));if(z)break;t=t.return;}0<w.length&&(h=new k(h,x,null,c,e),g.push({event:h,listeners:w}));}}if(0===(b&7)){a:{h=\\\\\"mouseover\\\\\"===a||\\\\\"pointerover\\\\\"===a;k=\\\\\"mouseout\\\\\"===a||\\\\\"pointerout\\\\\"===a;if(h&&0===(b&16)&&(x=c.relatedTarget||c.fromElement)&&(wc(x)||x[ff]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(x=c.relatedTarget||c.toElement,k=d,x=x?wc(x):null,null!==\nx&&(z=Zb(x),x!==z||5!==x.tag&&6!==x.tag))x=null;}else k=null,x=d;if(k!==x){w=Bd;v=\\\\\"onMouseLeave\\\\\";u=\\\\\"onMouseEnter\\\\\";t=\\\\\"mouse\\\\\";if(\\\\\"pointerout\\\\\"===a||\\\\\"pointerover\\\\\"===a)w=Td,v=\\\\\"onPointerLeave\\\\\",u=\\\\\"onPointerEnter\\\\\",t=\\\\\"pointer\\\\\";z=null==k?h:ue(k);q=null==x?h:ue(x);h=new w(v,t+\\\\\"leave\\\\\",k,c,e);h.target=z;h.relatedTarget=q;v=null;wc(e)===d&&(w=new w(u,t+\\\\\"enter\\\\\",x,c,e),w.target=q,w.relatedTarget=z,v=w);z=v;if(k&&x)b:{w=k;u=x;t=0;for(q=w;q;q=gf(q))t++;q=0;for(v=u;v;v=gf(v))q++;for(;0<t-q;)w=gf(w),t--;for(;0<q-t;)u=\ngf(u),q--;for(;t--;){if(w===u||null!==u&&w===u.alternate)break b;w=gf(w);u=gf(u);}w=null;}else w=null;null!==k&&hf(g,h,k,w,!1);null!==x&&null!==z&&hf(g,z,x,w,!0);}}}a:{h=d?ue(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if(\\\\\"select\\\\\"===k||\\\\\"input\\\\\"===k&&\\\\\"file\\\\\"===h.type)var J=ve;else if(me(h))if(we)J=Fe;else {J=De;var K=Ce;}else (k=h.nodeName)&&\\\\\"input\\\\\"===k.toLowerCase()&&(\\\\\"checkbox\\\\\"===h.type||\\\\\"radio\\\\\"===h.type)&&(J=Ee);if(J&&(J=J(a,d))){ne(g,J,c,e);break a}K&&K(a,h,d);\\\\\"focusout\\\\\"===a&&(K=h._wrapperState)&&\nK.controlled&&\\\\\"number\\\\\"===h.type&&bb(h,\\\\\"number\\\\\",h.value);}K=d?ue(d):window;switch(a){case \\\\\"focusin\\\\\":if(me(K)||\\\\\"true\\\\\"===K.contentEditable)Qe=K,Re=d,Se=null;break;case \\\\\"focusout\\\\\":Se=Re=Qe=null;break;case \\\\\"mousedown\\\\\":Te=!0;break;case \\\\\"contextmenu\\\\\":case \\\\\"mouseup\\\\\":case \\\\\"dragend\\\\\":Te=!1;Ue(g,c,e);break;case \\\\\"selectionchange\\\\\":if(Pe)break;case \\\\\"keydown\\\\\":case \\\\\"keyup\\\\\":Ue(g,c,e);}var Q;if(ae)b:{switch(a){case \\\\\"compositionstart\\\\\":var L=\\\\\"onCompositionStart\\\\\";break b;case \\\\\"compositionend\\\\\":L=\\\\\"onCompositionEnd\\\\\";break b;\ncase \\\\\"compositionupdate\\\\\":L=\\\\\"onCompositionUpdate\\\\\";break b}L=void 0;}else ie?ge(a,c)&&(L=\\\\\"onCompositionEnd\\\\\"):\\\\\"keydown\\\\\"===a&&229===c.keyCode&&(L=\\\\\"onCompositionStart\\\\\");L&&(de&&\\\\\"ko\\\\\"!==c.locale&&(ie||\\\\\"onCompositionStart\\\\\"!==L?\\\\\"onCompositionEnd\\\\\"===L&&ie&&(Q=nd()):(kd=e,ld=\\\\\"value\\\\\"in kd?kd.value:kd.textContent,ie=!0)),K=oe(d,L),0<K.length&&(L=new Ld(L,a,null,c,e),g.push({event:L,listeners:K}),Q?L.data=Q:(Q=he(c),null!==Q&&(L.data=Q))));if(Q=ce?je(a,c):ke(a,c))d=oe(d,\\\\\"onBeforeInput\\\\\"),0<d.length&&(e=new Ld(\\\\\"onBeforeInput\\\\\",\n\\\\\"beforeinput\\\\\",null,c,e),g.push({event:e,listeners:d}),e.data=Q);}se(g,b);});}function ef(a,b,c){return {instance:a,listener:b,currentTarget:c}}function oe(a,b){for(var c=b+\\\\\"Capture\\\\\",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Ob(a,c),null!=f&&d.unshift(ef(a,f,e)),f=Ob(a,b),null!=f&&d.push(ef(a,f,e)));a=a.return;}return d}function gf(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction hf(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,l=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==l&&(h=l,e?(k=Ob(c,f),null!=k&&g.unshift(ef(c,k,h))):e||(k=Ob(c,f),null!=k&&g.push(ef(c,k,h))));c=c.return;}0!==g.length&&a.push({event:b,listeners:g});}function jf(){}var kf=null,lf=null;function mf(a,b){switch(a){case \\\\\"button\\\\\":case \\\\\"input\\\\\":case \\\\\"select\\\\\":case \\\\\"textarea\\\\\":return !!b.autoFocus}return !1}\nfunction nf(a,b){return \\\\\"textarea\\\\\"===a||\\\\\"option\\\\\"===a||\\\\\"noscript\\\\\"===a||\\\\\"string\\\\\"===typeof b.children||\\\\\"number\\\\\"===typeof b.children||\\\\\"object\\\\\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var of=\\\\\"function\\\\\"===typeof setTimeout?setTimeout:void 0,pf=\\\\\"function\\\\\"===typeof clearTimeout?clearTimeout:void 0;function qf(a){1===a.nodeType?a.textContent=\\\\\"\\\\\":9===a.nodeType&&(a=a.body,null!=a&&(a.textContent=\\\\\"\\\\\"));}\nfunction rf(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}function sf(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(\\\\\"$\\\\\"===c||\\\\\"$!\\\\\"===c||\\\\\"$?\\\\\"===c){if(0===b)return a;b--;}else \\\\\"/$\\\\\"===c&&b++;}a=a.previousSibling;}return null}var tf=0;function uf(a){return {$$typeof:Ga,toString:a,valueOf:a}}var vf=Math.random().toString(36).slice(2),wf=\\\\\"__reactFiber$\\\\\"+vf,xf=\\\\\"__reactProps$\\\\\"+vf,ff=\\\\\"__reactContainer$\\\\\"+vf,yf=\\\\\"__reactEvents$\\\\\"+vf;\nfunction wc(a){var b=a[wf];if(b)return b;for(var c=a.parentNode;c;){if(b=c[ff]||c[wf]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=sf(a);null!==a;){if(c=a[wf])return c;a=sf(a);}return b}a=c;c=a.parentNode;}return null}function Cb(a){a=a[wf]||a[ff];return !a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function ue(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(y(33));}function Db(a){return a[xf]||null}\nfunction $e(a){var b=a[yf];void 0===b&&(b=a[yf]=new Set);return b}var zf=[],Af=-1;function Bf(a){return {current:a}}function H(a){0>Af||(a.current=zf[Af],zf[Af]=null,Af--);}function I(a,b){Af++;zf[Af]=a.current;a.current=b;}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf;\nfunction Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M);}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c);}\nfunction If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\\\\\"function\\\\\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||\\\\\"Unknown\\\\\",e));return objectAssign({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return !0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c);}\nvar Lf=null,Mf=null,Nf=scheduler.unstable_runWithPriority,Of=scheduler.unstable_scheduleCallback,Pf=scheduler.unstable_cancelCallback,Qf=scheduler.unstable_shouldYield,Rf=scheduler.unstable_requestPaint,Sf=scheduler.unstable_now,Tf=scheduler.unstable_getCurrentPriorityLevel,Uf=scheduler.unstable_ImmediatePriority,Vf=scheduler.unstable_UserBlockingPriority,Wf=scheduler.unstable_NormalPriority,Xf=scheduler.unstable_LowPriority,Yf=scheduler.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg};\nfunction eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a);}jg();}\nfunction jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});ag=null;}catch(c){throw null!==ag&&(ag=ag.slice(a+1)),Of(Uf,ig),c;}finally{cg=!1;}}}var kg=ra.ReactCurrentBatchConfig;function lg(a,b){if(a&&a.defaultProps){b=objectAssign({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}var mg=Bf(null),ng=null,og=null,pg=null;function qg(){pg=og=ng=null;}\nfunction rg(a){var b=mg.current;H(mg);a.type._context._currentValue=b;}function sg(a,b){for(;null!==a;){var c=a.alternate;if((a.childLanes&b)===b)if(null===c||(c.childLanes&b)===b)break;else c.childLanes|=b;else a.childLanes|=b,null!==c&&(c.childLanes|=b);a=a.return;}}function tg(a,b){ng=a;pg=og=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(ug=!0),a.firstContext=null);}\nfunction vg(a,b){if(pg!==a&&!1!==b&&0!==b){if(\\\\\"number\\\\\"!==typeof b||1073741823===b)pg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===og){if(null===ng)throw Error(y(308));og=b;ng.dependencies={lanes:0,firstContext:b,responders:null};}else og=og.next=b;}return a._currentValue}var wg=!1;function xg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null};}\nfunction yg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects});}function zg(a,b){return {eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}function Ag(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b;}}\nfunction Bg(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next;}while(null!==c);null===f?e=f=b:f=f.next=b;}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b;}\nfunction Cg(a,b,c,d){var e=a.updateQueue;wg=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var n=a.alternate;if(null!==n){n=n.updateQueue;var A=n.lastBaseUpdate;A!==g&&(null===A?n.firstBaseUpdate=l:A.next=l,n.lastBaseUpdate=k);}}if(null!==f){A=e.baseState;g=0;n=l=k=null;do{h=f.lane;var p=f.eventTime;if((d&h)===h){null!==n&&(n=n.next={eventTime:p,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,\nnext:null});a:{var C=a,x=f;h=b;p=c;switch(x.tag){case 1:C=x.payload;if(\\\\\"function\\\\\"===typeof C){A=C.call(p,A,h);break a}A=C;break a;case 3:C.flags=C.flags&-4097|64;case 0:C=x.payload;h=\\\\\"function\\\\\"===typeof C?C.call(p,A,h):C;if(null===h||void 0===h)break a;A=objectAssign({},A,h);break a;case 2:wg=!0;}}null!==f.callback&&(a.flags|=32,h=e.effects,null===h?e.effects=[f]:h.push(f));}else p={eventTime:p,lane:h,tag:f.tag,payload:f.payload,callback:f.callback,next:null},null===n?(l=n=p,k=A):n=n.next=p,g|=h;f=f.next;if(null===\nf)if(h=e.shared.pending,null===h)break;else f=h.next,h.next=null,e.lastBaseUpdate=h,e.shared.pending=null;}while(1);null===n&&(k=A);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=n;Dg|=g;a.lanes=g;a.memoizedState=A;}}function Eg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if(\\\\\"function\\\\\"!==typeof e)throw Error(y(191,e));e.call(d);}}}var Fg=(new react.Component).refs;\nfunction Gg(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:objectAssign({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c);}\nvar Kg={isMounted:function(a){return (a=a._reactInternals)?Zb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=Hg(),e=Ig(a),f=zg(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ag(a,f);Jg(a,e,d);},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=Hg(),e=Ig(a),f=zg(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ag(a,f);Jg(a,e,d);},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=Hg(),d=Ig(a),e=zg(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=\nb);Ag(a,e);Jg(a,d,c);}};function Lg(a,b,c,d,e,f,g){a=a.stateNode;return \\\\\"function\\\\\"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Je(c,d)||!Je(e,f):!0}\nfunction Mg(a,b,c){var d=!1,e=Cf;var f=b.contextType;\\\\\"object\\\\\"===typeof f&&null!==f?f=vg(f):(e=Ff(b)?Df:M.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Ef(a,e):Cf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Kg;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}\nfunction Ng(a,b,c,d){a=b.state;\\\\\"function\\\\\"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);\\\\\"function\\\\\"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Kg.enqueueReplaceState(b,b.state,null);}\nfunction Og(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Fg;xg(a);var f=b.contextType;\\\\\"object\\\\\"===typeof f&&null!==f?e.context=vg(f):(f=Ff(b)?Df:M.current,e.context=Ef(a,f));Cg(a,c,e,d);e.state=a.memoizedState;f=b.getDerivedStateFromProps;\\\\\"function\\\\\"===typeof f&&(Gg(a,b,f,c),e.state=a.memoizedState);\\\\\"function\\\\\"===typeof b.getDerivedStateFromProps||\\\\\"function\\\\\"===typeof e.getSnapshotBeforeUpdate||\\\\\"function\\\\\"!==typeof e.UNSAFE_componentWillMount&&\\\\\"function\\\\\"!==typeof e.componentWillMount||\n(b=e.state,\\\\\"function\\\\\"===typeof e.componentWillMount&&e.componentWillMount(),\\\\\"function\\\\\"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Kg.enqueueReplaceState(e,e.state,null),Cg(a,c,e,d),e.state=a.memoizedState);\\\\\"function\\\\\"===typeof e.componentDidMount&&(a.flags|=4);}var Pg=Array.isArray;\nfunction Qg(a,b,c){a=c.ref;if(null!==a&&\\\\\"function\\\\\"!==typeof a&&\\\\\"object\\\\\"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(y(309));var d=c.stateNode;}if(!d)throw Error(y(147,a));var e=\\\\\"\\\\\"+a;if(null!==b&&null!==b.ref&&\\\\\"function\\\\\"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Fg&&(b=d.refs={});null===a?delete b[e]:b[e]=a;};b._stringRef=e;return b}if(\\\\\"string\\\\\"!==typeof a)throw Error(y(284));if(!c._owner)throw Error(y(290,a));}return a}\nfunction Rg(a,b){if(\\\\\"textarea\\\\\"!==a.type)throw Error(y(31,\\\\\"[object Object]\\\\\"===Object.prototype.toString.call(b)?\\\\\"object with keys {\\\\\"+Object.keys(b).join(\\\\\", \\\\\")+\\\\\"}\\\\\":b));}\nfunction Sg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.flags=8;}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Tg(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags=2,\nc):d;b.flags=2;return c}function g(b){a&&null===b.alternate&&(b.flags=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Ug(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props),d.ref=Qg(a,b,c),d.return=a,d;d=Vg(c.type,c.key,c.props,null,a.mode,d);d.ref=Qg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=\nWg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function n(a,b,c,d,f){if(null===b||7!==b.tag)return b=Xg(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function A(a,b,c){if(\\\\\"string\\\\\"===typeof b||\\\\\"number\\\\\"===typeof b)return b=Ug(\\\\\"\\\\\"+b,a.mode,c),b.return=a,b;if(\\\\\"object\\\\\"===typeof b&&null!==b){switch(b.$$typeof){case sa:return c=Vg(b.type,b.key,b.props,null,a.mode,c),c.ref=Qg(a,null,b),c.return=a,c;case ta:return b=Wg(b,a.mode,c),b.return=a,b}if(Pg(b)||La(b))return b=Xg(b,\na.mode,c,null),b.return=a,b;Rg(a,b);}return null}function p(a,b,c,d){var e=null!==b?b.key:null;if(\\\\\"string\\\\\"===typeof c||\\\\\"number\\\\\"===typeof c)return null!==e?null:h(a,b,\\\\\"\\\\\"+c,d);if(\\\\\"object\\\\\"===typeof c&&null!==c){switch(c.$$typeof){case sa:return c.key===e?c.type===ua?n(a,b,c.props.children,d,e):k(a,b,c,d):null;case ta:return c.key===e?l(a,b,c,d):null}if(Pg(c)||La(c))return null!==e?null:n(a,b,c,d,null);Rg(a,c);}return null}function C(a,b,c,d,e){if(\\\\\"string\\\\\"===typeof d||\\\\\"number\\\\\"===typeof d)return a=a.get(c)||\nnull,h(b,a,\\\\\"\\\\\"+d,e);if(\\\\\"object\\\\\"===typeof d&&null!==d){switch(d.$$typeof){case sa:return a=a.get(null===d.key?c:d.key)||null,d.type===ua?n(b,a,d.props.children,e,d.key):k(b,a,d,e);case ta:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(Pg(d)||La(d))return a=a.get(c)||null,n(b,a,d,e,null);Rg(b,d);}return null}function x(e,g,h,k){for(var l=null,t=null,u=g,z=g=0,q=null;null!==u&&z<h.length;z++){u.index>z?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null===\nn.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q;}if(z===h.length)return c(e,u),l;if(null===u){for(;z<h.length;z++)u=A(e,h[z],k),null!==u&&(g=f(u,g,z),null===t?l=u:t.sibling=u,t=u);return l}for(u=d(e,u);z<h.length;z++)q=C(u,e,z,h[z],k),null!==q&&(a&&null!==q.alternate&&u.delete(null===q.key?z:q.key),g=f(q,g,z),null===t?l=q:t.sibling=q,t=q);a&&u.forEach(function(a){return b(e,a)});return l}function w(e,g,h,k){var l=La(h);if(\\\\\"function\\\\\"!==typeof l)throw Error(y(150));h=l.call(h);if(null==\nh)throw Error(y(151));for(var t=l=null,u=g,z=g=0,q=null,n=h.next();null!==u&&!n.done;z++,n=h.next()){u.index>z?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q;}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&&\nu.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\\\\\"object\\\\\"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l=\\\\\"object\\\\\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling);\nd=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling;}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h);}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else {c(a,d);break}else b(a,d);d=d.sibling;}d=\nWg(f,a.mode,h);d.return=a;a=d;}return g(a)}if(\\\\\"string\\\\\"===typeof f||\\\\\"number\\\\\"===typeof f)return f=\\\\\"\\\\\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if(\\\\\"undefined\\\\\"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||\\\\\"Component\\\\\"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g);\nfunction dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,\\\\\"\\\\\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a);}H(ah);I(ah,b);}function fh(){H(ah);H(bh);H(ch);}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c));}function hh(a){bh.current===a&&(H(ah),H(bh));}var P=Bf(0);\nfunction ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\\\\\"$?\\\\\"===c.data||\\\\\"$!\\\\\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}return null}var jh=null,kh=null,lh=!1;\nfunction mh(a,b){var c=nh(5,null,null,0);c.elementType=\\\\\"DELETED\\\\\";c.type=\\\\\"DELETED\\\\\";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c;}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\\\\\"\\\\\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return !1;default:return !1}}\nfunction ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c);}jh=a;kh=rf(b.firstChild);}else a.flags=a.flags&-1025|2,lh=!1,jh=a;}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a;}\nfunction rh(a){if(a!==jh)return !1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||\\\\\"head\\\\\"!==b&&\\\\\"body\\\\\"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(\\\\\"/$\\\\\"===c){if(0===b){kh=rf(a.nextSibling);break a}b--;}else \\\\\"$\\\\\"!==c&&\\\\\"$!\\\\\"!==c&&\\\\\"$?\\\\\"!==c||b++;}a=a.nextSibling;}kh=null;}}else kh=jh?rf(a.stateNode.nextSibling):null;return !0}\nfunction sh(){kh=jh=null;lh=!1;}var th=[];function uh(){for(var a=0;a<th.length;a++)th[a]._workInProgressVersionPrimary=null;th.length=0;}var vh=ra.ReactCurrentDispatcher,wh=ra.ReactCurrentBatchConfig,xh=0,R=null,S=null,T=null,yh=!1,zh=!1;function Ah(){throw Error(y(321));}function Bh(a,b){if(null===b)return !1;for(var c=0;c<b.length&&c<a.length;c++)if(!He(a[c],b[c]))return !1;return !0}\nfunction Ch(a,b,c,d,e,f){xh=f;R=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;vh.current=null===a||null===a.memoizedState?Dh:Eh;a=c(d,e);if(zh){f=0;do{zh=!1;if(!(25>f))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e);}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T}\nfunction Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null;}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else {if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a;}return T}function Jh(a,b){return \\\\\"function\\\\\"===typeof b?b(a):b}\nfunction Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g;}d.baseQueue=e=f;c.pending=null;}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else {var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,\neagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l;}k=k.next;}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d;}return [b.memoizedState,c.dispatch]}\nfunction Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f;}return [f,d]}\nfunction Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));}\nfunction Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=\ne.entanglements,h=a;0<h;){var k=31-Vc(h),v=1<<k;d[k]|=a;h&=~v;}}},[c,b,d]);h.useEffect(function(){return d(b._source,function(){var a=p.getSnapshot,c=p.setSnapshot;try{c(a(b._source));var d=Ig(w);e.mutableReadLanes|=d&e.pendingLanes;}catch(q){c(function(){throw q;});}})},[b,d]);He(C,c)&&He(x,b)&&He(A,d)||(a={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:n},a.dispatch=l=Oh.bind(null,R,a),k.queue=a,k.baseQueue=null,n=Mh(e,b,c),k.memoizedState=k.baseState=n);return n}\nfunction Ph(a,b,c){var d=Ih();return Nh(d,a,b,c)}function Qh(a){var b=Hh();\\\\\"function\\\\\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:a};a=a.dispatch=Oh.bind(null,R,a);return [b.memoizedState,a]}\nfunction Rh(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=R.updateQueue;null===b?(b={lastEffect:null},R.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function Sh(a){var b=Hh();a={current:a};return b.memoizedState=a}function Th(){return Ih().memoizedState}function Uh(a,b,c,d){var e=Hh();R.flags|=a;e.memoizedState=Rh(1|b,c,void 0,void 0===d?null:d);}\nfunction Vh(a,b,c,d){var e=Ih();d=void 0===d?null:d;var f=void 0;if(null!==S){var g=S.memoizedState;f=g.destroy;if(null!==d&&Bh(d,g.deps)){Rh(b,c,f,d);return}}R.flags|=a;e.memoizedState=Rh(1|b,c,f,d);}function Wh(a,b){return Uh(516,4,a,b)}function Xh(a,b){return Vh(516,4,a,b)}function Yh(a,b){return Vh(4,2,a,b)}function Zh(a,b){if(\\\\\"function\\\\\"===typeof b)return a=a(),b(a),function(){b(null);};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null;}}\nfunction $h(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Vh(4,2,Zh.bind(null,b,a),c)}function ai(){}function bi(a,b){var c=Ih();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Bh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}function ci(a,b){var c=Ih();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Bh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}\nfunction di(a,b){var c=eg();gg(98>c?98:c,function(){a(!0);});gg(97<c?97:c,function(){var c=wh.transition;wh.transition=1;try{a(!1),b();}finally{wh.transition=c;}});}\nfunction Oh(a,b,c){var d=Hg(),e=Ig(a),f={lane:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.pending;null===g?f.next=f:(f.next=g.next,g.next=f);b.pending=f;g=a.alternate;if(a===R||null!==g&&g===R)zh=yh=!0;else {if(0===a.lanes&&(null===g||0===g.lanes)&&(g=b.lastRenderedReducer,null!==g))try{var h=b.lastRenderedState,k=g(h,c);f.eagerReducer=g;f.eagerState=k;if(He(k,h))return}catch(l){}finally{}Jg(a,e,d);}}\nvar Gh={readContext:vg,useCallback:Ah,useContext:Ah,useEffect:Ah,useImperativeHandle:Ah,useLayoutEffect:Ah,useMemo:Ah,useReducer:Ah,useRef:Ah,useState:Ah,useDebugValue:Ah,useDeferredValue:Ah,useTransition:Ah,useMutableSource:Ah,useOpaqueIdentifier:Ah,unstable_isNewReconciler:!1},Dh={readContext:vg,useCallback:function(a,b){Hh().memoizedState=[a,void 0===b?null:b];return a},useContext:vg,useEffect:Wh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Uh(4,2,Zh.bind(null,\nb,a),c)},useLayoutEffect:function(a,b){return Uh(4,2,a,b)},useMemo:function(a,b){var c=Hh();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Hh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={pending:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Oh.bind(null,R,a);return [d.memoizedState,a]},useRef:Sh,useState:Qh,useDebugValue:ai,useDeferredValue:function(a){var b=Qh(a),c=b[0],d=b[1];Wh(function(){var b=wh.transition;\nwh.transition=1;try{d(a);}finally{wh.transition=b;}},[a]);return c},useTransition:function(){var a=Qh(!1),b=a[0];a=di.bind(null,a[1]);Sh(a);return [a,b]},useMutableSource:function(a,b,c){var d=Hh();d.memoizedState={refs:{getSnapshot:b,setSnapshot:null},source:a,subscribe:c};return Nh(d,a,b,c)},useOpaqueIdentifier:function(){if(lh){var a=!1,b=uf(function(){a||(a=!0,c(\\\\\"r:\\\\\"+(tf++).toString(36)));throw Error(y(355));}),c=Qh(b)[1];0===(R.mode&2)&&(R.flags|=516,Rh(5,function(){c(\\\\\"r:\\\\\"+(tf++).toString(36));},\nvoid 0,null));return b}b=\\\\\"r:\\\\\"+(tf++).toString(36);Qh(b);return b},unstable_isNewReconciler:!1},Eh={readContext:vg,useCallback:bi,useContext:vg,useEffect:Xh,useImperativeHandle:$h,useLayoutEffect:Yh,useMemo:ci,useReducer:Kh,useRef:Th,useState:function(){return Kh(Jh)},useDebugValue:ai,useDeferredValue:function(a){var b=Kh(Jh),c=b[0],d=b[1];Xh(function(){var b=wh.transition;wh.transition=1;try{d(a);}finally{wh.transition=b;}},[a]);return c},useTransition:function(){var a=Kh(Jh)[0];return [Th().current,\na]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Kh(Jh)[0]},unstable_isNewReconciler:!1},Fh={readContext:vg,useCallback:bi,useContext:vg,useEffect:Xh,useImperativeHandle:$h,useLayoutEffect:Yh,useMemo:ci,useReducer:Lh,useRef:Th,useState:function(){return Lh(Jh)},useDebugValue:ai,useDeferredValue:function(a){var b=Lh(Jh),c=b[0],d=b[1];Xh(function(){var b=wh.transition;wh.transition=1;try{d(a);}finally{wh.transition=b;}},[a]);return c},useTransition:function(){var a=Lh(Jh)[0];return [Th().current,\na]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Lh(Jh)[0]},unstable_isNewReconciler:!1},ei=ra.ReactCurrentOwner,ug=!1;function fi(a,b,c,d){b.child=null===a?Zg(b,null,c,d):Yg(b,a.child,c,d);}function gi(a,b,c,d,e){c=c.render;var f=b.ref;tg(b,e);d=Ch(a,b,c,d,f,e);if(null!==a&&!ug)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,hi(a,b,e);b.flags|=1;fi(a,b,d,e);return b.child}\nfunction ii(a,b,c,d,e,f){if(null===a){var g=c.type;if(\\\\\"function\\\\\"===typeof g&&!ji(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,ki(a,b,g,d,e,f);a=Vg(c.type,null,d,b,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(0===(e&f)&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:Je,c(e,d)&&a.ref===b.ref))return hi(a,b,f);b.flags|=1;a=Tg(g,d);a.ref=b.ref;a.return=b;return b.child=a}\nfunction ki(a,b,c,d,e,f){if(null!==a&&Je(a.memoizedProps,d)&&a.ref===b.ref)if(ug=!1,0!==(f&e))0!==(a.flags&16384)&&(ug=!0);else return b.lanes=a.lanes,hi(a,b,f);return li(a,b,c,d,f)}\nfunction mi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if(\\\\\"hidden\\\\\"===d.mode||\\\\\"unstable-defer-without-hiding\\\\\"===d.mode)if(0===(b.mode&4))b.memoizedState={baseLanes:0},ni(b,c);else if(0!==(c&1073741824))b.memoizedState={baseLanes:0},ni(b,null!==f?f.baseLanes:c);else return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a},ni(b,a),null;else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,ni(b,d);fi(a,b,e,c);return b.child}\nfunction oi(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=128;}function li(a,b,c,d,e){var f=Ff(c)?Df:M.current;f=Ef(b,f);tg(b,e);c=Ch(a,b,c,d,f,e);if(null!==a&&!ug)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,hi(a,b,e);b.flags|=1;fi(a,b,c,e);return b.child}\nfunction pi(a,b,c,d,e){if(Ff(c)){var f=!0;Jf(b);}else f=!1;tg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),Mg(b,c,d),Og(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;\\\\\"object\\\\\"===typeof l&&null!==l?l=vg(l):(l=Ff(c)?Df:M.current,l=Ef(b,l));var n=c.getDerivedStateFromProps,A=\\\\\"function\\\\\"===typeof n||\\\\\"function\\\\\"===typeof g.getSnapshotBeforeUpdate;A||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillReceiveProps&&\n\\\\\"function\\\\\"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Ng(b,g,d,l);wg=!1;var p=b.memoizedState;g.state=p;Cg(b,d,g,e);k=b.memoizedState;h!==d||p!==k||N.current||wg?(\\\\\"function\\\\\"===typeof n&&(Gg(b,c,n,d),k=b.memoizedState),(h=wg||Lg(b,c,h,d,p,k,l))?(A||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillMount&&\\\\\"function\\\\\"!==typeof g.componentWillMount||(\\\\\"function\\\\\"===typeof g.componentWillMount&&g.componentWillMount(),\\\\\"function\\\\\"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),\\\\\"function\\\\\"===\ntypeof g.componentDidMount&&(b.flags|=4)):(\\\\\"function\\\\\"===typeof g.componentDidMount&&(b.flags|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):(\\\\\"function\\\\\"===typeof g.componentDidMount&&(b.flags|=4),d=!1);}else {g=b.stateNode;yg(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:lg(b.type,h);g.props=l;A=b.pendingProps;p=g.context;k=c.contextType;\\\\\"object\\\\\"===typeof k&&null!==k?k=vg(k):(k=Ff(c)?Df:M.current,k=Ef(b,k));var C=c.getDerivedStateFromProps;(n=\\\\\"function\\\\\"===typeof C||\n\\\\\"function\\\\\"===typeof g.getSnapshotBeforeUpdate)||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillReceiveProps&&\\\\\"function\\\\\"!==typeof g.componentWillReceiveProps||(h!==A||p!==k)&&Ng(b,g,d,k);wg=!1;p=b.memoizedState;g.state=p;Cg(b,d,g,e);var x=b.memoizedState;h!==A||p!==x||N.current||wg?(\\\\\"function\\\\\"===typeof C&&(Gg(b,c,C,d),x=b.memoizedState),(l=wg||Lg(b,c,l,d,p,x,k))?(n||\\\\\"function\\\\\"!==typeof g.UNSAFE_componentWillUpdate&&\\\\\"function\\\\\"!==typeof g.componentWillUpdate||(\\\\\"function\\\\\"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,\nx,k),\\\\\"function\\\\\"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),\\\\\"function\\\\\"===typeof g.componentDidUpdate&&(b.flags|=4),\\\\\"function\\\\\"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=256)):(\\\\\"function\\\\\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=4),\\\\\"function\\\\\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=256),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=l):(\\\\\"function\\\\\"!==typeof g.componentDidUpdate||\nh===a.memoizedProps&&p===a.memoizedState||(b.flags|=4),\\\\\"function\\\\\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=256),d=!1);}return qi(a,b,c,d,f,e)}\nfunction qi(a,b,c,d,e,f){oi(a,b);var g=0!==(b.flags&64);if(!d&&!g)return e&&Kf(b,c,!1),hi(a,b,f);d=b.stateNode;ei.current=b;var h=g&&\\\\\"function\\\\\"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Yg(b,a.child,null,f),b.child=Yg(b,null,h,f)):fi(a,b,h,f);b.memoizedState=d.state;e&&Kf(b,c,!0);return b.child}function ri(a){var b=a.stateNode;b.pendingContext?Hf(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Hf(a,b.context,!1);eh(a,b.containerInfo);}\nvar si={dehydrated:null,retryLane:0};\nfunction ti(a,b,c){var d=b.pendingProps,e=P.current,f=!1,g;(g=0!==(b.flags&64))||(g=null!==a&&null===a.memoizedState?!1:0!==(e&2));g?(f=!0,b.flags&=-65):null!==a&&null===a.memoizedState||void 0===d.fallback||!0===d.unstable_avoidThisFallback||(e|=1);I(P,e&1);if(null===a){void 0!==d.fallback&&ph(b);a=d.children;e=d.fallback;if(f)return a=ui(b,a,e,c),b.child.memoizedState={baseLanes:c},b.memoizedState=si,a;if(\\\\\"number\\\\\"===typeof d.unstable_expectedLoadTime)return a=ui(b,a,e,c),b.child.memoizedState={baseLanes:c},\nb.memoizedState=si,b.lanes=33554432,a;c=vi({mode:\\\\\"visible\\\\\",children:a},b.mode,c,null);c.return=b;return b.child=c}if(null!==a.memoizedState){if(f)return d=wi(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=si,d;c=xi(a,b,d.children,c);b.memoizedState=null;return c}if(f)return d=wi(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:\n{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=si,d;c=xi(a,b,d.children,c);b.memoizedState=null;return c}function ui(a,b,c,d){var e=a.mode,f=a.child;b={mode:\\\\\"hidden\\\\\",children:b};0===(e&2)&&null!==f?(f.childLanes=0,f.pendingProps=b):f=vi(b,e,0,null);c=Xg(c,e,d,null);f.return=a;c.return=a;f.sibling=c;a.child=f;return c}\nfunction xi(a,b,c,d){var e=a.child;a=e.sibling;c=Tg(e,{mode:\\\\\"visible\\\\\",children:c});0===(b.mode&2)&&(c.lanes=d);c.return=b;c.sibling=null;null!==a&&(a.nextEffect=null,a.flags=8,b.firstEffect=b.lastEffect=a);return b.child=c}\nfunction wi(a,b,c,d,e){var f=b.mode,g=a.child;a=g.sibling;var h={mode:\\\\\"hidden\\\\\",children:c};0===(f&2)&&b.child!==g?(c=b.child,c.childLanes=0,c.pendingProps=h,g=c.lastEffect,null!==g?(b.firstEffect=c.firstEffect,b.lastEffect=g,g.nextEffect=null):b.firstEffect=b.lastEffect=null):c=Tg(g,h);null!==a?d=Tg(a,d):(d=Xg(d,f,e,null),d.flags|=2);d.return=b;c.return=b;c.sibling=d;b.child=c;return d}function yi(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);sg(a.return,b);}\nfunction zi(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=c,g.tailMode=e,g.lastEffect=f);}\nfunction Ai(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;fi(a,b,d.children,c);d=P.current;if(0!==(d&2))d=d&1|2,b.flags|=64;else {if(null!==a&&0!==(a.flags&64))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&yi(a,c);else if(19===a.tag)yi(a,c);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return;}a.sibling.return=a.return;a=a.sibling;}d&=1;}I(P,d);if(0===(b.mode&2))b.memoizedState=\nnull;else switch(e){case \\\\\"forwards\\\\\":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===ih(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);zi(b,!1,e,c,f,b.lastEffect);break;case \\\\\"backwards\\\\\":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===ih(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a;}zi(b,!0,c,null,f,b.lastEffect);break;case \\\\\"together\\\\\":zi(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null;}return b.child}\nfunction hi(a,b,c){null!==a&&(b.dependencies=a.dependencies);Dg|=b.lanes;if(0!==(c&b.childLanes)){if(null!==a&&b.child!==a.child)throw Error(y(153));if(null!==b.child){a=b.child;c=Tg(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Tg(a,a.pendingProps),c.return=b;c.sibling=null;}return b.child}return null}var Bi,Ci,Di,Ei;\nBi=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;}c.sibling.return=c.return;c=c.sibling;}};Ci=function(){};\nDi=function(a,b,c,d){var e=a.memoizedProps;if(e!==d){a=b.stateNode;dh(ah.current);var f=null;switch(c){case \\\\\"input\\\\\":e=Ya(a,e);d=Ya(a,d);f=[];break;case \\\\\"option\\\\\":e=eb(a,e);d=eb(a,d);f=[];break;case \\\\\"select\\\\\":e=objectAssign({},e,{value:void 0});d=objectAssign({},d,{value:void 0});f=[];break;case \\\\\"textarea\\\\\":e=gb(a,e);d=gb(a,d);f=[];break;default:\\\\\"function\\\\\"!==typeof e.onClick&&\\\\\"function\\\\\"===typeof d.onClick&&(a.onclick=jf);}vb(c,d);var g;c=null;for(l in e)if(!d.hasOwnProperty(l)&&e.hasOwnProperty(l)&&null!=e[l])if(\\\\\"style\\\\\"===\nl){var h=e[l];for(g in h)h.hasOwnProperty(g)&&(c||(c={}),c[g]=\\\\\"\\\\\");}else \\\\\"dangerouslySetInnerHTML\\\\\"!==l&&\\\\\"children\\\\\"!==l&&\\\\\"suppressContentEditableWarning\\\\\"!==l&&\\\\\"suppressHydrationWarning\\\\\"!==l&&\\\\\"autoFocus\\\\\"!==l&&(ca.hasOwnProperty(l)?f||(f=[]):(f=f||[]).push(l,null));for(l in d){var k=d[l];h=null!=e?e[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if(\\\\\"style\\\\\"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]=\\\\\"\\\\\");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||\n(c={}),c[g]=k[g]);}else c||(f||(f=[]),f.push(l,c)),c=k;else \\\\\"dangerouslySetInnerHTML\\\\\"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(f=f||[]).push(l,k)):\\\\\"children\\\\\"===l?\\\\\"string\\\\\"!==typeof k&&\\\\\"number\\\\\"!==typeof k||(f=f||[]).push(l,\\\\\"\\\\\"+k):\\\\\"suppressContentEditableWarning\\\\\"!==l&&\\\\\"suppressHydrationWarning\\\\\"!==l&&(ca.hasOwnProperty(l)?(null!=k&&\\\\\"onScroll\\\\\"===l&&G(\\\\\"scroll\\\\\",a),f||h===k||(f=[])):\\\\\"object\\\\\"===typeof k&&null!==k&&k.$$typeof===Ga?k.toString():(f=f||[]).push(l,k));}c&&(f=f||[]).push(\\\\\"style\\\\\",\nc);var l=f;if(b.updateQueue=l)b.flags|=4;}};Ei=function(a,b,c,d){c!==d&&(b.flags|=4);};function Fi(a,b){if(!lh)switch(a.tailMode){case \\\\\"hidden\\\\\":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case \\\\\"collapsed\\\\\":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null;}}\nfunction Gi(a,b,c){var d=b.pendingProps;switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Ff(b.type)&&Gf(),null;case 3:fh();H(N);H(M);uh();d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)rh(b)?b.flags|=4:d.hydrate||(b.flags|=256);Ci(b);return null;case 5:hh(b);var e=dh(ch.current);c=b.type;if(null!==a&&null!=b.stateNode)Di(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=128);else {if(!d){if(null===\nb.stateNode)throw Error(y(166));return null}a=dh(ah.current);if(rh(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[wf]=b;d[xf]=f;switch(c){case \\\\\"dialog\\\\\":G(\\\\\"cancel\\\\\",d);G(\\\\\"close\\\\\",d);break;case \\\\\"iframe\\\\\":case \\\\\"object\\\\\":case \\\\\"embed\\\\\":G(\\\\\"load\\\\\",d);break;case \\\\\"video\\\\\":case \\\\\"audio\\\\\":for(a=0;a<Xe.length;a++)G(Xe[a],d);break;case \\\\\"source\\\\\":G(\\\\\"error\\\\\",d);break;case \\\\\"img\\\\\":case \\\\\"image\\\\\":case \\\\\"link\\\\\":G(\\\\\"error\\\\\",d);G(\\\\\"load\\\\\",d);break;case \\\\\"details\\\\\":G(\\\\\"toggle\\\\\",d);break;case \\\\\"input\\\\\":Za(d,f);G(\\\\\"invalid\\\\\",d);break;case \\\\\"select\\\\\":d._wrapperState=\n{wasMultiple:!!f.multiple};G(\\\\\"invalid\\\\\",d);break;case \\\\\"textarea\\\\\":hb(d,f),G(\\\\\"invalid\\\\\",d);}vb(c,f);a=null;for(var g in f)f.hasOwnProperty(g)&&(e=f[g],\\\\\"children\\\\\"===g?\\\\\"string\\\\\"===typeof e?d.textContent!==e&&(a=[\\\\\"children\\\\\",e]):\\\\\"number\\\\\"===typeof e&&d.textContent!==\\\\\"\\\\\"+e&&(a=[\\\\\"children\\\\\",\\\\\"\\\\\"+e]):ca.hasOwnProperty(g)&&null!=e&&\\\\\"onScroll\\\\\"===g&&G(\\\\\"scroll\\\\\",d));switch(c){case \\\\\"input\\\\\":Va(d);cb(d,f,!0);break;case \\\\\"textarea\\\\\":Va(d);jb(d);break;case \\\\\"select\\\\\":case \\\\\"option\\\\\":break;default:\\\\\"function\\\\\"===typeof f.onClick&&(d.onclick=\njf);}d=a;b.updateQueue=d;null!==d&&(b.flags|=4);}else {g=9===e.nodeType?e:e.ownerDocument;a===kb.html&&(a=lb(c));a===kb.html?\\\\\"script\\\\\"===c?(a=g.createElement(\\\\\"div\\\\\"),a.innerHTML=\\\\\"<script>\\\\\\\\x3c/script>\\\\\",a=a.removeChild(a.firstChild)):\\\\\"string\\\\\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\\\\\"select\\\\\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case \\\\\"dialog\\\\\":G(\\\\\"cancel\\\\\",a);G(\\\\\"close\\\\\",a);\ne=d;break;case \\\\\"iframe\\\\\":case \\\\\"object\\\\\":case \\\\\"embed\\\\\":G(\\\\\"load\\\\\",a);e=d;break;case \\\\\"video\\\\\":case \\\\\"audio\\\\\":for(e=0;e<Xe.length;e++)G(Xe[e],a);e=d;break;case \\\\\"source\\\\\":G(\\\\\"error\\\\\",a);e=d;break;case \\\\\"img\\\\\":case \\\\\"image\\\\\":case \\\\\"link\\\\\":G(\\\\\"error\\\\\",a);G(\\\\\"load\\\\\",a);e=d;break;case \\\\\"details\\\\\":G(\\\\\"toggle\\\\\",a);e=d;break;case \\\\\"input\\\\\":Za(a,d);e=Ya(a,d);G(\\\\\"invalid\\\\\",a);break;case \\\\\"option\\\\\":e=eb(a,d);break;case \\\\\"select\\\\\":a._wrapperState={wasMultiple:!!d.multiple};e=objectAssign({},d,{value:void 0});G(\\\\\"invalid\\\\\",a);break;case \\\\\"textarea\\\\\":hb(a,d);e=\ngb(a,d);G(\\\\\"invalid\\\\\",a);break;default:e=d;}vb(c,e);var h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];\\\\\"style\\\\\"===f?tb(a,k):\\\\\"dangerouslySetInnerHTML\\\\\"===f?(k=k?k.__html:void 0,null!=k&&ob(a,k)):\\\\\"children\\\\\"===f?\\\\\"string\\\\\"===typeof k?(\\\\\"textarea\\\\\"!==c||\\\\\"\\\\\"!==k)&&pb(a,k):\\\\\"number\\\\\"===typeof k&&pb(a,\\\\\"\\\\\"+k):\\\\\"suppressContentEditableWarning\\\\\"!==f&&\\\\\"suppressHydrationWarning\\\\\"!==f&&\\\\\"autoFocus\\\\\"!==f&&(ca.hasOwnProperty(f)?null!=k&&\\\\\"onScroll\\\\\"===f&&G(\\\\\"scroll\\\\\",a):null!=k&&qa(a,f,k,g));}switch(c){case \\\\\"input\\\\\":Va(a);cb(a,d,!1);\nbreak;case \\\\\"textarea\\\\\":Va(a);jb(a);break;case \\\\\"option\\\\\":null!=d.value&&a.setAttribute(\\\\\"value\\\\\",\\\\\"\\\\\"+Sa(d.value));break;case \\\\\"select\\\\\":a.multiple=!!d.multiple;f=d.value;null!=f?fb(a,!!d.multiple,f,!1):null!=d.defaultValue&&fb(a,!!d.multiple,d.defaultValue,!0);break;default:\\\\\"function\\\\\"===typeof e.onClick&&(a.onclick=jf);}mf(c,d)&&(b.flags|=4);}null!==b.ref&&(b.flags|=128);}return null;case 6:if(a&&null!=b.stateNode)Ei(a,b,a.memoizedProps,d);else {if(\\\\\"string\\\\\"!==typeof d&&null===b.stateNode)throw Error(y(166));\nc=dh(ch.current);dh(ah.current);rh(b)?(d=b.stateNode,c=b.memoizedProps,d[wf]=b,d.nodeValue!==c&&(b.flags|=4)):(d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[wf]=b,b.stateNode=d);}return null;case 13:H(P);d=b.memoizedState;if(0!==(b.flags&64))return b.lanes=c,b;d=null!==d;c=!1;null===a?void 0!==b.memoizedProps.fallback&&rh(b):c=null!==a.memoizedState;if(d&&!c&&0!==(b.mode&2))if(null===a&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(P.current&1))0===V&&(V=3);else {if(0===V||3===V)V=\n4;null===U||0===(Dg&134217727)&&0===(Hi&134217727)||Ii(U,W);}if(d||c)b.flags|=4;return null;case 4:return fh(),Ci(b),null===a&&cf(b.stateNode.containerInfo),null;case 10:return rg(b),null;case 17:return Ff(b.type)&&Gf(),null;case 19:H(P);d=b.memoizedState;if(null===d)return null;f=0!==(b.flags&64);g=d.rendering;if(null===g)if(f)Fi(d,!1);else {if(0!==V||null!==a&&0!==(a.flags&64))for(a=b.child;null!==a;){g=ih(a);if(null!==g){b.flags|=64;Fi(d,!1);f=g.updateQueue;null!==f&&(b.updateQueue=f,b.flags|=4);\nnull===d.lastEffect&&(b.firstEffect=null);b.lastEffect=d.lastEffect;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=2,f.nextEffect=null,f.firstEffect=null,f.lastEffect=null,g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,\nf.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;I(P,P.current&1|2);return b.child}a=a.sibling;}null!==d.tail&&O()>Ji&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432);}else {if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&\\\\\"hidden\\\\\"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|=\n64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g);}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&\\\\\"unstable-defer-without-hiding\\\\\"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));}\nfunction Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}}\nfunction Mi(a,b){try{var c=\\\\\"\\\\\",d=b;do c+=Qa(d),d=d.return;while(d);var e=c;}catch(f){e=\\\\\"Error generating stack: \\\\\"+f.message+\\\\\"\\\\\"+f.stack;}return {value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value);}catch(c){setTimeout(function(){throw c;});}}var Oi=\\\\\"function\\\\\"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b);};return c}\nfunction Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if(\\\\\"function\\\\\"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)};}var f=a.stateNode;null!==f&&\\\\\"function\\\\\"===typeof f.componentDidCatch&&(c.callback=function(){\\\\\"function\\\\\"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\\\\\"\\\\\"});});return c}var Ui=\\\\\"function\\\\\"===typeof WeakSet?WeakSet:Set;\nfunction Vi(a){var b=a.ref;if(null!==b)if(\\\\\"function\\\\\"===typeof b)try{b(null);}catch(c){Wi(a,c);}else b.current=null;}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b;}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));}\nfunction Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d();}a=a.next;}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d;}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d,\nb.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode;}Eg(c,b,a);}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c))));\nreturn;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));}\nfunction aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,\\\\\"function\\\\\"===typeof d.setProperty?d.setProperty(\\\\\"display\\\\\",\\\\\"none\\\\\",\\\\\"important\\\\\"):d.display=\\\\\"none\\\\\";else {d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty(\\\\\"display\\\\\")?e.display:null;d.style.display=sb(\\\\\"display\\\\\",e);}}else if(6===c.tag)c.stateNode.nodeValue=b?\\\\\"\\\\\":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===\na)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return;}c.sibling.return=c.return;c=c.sibling;}}\nfunction bj(a,b){if(Mf&&\\\\\"function\\\\\"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b);}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else {d=b;try{e();}catch(f){Wi(d,f);}}c=c.next;}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if(\\\\\"function\\\\\"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount();}catch(f){Wi(b,\nf);}break;case 5:Vi(b);break;case 4:cj(a,b);}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null;}function ej(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return;}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,\\\\\"\\\\\"),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return;}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===\nc.child||4===c.tag)continue b;else c.child.return=c,c=c.child;}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b);}\nfunction gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling;}\nfunction hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling;}\nfunction cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return;}d=!0;}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else {if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return;}k.sibling.return=k.return;k=k.sibling;}f?(g=e,h=c.stateNode,\n8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode);}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1);}c.sibling.return=c.return;c=c.sibling;}}\nfunction ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;\\\\\"input\\\\\"===a&&\\\\\"radio\\\\\"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;e<f.length;e+=\n2){var g=f[e],h=f[e+1];\\\\\"style\\\\\"===g?tb(c,h):\\\\\"dangerouslySetInnerHTML\\\\\"===g?ob(c,h):\\\\\"children\\\\\"===g?pb(c,h):qa(c,g,h,b);}switch(a){case \\\\\"input\\\\\":ab(c,d);break;case \\\\\"textarea\\\\\":ib(c,d);break;case \\\\\"select\\\\\":a=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,f=d.value,null!=f?fb(c,!!d.multiple,f,!1):a!==!!d.multiple&&(null!=d.defaultValue?fb(c,!!d.multiple,d.defaultValue,!0):fb(c,!!d.multiple,d.multiple?[]:\\\\\"\\\\\",!1));}}}return;case 6:if(null===b.stateNode)throw Error(y(162));b.stateNode.nodeValue=\nb.memoizedProps;return;case 3:c=b.stateNode;c.hydrate&&(c.hydrate=!1,Cc(c.containerInfo));return;case 12:return;case 13:null!==b.memoizedState&&(jj=O(),aj(b.child,!0));kj(b);return;case 19:kj(b);return;case 17:return;case 23:case 24:aj(b,null!==b.memoizedState);return}throw Error(y(163));}function kj(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Ui);b.forEach(function(b){var d=lj.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d));});}}\nfunction mj(a,b){return null!==a&&(a=a.memoizedState,null===a||null!==a.dehydrated)?(b=b.memoizedState,null!==b&&null===b.dehydrated):!1}var nj=Math.ceil,oj=ra.ReactCurrentDispatcher,pj=ra.ReactCurrentOwner,X=0,U=null,Y=null,W=0,qj=0,rj=Bf(0),V=0,sj=null,tj=0,Dg=0,Hi=0,uj=0,vj=null,jj=0,Ji=Infinity;function wj(){Ji=O()+500;}var Z=null,Qi=!1,Ri=null,Ti=null,xj=!1,yj=null,zj=90,Aj=[],Bj=[],Cj=null,Dj=0,Ej=null,Fj=-1,Gj=0,Hj=0,Ij=null,Jj=!1;function Hg(){return 0!==(X&48)?O():-1!==Fj?Fj:Fj=O()}\nfunction Ig(a){a=a.mode;if(0===(a&2))return 1;if(0===(a&4))return 99===eg()?1:2;0===Gj&&(Gj=tj);if(0!==kg.transition){0!==Hj&&(Hj=null!==vj?vj.pendingLanes:0);a=Gj;var b=4186112&~Hj;b&=-b;0===b&&(a=4186112&~a,b=a&-a,0===b&&(b=8192));return b}a=eg();0!==(X&4)&&98===a?a=Xc(12,Gj):(a=Sc(a),a=Xc(a,Gj));return a}\nfunction Jg(a,b,c){if(50<Dj)throw Dj=0,Ej=null,Error(y(185));a=Kj(a,b);if(null===a)return null;$c(a,b,c);a===U&&(Hi|=b,4===V&&Ii(a,W));var d=eg();1===b?0!==(X&8)&&0===(X&48)?Lj(a):(Mj(a,c),0===X&&(wj(),ig())):(0===(X&4)||98!==d&&99!==d||(null===Cj?Cj=new Set([a]):Cj.add(a)),Mj(a,c));vj=a;}function Kj(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}\nfunction Mj(a,b){for(var c=a.callbackNode,d=a.suspendedLanes,e=a.pingedLanes,f=a.expirationTimes,g=a.pendingLanes;0<g;){var h=31-Vc(g),k=1<<h,l=f[h];if(-1===l){if(0===(k&d)||0!==(k&e)){l=b;Rc(k);var n=F;f[h]=10<=n?l+250:6<=n?l+5E3:-1;}}else l<=b&&(a.expiredLanes|=k);g&=~k;}d=Uc(a,a===U?W:0);b=F;if(0===d)null!==c&&(c!==Zf&&Pf(c),a.callbackNode=null,a.callbackPriority=0);else {if(null!==c){if(a.callbackPriority===b)return;c!==Zf&&Pf(c);}15===b?(c=Lj.bind(null,a),null===ag?(ag=[c],bg=Of(Uf,jg)):ag.push(c),\nc=Zf):14===b?c=hg(99,Lj.bind(null,a)):(c=Tc(b),c=hg(c,Nj.bind(null,a)));a.callbackPriority=b;a.callbackNode=c;}}\nfunction Nj(a){Fj=-1;Hj=Gj=0;if(0!==(X&48))throw Error(y(327));var b=a.callbackNode;if(Oj()&&a.callbackNode!==b)return null;var c=Uc(a,a===U?W:0);if(0===c)return null;var d=c;var e=X;X|=16;var f=Pj();if(U!==a||W!==d)wj(),Qj(a,d);do try{Rj();break}catch(h){Sj(a,h);}while(1);qg();oj.current=f;X=e;null!==Y?d=0:(U=null,W=0,d=V);if(0!==(tj&Hi))Qj(a,0);else if(0!==d){2===d&&(X|=64,a.hydrate&&(a.hydrate=!1,qf(a.containerInfo)),c=Wc(a),0!==c&&(d=Tj(a,c)));if(1===d)throw b=sj,Qj(a,0),Ii(a,c),Mj(a,O()),b;a.finishedWork=\na.current.alternate;a.finishedLanes=c;switch(d){case 0:case 1:throw Error(y(345));case 2:Uj(a);break;case 3:Ii(a,c);if((c&62914560)===c&&(d=jj+500-O(),10<d)){if(0!==Uc(a,0))break;e=a.suspendedLanes;if((e&c)!==c){Hg();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=of(Uj.bind(null,a),d);break}Uj(a);break;case 4:Ii(a,c);if((c&4186112)===c)break;d=a.eventTimes;for(e=-1;0<c;){var g=31-Vc(c);f=1<<g;g=d[g];g>e&&(e=g);c&=~f;}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>\nc?4320:1960*nj(c/1960))-c;if(10<c){a.timeoutHandle=of(Uj.bind(null,a),c);break}Uj(a);break;case 5:Uj(a);break;default:throw Error(y(329));}}Mj(a,O());return a.callbackNode===b?Nj.bind(null,a):null}function Ii(a,b){b&=~uj;b&=~Hi;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-Vc(b),d=1<<c;a[c]=-1;b&=~d;}}\nfunction Lj(a){if(0!==(X&48))throw Error(y(327));Oj();if(a===U&&0!==(a.expiredLanes&W)){var b=W;var c=Tj(a,b);0!==(tj&Hi)&&(b=Uc(a,b),c=Tj(a,b));}else b=Uc(a,0),c=Tj(a,b);0!==a.tag&&2===c&&(X|=64,a.hydrate&&(a.hydrate=!1,qf(a.containerInfo)),b=Wc(a),0!==b&&(c=Tj(a,b)));if(1===c)throw c=sj,Qj(a,0),Ii(a,b),Mj(a,O()),c;a.finishedWork=a.current.alternate;a.finishedLanes=b;Uj(a);Mj(a,O());return null}\nfunction Vj(){if(null!==Cj){var a=Cj;Cj=null;a.forEach(function(a){a.expiredLanes|=24&a.pendingLanes;Mj(a,O());});}ig();}function Wj(a,b){var c=X;X|=1;try{return a(b)}finally{X=c,0===X&&(wj(),ig());}}function Xj(a,b){var c=X;X&=-2;X|=8;try{return a(b)}finally{X=c,0===X&&(wj(),ig());}}function ni(a,b){I(rj,qj);qj|=b;tj|=b;}function Ki(){qj=rj.current;H(rj);}\nfunction Qj(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,pf(c));if(null!==Y)for(c=Y.return;null!==c;){var d=c;switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&Gf();break;case 3:fh();H(N);H(M);uh();break;case 5:hh(d);break;case 4:fh();break;case 13:H(P);break;case 19:H(P);break;case 10:rg(d);break;case 23:case 24:Ki();}c=c.return;}U=a;Y=Tg(a.current,null);W=qj=tj=b;V=0;sj=null;uj=Hi=Dg=0;}\nfunction Sj(a,b){do{var c=Y;try{qg();vh.current=Gh;if(yh){for(var d=R.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next;}yh=!1;}xh=0;T=S=R=null;zh=!1;pj.current=null;if(null===c||null===c.return){V=1;sj=b;Y=null;break}a:{var f=a,g=c.return,h=c,k=b;b=W;h.flags|=2048;h.firstEffect=h.lastEffect=null;if(null!==k&&\\\\\"object\\\\\"===typeof k&&\\\\\"function\\\\\"===typeof k.then){var l=k;if(0===(h.mode&2)){var n=h.alternate;n?(h.updateQueue=n.updateQueue,h.memoizedState=n.memoizedState,h.lanes=n.lanes):\n(h.updateQueue=null,h.memoizedState=null);}var A=0!==(P.current&1),p=g;do{var C;if(C=13===p.tag){var x=p.memoizedState;if(null!==x)C=null!==x.dehydrated?!0:!1;else {var w=p.memoizedProps;C=void 0===w.fallback?!1:!0!==w.unstable_avoidThisFallback?!0:A?!1:!0;}}if(C){var z=p.updateQueue;if(null===z){var u=new Set;u.add(l);p.updateQueue=u;}else z.add(l);if(0===(p.mode&2)){p.flags|=64;h.flags|=16384;h.flags&=-2981;if(1===h.tag)if(null===h.alternate)h.tag=17;else {var t=zg(-1,1);t.tag=2;Ag(h,t);}h.lanes|=1;break a}k=\nvoid 0;h=b;var q=f.pingCache;null===q?(q=f.pingCache=new Oi,k=new Set,q.set(l,k)):(k=q.get(l),void 0===k&&(k=new Set,q.set(l,k)));if(!k.has(h)){k.add(h);var v=Yj.bind(null,f,l,h);l.then(v,v);}p.flags|=4096;p.lanes=b;break a}p=p.return;}while(null!==p);k=Error((Ra(h.type)||\\\\\"A React component\\\\\")+\\\\\" suspended while rendering, but no fallback UI was specified.Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.\\\\\");}5!==V&&(V=2);k=Mi(k,h);p=\ng;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&(\\\\\"function\\\\\"===typeof K.getDerivedStateFromError||null!==Q&&\\\\\"function\\\\\"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return;}while(null!==p)}Zj(c);}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}\nfunction Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e);}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y);}function Rj(){for(;null!==Y&&!Qf();)bk(Y);}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null;}\nfunction Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d;}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1<b.flags&&(null!==\na.lastEffect?a.lastEffect.nextEffect=b:a.firstEffect=b,a.lastEffect=b));}else {c=Li(b);if(null!==c){c.flags&=2047;Y=c;return}null!==a&&(a.firstEffect=a.lastEffect=null,a.flags|=2048);}b=b.sibling;if(null!==b){Y=b;return}Y=b=a;}while(null!==b);0===V&&(V=5);}function Uj(a){var b=eg();gg(99,dk.bind(null,a,b));return null}\nfunction dk(a,b){do Oj();while(null!==yj);if(0!==(X&48))throw Error(y(327));var c=a.finishedWork;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(y(177));a.callbackNode=null;var d=c.lanes|c.childLanes,e=d,f=a.pendingLanes&~e;a.pendingLanes=e;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=e;a.mutableReadLanes&=e;a.entangledLanes&=e;e=a.entanglements;for(var g=a.eventTimes,h=a.expirationTimes;0<f;){var k=31-Vc(f),l=1<<k;e[k]=0;g[k]=-1;h[k]=-1;f&=~l;}null!==\nCj&&0===(d&24)&&Cj.has(a)&&Cj.delete(a);a===U&&(Y=U=null,W=0);1<c.flags?null!==c.lastEffect?(c.lastEffect.nextEffect=c,d=c.firstEffect):d=c:d=c.firstEffect;if(null!==d){e=X;X|=32;pj.current=null;kf=fd;g=Ne();if(Oe(g)){if(\\\\\"selectionStart\\\\\"in g)h={start:g.selectionStart,end:g.selectionEnd};else a:if(h=(h=g.ownerDocument)&&h.defaultView||window,(l=h.getSelection&&h.getSelection())&&0!==l.rangeCount){h=l.anchorNode;f=l.anchorOffset;k=l.focusNode;l=l.focusOffset;try{h.nodeType,k.nodeType;}catch(va){h=null;\nbreak a}var n=0,A=-1,p=-1,C=0,x=0,w=g,z=null;b:for(;;){for(var u;;){w!==h||0!==f&&3!==w.nodeType||(A=n+f);w!==k||0!==l&&3!==w.nodeType||(p=n+l);3===w.nodeType&&(n+=w.nodeValue.length);if(null===(u=w.firstChild))break;z=w;w=u;}for(;;){if(w===g)break b;z===h&&++C===f&&(A=n);z===k&&++x===l&&(p=n);if(null!==(u=w.nextSibling))break;w=z;z=w.parentNode;}w=u;}h=-1===A||-1===p?null:{start:A,end:p};}else h=null;h=h||{start:0,end:0};}else h=null;lf={focusedElem:g,selectionRange:h};fd=!1;Ij=null;Jj=!1;Z=d;do try{ek();}catch(va){if(null===\nZ)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect;}while(null!==Z);Ij=null;Z=d;do try{for(g=a;null!==Z;){var t=Z.flags;t&16&&pb(Z.stateNode,\\\\\"\\\\\");if(t&128){var q=Z.alternate;if(null!==q){var v=q.ref;null!==v&&(\\\\\"function\\\\\"===typeof v?v(null):v.current=null);}}switch(t&1038){case 2:fj(Z);Z.flags&=-3;break;case 6:fj(Z);Z.flags&=-3;ij(Z.alternate,Z);break;case 1024:Z.flags&=-1025;break;case 1028:Z.flags&=-1025;ij(Z.alternate,Z);break;case 4:ij(Z.alternate,Z);break;case 8:h=Z;cj(g,h);var J=h.alternate;dj(h);null!==\nJ&&dj(J);}Z=Z.nextEffect;}}catch(va){if(null===Z)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect;}while(null!==Z);v=lf;q=Ne();t=v.focusedElem;g=v.selectionRange;if(q!==t&&t&&t.ownerDocument&&Me(t.ownerDocument.documentElement,t)){null!==g&&Oe(t)&&(q=g.start,v=g.end,void 0===v&&(v=q),\\\\\"selectionStart\\\\\"in t?(t.selectionStart=q,t.selectionEnd=Math.min(v,t.value.length)):(v=(q=t.ownerDocument||document)&&q.defaultView||window,v.getSelection&&(v=v.getSelection(),h=t.textContent.length,J=Math.min(g.start,h),g=void 0===\ng.end?J:Math.min(g.end,h),!v.extend&&J>g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});\\\\\"function\\\\\"===typeof t.focus&&t.focus();for(t=\n0;t<q.length;t++)v=q[t],v.element.scrollLeft=v.left,v.element.scrollTop=v.top;}fd=!!kf;lf=kf=null;a.current=c;Z=d;do try{for(t=a;null!==Z;){var K=Z.flags;K&36&&Yi(t,Z.alternate,Z);if(K&128){q=void 0;var Q=Z.ref;if(null!==Q){var L=Z.stateNode;switch(Z.tag){case 5:q=L;break;default:q=L;}\\\\\"function\\\\\"===typeof Q?Q(q):Q.current=q;}}Z=Z.nextEffect;}}catch(va){if(null===Z)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect;}while(null!==Z);Z=null;$f();X=e;}else a.current=c;if(xj)xj=!1,yj=a,zj=b;else for(Z=d;null!==Z;)b=\nZ.nextEffect,Z.nextEffect=null,Z.flags&8&&(K=Z,K.sibling=null,K.stateNode=null),Z=b;d=a.pendingLanes;0===d&&(Ti=null);1===d?a===Ej?Dj++:(Dj=0,Ej=a):Dj=0;c=c.stateNode;if(Mf&&\\\\\"function\\\\\"===typeof Mf.onCommitFiberRoot)try{Mf.onCommitFiberRoot(Lf,c,void 0,64===(c.current.flags&64));}catch(va){}Mj(a,O());if(Qi)throw Qi=!1,a=Ri,Ri=null,a;if(0!==(X&8))return null;ig();return null}\nfunction ek(){for(;null!==Z;){var a=Z.alternate;Jj||null===Ij||(0!==(Z.flags&8)?dc(Z,Ij)&&(Jj=!0):13===Z.tag&&mj(a,Z)&&dc(Z,Ij)&&(Jj=!0));var b=Z.flags;0!==(b&256)&&Xi(a,Z);0===(b&512)||xj||(xj=!0,hg(97,function(){Oj();return null}));Z=Z.nextEffect;}}function Oj(){if(90!==zj){var a=97<zj?97:zj;zj=90;return gg(a,fk)}return !1}function $i(a,b){Aj.push(b,a);xj||(xj=!0,hg(97,function(){Oj();return null}));}function Zi(a,b){Bj.push(b,a);xj||(xj=!0,hg(97,function(){Oj();return null}));}\nfunction fk(){if(null===yj)return !1;var a=yj;yj=null;if(0!==(X&48))throw Error(y(331));var b=X;X|=32;var c=Bj;Bj=[];for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],g=e.destroy;e.destroy=void 0;if(\\\\\"function\\\\\"===typeof g)try{g();}catch(k){if(null===f)throw Error(y(330));Wi(f,k);}}c=Aj;Aj=[];for(d=0;d<c.length;d+=2){e=c[d];f=c[d+1];try{var h=e.create;e.destroy=h();}catch(k){if(null===f)throw Error(y(330));Wi(f,k);}}for(h=a.current.firstEffect;null!==h;)a=h.nextEffect,h.nextEffect=null,h.flags&8&&(h.sibling=\nnull,h.stateNode=null),h=a;X=b;ig();return !0}function gk(a,b,c){b=Mi(c,b);b=Pi(a,b,1);Ag(a,b);b=Hg();a=Kj(a,1);null!==a&&($c(a,1,b),Mj(a,b));}\nfunction Wi(a,b){if(3===a.tag)gk(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){gk(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if(\\\\\"function\\\\\"===typeof c.type.getDerivedStateFromError||\\\\\"function\\\\\"===typeof d.componentDidCatch&&(null===Ti||!Ti.has(d))){a=Mi(b,a);var e=Si(c,a,1);Ag(c,e);e=Hg();c=Kj(c,1);if(null!==c)$c(c,1,e),Mj(c,e);else if(\\\\\"function\\\\\"===typeof d.componentDidCatch&&(null===Ti||!Ti.has(d)))try{d.componentDidCatch(b,a);}catch(f){}break}}c=c.return;}}\nfunction Yj(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=Hg();a.pingedLanes|=a.suspendedLanes&c;U===a&&(W&c)===c&&(4===V||3===V&&(W&62914560)===W&&500>O()-jj?Qj(a,0):uj|=c);Mj(a,b);}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c));}var ck;\nck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else {ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!==\nb?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64;}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if(\\\\\"object\\\\\"===\ntypeof e&&null!==e&&\\\\\"function\\\\\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b);}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;\\\\\"function\\\\\"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c);}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);\na=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,\\\\\"\\\\\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282));\nd=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else {e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e<a.length;e+=2)f=a[e],f._workInProgressVersionPrimary=a[e+1],th.push(f);c=Zg(b,null,d,c);for(b.child=c;c;)c.flags=c.flags&-3|1024,c=c.sibling;}else fi(a,b,d,c),sh();b=b.child;}return b;case 5:return gh(b),null===a&&\nph(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,nf(d,e)?g=null:null!==f&&nf(d,f)&&(b.flags|=16),oi(a,b),fi(a,b,g,c),b.child;case 6:return null===a&&ph(b),null;case 13:return ti(a,b,c);case 4:return eh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Yg(b,null,d,c):fi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),gi(a,b,d,e,c);case 7:return fi(a,b,b.pendingProps,c),b.child;case 8:return fi(a,b,b.pendingProps.children,\nc),b.child;case 12:return fi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(mg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=He(h,f)?0:(\\\\\"function\\\\\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!N.current){b=hi(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=\nk.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=zg(-1,c&-c),l.tag=2,Ag(h,l));h.lanes|=c;l=h.alternate;null!==l&&(l.lanes|=c);sg(h.return,c);k.lanes|=c;break}l=l.next;}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return;}h=g;}fi(a,b,e.children,c);b=b.child;}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,tg(b,c),e=vg(e,\nf.unstable_observedBits),d=d(e),b.flags|=1,fi(a,b,d,c),b.child;case 14:return e=b.type,f=lg(e,b.pendingProps),f=lg(e.type,f),ii(a,b,e,f,d,c);case 15:return ki(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),b.tag=1,Ff(d)?(a=!0,Jf(b)):a=!1,tg(b,c),Mg(b,d,e),Og(b,d,e,c),qi(null,b,d,!0,a,c);case 19:return Ai(a,b,c);case 23:return mi(a,b,c);case 24:return mi(a,b,c)}throw Error(y(156,b.tag));\n};function ik(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.flags=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childLanes=this.lanes=0;this.alternate=null;}function nh(a,b,c,d){return new ik(a,b,c,d)}function ji(a){a=a.prototype;return !(!a||!a.isReactComponent)}\nfunction hk(a){if(\\\\\"function\\\\\"===typeof a)return ji(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Aa)return 11;if(a===Da)return 14}return 2}\nfunction Tg(a,b){var c=a.alternate;null===c?(c=nh(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Vg(a,b,c,d,e,f){var g=2;d=a;if(\\\\\"function\\\\\"===typeof a)ji(a)&&(g=1);else if(\\\\\"string\\\\\"===typeof a)g=5;else a:switch(a){case ua:return Xg(c.children,e,f,b);case Ha:g=8;e|=16;break;case wa:g=8;e|=1;break;case xa:return a=nh(12,c,b,e|8),a.elementType=xa,a.type=xa,a.lanes=f,a;case Ba:return a=nh(13,c,b,e),a.type=Ba,a.elementType=Ba,a.lanes=f,a;case Ca:return a=nh(19,c,b,e),a.elementType=Ca,a.lanes=f,a;case Ia:return vi(c,e,f,b);case Ja:return a=nh(24,c,b,e),a.elementType=Ja,a.lanes=f,a;default:if(\\\\\"object\\\\\"===\ntypeof a&&null!==a)switch(a.$$typeof){case ya:g=10;break a;case za:g=9;break a;case Aa:g=11;break a;case Da:g=14;break a;case Ea:g=16;d=null;break a;case Fa:g=22;break a}throw Error(y(130,null==a?a:typeof a,\\\\\"\\\\\"));}b=nh(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Xg(a,b,c,d){a=nh(7,a,d,b);a.lanes=c;return a}function vi(a,b,c,d){a=nh(23,a,d,b);a.elementType=Ia;a.lanes=c;return a}function Ug(a,b,c){a=nh(6,a,null,b);a.lanes=c;return a}\nfunction Wg(a,b,c){b=nh(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction jk(a,b,c){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode=null;this.callbackPriority=0;this.eventTimes=Zc(0);this.expirationTimes=Zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=Zc(0);this.mutableSourceEagerHydrationData=null;}\nfunction kk(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return {$$typeof:ta,key:null==d?null:\\\\\"\\\\\"+d,children:a,containerInfo:b,implementation:c}}\nfunction lk(a,b,c,d){var e=b.current,f=Hg(),g=Ig(e);a:if(c){c=c._reactInternals;b:{if(Zb(c)!==c||1!==c.tag)throw Error(y(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(Ff(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return;}while(null!==h);throw Error(y(171));}if(1===c.tag){var k=c.type;if(Ff(k)){c=If(c,k,h);break a}}c=h;}else c=Cf;null===b.context?b.context=c:b.pendingContext=c;b=zg(f,g);b.payload={element:a};d=void 0===d?null:d;null!==\nd&&(b.callback=d);Ag(e,b);Jg(e,g,f);return g}function mk(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function nk(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b;}}function ok(a,b){nk(a,b);(a=a.alternate)&&nk(a,b);}function pk(){return null}\nfunction qk(a,b,c){var d=null!=c&&null!=c.hydrationOptions&&c.hydrationOptions.mutableSources||null;c=new jk(a,b,null!=c&&!0===c.hydrate);b=nh(3,null,null,2===b?7:1===b?3:0);c.current=b;b.stateNode=c;xg(b);a[ff]=c.current;cf(8===a.nodeType?a.parentNode:a);if(d)for(a=0;a<d.length;a++){b=d[a];var e=b._getVersion;e=e(b._source);null==c.mutableSourceEagerHydrationData?c.mutableSourceEagerHydrationData=[b,e]:c.mutableSourceEagerHydrationData.push(b,e);}this._internalRoot=c;}\nqk.prototype.render=function(a){lk(a,this._internalRoot,null,null);};qk.prototype.unmount=function(){var a=this._internalRoot,b=a.containerInfo;lk(null,a,null,function(){b[ff]=null;});};function rk(a){return !(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||\\\\\" react-mount-point-unstable \\\\\"!==a.nodeValue))}\nfunction sk(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute(\\\\\"data-reactroot\\\\\")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new qk(a,0,b?{hydrate:!0}:void 0)}\nfunction tk(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if(\\\\\"function\\\\\"===typeof e){var h=e;e=function(){var a=mk(g);h.call(a);};}lk(b,g,a,e);}else {f=c._reactRootContainer=sk(c,d);g=f._internalRoot;if(\\\\\"function\\\\\"===typeof e){var k=e;e=function(){var a=mk(g);k.call(a);};}Xj(function(){lk(b,g,a,e);});}return mk(g)}ec=function(a){if(13===a.tag){var b=Hg();Jg(a,4,b);ok(a,4);}};fc=function(a){if(13===a.tag){var b=Hg();Jg(a,67108864,b);ok(a,67108864);}};\ngc=function(a){if(13===a.tag){var b=Hg(),c=Ig(a);Jg(a,c,b);ok(a,c);}};hc=function(a,b){return b()};\nyb=function(a,b,c){switch(b){case \\\\\"input\\\\\":ab(a,c);b=c.name;if(\\\\\"radio\\\\\"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll(\\\\\"input[name=\\\\\"+JSON.stringify(\\\\\"\\\\\"+b)+'][type=\\\\\"radio\\\\\"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Db(d);if(!e)throw Error(y(90));Wa(d);ab(d,e);}}}break;case \\\\\"textarea\\\\\":ib(a,c);break;case \\\\\"select\\\\\":b=c.value,null!=b&&fb(a,!!c.multiple,b,!1);}};Gb=Wj;\nHb=function(a,b,c,d,e){var f=X;X|=4;try{return gg(98,a.bind(null,b,c,d,e))}finally{X=f,0===X&&(wj(),ig());}};Ib=function(){0===(X&49)&&(Vj(),Oj());};Jb=function(a,b){var c=X;X|=2;try{return a(b)}finally{X=c,0===X&&(wj(),ig());}};function uk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!rk(b))throw Error(y(200));return kk(a,b,null,c)}var vk={Events:[Cb,ue,Db,Eb,Fb,Oj,{current:!1}]},wk={findFiberByHostInstance:wc,bundleType:0,version:\\\\\"17.0.2\\\\\",rendererPackageName:\\\\\"react-dom\\\\\"};\nvar xk={bundleType:wk.bundleType,version:wk.version,rendererPackageName:wk.rendererPackageName,rendererConfig:wk.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ra.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=cc(a);return null===a?null:a.stateNode},findFiberByHostInstance:wk.findFiberByHostInstance||\npk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(\\\\\"undefined\\\\\"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yk=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yk.isDisabled&&yk.supportsFiber)try{Lf=yk.inject(xk),Mf=yk;}catch(a){}}var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vk;var createPortal=uk;\nvar findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if(\\\\\"function\\\\\"===typeof a.render)throw Error(y(188));throw Error(y(268,Object.keys(a)));}a=cc(b);a=null===a?null:a.stateNode;return a};var flushSync=function(a,b){var c=X;if(0!==(c&48))return a(b);X|=1;try{if(a)return gg(99,a.bind(null,b))}finally{X=c,ig();}};var hydrate=function(a,b,c){if(!rk(b))throw Error(y(200));return tk(null,a,b,!0,c)};\nvar render=function(a,b,c){if(!rk(b))throw Error(y(200));return tk(null,a,b,!1,c)};var unmountComponentAtNode=function(a){if(!rk(a))throw Error(y(40));return a._reactRootContainer?(Xj(function(){tk(null,null,a,!1,function(){a._reactRootContainer=null;a[ff]=null;});}),!0):!1};var unstable_batchedUpdates=Wj;var unstable_createPortal=function(a,b){return uk(a,b,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)};\nvar unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!rk(c))throw Error(y(200));if(null==a||void 0===a._reactInternals)throw Error(y(38));return tk(a,b,c,!1,d)};var version=\\\\\"17.0.2\\\\\";\nvar reactDom_production_min = {\n\t__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,\n\tcreatePortal: createPortal,\n\tfindDOMNode: findDOMNode,\n\tflushSync: flushSync,\n\thydrate: hydrate,\n\trender: render,\n\tunmountComponentAtNode: unmountComponentAtNode,\n\tunstable_batchedUpdates: unstable_batchedUpdates,\n\tunstable_createPortal: unstable_createPortal,\n\tunstable_renderSubtreeIntoContainer: unstable_renderSubtreeIntoContainer,\n\tversion: version\n};\nvar reactDom = createCommonjsModule(function (module) {\nfunction checkDCE() {\n  if (\n    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n  ) {\n    return;\n  }\n  try {\n    // Verify that the code above has been dead code eliminated (DCE'd).\n    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n  } catch (err) {\n    // DevTools shouldn't crash React, no matter what.\n    // We should still report in case we break this code.\n    console.error(err);\n  }\n}\n{\n  // DCE check should happen before ReactDOM bundle executes so that\n  // DevTools can report bad minification during injection.\n  checkDCE();\n  module.exports = reactDom_production_min;\n}\n});\nexport default reactDom;\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: allFiles 1`] = `\nArray [\n  \"_snowpack/env.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/react-dom.js\",\n  \"_snowpack/pkg/react.js\",\n  \"dist/App.css\",\n  \"dist/App.css.proxy.js\",\n  \"dist/App.js\",\n  \"dist/index.css\",\n  \"dist/index.css.proxy.js\",\n  \"dist/index.js\",\n  \"dist/logo.svg\",\n  \"dist/logo.svg.proxy.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/App.css 1`] = `\n\".App {\n  text-align: center;\n}\n.App code {\n  background: #FFF3;\n  padding: 4px 8px;\n  border-radius: 4px;\n}\n.App p {\n  margin: 0.4rem;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n.App-link {\n  color: #61dafb;\n}\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/App.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\".App {  text-align: center;}.App code {  background: #FFF3;  padding: 4px 8px;  border-radius: 4px;}.App p {  margin: 0.4rem;}.App-logo {  height: 40vmin;  pointer-events: none;}@media (prefers-reduced-motion: no-preference) {  .App-logo {    animation: App-logo-spin infinite 20s linear;  }}.App-header {  background-color: #282c34;  min-height: 100vh;  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  font-size: calc(10px + 2vmin);  color: white;}.App-link {  color: #61dafb;}@keyframes App-logo-spin {  from {    transform: rotate(0deg);  }  to {    transform: rotate(360deg);  }}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/App.js 1`] = `\n\"import React, {useState, useEffect} from \\\\\"../_snowpack/pkg/react.js\\\\\";\nimport logo from \\\\\"./logo.svg.proxy.js\\\\\";\nimport \\\\\"./App.css.proxy.js\\\\\";\nfunction App({}) {\n  const [count, setCount] = useState(0);\n  useEffect(() => {\n    const timer = setTimeout(() => setCount(count + 1), 1e3);\n    return () => clearTimeout(timer);\n  }, [count, setCount]);\n  return /* @__PURE__ */ React.createElement(\\\\\"div\\\\\", {\n    className: \\\\\"App\\\\\"\n  }, /* @__PURE__ */ React.createElement(\\\\\"header\\\\\", {\n    className: \\\\\"App-header\\\\\"\n  }, /* @__PURE__ */ React.createElement(\\\\\"img\\\\\", {\n    src: logo,\n    className: \\\\\"App-logo\\\\\",\n    alt: \\\\\"logo\\\\\"\n  }), /* @__PURE__ */ React.createElement(\\\\\"p\\\\\", null, \\\\\"Edit \\\\\", /* @__PURE__ */ React.createElement(\\\\\"code\\\\\", null, \\\\\"src/App.tsx\\\\\"), \\\\\" and save to reload.\\\\\"), /* @__PURE__ */ React.createElement(\\\\\"p\\\\\", null, \\\\\"Page has been open for \\\\\", /* @__PURE__ */ React.createElement(\\\\\"code\\\\\", null, count), \\\\\" seconds.\\\\\"), /* @__PURE__ */ React.createElement(\\\\\"p\\\\\", null, /* @__PURE__ */ React.createElement(\\\\\"a\\\\\", {\n    className: \\\\\"App-link\\\\\",\n    href: \\\\\"https://reactjs.org\\\\\",\n    target: \\\\\"_blank\\\\\",\n    rel: \\\\\"noopener noreferrer\\\\\"\n  }, \\\\\"Learn React\\\\\"))));\n}\nexport default App;\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/index.css 1`] = `\n\"body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, \\\\\"Segoe UI\\\\\", \\\\\"Roboto\\\\\", \\\\\"Oxygen\\\\\",\n    \\\\\"Ubuntu\\\\\", \\\\\"Cantarell\\\\\", \\\\\"Fira Sans\\\\\", \\\\\"Droid Sans\\\\\", \\\\\"Helvetica Neue\\\\\",\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, \\\\\"Courier New\\\\\",\n    monospace;\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/index.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\"body {  margin: 0;  font-family: -apple-system, BlinkMacSystemFont, \\\\\\\\\\\\\"Segoe UI\\\\\\\\\\\\\", \\\\\\\\\\\\\"Roboto\\\\\\\\\\\\\", \\\\\\\\\\\\\"Oxygen\\\\\\\\\\\\\",    \\\\\\\\\\\\\"Ubuntu\\\\\\\\\\\\\", \\\\\\\\\\\\\"Cantarell\\\\\\\\\\\\\", \\\\\\\\\\\\\"Fira Sans\\\\\\\\\\\\\", \\\\\\\\\\\\\"Droid Sans\\\\\\\\\\\\\", \\\\\\\\\\\\\"Helvetica Neue\\\\\\\\\\\\\",    sans-serif;  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;}code {  font-family: source-code-pro, Menlo, Monaco, Consolas, \\\\\\\\\\\\\"Courier New\\\\\\\\\\\\\",    monospace;}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/index.js 1`] = `\n\"import * as __SNOWPACK_ENV__ from '../_snowpack/env.js';\nimport.meta.env = __SNOWPACK_ENV__;\nimport React from \\\\\"../_snowpack/pkg/react.js\\\\\";\nimport ReactDOM from \\\\\"../_snowpack/pkg/react-dom.js\\\\\";\nimport App from \\\\\"./App.js\\\\\";\nimport \\\\\"./index.css.proxy.js\\\\\";\nReactDOM.render(/* @__PURE__ */ React.createElement(React.StrictMode, null, /* @__PURE__ */ React.createElement(App, null)), document.getElementById(\\\\\"root\\\\\"));\nif (undefined /* [snowpack] import.meta.hot */ ) {\n  undefined /* [snowpack] import.meta.hot */ .accept();\n}\"\n`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: dist/logo.svg.proxy.js 1`] = `\"export default \\\\\"/dist/logo.svg\\\\\";\"`;\n\nexports[`create-snowpack-app app-template-react-typescript > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\\\\\"root\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: _snowpack/env.js 1`] = `\n\"export const MODE = \\\\\"production\\\\\";\nexport const NODE_ENV = \\\\\"production\\\\\";\nexport const SSR = false;\"\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"svelte\\\\\": \\\\\"./svelte.js\\\\\",\n    \\\\\"svelte/internal\\\\\": \\\\\"./svelte/internal.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: _snowpack/pkg/svelte.js 1`] = `\"export { o as onMount } from './common/index-XXXXXXXX.js';\"`;\n\nexports[`create-snowpack-app app-template-svelte > build: _snowpack/pkg/svelte/internal.js 1`] = `\"export { S as SvelteComponent, a as append, b as attr, d as detach, e as element, i as init, c as insert, n as noop, s as safe_not_equal, f as set_data, g as space, t as text } from '../common/index-XXXXXXXX.js';\"`;\n\nexports[`create-snowpack-app app-template-svelte > build: allFiles 1`] = `\nArray [\n  \"_snowpack/env.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/svelte.js\",\n  \"_snowpack/pkg/svelte/internal.js\",\n  \"dist/App.svelte.css\",\n  \"dist/App.svelte.css.proxy.js\",\n  \"dist/App.svelte.js\",\n  \"dist/index.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"logo.svg\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: dist/App.svelte.css 1`] = `\"body{margin:0;font-family:Arial, Helvetica, sans-serif}.App.svelte-rq4gzr.svelte-rq4gzr{text-align:center}.App.svelte-rq4gzr code.svelte-rq4gzr{background:#0002;padding:4px 8px;border-radius:4px}.App.svelte-rq4gzr p.svelte-rq4gzr{margin:0.4rem}.App-header.svelte-rq4gzr.svelte-rq4gzr{background-color:#f9f6f6;color:#333;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin)}.App-link.svelte-rq4gzr.svelte-rq4gzr{color:#ff3e00}.App-logo.svelte-rq4gzr.svelte-rq4gzr{height:36vmin;pointer-events:none;margin-bottom:3rem;animation:svelte-rq4gzr-App-logo-pulse infinite 1.6s ease-in-out alternate}@keyframes svelte-rq4gzr-App-logo-pulse{from{transform:scale(1)}to{transform:scale(1.06)}}\"`;\n\nexports[`create-snowpack-app app-template-svelte > build: dist/App.svelte.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\"body{margin:0;font-family:Arial, Helvetica, sans-serif}.App.svelte-rq4gzr.svelte-rq4gzr{text-align:center}.App.svelte-rq4gzr code.svelte-rq4gzr{background:#0002;padding:4px 8px;border-radius:4px}.App.svelte-rq4gzr p.svelte-rq4gzr{margin:0.4rem}.App-header.svelte-rq4gzr.svelte-rq4gzr{background-color:#f9f6f6;color:#333;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin)}.App-link.svelte-rq4gzr.svelte-rq4gzr{color:#ff3e00}.App-logo.svelte-rq4gzr.svelte-rq4gzr{height:36vmin;pointer-events:none;margin-bottom:3rem;animation:svelte-rq4gzr-App-logo-pulse infinite 1.6s ease-in-out alternate}@keyframes svelte-rq4gzr-App-logo-pulse{from{transform:scale(1)}to{transform:scale(1.06)}}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: dist/App.svelte.js 1`] = `\n\"import './App.svelte.css.proxy.js';\nimport {\n\tSvelteComponent,\n\tappend,\n\tattr,\n\tdetach,\n\telement,\n\tinit,\n\tinsert,\n\tnoop,\n\tsafe_not_equal,\n\tset_data,\n\tspace,\n\ttext\n} from \\\\\"../_snowpack/pkg/svelte/internal.js\\\\\";\nimport { onMount } from \\\\\"../_snowpack/pkg/svelte.js\\\\\";\nfunction create_fragment(ctx) {\n\tlet div;\n\tlet header;\n\tlet img;\n\tlet img_src_value;\n\tlet t0;\n\tlet p0;\n\tlet t4;\n\tlet p1;\n\tlet t5;\n\tlet code1;\n\tlet t6;\n\tlet t7;\n\tlet t8;\n\tlet p2;\n\treturn {\n\t\tc() {\n\t\t\tdiv = element(\\\\\"div\\\\\");\n\t\t\theader = element(\\\\\"header\\\\\");\n\t\t\timg = element(\\\\\"img\\\\\");\n\t\t\tt0 = space();\n\t\t\tp0 = element(\\\\\"p\\\\\");\n\t\t\tp0.innerHTML = \\`Edit <code class=\\\\\"svelte-rq4gzr\\\\\">src/App.svelte</code> and save to reload.\\`;\n\t\t\tt4 = space();\n\t\t\tp1 = element(\\\\\"p\\\\\");\n\t\t\tt5 = text(\\\\\"Page has been open for \\\\\");\n\t\t\tcode1 = element(\\\\\"code\\\\\");\n\t\t\tt6 = text(/*count*/ ctx[0]);\n\t\t\tt7 = text(\\\\\" seconds.\\\\\");\n\t\t\tt8 = space();\n\t\t\tp2 = element(\\\\\"p\\\\\");\n\t\t\tp2.innerHTML = \\`<a class=\\\\\"App-link svelte-rq4gzr\\\\\" href=\\\\\"https://svelte.dev\\\\\" target=\\\\\"_blank\\\\\" rel=\\\\\"noopener noreferrer\\\\\">Learn Svelte</a>\\`;\n\t\t\tif (img.src !== (img_src_value = \\\\\"/logo.svg\\\\\")) attr(img, \\\\\"src\\\\\", img_src_value);\n\t\t\tattr(img, \\\\\"class\\\\\", \\\\\"App-logo svelte-rq4gzr\\\\\");\n\t\t\tattr(img, \\\\\"alt\\\\\", \\\\\"logo\\\\\");\n\t\t\tattr(p0, \\\\\"class\\\\\", \\\\\"svelte-rq4gzr\\\\\");\n\t\t\tattr(code1, \\\\\"class\\\\\", \\\\\"svelte-rq4gzr\\\\\");\n\t\t\tattr(p1, \\\\\"class\\\\\", \\\\\"svelte-rq4gzr\\\\\");\n\t\t\tattr(p2, \\\\\"class\\\\\", \\\\\"svelte-rq4gzr\\\\\");\n\t\t\tattr(header, \\\\\"class\\\\\", \\\\\"App-header svelte-rq4gzr\\\\\");\n\t\t\tattr(div, \\\\\"class\\\\\", \\\\\"App svelte-rq4gzr\\\\\");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tappend(div, header);\n\t\t\tappend(header, img);\n\t\t\tappend(header, t0);\n\t\t\tappend(header, p0);\n\t\t\tappend(header, t4);\n\t\t\tappend(header, p1);\n\t\t\tappend(p1, t5);\n\t\t\tappend(p1, code1);\n\t\t\tappend(code1, t6);\n\t\t\tappend(p1, t7);\n\t\t\tappend(header, t8);\n\t\t\tappend(header, p2);\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tif (dirty & /*count*/ 1) set_data(t6, /*count*/ ctx[0]);\n\t\t},\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t}\n\t};\n}\nfunction instance($$self, $$props, $$invalidate) {\n\tlet count = 0;\n\tonMount(() => {\n\t\tconst interval = setInterval(() => $$invalidate(0, count++, count), 1000);\n\t\treturn () => {\n\t\t\tclearInterval(interval);\n\t\t};\n\t});\n\treturn [count];\n}\nclass App extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance, create_fragment, safe_not_equal, {});\n\t}\n}\nexport default App;\"\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: dist/index.js 1`] = `\n\"import * as __SNOWPACK_ENV__ from '../_snowpack/env.js';\nimport.meta.env = __SNOWPACK_ENV__;\nimport App from './App.svelte.js';\nlet app = new App({\n  target: document.body,\n});\nexport default app;\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (undefined /* [snowpack] import.meta.hot */ ) {\n  undefined /* [snowpack] import.meta.hot */ .accept();\n  undefined /* [snowpack] import.meta.hot */ .dispose(() => {\n    app.$destroy();\n  });\n}\"\n`;\n\nexports[`create-snowpack-app app-template-svelte > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: _snowpack/env.js 1`] = `\n\"export const MODE = \\\\\"production\\\\\";\nexport const NODE_ENV = \\\\\"production\\\\\";\nexport const SSR = false;\"\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"svelte\\\\\": \\\\\"./svelte.js\\\\\",\n    \\\\\"svelte/internal\\\\\": \\\\\"./svelte/internal.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: _snowpack/pkg/svelte.js 1`] = `\"export { o as onMount } from './common/index-XXXXXXXX.js';\"`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: _snowpack/pkg/svelte/internal.js 1`] = `\"export { S as SvelteComponent, a as append, b as attr, d as detach, e as element, i as init, c as insert, n as noop, s as safe_not_equal, f as set_data, g as space, t as text } from '../common/index-XXXXXXXX.js';\"`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: allFiles 1`] = `\nArray [\n  \"_snowpack/env.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/svelte.js\",\n  \"_snowpack/pkg/svelte/internal.js\",\n  \"dist/App.svelte.css\",\n  \"dist/App.svelte.css.proxy.js\",\n  \"dist/App.svelte.js\",\n  \"dist/index.js\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"logo.svg\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: dist/App.svelte.css 1`] = `\"body{margin:0;font-family:Arial, Helvetica, sans-serif}.App.svelte-190tdcp.svelte-190tdcp{text-align:center}.App.svelte-190tdcp code.svelte-190tdcp{background:#0002;padding:4px 8px;border-radius:4px}.App.svelte-190tdcp p.svelte-190tdcp{margin:0.4rem}.App-header.svelte-190tdcp.svelte-190tdcp{background-color:#f9f6f6;color:#333;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin)}.App-link.svelte-190tdcp.svelte-190tdcp{color:#ff3e00}.App-logo.svelte-190tdcp.svelte-190tdcp{height:36vmin;pointer-events:none;margin-bottom:3rem;animation:svelte-190tdcp-App-logo-spin infinite 1.6s ease-in-out alternate}@keyframes svelte-190tdcp-App-logo-spin{from{transform:scale(1)}to{transform:scale(1.06)}}\"`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: dist/App.svelte.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\"body{margin:0;font-family:Arial, Helvetica, sans-serif}.App.svelte-190tdcp.svelte-190tdcp{text-align:center}.App.svelte-190tdcp code.svelte-190tdcp{background:#0002;padding:4px 8px;border-radius:4px}.App.svelte-190tdcp p.svelte-190tdcp{margin:0.4rem}.App-header.svelte-190tdcp.svelte-190tdcp{background-color:#f9f6f6;color:#333;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin)}.App-link.svelte-190tdcp.svelte-190tdcp{color:#ff3e00}.App-logo.svelte-190tdcp.svelte-190tdcp{height:36vmin;pointer-events:none;margin-bottom:3rem;animation:svelte-190tdcp-App-logo-spin infinite 1.6s ease-in-out alternate}@keyframes svelte-190tdcp-App-logo-spin{from{transform:scale(1)}to{transform:scale(1.06)}}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: dist/App.svelte.js 1`] = `\n\"import './App.svelte.css.proxy.js';\nimport {\n\tSvelteComponent,\n\tappend,\n\tattr,\n\tdetach,\n\telement,\n\tinit,\n\tinsert,\n\tnoop,\n\tsafe_not_equal,\n\tset_data,\n\tspace,\n\ttext\n} from \\\\\"../_snowpack/pkg/svelte/internal.js\\\\\";\nimport { onMount } from \\\\\"../_snowpack/pkg/svelte.js\\\\\";\nfunction create_fragment(ctx) {\n\tlet div;\n\tlet header;\n\tlet img;\n\tlet img_src_value;\n\tlet t0;\n\tlet p0;\n\tlet t4;\n\tlet p1;\n\tlet t5;\n\tlet code1;\n\tlet t6;\n\tlet t7;\n\tlet t8;\n\tlet p2;\n\treturn {\n\t\tc() {\n\t\t\tdiv = element(\\\\\"div\\\\\");\n\t\t\theader = element(\\\\\"header\\\\\");\n\t\t\timg = element(\\\\\"img\\\\\");\n\t\t\tt0 = space();\n\t\t\tp0 = element(\\\\\"p\\\\\");\n\t\t\tp0.innerHTML = \\`Edit <code class=\\\\\"svelte-190tdcp\\\\\">src/App.svelte</code> and save to reload.\\`;\n\t\t\tt4 = space();\n\t\t\tp1 = element(\\\\\"p\\\\\");\n\t\t\tt5 = text(\\\\\"Page has been open for \\\\\");\n\t\t\tcode1 = element(\\\\\"code\\\\\");\n\t\t\tt6 = text(/*count*/ ctx[0]);\n\t\t\tt7 = text(\\\\\" seconds.\\\\\");\n\t\t\tt8 = space();\n\t\t\tp2 = element(\\\\\"p\\\\\");\n\t\t\tp2.innerHTML = \\`<a class=\\\\\"App-link svelte-190tdcp\\\\\" href=\\\\\"https://svelte.dev\\\\\" target=\\\\\"_blank\\\\\" rel=\\\\\"noopener noreferrer\\\\\">Learn Svelte</a>\\`;\n\t\t\tif (img.src !== (img_src_value = \\\\\"/logo.svg\\\\\")) attr(img, \\\\\"src\\\\\", img_src_value);\n\t\t\tattr(img, \\\\\"class\\\\\", \\\\\"App-logo svelte-190tdcp\\\\\");\n\t\t\tattr(img, \\\\\"alt\\\\\", \\\\\"logo\\\\\");\n\t\t\tattr(p0, \\\\\"class\\\\\", \\\\\"svelte-190tdcp\\\\\");\n\t\t\tattr(code1, \\\\\"class\\\\\", \\\\\"svelte-190tdcp\\\\\");\n\t\t\tattr(p1, \\\\\"class\\\\\", \\\\\"svelte-190tdcp\\\\\");\n\t\t\tattr(p2, \\\\\"class\\\\\", \\\\\"svelte-190tdcp\\\\\");\n\t\t\tattr(header, \\\\\"class\\\\\", \\\\\"App-header svelte-190tdcp\\\\\");\n\t\t\tattr(div, \\\\\"class\\\\\", \\\\\"App svelte-190tdcp\\\\\");\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tinsert(target, div, anchor);\n\t\t\tappend(div, header);\n\t\t\tappend(header, img);\n\t\t\tappend(header, t0);\n\t\t\tappend(header, p0);\n\t\t\tappend(header, t4);\n\t\t\tappend(header, p1);\n\t\t\tappend(p1, t5);\n\t\t\tappend(p1, code1);\n\t\t\tappend(code1, t6);\n\t\t\tappend(p1, t7);\n\t\t\tappend(header, t8);\n\t\t\tappend(header, p2);\n\t\t},\n\t\tp(ctx, [dirty]) {\n\t\t\tif (dirty & /*count*/ 1) set_data(t6, /*count*/ ctx[0]);\n\t\t},\n\t\ti: noop,\n\t\to: noop,\n\t\td(detaching) {\n\t\t\tif (detaching) detach(div);\n\t\t}\n\t};\n}\nfunction instance($$self, $$props, $$invalidate) {\n\tlet count = 0;\n\tonMount(() => {\n\t\tconst interval = setInterval(() => $$invalidate(0, count++, count), 1000);\n\t\treturn () => {\n\t\t\tclearInterval(interval);\n\t\t};\n\t});\n\treturn [count];\n}\nclass App extends SvelteComponent {\n\tconstructor(options) {\n\t\tsuper();\n\t\tinit(this, options, instance, create_fragment, safe_not_equal, {});\n\t}\n}\nexport default App;\"\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: dist/index.js 1`] = `\n\"import * as __SNOWPACK_ENV__ from '../_snowpack/env.js';\nimport.meta.env = __SNOWPACK_ENV__;\nimport App from \\\\\"./App.svelte.js\\\\\";\nvar app = new App({\n  target: document.body\n});\nexport default app;\nif (undefined /* [snowpack] import.meta.hot */ ) {\n  undefined /* [snowpack] import.meta.hot */ .accept();\n  undefined /* [snowpack] import.meta.hot */ .dispose(() => {\n    app.$destroy();\n  });\n}\"\n`;\n\nexports[`create-snowpack-app app-template-svelte-typescript > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: _snowpack/env.js 1`] = `\n\"export const MODE = \\\\\"production\\\\\";\nexport const NODE_ENV = \\\\\"production\\\\\";\nexport const SSR = false;\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"vue\\\\\": \\\\\"./vue.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: _snowpack/pkg/vue.js 1`] = `\n\"/**\n * Make a map and return a function for checking if a key\n * is in that map.\n * IMPORTANT: all calls of this function must be prefixed with\n * \\\\\\\\/\\\\\\\\*#\\\\\\\\_\\\\\\\\_PURE\\\\\\\\_\\\\\\\\_\\\\\\\\*\\\\\\\\/\n * So that rollup can tree-shake them if necessary.\n */\nfunction makeMap(str, expectsLowerCase) {\n    const map = Object.create(null);\n    const list = str.split(',');\n    for (let i = 0; i < list.length; i++) {\n        map[list[i]] = true;\n    }\n    return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];\n}\nconst GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +\n    'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +\n    'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';\nconst isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);\n/**\n * On the client we only need to offer special cases for boolean attributes that\n * have different names from their corresponding dom properties:\n * - itemscope -> N/A\n * - allowfullscreen -> allowFullscreen\n * - formnovalidate -> formNoValidate\n * - ismap -> isMap\n * - nomodule -> noModule\n * - novalidate -> noValidate\n * - readonly -> readOnly\n */\nconst specialBooleanAttrs = \\`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly\\`;\nconst isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);\nfunction normalizeStyle(value) {\n    if (isArray(value)) {\n        const res = {};\n        for (let i = 0; i < value.length; i++) {\n            const item = value[i];\n            const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);\n            if (normalized) {\n                for (const key in normalized) {\n                    res[key] = normalized[key];\n                }\n            }\n        }\n        return res;\n    }\n    else if (isObject(value)) {\n        return value;\n    }\n}\nconst listDelimiterRE = /;(?![^(]*\\\\\\\\))/g;\nconst propertyDelimiterRE = /:(.+)/;\nfunction parseStringStyle(cssText) {\n    const ret = {};\n    cssText.split(listDelimiterRE).forEach(item => {\n        if (item) {\n            const tmp = item.split(propertyDelimiterRE);\n            tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n        }\n    });\n    return ret;\n}\nfunction normalizeClass(value) {\n    let res = '';\n    if (isString(value)) {\n        res = value;\n    }\n    else if (isArray(value)) {\n        for (let i = 0; i < value.length; i++) {\n            const normalized = normalizeClass(value[i]);\n            if (normalized) {\n                res += normalized + ' ';\n            }\n        }\n    }\n    else if (isObject(value)) {\n        for (const name in value) {\n            if (value[name]) {\n                res += name + ' ';\n            }\n        }\n    }\n    return res.trim();\n}\n/**\n * For converting {{ interpolation }} values to displayed strings.\n * @private\n */\nconst toDisplayString = (val) => {\n    return val == null\n        ? ''\n        : isObject(val)\n            ? JSON.stringify(val, replacer, 2)\n            : String(val);\n};\nconst replacer = (_key, val) => {\n    if (isMap(val)) {\n        return {\n            [\\`Map(\\${val.size})\\`]: [...val.entries()].reduce((entries, [key, val]) => {\n                entries[\\`\\${key} =>\\`] = val;\n                return entries;\n            }, {})\n        };\n    }\n    else if (isSet(val)) {\n        return {\n            [\\`Set(\\${val.size})\\`]: [...val.values()]\n        };\n    }\n    else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n        return String(val);\n    }\n    return val;\n};\nconst EMPTY_OBJ =  {};\nconst EMPTY_ARR =  [];\nconst NOOP = () => { };\n/**\n * Always return false.\n */\nconst NO = () => false;\nconst onRE = /^on[^a-z]/;\nconst isOn = (key) => onRE.test(key);\nconst isModelListener = (key) => key.startsWith('onUpdate:');\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n    const i = arr.indexOf(el);\n    if (i > -1) {\n        arr.splice(i, 1);\n    }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === '[object Map]';\nconst isSet = (val) => toTypeString(val) === '[object Set]';\nconst isFunction = (val) => typeof val === 'function';\nconst isString = (val) => typeof val === 'string';\nconst isSymbol = (val) => typeof val === 'symbol';\nconst isObject = (val) => val !== null && typeof val === 'object';\nconst isPromise = (val) => {\n    return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n    // extract \\\\\"RawType\\\\\" from strings like \\\\\"[object RawType]\\\\\"\n    return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === '[object Object]';\nconst isIntegerKey = (key) => isString(key) &&\n    key !== 'NaN' &&\n    key[0] !== '-' &&\n    '' + parseInt(key, 10) === key;\nconst isReservedProp = /*#__PURE__*/ makeMap(\n// the leading comma is intentional so empty string \\\\\"\\\\\" is also included\n',key,ref,' +\n    'onVnodeBeforeMount,onVnodeMounted,' +\n    'onVnodeBeforeUpdate,onVnodeUpdated,' +\n    'onVnodeBeforeUnmount,onVnodeUnmounted');\nconst cacheStringFunction = (fn) => {\n    const cache = Object.create(null);\n    return ((str) => {\n        const hit = cache[str];\n        return hit || (cache[str] = fn(str));\n    });\n};\nconst camelizeRE = /-(\\\\\\\\w)/g;\n/**\n * @private\n */\nconst camelize = cacheStringFunction((str) => {\n    return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\n});\nconst hyphenateRE = /\\\\\\\\B([A-Z])/g;\n/**\n * @private\n */\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());\n/**\n * @private\n */\nconst capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\n/**\n * @private\n */\nconst toHandlerKey = cacheStringFunction((str) => (str ? \\`on\\${capitalize(str)}\\` : \\`\\`));\n// compare whether a value has changed, accounting for NaN.\nconst hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\nconst invokeArrayFns = (fns, arg) => {\n    for (let i = 0; i < fns.length; i++) {\n        fns[i](arg);\n    }\n};\nconst def = (obj, key, value) => {\n    Object.defineProperty(obj, key, {\n        configurable: true,\n        enumerable: false,\n        value\n    });\n};\nconst toNumber = (val) => {\n    const n = parseFloat(val);\n    return isNaN(n) ? val : n;\n};\nconst targetMap = new WeakMap();\nconst effectStack = [];\nlet activeEffect;\nconst ITERATE_KEY = Symbol( '');\nconst MAP_KEY_ITERATE_KEY = Symbol( '');\nfunction isEffect(fn) {\n    return fn && fn._isEffect === true;\n}\nfunction effect(fn, options = EMPTY_OBJ) {\n    if (isEffect(fn)) {\n        fn = fn.raw;\n    }\n    const effect = createReactiveEffect(fn, options);\n    if (!options.lazy) {\n        effect();\n    }\n    return effect;\n}\nfunction stop(effect) {\n    if (effect.active) {\n        cleanup(effect);\n        if (effect.options.onStop) {\n            effect.options.onStop();\n        }\n        effect.active = false;\n    }\n}\nlet uid = 0;\nfunction createReactiveEffect(fn, options) {\n    const effect = function reactiveEffect() {\n        if (!effect.active) {\n            return options.scheduler ? undefined : fn();\n        }\n        if (!effectStack.includes(effect)) {\n            cleanup(effect);\n            try {\n                enableTracking();\n                effectStack.push(effect);\n                activeEffect = effect;\n                return fn();\n            }\n            finally {\n                effectStack.pop();\n                resetTracking();\n                activeEffect = effectStack[effectStack.length - 1];\n            }\n        }\n    };\n    effect.id = uid++;\n    effect.allowRecurse = !!options.allowRecurse;\n    effect._isEffect = true;\n    effect.active = true;\n    effect.raw = fn;\n    effect.deps = [];\n    effect.options = options;\n    return effect;\n}\nfunction cleanup(effect) {\n    const { deps } = effect;\n    if (deps.length) {\n        for (let i = 0; i < deps.length; i++) {\n            deps[i].delete(effect);\n        }\n        deps.length = 0;\n    }\n}\nlet shouldTrack = true;\nconst trackStack = [];\nfunction pauseTracking() {\n    trackStack.push(shouldTrack);\n    shouldTrack = false;\n}\nfunction enableTracking() {\n    trackStack.push(shouldTrack);\n    shouldTrack = true;\n}\nfunction resetTracking() {\n    const last = trackStack.pop();\n    shouldTrack = last === undefined ? true : last;\n}\nfunction track(target, type, key) {\n    if (!shouldTrack || activeEffect === undefined) {\n        return;\n    }\n    let depsMap = targetMap.get(target);\n    if (!depsMap) {\n        targetMap.set(target, (depsMap = new Map()));\n    }\n    let dep = depsMap.get(key);\n    if (!dep) {\n        depsMap.set(key, (dep = new Set()));\n    }\n    if (!dep.has(activeEffect)) {\n        dep.add(activeEffect);\n        activeEffect.deps.push(dep);\n    }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n    const depsMap = targetMap.get(target);\n    if (!depsMap) {\n        // never been tracked\n        return;\n    }\n    const effects = new Set();\n    const add = (effectsToAdd) => {\n        if (effectsToAdd) {\n            effectsToAdd.forEach(effect => {\n                if (effect !== activeEffect || effect.allowRecurse) {\n                    effects.add(effect);\n                }\n            });\n        }\n    };\n    if (type === \\\\\"clear\\\\\" /* CLEAR */) {\n        // collection being cleared\n        // trigger all effects for target\n        depsMap.forEach(add);\n    }\n    else if (key === 'length' && isArray(target)) {\n        depsMap.forEach((dep, key) => {\n            if (key === 'length' || key >= newValue) {\n                add(dep);\n            }\n        });\n    }\n    else {\n        // schedule runs for SET | ADD | DELETE\n        if (key !== void 0) {\n            add(depsMap.get(key));\n        }\n        // also run for iteration key on ADD | DELETE | Map.SET\n        switch (type) {\n            case \\\\\"add\\\\\" /* ADD */:\n                if (!isArray(target)) {\n                    add(depsMap.get(ITERATE_KEY));\n                    if (isMap(target)) {\n                        add(depsMap.get(MAP_KEY_ITERATE_KEY));\n                    }\n                }\n                else if (isIntegerKey(key)) {\n                    // new index added to array -> length changes\n                    add(depsMap.get('length'));\n                }\n                break;\n            case \\\\\"delete\\\\\" /* DELETE */:\n                if (!isArray(target)) {\n                    add(depsMap.get(ITERATE_KEY));\n                    if (isMap(target)) {\n                        add(depsMap.get(MAP_KEY_ITERATE_KEY));\n                    }\n                }\n                break;\n            case \\\\\"set\\\\\" /* SET */:\n                if (isMap(target)) {\n                    add(depsMap.get(ITERATE_KEY));\n                }\n                break;\n        }\n    }\n    const run = (effect) => {\n        if (effect.options.scheduler) {\n            effect.options.scheduler(effect);\n        }\n        else {\n            effect();\n        }\n    };\n    effects.forEach(run);\n}\nconst isNonTrackableKeys = /*#__PURE__*/ makeMap(\\`__proto__,__v_isRef,__isVue\\`);\nconst builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)\n    .map(key => Symbol[key])\n    .filter(isSymbol));\nconst get = /*#__PURE__*/ createGetter();\nconst shallowGet = /*#__PURE__*/ createGetter(false, true);\nconst readonlyGet = /*#__PURE__*/ createGetter(true);\nconst shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);\nconst arrayInstrumentations = {};\n['includes', 'indexOf', 'lastIndexOf'].forEach(key => {\n    const method = Array.prototype[key];\n    arrayInstrumentations[key] = function (...args) {\n        const arr = toRaw(this);\n        for (let i = 0, l = this.length; i < l; i++) {\n            track(arr, \\\\\"get\\\\\" /* GET */, i + '');\n        }\n        // we run the method using the original args first (which may be reactive)\n        const res = method.apply(arr, args);\n        if (res === -1 || res === false) {\n            // if that didn't work, run it again using raw values.\n            return method.apply(arr, args.map(toRaw));\n        }\n        else {\n            return res;\n        }\n    };\n});\n['push', 'pop', 'shift', 'unshift', 'splice'].forEach(key => {\n    const method = Array.prototype[key];\n    arrayInstrumentations[key] = function (...args) {\n        pauseTracking();\n        const res = method.apply(this, args);\n        resetTracking();\n        return res;\n    };\n});\nfunction createGetter(isReadonly = false, shallow = false) {\n    return function get(target, key, receiver) {\n        if (key === \\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */) {\n            return !isReadonly;\n        }\n        else if (key === \\\\\"__v_isReadonly\\\\\" /* IS_READONLY */) {\n            return isReadonly;\n        }\n        else if (key === \\\\\"__v_raw\\\\\" /* RAW */ &&\n            receiver ===\n                (isReadonly\n                    ? shallow\n                        ? shallowReadonlyMap\n                        : readonlyMap\n                    : shallow\n                        ? shallowReactiveMap\n                        : reactiveMap).get(target)) {\n            return target;\n        }\n        const targetIsArray = isArray(target);\n        if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {\n            return Reflect.get(arrayInstrumentations, key, receiver);\n        }\n        const res = Reflect.get(target, key, receiver);\n        if (isSymbol(key)\n            ? builtInSymbols.has(key)\n            : isNonTrackableKeys(key)) {\n            return res;\n        }\n        if (!isReadonly) {\n            track(target, \\\\\"get\\\\\" /* GET */, key);\n        }\n        if (shallow) {\n            return res;\n        }\n        if (isRef(res)) {\n            // ref unwrapping - does not apply for Array + integer key.\n            const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\n            return shouldUnwrap ? res.value : res;\n        }\n        if (isObject(res)) {\n            // Convert returned value into a proxy as well. we do the isObject check\n            // here to avoid invalid value warning. Also need to lazy access readonly\n            // and reactive here to avoid circular dependency.\n            return isReadonly ? readonly(res) : reactive(res);\n        }\n        return res;\n    };\n}\nconst set = /*#__PURE__*/ createSetter();\nconst shallowSet = /*#__PURE__*/ createSetter(true);\nfunction createSetter(shallow = false) {\n    return function set(target, key, value, receiver) {\n        let oldValue = target[key];\n        if (!shallow) {\n            value = toRaw(value);\n            oldValue = toRaw(oldValue);\n            if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n                oldValue.value = value;\n                return true;\n            }\n        }\n        const hadKey = isArray(target) && isIntegerKey(key)\n            ? Number(key) < target.length\n            : hasOwn(target, key);\n        const result = Reflect.set(target, key, value, receiver);\n        // don't trigger if target is something up in the prototype chain of original\n        if (target === toRaw(receiver)) {\n            if (!hadKey) {\n                trigger(target, \\\\\"add\\\\\" /* ADD */, key, value);\n            }\n            else if (hasChanged(value, oldValue)) {\n                trigger(target, \\\\\"set\\\\\" /* SET */, key, value);\n            }\n        }\n        return result;\n    };\n}\nfunction deleteProperty(target, key) {\n    const hadKey = hasOwn(target, key);\n    const oldValue = target[key];\n    const result = Reflect.deleteProperty(target, key);\n    if (result && hadKey) {\n        trigger(target, \\\\\"delete\\\\\" /* DELETE */, key, undefined);\n    }\n    return result;\n}\nfunction has(target, key) {\n    const result = Reflect.has(target, key);\n    if (!isSymbol(key) || !builtInSymbols.has(key)) {\n        track(target, \\\\\"has\\\\\" /* HAS */, key);\n    }\n    return result;\n}\nfunction ownKeys(target) {\n    track(target, \\\\\"iterate\\\\\" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);\n    return Reflect.ownKeys(target);\n}\nconst mutableHandlers = {\n    get,\n    set,\n    deleteProperty,\n    has,\n    ownKeys\n};\nconst readonlyHandlers = {\n    get: readonlyGet,\n    set(target, key) {\n        return true;\n    },\n    deleteProperty(target, key) {\n        return true;\n    }\n};\nconst shallowReactiveHandlers = extend({}, mutableHandlers, {\n    get: shallowGet,\n    set: shallowSet\n});\n// Props handlers are special in the sense that it should not unwrap top-level\n// refs (in order to allow refs to be explicitly passed down), but should\n// retain the reactivity of the normal readonly object.\nconst shallowReadonlyHandlers = extend({}, readonlyHandlers, {\n    get: shallowReadonlyGet\n});\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\nconst toShallow = (value) => value;\nconst getProto = (v) => Reflect.getPrototypeOf(v);\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\n    // #1772: readonly(reactive(Map)) should return readonly + reactive version\n    // of the value\n    target = target[\\\\\"__v_raw\\\\\" /* RAW */];\n    const rawTarget = toRaw(target);\n    const rawKey = toRaw(key);\n    if (key !== rawKey) {\n        !isReadonly && track(rawTarget, \\\\\"get\\\\\" /* GET */, key);\n    }\n    !isReadonly && track(rawTarget, \\\\\"get\\\\\" /* GET */, rawKey);\n    const { has } = getProto(rawTarget);\n    const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n    if (has.call(rawTarget, key)) {\n        return wrap(target.get(key));\n    }\n    else if (has.call(rawTarget, rawKey)) {\n        return wrap(target.get(rawKey));\n    }\n}\nfunction has$1(key, isReadonly = false) {\n    const target = this[\\\\\"__v_raw\\\\\" /* RAW */];\n    const rawTarget = toRaw(target);\n    const rawKey = toRaw(key);\n    if (key !== rawKey) {\n        !isReadonly && track(rawTarget, \\\\\"has\\\\\" /* HAS */, key);\n    }\n    !isReadonly && track(rawTarget, \\\\\"has\\\\\" /* HAS */, rawKey);\n    return key === rawKey\n        ? target.has(key)\n        : target.has(key) || target.has(rawKey);\n}\nfunction size(target, isReadonly = false) {\n    target = target[\\\\\"__v_raw\\\\\" /* RAW */];\n    !isReadonly && track(toRaw(target), \\\\\"iterate\\\\\" /* ITERATE */, ITERATE_KEY);\n    return Reflect.get(target, 'size', target);\n}\nfunction add(value) {\n    value = toRaw(value);\n    const target = toRaw(this);\n    const proto = getProto(target);\n    const hadKey = proto.has.call(target, value);\n    if (!hadKey) {\n        target.add(value);\n        trigger(target, \\\\\"add\\\\\" /* ADD */, value, value);\n    }\n    return this;\n}\nfunction set$1(key, value) {\n    value = toRaw(value);\n    const target = toRaw(this);\n    const { has, get } = getProto(target);\n    let hadKey = has.call(target, key);\n    if (!hadKey) {\n        key = toRaw(key);\n        hadKey = has.call(target, key);\n    }\n    const oldValue = get.call(target, key);\n    target.set(key, value);\n    if (!hadKey) {\n        trigger(target, \\\\\"add\\\\\" /* ADD */, key, value);\n    }\n    else if (hasChanged(value, oldValue)) {\n        trigger(target, \\\\\"set\\\\\" /* SET */, key, value);\n    }\n    return this;\n}\nfunction deleteEntry(key) {\n    const target = toRaw(this);\n    const { has, get } = getProto(target);\n    let hadKey = has.call(target, key);\n    if (!hadKey) {\n        key = toRaw(key);\n        hadKey = has.call(target, key);\n    }\n    const oldValue = get ? get.call(target, key) : undefined;\n    // forward the operation before queueing reactions\n    const result = target.delete(key);\n    if (hadKey) {\n        trigger(target, \\\\\"delete\\\\\" /* DELETE */, key, undefined);\n    }\n    return result;\n}\nfunction clear() {\n    const target = toRaw(this);\n    const hadItems = target.size !== 0;\n    // forward the operation before queueing reactions\n    const result = target.clear();\n    if (hadItems) {\n        trigger(target, \\\\\"clear\\\\\" /* CLEAR */, undefined, undefined);\n    }\n    return result;\n}\nfunction createForEach(isReadonly, isShallow) {\n    return function forEach(callback, thisArg) {\n        const observed = this;\n        const target = observed[\\\\\"__v_raw\\\\\" /* RAW */];\n        const rawTarget = toRaw(target);\n        const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n        !isReadonly && track(rawTarget, \\\\\"iterate\\\\\" /* ITERATE */, ITERATE_KEY);\n        return target.forEach((value, key) => {\n            // important: make sure the callback is\n            // 1. invoked with the reactive map as \\`this\\` and 3rd arg\n            // 2. the value received should be a corresponding reactive/readonly.\n            return callback.call(thisArg, wrap(value), wrap(key), observed);\n        });\n    };\n}\nfunction createIterableMethod(method, isReadonly, isShallow) {\n    return function (...args) {\n        const target = this[\\\\\"__v_raw\\\\\" /* RAW */];\n        const rawTarget = toRaw(target);\n        const targetIsMap = isMap(rawTarget);\n        const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);\n        const isKeyOnly = method === 'keys' && targetIsMap;\n        const innerIterator = target[method](...args);\n        const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n        !isReadonly &&\n            track(rawTarget, \\\\\"iterate\\\\\" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\n        // return a wrapped iterator which returns observed versions of the\n        // values emitted from the real iterator\n        return {\n            // iterator protocol\n            next() {\n                const { value, done } = innerIterator.next();\n                return done\n                    ? { value, done }\n                    : {\n                        value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n                        done\n                    };\n            },\n            // iterable protocol\n            [Symbol.iterator]() {\n                return this;\n            }\n        };\n    };\n}\nfunction createReadonlyMethod(type) {\n    return function (...args) {\n        return type === \\\\\"delete\\\\\" /* DELETE */ ? false : this;\n    };\n}\nconst mutableInstrumentations = {\n    get(key) {\n        return get$1(this, key);\n    },\n    get size() {\n        return size(this);\n    },\n    has: has$1,\n    add,\n    set: set$1,\n    delete: deleteEntry,\n    clear,\n    forEach: createForEach(false, false)\n};\nconst shallowInstrumentations = {\n    get(key) {\n        return get$1(this, key, false, true);\n    },\n    get size() {\n        return size(this);\n    },\n    has: has$1,\n    add,\n    set: set$1,\n    delete: deleteEntry,\n    clear,\n    forEach: createForEach(false, true)\n};\nconst readonlyInstrumentations = {\n    get(key) {\n        return get$1(this, key, true);\n    },\n    get size() {\n        return size(this, true);\n    },\n    has(key) {\n        return has$1.call(this, key, true);\n    },\n    add: createReadonlyMethod(\\\\\"add\\\\\" /* ADD */),\n    set: createReadonlyMethod(\\\\\"set\\\\\" /* SET */),\n    delete: createReadonlyMethod(\\\\\"delete\\\\\" /* DELETE */),\n    clear: createReadonlyMethod(\\\\\"clear\\\\\" /* CLEAR */),\n    forEach: createForEach(true, false)\n};\nconst shallowReadonlyInstrumentations = {\n    get(key) {\n        return get$1(this, key, true, true);\n    },\n    get size() {\n        return size(this, true);\n    },\n    has(key) {\n        return has$1.call(this, key, true);\n    },\n    add: createReadonlyMethod(\\\\\"add\\\\\" /* ADD */),\n    set: createReadonlyMethod(\\\\\"set\\\\\" /* SET */),\n    delete: createReadonlyMethod(\\\\\"delete\\\\\" /* DELETE */),\n    clear: createReadonlyMethod(\\\\\"clear\\\\\" /* CLEAR */),\n    forEach: createForEach(true, true)\n};\nconst iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];\niteratorMethods.forEach(method => {\n    mutableInstrumentations[method] = createIterableMethod(method, false, false);\n    readonlyInstrumentations[method] = createIterableMethod(method, true, false);\n    shallowInstrumentations[method] = createIterableMethod(method, false, true);\n    shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);\n});\nfunction createInstrumentationGetter(isReadonly, shallow) {\n    const instrumentations = shallow\n        ? isReadonly\n            ? shallowReadonlyInstrumentations\n            : shallowInstrumentations\n        : isReadonly\n            ? readonlyInstrumentations\n            : mutableInstrumentations;\n    return (target, key, receiver) => {\n        if (key === \\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */) {\n            return !isReadonly;\n        }\n        else if (key === \\\\\"__v_isReadonly\\\\\" /* IS_READONLY */) {\n            return isReadonly;\n        }\n        else if (key === \\\\\"__v_raw\\\\\" /* RAW */) {\n            return target;\n        }\n        return Reflect.get(hasOwn(instrumentations, key) && key in target\n            ? instrumentations\n            : target, key, receiver);\n    };\n}\nconst mutableCollectionHandlers = {\n    get: createInstrumentationGetter(false, false)\n};\nconst shallowCollectionHandlers = {\n    get: createInstrumentationGetter(false, true)\n};\nconst readonlyCollectionHandlers = {\n    get: createInstrumentationGetter(true, false)\n};\nconst reactiveMap = new WeakMap();\nconst shallowReactiveMap = new WeakMap();\nconst readonlyMap = new WeakMap();\nconst shallowReadonlyMap = new WeakMap();\nfunction targetTypeMap(rawType) {\n    switch (rawType) {\n        case 'Object':\n        case 'Array':\n            return 1 /* COMMON */;\n        case 'Map':\n        case 'Set':\n        case 'WeakMap':\n        case 'WeakSet':\n            return 2 /* COLLECTION */;\n        default:\n            return 0 /* INVALID */;\n    }\n}\nfunction getTargetType(value) {\n    return value[\\\\\"__v_skip\\\\\" /* SKIP */] || !Object.isExtensible(value)\n        ? 0 /* INVALID */\n        : targetTypeMap(toRawType(value));\n}\nfunction reactive(target) {\n    // if trying to observe a readonly proxy, return the readonly version.\n    if (target && target[\\\\\"__v_isReadonly\\\\\" /* IS_READONLY */]) {\n        return target;\n    }\n    return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\n}\n/**\n * Return a shallowly-reactive copy of the original object, where only the root\n * level properties are reactive. It also does not auto-unwrap refs (even at the\n * root level).\n */\nfunction shallowReactive(target) {\n    return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);\n}\n/**\n * Creates a readonly copy of the original object. Note the returned copy is not\n * made reactive, but \\`readonly\\` can be called on an already reactive object.\n */\nfunction readonly(target) {\n    return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\n    if (!isObject(target)) {\n        return target;\n    }\n    // target is already a Proxy, return it.\n    // exception: calling readonly() on a reactive object\n    if (target[\\\\\"__v_raw\\\\\" /* RAW */] &&\n        !(isReadonly && target[\\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */])) {\n        return target;\n    }\n    // target already has corresponding Proxy\n    const existingProxy = proxyMap.get(target);\n    if (existingProxy) {\n        return existingProxy;\n    }\n    // only a whitelist of value types can be observed.\n    const targetType = getTargetType(target);\n    if (targetType === 0 /* INVALID */) {\n        return target;\n    }\n    const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);\n    proxyMap.set(target, proxy);\n    return proxy;\n}\nfunction isReactive(value) {\n    if (isReadonly(value)) {\n        return isReactive(value[\\\\\"__v_raw\\\\\" /* RAW */]);\n    }\n    return !!(value && value[\\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */]);\n}\nfunction isReadonly(value) {\n    return !!(value && value[\\\\\"__v_isReadonly\\\\\" /* IS_READONLY */]);\n}\nfunction isProxy(value) {\n    return isReactive(value) || isReadonly(value);\n}\nfunction toRaw(observed) {\n    return ((observed && toRaw(observed[\\\\\"__v_raw\\\\\" /* RAW */])) || observed);\n}\nfunction isRef(r) {\n    return Boolean(r && r.__v_isRef === true);\n}\nfunction unref(ref) {\n    return isRef(ref) ? ref.value : ref;\n}\nconst shallowUnwrapHandlers = {\n    get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\n    set: (target, key, value, receiver) => {\n        const oldValue = target[key];\n        if (isRef(oldValue) && !isRef(value)) {\n            oldValue.value = value;\n            return true;\n        }\n        else {\n            return Reflect.set(target, key, value, receiver);\n        }\n    }\n};\nfunction proxyRefs(objectWithRefs) {\n    return isReactive(objectWithRefs)\n        ? objectWithRefs\n        : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n}\nclass ObjectRefImpl {\n    constructor(_object, _key) {\n        this._object = _object;\n        this._key = _key;\n        this.__v_isRef = true;\n    }\n    get value() {\n        return this._object[this._key];\n    }\n    set value(newVal) {\n        this._object[this._key] = newVal;\n    }\n}\nfunction toRef(object, key) {\n    return isRef(object[key])\n        ? object[key]\n        : new ObjectRefImpl(object, key);\n}\nclass ComputedRefImpl {\n    constructor(getter, _setter, isReadonly) {\n        this._setter = _setter;\n        this._dirty = true;\n        this.__v_isRef = true;\n        this.effect = effect(getter, {\n            lazy: true,\n            scheduler: () => {\n                if (!this._dirty) {\n                    this._dirty = true;\n                    trigger(toRaw(this), \\\\\"set\\\\\" /* SET */, 'value');\n                }\n            }\n        });\n        this[\\\\\"__v_isReadonly\\\\\" /* IS_READONLY */] = isReadonly;\n    }\n    get value() {\n        // the computed ref may get wrapped by other proxies e.g. readonly() #3376\n        const self = toRaw(this);\n        if (self._dirty) {\n            self._value = this.effect();\n            self._dirty = false;\n        }\n        track(self, \\\\\"get\\\\\" /* GET */, 'value');\n        return self._value;\n    }\n    set value(newValue) {\n        this._setter(newValue);\n    }\n}\nfunction computed(getterOrOptions) {\n    let getter;\n    let setter;\n    if (isFunction(getterOrOptions)) {\n        getter = getterOrOptions;\n        setter =  NOOP;\n    }\n    else {\n        getter = getterOrOptions.get;\n        setter = getterOrOptions.set;\n    }\n    return new ComputedRefImpl(getter, setter, isFunction(getterOrOptions) || !getterOrOptions.set);\n}\nconst stack = [];\nfunction warn(msg, ...args) {\n    // avoid props formatting or warn handler tracking deps that might be mutated\n    // during patch, leading to infinite recursion.\n    pauseTracking();\n    const instance = stack.length ? stack[stack.length - 1].component : null;\n    const appWarnHandler = instance && instance.appContext.config.warnHandler;\n    const trace = getComponentTrace();\n    if (appWarnHandler) {\n        callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [\n            msg + args.join(''),\n            instance && instance.proxy,\n            trace\n                .map(({ vnode }) => \\`at <\\${formatComponentName(instance, vnode.type)}>\\`)\n                .join(''),\n            trace\n        ]);\n    }\n    else {\n        const warnArgs = [\\`[Vue warn]: \\${msg}\\`, ...args];\n        if (trace.length &&\n            // avoid spamming console during tests\n            !false) {\n            warnArgs.push(\\`\\`, ...formatTrace(trace));\n        }\n        console.warn(...warnArgs);\n    }\n    resetTracking();\n}\nfunction getComponentTrace() {\n    let currentVNode = stack[stack.length - 1];\n    if (!currentVNode) {\n        return [];\n    }\n    // we can't just use the stack because it will be incomplete during updates\n    // that did not start from the root. Re-construct the parent chain using\n    // instance parent pointers.\n    const normalizedStack = [];\n    while (currentVNode) {\n        const last = normalizedStack[0];\n        if (last && last.vnode === currentVNode) {\n            last.recurseCount++;\n        }\n        else {\n            normalizedStack.push({\n                vnode: currentVNode,\n                recurseCount: 0\n            });\n        }\n        const parentInstance = currentVNode.component && currentVNode.component.parent;\n        currentVNode = parentInstance && parentInstance.vnode;\n    }\n    return normalizedStack;\n}\nfunction formatTrace(trace) {\n    const logs = [];\n    trace.forEach((entry, i) => {\n        logs.push(...(i === 0 ? [] : [\\`\\`]), ...formatTraceEntry(entry));\n    });\n    return logs;\n}\nfunction formatTraceEntry({ vnode, recurseCount }) {\n    const postfix = recurseCount > 0 ? \\`... (\\${recurseCount} recursive calls)\\` : \\`\\`;\n    const isRoot = vnode.component ? vnode.component.parent == null : false;\n    const open = \\` at <\\${formatComponentName(vnode.component, vnode.type, isRoot)}\\`;\n    const close = \\`>\\` + postfix;\n    return vnode.props\n        ? [open, ...formatProps(vnode.props), close]\n        : [open + close];\n}\nfunction formatProps(props) {\n    const res = [];\n    const keys = Object.keys(props);\n    keys.slice(0, 3).forEach(key => {\n        res.push(...formatProp(key, props[key]));\n    });\n    if (keys.length > 3) {\n        res.push(\\` ...\\`);\n    }\n    return res;\n}\nfunction formatProp(key, value, raw) {\n    if (isString(value)) {\n        value = JSON.stringify(value);\n        return raw ? value : [\\`\\${key}=\\${value}\\`];\n    }\n    else if (typeof value === 'number' ||\n        typeof value === 'boolean' ||\n        value == null) {\n        return raw ? value : [\\`\\${key}=\\${value}\\`];\n    }\n    else if (isRef(value)) {\n        value = formatProp(key, toRaw(value.value), true);\n        return raw ? value : [\\`\\${key}=Ref<\\`, value, \\`>\\`];\n    }\n    else if (isFunction(value)) {\n        return [\\`\\${key}=fn\\${value.name ? \\`<\\${value.name}>\\` : \\`\\`}\\`];\n    }\n    else {\n        value = toRaw(value);\n        return raw ? value : [\\`\\${key}=\\`, value];\n    }\n}\nfunction callWithErrorHandling(fn, instance, type, args) {\n    let res;\n    try {\n        res = args ? fn(...args) : fn();\n    }\n    catch (err) {\n        handleError(err, instance, type);\n    }\n    return res;\n}\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\n    if (isFunction(fn)) {\n        const res = callWithErrorHandling(fn, instance, type, args);\n        if (res && isPromise(res)) {\n            res.catch(err => {\n                handleError(err, instance, type);\n            });\n        }\n        return res;\n    }\n    const values = [];\n    for (let i = 0; i < fn.length; i++) {\n        values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\n    }\n    return values;\n}\nfunction handleError(err, instance, type, throwInDev = true) {\n    const contextVNode = instance ? instance.vnode : null;\n    if (instance) {\n        let cur = instance.parent;\n        // the exposed instance is the render proxy to keep it consistent with 2.x\n        const exposedInstance = instance.proxy;\n        // in production the hook receives only the error code\n        const errorInfo =  type;\n        while (cur) {\n            const errorCapturedHooks = cur.ec;\n            if (errorCapturedHooks) {\n                for (let i = 0; i < errorCapturedHooks.length; i++) {\n                    if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\n                        return;\n                    }\n                }\n            }\n            cur = cur.parent;\n        }\n        // app-level handling\n        const appErrorHandler = instance.appContext.config.errorHandler;\n        if (appErrorHandler) {\n            callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);\n            return;\n        }\n    }\n    logError(err, type, contextVNode, throwInDev);\n}\nfunction logError(err, type, contextVNode, throwInDev = true) {\n    {\n        // recover in prod to reduce the impact on end-user\n        console.error(err);\n    }\n}\nlet isFlushing = false;\nlet isFlushPending = false;\nconst queue = [];\nlet flushIndex = 0;\nconst pendingPreFlushCbs = [];\nlet activePreFlushCbs = null;\nlet preFlushIndex = 0;\nconst pendingPostFlushCbs = [];\nlet activePostFlushCbs = null;\nlet postFlushIndex = 0;\nconst resolvedPromise = Promise.resolve();\nlet currentFlushPromise = null;\nlet currentPreFlushParentJob = null;\nconst RECURSION_LIMIT = 100;\nfunction nextTick(fn) {\n    const p = currentFlushPromise || resolvedPromise;\n    return fn ? p.then(this ? fn.bind(this) : fn) : p;\n}\n// #2768\n// Use binary-search to find a suitable position in the queue,\n// so that the queue maintains the increasing order of job's id,\n// which can prevent the job from being skipped and also can avoid repeated patching.\nfunction findInsertionIndex(job) {\n    // the start index should be \\`flushIndex + 1\\`\n    let start = flushIndex + 1;\n    let end = queue.length;\n    const jobId = getId(job);\n    while (start < end) {\n        const middle = (start + end) >>> 1;\n        const middleJobId = getId(queue[middle]);\n        middleJobId < jobId ? (start = middle + 1) : (end = middle);\n    }\n    return start;\n}\nfunction queueJob(job) {\n    // the dedupe search uses the startIndex argument of Array.includes()\n    // by default the search index includes the current job that is being run\n    // so it cannot recursively trigger itself again.\n    // if the job is a watch() callback, the search will start with a +1 index to\n    // allow it recursively trigger itself - it is the user's responsibility to\n    // ensure it doesn't end up in an infinite loop.\n    if ((!queue.length ||\n        !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&\n        job !== currentPreFlushParentJob) {\n        const pos = findInsertionIndex(job);\n        if (pos > -1) {\n            queue.splice(pos, 0, job);\n        }\n        else {\n            queue.push(job);\n        }\n        queueFlush();\n    }\n}\nfunction queueFlush() {\n    if (!isFlushing && !isFlushPending) {\n        isFlushPending = true;\n        currentFlushPromise = resolvedPromise.then(flushJobs);\n    }\n}\nfunction invalidateJob(job) {\n    const i = queue.indexOf(job);\n    if (i > flushIndex) {\n        queue.splice(i, 1);\n    }\n}\nfunction queueCb(cb, activeQueue, pendingQueue, index) {\n    if (!isArray(cb)) {\n        if (!activeQueue ||\n            !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {\n            pendingQueue.push(cb);\n        }\n    }\n    else {\n        // if cb is an array, it is a component lifecycle hook which can only be\n        // triggered by a job, which is already deduped in the main queue, so\n        // we can skip duplicate check here to improve perf\n        pendingQueue.push(...cb);\n    }\n    queueFlush();\n}\nfunction queuePreFlushCb(cb) {\n    queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);\n}\nfunction queuePostFlushCb(cb) {\n    queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);\n}\nfunction flushPreFlushCbs(seen, parentJob = null) {\n    if (pendingPreFlushCbs.length) {\n        currentPreFlushParentJob = parentJob;\n        activePreFlushCbs = [...new Set(pendingPreFlushCbs)];\n        pendingPreFlushCbs.length = 0;\n        for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {\n            activePreFlushCbs[preFlushIndex]();\n        }\n        activePreFlushCbs = null;\n        preFlushIndex = 0;\n        currentPreFlushParentJob = null;\n        // recursively flush until it drains\n        flushPreFlushCbs(seen, parentJob);\n    }\n}\nfunction flushPostFlushCbs(seen) {\n    if (pendingPostFlushCbs.length) {\n        const deduped = [...new Set(pendingPostFlushCbs)];\n        pendingPostFlushCbs.length = 0;\n        // #1947 already has active queue, nested flushPostFlushCbs call\n        if (activePostFlushCbs) {\n            activePostFlushCbs.push(...deduped);\n            return;\n        }\n        activePostFlushCbs = deduped;\n        activePostFlushCbs.sort((a, b) => getId(a) - getId(b));\n        for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\n            activePostFlushCbs[postFlushIndex]();\n        }\n        activePostFlushCbs = null;\n        postFlushIndex = 0;\n    }\n}\nconst getId = (job) => job.id == null ? Infinity : job.id;\nfunction flushJobs(seen) {\n    isFlushPending = false;\n    isFlushing = true;\n    flushPreFlushCbs(seen);\n    // Sort queue before flush.\n    // This ensures that:\n    // 1. Components are updated from parent to child. (because parent is always\n    //    created before the child so its render effect will have smaller\n    //    priority number)\n    // 2. If a component is unmounted during a parent component's update,\n    //    its update can be skipped.\n    queue.sort((a, b) => getId(a) - getId(b));\n    try {\n        for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\n            const job = queue[flushIndex];\n            if (job) {\n                if ((\\\\\"production\\\\\" !== 'production')) ;\n                callWithErrorHandling(job, null, 14 /* SCHEDULER */);\n            }\n        }\n    }\n    finally {\n        flushIndex = 0;\n        queue.length = 0;\n        flushPostFlushCbs();\n        isFlushing = false;\n        currentFlushPromise = null;\n        // some postFlushCb queued jobs!\n        // keep flushing until it drains.\n        if (queue.length || pendingPostFlushCbs.length) {\n            flushJobs(seen);\n        }\n    }\n}\nfunction checkRecursiveUpdates(seen, fn) {\n    if (!seen.has(fn)) {\n        seen.set(fn, 1);\n    }\n    else {\n        const count = seen.get(fn);\n        if (count > RECURSION_LIMIT) {\n            throw new Error(\\`Maximum recursive updates exceeded. \\` +\n                \\`This means you have a reactive effect that is mutating its own \\` +\n                \\`dependencies and thus recursively triggering itself. Possible sources \\` +\n                \\`include component template, render function, updated hook or \\` +\n                \\`watcher source function.\\`);\n        }\n        else {\n            seen.set(fn, count + 1);\n        }\n    }\n}\nfunction emit(instance, event, ...rawArgs) {\n    const props = instance.vnode.props || EMPTY_OBJ;\n    let args = rawArgs;\n    const isModelListener = event.startsWith('update:');\n    // for v-model update:xxx events, apply modifiers on args\n    const modelArg = isModelListener && event.slice(7);\n    if (modelArg && modelArg in props) {\n        const modifiersKey = \\`\\${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers\\`;\n        const { number, trim } = props[modifiersKey] || EMPTY_OBJ;\n        if (trim) {\n            args = rawArgs.map(a => a.trim());\n        }\n        else if (number) {\n            args = rawArgs.map(toNumber);\n        }\n    }\n    let handlerName;\n    let handler = props[(handlerName = toHandlerKey(event))] ||\n        // also try camelCase event handler (#2249)\n        props[(handlerName = toHandlerKey(camelize(event)))];\n    // for v-model update:xxx events, also trigger kebab-case equivalent\n    // for props passed via kebab-case\n    if (!handler && isModelListener) {\n        handler = props[(handlerName = toHandlerKey(hyphenate(event)))];\n    }\n    if (handler) {\n        callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\n    }\n    const onceHandler = props[handlerName + \\`Once\\`];\n    if (onceHandler) {\n        if (!instance.emitted) {\n            (instance.emitted = {})[handlerName] = true;\n        }\n        else if (instance.emitted[handlerName]) {\n            return;\n        }\n        callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\n    }\n}\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\n    if (!appContext.deopt && comp.__emits !== undefined) {\n        return comp.__emits;\n    }\n    const raw = comp.emits;\n    let normalized = {};\n    // apply mixin/extends props\n    let hasExtends = false;\n    if ( !isFunction(comp)) {\n        const extendEmits = (raw) => {\n            const normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true);\n            if (normalizedFromExtend) {\n                hasExtends = true;\n                extend(normalized, normalizedFromExtend);\n            }\n        };\n        if (!asMixin && appContext.mixins.length) {\n            appContext.mixins.forEach(extendEmits);\n        }\n        if (comp.extends) {\n            extendEmits(comp.extends);\n        }\n        if (comp.mixins) {\n            comp.mixins.forEach(extendEmits);\n        }\n    }\n    if (!raw && !hasExtends) {\n        return (comp.__emits = null);\n    }\n    if (isArray(raw)) {\n        raw.forEach(key => (normalized[key] = null));\n    }\n    else {\n        extend(normalized, raw);\n    }\n    return (comp.__emits = normalized);\n}\n// Check if an incoming prop key is a declared emit event listener.\n// e.g. With \\`emits: { click: null }\\`, props named \\`onClick\\` and \\`onclick\\` are\n// both considered matched listeners.\nfunction isEmitListener(options, key) {\n    if (!options || !isOn(key)) {\n        return false;\n    }\n    key = key.slice(2).replace(/Once$/, '');\n    return (hasOwn(options, key[0].toLowerCase() + key.slice(1)) ||\n        hasOwn(options, hyphenate(key)) ||\n        hasOwn(options, key));\n}\nlet isRenderingCompiledSlot = 0;\nconst setCompiledSlotRendering = (n) => (isRenderingCompiledSlot += n);\n/**\n * mark the current rendering instance for asset resolution (e.g.\n * resolveComponent, resolveDirective) during render\n */\nlet currentRenderingInstance = null;\nlet currentScopeId = null;\n/**\n * Note: rendering calls maybe nested. The function returns the parent rendering\n * instance if present, which should be restored after the render is done:\n *\n * \\`\\`\\`js\n * const prev = setCurrentRenderingInstance(i)\n * // ...render\n * setCurrentRenderingInstance(prev)\n * \\`\\`\\`\n */\nfunction setCurrentRenderingInstance(instance) {\n    const prev = currentRenderingInstance;\n    currentRenderingInstance = instance;\n    currentScopeId = (instance && instance.type.__scopeId) || null;\n    return prev;\n}\n/**\n * Wrap a slot function to memoize current rendering instance\n * @private compiler helper\n */\nfunction withCtx(fn, ctx = currentRenderingInstance) {\n    if (!ctx)\n        return fn;\n    const renderFnWithContext = (...args) => {\n        // If a user calls a compiled slot inside a template expression (#1745), it\n        // can mess up block tracking, so by default we need to push a null block to\n        // avoid that. This isn't necessary if rendering a compiled \\`<slot>\\`.\n        if (!isRenderingCompiledSlot) {\n            openBlock(true /* null block that disables tracking */);\n        }\n        const prevInstance = setCurrentRenderingInstance(ctx);\n        const res = fn(...args);\n        setCurrentRenderingInstance(prevInstance);\n        if (!isRenderingCompiledSlot) {\n            closeBlock();\n        }\n        return res;\n    };\n    // mark this as a compiled slot function.\n    // this is used in vnode.ts -> normalizeChildren() to set the slot\n    // rendering flag.\n    renderFnWithContext._c = true;\n    return renderFnWithContext;\n}\n/**\n * dev only flag to track whether $attrs was used during render.\n * If $attrs was used during render then the warning for failed attrs\n * fallthrough can be suppressed.\n */\nlet accessedAttrs = false;\nfunction markAttrsAccessed() {\n    accessedAttrs = true;\n}\nfunction renderComponentRoot(instance) {\n    const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx } = instance;\n    let result;\n    const prev = setCurrentRenderingInstance(instance);\n    try {\n        let fallthroughAttrs;\n        if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\n            // withProxy is a proxy with a different \\`has\\` trap only for\n            // runtime-compiled render functions using \\`with\\` block.\n            const proxyToUse = withProxy || proxy;\n            result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));\n            fallthroughAttrs = attrs;\n        }\n        else {\n            // functional\n            const render = Component;\n            // in dev, mark attrs accessed if optional props (attrs === props)\n            if ((\\\\\"production\\\\\" !== 'production') && attrs === props) ;\n            result = normalizeVNode(render.length > 1\n                ? render(props, (\\\\\"production\\\\\" !== 'production')\n                    ? {\n                        get attrs() {\n                            markAttrsAccessed();\n                            return attrs;\n                        },\n                        slots,\n                        emit\n                    }\n                    : { attrs, slots, emit })\n                : render(props, null /* we know it doesn't need it */));\n            fallthroughAttrs = Component.props\n                ? attrs\n                : getFunctionalFallthrough(attrs);\n        }\n        // attr merging\n        // in dev mode, comments are preserved, and it's possible for a template\n        // to have comments along side the root element which makes it a fragment\n        let root = result;\n        let setRoot = undefined;\n        if ((\\\\\"production\\\\\" !== 'production') &&\n            result.patchFlag > 0 &&\n            result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) ;\n        if (Component.inheritAttrs !== false && fallthroughAttrs) {\n            const keys = Object.keys(fallthroughAttrs);\n            const { shapeFlag } = root;\n            if (keys.length) {\n                if (shapeFlag & 1 /* ELEMENT */ ||\n                    shapeFlag & 6 /* COMPONENT */) {\n                    if (propsOptions && keys.some(isModelListener)) {\n                        // If a v-model listener (onUpdate:xxx) has a corresponding declared\n                        // prop, it indicates this component expects to handle v-model and\n                        // it should not fallthrough.\n                        // related: #1543, #1643, #1989\n                        fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);\n                    }\n                    root = cloneVNode(root, fallthroughAttrs);\n                }\n                else if ((\\\\\"production\\\\\" !== 'production') && !accessedAttrs && root.type !== Comment) ;\n            }\n        }\n        // inherit directives\n        if (vnode.dirs) {\n            if ((\\\\\"production\\\\\" !== 'production') && !isElementRoot(root)) ;\n            root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\n        }\n        // inherit transition data\n        if (vnode.transition) {\n            if ((\\\\\"production\\\\\" !== 'production') && !isElementRoot(root)) ;\n            root.transition = vnode.transition;\n        }\n        if ((\\\\\"production\\\\\" !== 'production') && setRoot) ;\n        else {\n            result = root;\n        }\n    }\n    catch (err) {\n        blockStack.length = 0;\n        handleError(err, instance, 1 /* RENDER_FUNCTION */);\n        result = createVNode(Comment);\n    }\n    setCurrentRenderingInstance(prev);\n    return result;\n}\n/**\n * dev only\n * In dev mode, template root level comments are rendered, which turns the\n * template into a fragment root, but we need to locate the single element\n * root for attrs and scope id processing.\n */\nconst getChildRoot = (vnode) => {\n    const rawChildren = vnode.children;\n    const dynamicChildren = vnode.dynamicChildren;\n    const childRoot = filterSingleRoot(rawChildren);\n    if (!childRoot) {\n        return [vnode, undefined];\n    }\n    const index = rawChildren.indexOf(childRoot);\n    const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\n    const setRoot = (updatedRoot) => {\n        rawChildren[index] = updatedRoot;\n        if (dynamicChildren) {\n            if (dynamicIndex > -1) {\n                dynamicChildren[dynamicIndex] = updatedRoot;\n            }\n            else if (updatedRoot.patchFlag > 0) {\n                vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\n            }\n        }\n    };\n    return [normalizeVNode(childRoot), setRoot];\n};\nfunction filterSingleRoot(children) {\n    let singleRoot;\n    for (let i = 0; i < children.length; i++) {\n        const child = children[i];\n        if (isVNode(child)) {\n            // ignore user comment\n            if (child.type !== Comment || child.children === 'v-if') {\n                if (singleRoot) {\n                    // has more than 1 non-comment child, return now\n                    return;\n                }\n                else {\n                    singleRoot = child;\n                }\n            }\n        }\n        else {\n            return;\n        }\n    }\n    return singleRoot;\n}\nconst getFunctionalFallthrough = (attrs) => {\n    let res;\n    for (const key in attrs) {\n        if (key === 'class' || key === 'style' || isOn(key)) {\n            (res || (res = {}))[key] = attrs[key];\n        }\n    }\n    return res;\n};\nconst filterModelListeners = (attrs, props) => {\n    const res = {};\n    for (const key in attrs) {\n        if (!isModelListener(key) || !(key.slice(9) in props)) {\n            res[key] = attrs[key];\n        }\n    }\n    return res;\n};\nconst isElementRoot = (vnode) => {\n    return (vnode.shapeFlag & 6 /* COMPONENT */ ||\n        vnode.shapeFlag & 1 /* ELEMENT */ ||\n        vnode.type === Comment // potential v-if branch switch\n    );\n};\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\n    const { props: prevProps, children: prevChildren, component } = prevVNode;\n    const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\n    const emits = component.emitsOptions;\n    // force child update for runtime directive or transition on component vnode.\n    if (nextVNode.dirs || nextVNode.transition) {\n        return true;\n    }\n    if (optimized && patchFlag >= 0) {\n        if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {\n            // slot content that references values that might have changed,\n            // e.g. in a v-for\n            return true;\n        }\n        if (patchFlag & 16 /* FULL_PROPS */) {\n            if (!prevProps) {\n                return !!nextProps;\n            }\n            // presence of this flag indicates props are always non-null\n            return hasPropsChanged(prevProps, nextProps, emits);\n        }\n        else if (patchFlag & 8 /* PROPS */) {\n            const dynamicProps = nextVNode.dynamicProps;\n            for (let i = 0; i < dynamicProps.length; i++) {\n                const key = dynamicProps[i];\n                if (nextProps[key] !== prevProps[key] &&\n                    !isEmitListener(emits, key)) {\n                    return true;\n                }\n            }\n        }\n    }\n    else {\n        // this path is only taken by manually written render functions\n        // so presence of any children leads to a forced update\n        if (prevChildren || nextChildren) {\n            if (!nextChildren || !nextChildren.$stable) {\n                return true;\n            }\n        }\n        if (prevProps === nextProps) {\n            return false;\n        }\n        if (!prevProps) {\n            return !!nextProps;\n        }\n        if (!nextProps) {\n            return true;\n        }\n        return hasPropsChanged(prevProps, nextProps, emits);\n    }\n    return false;\n}\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\n    const nextKeys = Object.keys(nextProps);\n    if (nextKeys.length !== Object.keys(prevProps).length) {\n        return true;\n    }\n    for (let i = 0; i < nextKeys.length; i++) {\n        const key = nextKeys[i];\n        if (nextProps[key] !== prevProps[key] &&\n            !isEmitListener(emitsOptions, key)) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction updateHOCHostEl({ vnode, parent }, el // HostNode\n) {\n    while (parent && parent.subTree === vnode) {\n        (vnode = parent.vnode).el = el;\n        parent = parent.parent;\n    }\n}\nconst isSuspense = (type) => type.__isSuspense;\nfunction normalizeSuspenseChildren(vnode) {\n    const { shapeFlag, children } = vnode;\n    let content;\n    let fallback;\n    if (shapeFlag & 32 /* SLOTS_CHILDREN */) {\n        content = normalizeSuspenseSlot(children.default);\n        fallback = normalizeSuspenseSlot(children.fallback);\n    }\n    else {\n        content = normalizeSuspenseSlot(children);\n        fallback = normalizeVNode(null);\n    }\n    return {\n        content,\n        fallback\n    };\n}\nfunction normalizeSuspenseSlot(s) {\n    if (isFunction(s)) {\n        s = s();\n    }\n    if (isArray(s)) {\n        const singleChild = filterSingleRoot(s);\n        s = singleChild;\n    }\n    return normalizeVNode(s);\n}\nfunction queueEffectWithSuspense(fn, suspense) {\n    if (suspense && suspense.pendingBranch) {\n        if (isArray(fn)) {\n            suspense.effects.push(...fn);\n        }\n        else {\n            suspense.effects.push(fn);\n        }\n    }\n    else {\n        queuePostFlushCb(fn);\n    }\n}\nfunction initProps(instance, rawProps, isStateful, // result of bitwise flag comparison\nisSSR = false) {\n    const props = {};\n    const attrs = {};\n    def(attrs, InternalObjectKey, 1);\n    instance.propsDefaults = Object.create(null);\n    setFullProps(instance, rawProps, props, attrs);\n    if (isStateful) {\n        // stateful\n        instance.props = isSSR ? props : shallowReactive(props);\n    }\n    else {\n        if (!instance.type.props) {\n            // functional w/ optional props, props === attrs\n            instance.props = attrs;\n        }\n        else {\n            // functional w/ declared props\n            instance.props = props;\n        }\n    }\n    instance.attrs = attrs;\n}\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\n    const { props, attrs, vnode: { patchFlag } } = instance;\n    const rawCurrentProps = toRaw(props);\n    const [options] = instance.propsOptions;\n    if (\n    // always force full diff in dev\n    // - #1942 if hmr is enabled with sfc component\n    // - vite#872 non-sfc component used by sfc component\n        (optimized || patchFlag > 0) &&\n        !(patchFlag & 16 /* FULL_PROPS */)) {\n        if (patchFlag & 8 /* PROPS */) {\n            // Compiler-generated props & no keys change, just set the updated\n            // the props.\n            const propsToUpdate = instance.vnode.dynamicProps;\n            for (let i = 0; i < propsToUpdate.length; i++) {\n                const key = propsToUpdate[i];\n                // PROPS flag guarantees rawProps to be non-null\n                const value = rawProps[key];\n                if (options) {\n                    // attr / props separation was done on init and will be consistent\n                    // in this code path, so just check if attrs have it.\n                    if (hasOwn(attrs, key)) {\n                        attrs[key] = value;\n                    }\n                    else {\n                        const camelizedKey = camelize(key);\n                        props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance);\n                    }\n                }\n                else {\n                    attrs[key] = value;\n                }\n            }\n        }\n    }\n    else {\n        // full props update.\n        setFullProps(instance, rawProps, props, attrs);\n        // in case of dynamic props, check if we need to delete keys from\n        // the props object\n        let kebabKey;\n        for (const key in rawCurrentProps) {\n            if (!rawProps ||\n                // for camelCase\n                (!hasOwn(rawProps, key) &&\n                    // it's possible the original props was passed in as kebab-case\n                    // and converted to camelCase (#955)\n                    ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))) {\n                if (options) {\n                    if (rawPrevProps &&\n                        // for camelCase\n                        (rawPrevProps[key] !== undefined ||\n                            // for kebab-case\n                            rawPrevProps[kebabKey] !== undefined)) {\n                        props[key] = resolvePropValue(options, rawProps || EMPTY_OBJ, key, undefined, instance);\n                    }\n                }\n                else {\n                    delete props[key];\n                }\n            }\n        }\n        // in the case of functional component w/o props declaration, props and\n        // attrs point to the same object so it should already have been updated.\n        if (attrs !== rawCurrentProps) {\n            for (const key in attrs) {\n                if (!rawProps || !hasOwn(rawProps, key)) {\n                    delete attrs[key];\n                }\n            }\n        }\n    }\n    // trigger updates for $attrs in case it's used in component slots\n    trigger(instance, \\\\\"set\\\\\" /* SET */, '$attrs');\n}\nfunction setFullProps(instance, rawProps, props, attrs) {\n    const [options, needCastKeys] = instance.propsOptions;\n    if (rawProps) {\n        for (const key in rawProps) {\n            const value = rawProps[key];\n            // key, ref are reserved and never passed down\n            if (isReservedProp(key)) {\n                continue;\n            }\n            // prop option names are camelized during normalization, so to support\n            // kebab -> camel conversion here we need to camelize the key.\n            let camelKey;\n            if (options && hasOwn(options, (camelKey = camelize(key)))) {\n                props[camelKey] = value;\n            }\n            else if (!isEmitListener(instance.emitsOptions, key)) {\n                // Any non-declared (either as a prop or an emitted event) props are put\n                // into a separate \\`attrs\\` object for spreading. Make sure to preserve\n                // original key casing\n                attrs[key] = value;\n            }\n        }\n    }\n    if (needCastKeys) {\n        const rawCurrentProps = toRaw(props);\n        for (let i = 0; i < needCastKeys.length; i++) {\n            const key = needCastKeys[i];\n            props[key] = resolvePropValue(options, rawCurrentProps, key, rawCurrentProps[key], instance);\n        }\n    }\n}\nfunction resolvePropValue(options, props, key, value, instance) {\n    const opt = options[key];\n    if (opt != null) {\n        const hasDefault = hasOwn(opt, 'default');\n        // default values\n        if (hasDefault && value === undefined) {\n            const defaultValue = opt.default;\n            if (opt.type !== Function && isFunction(defaultValue)) {\n                const { propsDefaults } = instance;\n                if (key in propsDefaults) {\n                    value = propsDefaults[key];\n                }\n                else {\n                    setCurrentInstance(instance);\n                    value = propsDefaults[key] = defaultValue(props);\n                    setCurrentInstance(null);\n                }\n            }\n            else {\n                value = defaultValue;\n            }\n        }\n        // boolean casting\n        if (opt[0 /* shouldCast */]) {\n            if (!hasOwn(props, key) && !hasDefault) {\n                value = false;\n            }\n            else if (opt[1 /* shouldCastTrue */] &&\n                (value === '' || value === hyphenate(key))) {\n                value = true;\n            }\n        }\n    }\n    return value;\n}\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\n    if (!appContext.deopt && comp.__props) {\n        return comp.__props;\n    }\n    const raw = comp.props;\n    const normalized = {};\n    const needCastKeys = [];\n    // apply mixin/extends props\n    let hasExtends = false;\n    if ( !isFunction(comp)) {\n        const extendProps = (raw) => {\n            hasExtends = true;\n            const [props, keys] = normalizePropsOptions(raw, appContext, true);\n            extend(normalized, props);\n            if (keys)\n                needCastKeys.push(...keys);\n        };\n        if (!asMixin && appContext.mixins.length) {\n            appContext.mixins.forEach(extendProps);\n        }\n        if (comp.extends) {\n            extendProps(comp.extends);\n        }\n        if (comp.mixins) {\n            comp.mixins.forEach(extendProps);\n        }\n    }\n    if (!raw && !hasExtends) {\n        return (comp.__props = EMPTY_ARR);\n    }\n    if (isArray(raw)) {\n        for (let i = 0; i < raw.length; i++) {\n            const normalizedKey = camelize(raw[i]);\n            if (validatePropName(normalizedKey)) {\n                normalized[normalizedKey] = EMPTY_OBJ;\n            }\n        }\n    }\n    else if (raw) {\n        for (const key in raw) {\n            const normalizedKey = camelize(key);\n            if (validatePropName(normalizedKey)) {\n                const opt = raw[key];\n                const prop = (normalized[normalizedKey] =\n                    isArray(opt) || isFunction(opt) ? { type: opt } : opt);\n                if (prop) {\n                    const booleanIndex = getTypeIndex(Boolean, prop.type);\n                    const stringIndex = getTypeIndex(String, prop.type);\n                    prop[0 /* shouldCast */] = booleanIndex > -1;\n                    prop[1 /* shouldCastTrue */] =\n                        stringIndex < 0 || booleanIndex < stringIndex;\n                    // if the prop needs boolean casting or default value\n                    if (booleanIndex > -1 || hasOwn(prop, 'default')) {\n                        needCastKeys.push(normalizedKey);\n                    }\n                }\n            }\n        }\n    }\n    return (comp.__props = [normalized, needCastKeys]);\n}\nfunction validatePropName(key) {\n    if (key[0] !== '$') {\n        return true;\n    }\n    return false;\n}\n// use function string name to check type constructors\n// so that it works across vms / iframes.\nfunction getType(ctor) {\n    const match = ctor && ctor.toString().match(/^\\\\\\\\s*function (\\\\\\\\w+)/);\n    return match ? match[1] : '';\n}\nfunction isSameType(a, b) {\n    return getType(a) === getType(b);\n}\nfunction getTypeIndex(type, expectedTypes) {\n    if (isArray(expectedTypes)) {\n        return expectedTypes.findIndex(t => isSameType(t, type));\n    }\n    else if (isFunction(expectedTypes)) {\n        return isSameType(expectedTypes, type) ? 0 : -1;\n    }\n    return -1;\n}\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\n    if (target) {\n        const hooks = target[type] || (target[type] = []);\n        // cache the error handling wrapper for injected hooks so the same hook\n        // can be properly deduped by the scheduler. \\\\\"__weh\\\\\" stands for \\\\\"with error\n        // handling\\\\\".\n        const wrappedHook = hook.__weh ||\n            (hook.__weh = (...args) => {\n                if (target.isUnmounted) {\n                    return;\n                }\n                // disable tracking inside all lifecycle hooks\n                // since they can potentially be called inside effects.\n                pauseTracking();\n                // Set currentInstance during hook invocation.\n                // This assumes the hook does not synchronously trigger other hooks, which\n                // can only be false when the user does something really funky.\n                setCurrentInstance(target);\n                const res = callWithAsyncErrorHandling(hook, target, type, args);\n                setCurrentInstance(null);\n                resetTracking();\n                return res;\n            });\n        if (prepend) {\n            hooks.unshift(wrappedHook);\n        }\n        else {\n            hooks.push(wrappedHook);\n        }\n        return wrappedHook;\n    }\n}\nconst createHook = (lifecycle) => (hook, target = currentInstance) =>\n// post-create lifecycle registrations are noops during SSR\n!isInSSRComponentSetup && injectHook(lifecycle, hook, target);\nconst onBeforeMount = createHook(\\\\\"bm\\\\\" /* BEFORE_MOUNT */);\nconst onMounted = createHook(\\\\\"m\\\\\" /* MOUNTED */);\nconst onBeforeUpdate = createHook(\\\\\"bu\\\\\" /* BEFORE_UPDATE */);\nconst onUpdated = createHook(\\\\\"u\\\\\" /* UPDATED */);\nconst onBeforeUnmount = createHook(\\\\\"bum\\\\\" /* BEFORE_UNMOUNT */);\nconst onUnmounted = createHook(\\\\\"um\\\\\" /* UNMOUNTED */);\nconst onRenderTriggered = createHook(\\\\\"rtg\\\\\" /* RENDER_TRIGGERED */);\nconst onRenderTracked = createHook(\\\\\"rtc\\\\\" /* RENDER_TRACKED */);\nconst onErrorCaptured = (hook, target = currentInstance) => {\n    injectHook(\\\\\"ec\\\\\" /* ERROR_CAPTURED */, hook, target);\n};\n// initial value for watchers to trigger on undefined initial values\nconst INITIAL_WATCHER_VALUE = {};\n// implementation\nfunction watch(source, cb, options) {\n    return doWatch(source, cb, options);\n}\nfunction doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {\n    let getter;\n    let forceTrigger = false;\n    if (isRef(source)) {\n        getter = () => source.value;\n        forceTrigger = !!source._shallow;\n    }\n    else if (isReactive(source)) {\n        getter = () => source;\n        deep = true;\n    }\n    else if (isArray(source)) {\n        getter = () => source.map(s => {\n            if (isRef(s)) {\n                return s.value;\n            }\n            else if (isReactive(s)) {\n                return traverse(s);\n            }\n            else if (isFunction(s)) {\n                return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */, [\n                    instance && instance.proxy\n                ]);\n            }\n            else ;\n        });\n    }\n    else if (isFunction(source)) {\n        if (cb) {\n            // getter with cb\n            getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */, [\n                instance && instance.proxy\n            ]);\n        }\n        else {\n            // no cb -> simple effect\n            getter = () => {\n                if (instance && instance.isUnmounted) {\n                    return;\n                }\n                if (cleanup) {\n                    cleanup();\n                }\n                return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);\n            };\n        }\n    }\n    else {\n        getter = NOOP;\n    }\n    if (cb && deep) {\n        const baseGetter = getter;\n        getter = () => traverse(baseGetter());\n    }\n    let cleanup;\n    let onInvalidate = (fn) => {\n        cleanup = runner.options.onStop = () => {\n            callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);\n        };\n    };\n    let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;\n    const job = () => {\n        if (!runner.active) {\n            return;\n        }\n        if (cb) {\n            // watch(source, cb)\n            const newValue = runner();\n            if (deep || forceTrigger || hasChanged(newValue, oldValue)) {\n                // cleanup before running cb again\n                if (cleanup) {\n                    cleanup();\n                }\n                callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [\n                    newValue,\n                    // pass undefined as the old value when it's changed for the first time\n                    oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\n                    onInvalidate\n                ]);\n                oldValue = newValue;\n            }\n        }\n        else {\n            // watchEffect\n            runner();\n        }\n    };\n    // important: mark the job as a watcher callback so that scheduler knows\n    // it is allowed to self-trigger (#1727)\n    job.allowRecurse = !!cb;\n    let scheduler;\n    if (flush === 'sync') {\n        scheduler = job;\n    }\n    else if (flush === 'post') {\n        scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);\n    }\n    else {\n        // default: 'pre'\n        scheduler = () => {\n            if (!instance || instance.isMounted) {\n                queuePreFlushCb(job);\n            }\n            else {\n                // with 'pre' option, the first call must happen before\n                // the component is mounted so it is called synchronously.\n                job();\n            }\n        };\n    }\n    const runner = effect(getter, {\n        lazy: true,\n        onTrack,\n        onTrigger,\n        scheduler\n    });\n    recordInstanceBoundEffect(runner, instance);\n    // initial run\n    if (cb) {\n        if (immediate) {\n            job();\n        }\n        else {\n            oldValue = runner();\n        }\n    }\n    else if (flush === 'post') {\n        queuePostRenderEffect(runner, instance && instance.suspense);\n    }\n    else {\n        runner();\n    }\n    return () => {\n        stop(runner);\n        if (instance) {\n            remove(instance.effects, runner);\n        }\n    };\n}\n// this.$watch\nfunction instanceWatch(source, cb, options) {\n    const publicThis = this.proxy;\n    const getter = isString(source)\n        ? () => publicThis[source]\n        : source.bind(publicThis);\n    return doWatch(getter, cb.bind(publicThis), options, this);\n}\nfunction traverse(value, seen = new Set()) {\n    if (!isObject(value) || seen.has(value)) {\n        return value;\n    }\n    seen.add(value);\n    if (isRef(value)) {\n        traverse(value.value, seen);\n    }\n    else if (isArray(value)) {\n        for (let i = 0; i < value.length; i++) {\n            traverse(value[i], seen);\n        }\n    }\n    else if (isSet(value) || isMap(value)) {\n        value.forEach((v) => {\n            traverse(v, seen);\n        });\n    }\n    else {\n        for (const key in value) {\n            traverse(value[key], seen);\n        }\n    }\n    return value;\n}\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\nfunction onActivated(hook, target) {\n    registerKeepAliveHook(hook, \\\\\"a\\\\\" /* ACTIVATED */, target);\n}\nfunction onDeactivated(hook, target) {\n    registerKeepAliveHook(hook, \\\\\"da\\\\\" /* DEACTIVATED */, target);\n}\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\n    // cache the deactivate branch check wrapper for injected hooks so the same\n    // hook can be properly deduped by the scheduler. \\\\\"__wdc\\\\\" stands for \\\\\"with\n    // deactivation check\\\\\".\n    const wrappedHook = hook.__wdc ||\n        (hook.__wdc = () => {\n            // only fire the hook if the target instance is NOT in a deactivated branch.\n            let current = target;\n            while (current) {\n                if (current.isDeactivated) {\n                    return;\n                }\n                current = current.parent;\n            }\n            hook();\n        });\n    injectHook(type, wrappedHook, target);\n    // In addition to registering it on the target instance, we walk up the parent\n    // chain and register it on all ancestor instances that are keep-alive roots.\n    // This avoids the need to walk the entire component tree when invoking these\n    // hooks, and more importantly, avoids the need to track child components in\n    // arrays.\n    if (target) {\n        let current = target.parent;\n        while (current && current.parent) {\n            if (isKeepAlive(current.parent.vnode)) {\n                injectToKeepAliveRoot(wrappedHook, type, target, current);\n            }\n            current = current.parent;\n        }\n    }\n}\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\n    // injectHook wraps the original for error handling, so make sure to remove\n    // the wrapped version.\n    const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */);\n    onUnmounted(() => {\n        remove(keepAliveRoot[type], injected);\n    }, target);\n}\nconst isInternalKey = (key) => key[0] === '_' || key === '$stable';\nconst normalizeSlotValue = (value) => isArray(value)\n    ? value.map(normalizeVNode)\n    : [normalizeVNode(value)];\nconst normalizeSlot = (key, rawSlot, ctx) => withCtx((props) => {\n    return normalizeSlotValue(rawSlot(props));\n}, ctx);\nconst normalizeObjectSlots = (rawSlots, slots) => {\n    const ctx = rawSlots._ctx;\n    for (const key in rawSlots) {\n        if (isInternalKey(key))\n            continue;\n        const value = rawSlots[key];\n        if (isFunction(value)) {\n            slots[key] = normalizeSlot(key, value, ctx);\n        }\n        else if (value != null) {\n            const normalized = normalizeSlotValue(value);\n            slots[key] = () => normalized;\n        }\n    }\n};\nconst normalizeVNodeSlots = (instance, children) => {\n    const normalized = normalizeSlotValue(children);\n    instance.slots.default = () => normalized;\n};\nconst initSlots = (instance, children) => {\n    if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\n        const type = children._;\n        if (type) {\n            instance.slots = children;\n            // make compiler marker non-enumerable\n            def(children, '_', type);\n        }\n        else {\n            normalizeObjectSlots(children, (instance.slots = {}));\n        }\n    }\n    else {\n        instance.slots = {};\n        if (children) {\n            normalizeVNodeSlots(instance, children);\n        }\n    }\n    def(instance.slots, InternalObjectKey, 1);\n};\nconst updateSlots = (instance, children, optimized) => {\n    const { vnode, slots } = instance;\n    let needDeletionCheck = true;\n    let deletionComparisonTarget = EMPTY_OBJ;\n    if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\n        const type = children._;\n        if (type) {\n            // compiled slots.\n            if (optimized && type === 1 /* STABLE */) {\n                // compiled AND stable.\n                // no need to update, and skip stale slots removal.\n                needDeletionCheck = false;\n            }\n            else {\n                // compiled but dynamic (v-if/v-for on slots) - update slots, but skip\n                // normalization.\n                extend(slots, children);\n                // #2893\n                // when rendering the optimized slots by manually written render function,\n                // we need to delete the \\`slots._\\` flag if necessary to make subsequent updates reliable,\n                // i.e. let the \\`renderSlot\\` create the bailed Fragment\n                if (!optimized && type === 1 /* STABLE */) {\n                    delete slots._;\n                }\n            }\n        }\n        else {\n            needDeletionCheck = !children.$stable;\n            normalizeObjectSlots(children, slots);\n        }\n        deletionComparisonTarget = children;\n    }\n    else if (children) {\n        // non slot object children (direct value) passed to a component\n        normalizeVNodeSlots(instance, children);\n        deletionComparisonTarget = { default: 1 };\n    }\n    // delete stale slots\n    if (needDeletionCheck) {\n        for (const key in slots) {\n            if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {\n                delete slots[key];\n            }\n        }\n    }\n};\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\n    const bindings = vnode.dirs;\n    const oldBindings = prevVNode && prevVNode.dirs;\n    for (let i = 0; i < bindings.length; i++) {\n        const binding = bindings[i];\n        if (oldBindings) {\n            binding.oldValue = oldBindings[i].value;\n        }\n        const hook = binding.dir[name];\n        if (hook) {\n            callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [\n                vnode.el,\n                binding,\n                vnode,\n                prevVNode\n            ]);\n        }\n    }\n}\nfunction createAppContext() {\n    return {\n        app: null,\n        config: {\n            isNativeTag: NO,\n            performance: false,\n            globalProperties: {},\n            optionMergeStrategies: {},\n            isCustomElement: NO,\n            errorHandler: undefined,\n            warnHandler: undefined\n        },\n        mixins: [],\n        components: {},\n        directives: {},\n        provides: Object.create(null)\n    };\n}\nlet uid$1 = 0;\nfunction createAppAPI(render, hydrate) {\n    return function createApp(rootComponent, rootProps = null) {\n        if (rootProps != null && !isObject(rootProps)) {\n            rootProps = null;\n        }\n        const context = createAppContext();\n        const installedPlugins = new Set();\n        let isMounted = false;\n        const app = (context.app = {\n            _uid: uid$1++,\n            _component: rootComponent,\n            _props: rootProps,\n            _container: null,\n            _context: context,\n            version,\n            get config() {\n                return context.config;\n            },\n            set config(v) {\n            },\n            use(plugin, ...options) {\n                if (installedPlugins.has(plugin)) ;\n                else if (plugin && isFunction(plugin.install)) {\n                    installedPlugins.add(plugin);\n                    plugin.install(app, ...options);\n                }\n                else if (isFunction(plugin)) {\n                    installedPlugins.add(plugin);\n                    plugin(app, ...options);\n                }\n                else ;\n                return app;\n            },\n            mixin(mixin) {\n                {\n                    if (!context.mixins.includes(mixin)) {\n                        context.mixins.push(mixin);\n                        // global mixin with props/emits de-optimizes props/emits\n                        // normalization caching.\n                        if (mixin.props || mixin.emits) {\n                            context.deopt = true;\n                        }\n                    }\n                }\n                return app;\n            },\n            component(name, component) {\n                if (!component) {\n                    return context.components[name];\n                }\n                context.components[name] = component;\n                return app;\n            },\n            directive(name, directive) {\n                if (!directive) {\n                    return context.directives[name];\n                }\n                context.directives[name] = directive;\n                return app;\n            },\n            mount(rootContainer, isHydrate, isSVG) {\n                if (!isMounted) {\n                    const vnode = createVNode(rootComponent, rootProps);\n                    // store app context on the root VNode.\n                    // this will be set on the root instance on initial mount.\n                    vnode.appContext = context;\n                    if (isHydrate && hydrate) {\n                        hydrate(vnode, rootContainer);\n                    }\n                    else {\n                        render(vnode, rootContainer, isSVG);\n                    }\n                    isMounted = true;\n                    app._container = rootContainer;\n                    rootContainer.__vue_app__ = app;\n                    return vnode.component.proxy;\n                }\n            },\n            unmount() {\n                if (isMounted) {\n                    render(null, app._container);\n                    delete app._container.__vue_app__;\n                }\n            },\n            provide(key, value) {\n                // TypeScript doesn't allow symbols as index type\n                // https://github.com/Microsoft/TypeScript/issues/24587\n                context.provides[key] = value;\n                return app;\n            }\n        });\n        return app;\n    };\n}\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\nconst prodEffectOptions = {\n    scheduler: queueJob,\n    // #1801, #2043 component render effects should allow recursive updates\n    allowRecurse: true\n};\nconst queuePostRenderEffect = queueEffectWithSuspense\n    ;\nconst setRef = (rawRef, oldRawRef, parentSuspense, vnode) => {\n    if (isArray(rawRef)) {\n        rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode));\n        return;\n    }\n    let value;\n    if (!vnode) {\n        // means unmount\n        value = null;\n    }\n    else if (isAsyncWrapper(vnode)) {\n        // when mounting async components, nothing needs to be done,\n        // because the template ref is forwarded to inner component\n        return;\n    }\n    else if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\n        value = vnode.component.exposed || vnode.component.proxy;\n    }\n    else {\n        value = vnode.el;\n    }\n    const { i: owner, r: ref } = rawRef;\n    const oldRef = oldRawRef && oldRawRef.r;\n    const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\n    const setupState = owner.setupState;\n    // unset old ref\n    if (oldRef != null && oldRef !== ref) {\n        if (isString(oldRef)) {\n            refs[oldRef] = null;\n            if (hasOwn(setupState, oldRef)) {\n                setupState[oldRef] = null;\n            }\n        }\n        else if (isRef(oldRef)) {\n            oldRef.value = null;\n        }\n    }\n    if (isString(ref)) {\n        const doSet = () => {\n            refs[ref] = value;\n            if (hasOwn(setupState, ref)) {\n                setupState[ref] = value;\n            }\n        };\n        // #1789: for non-null values, set them after render\n        // null values means this is unmount and it should not overwrite another\n        // ref with the same key\n        if (value) {\n            doSet.id = -1;\n            queuePostRenderEffect(doSet, parentSuspense);\n        }\n        else {\n            doSet();\n        }\n    }\n    else if (isRef(ref)) {\n        const doSet = () => {\n            ref.value = value;\n        };\n        if (value) {\n            doSet.id = -1;\n            queuePostRenderEffect(doSet, parentSuspense);\n        }\n        else {\n            doSet();\n        }\n    }\n    else if (isFunction(ref)) {\n        callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);\n    }\n    else ;\n};\n/**\n * The createRenderer function accepts two generic arguments:\n * HostNode and HostElement, corresponding to Node and Element types in the\n * host environment. For example, for runtime-dom, HostNode would be the DOM\n * \\`Node\\` interface and HostElement would be the DOM \\`Element\\` interface.\n *\n * Custom renderers can pass in the platform specific types like this:\n *\n * \\`\\`\\` js\n * const { render, createApp } = createRenderer<Node, Element>({\n *   patchProp,\n *   ...nodeOps\n * })\n * \\`\\`\\`\n */\nfunction createRenderer(options) {\n    return baseCreateRenderer(options);\n}\n// implementation\nfunction baseCreateRenderer(options, createHydrationFns) {\n    const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;\n    // Note: functions inside this closure should use \\`const xxx = () => {}\\`\n    // style in order to prevent being inlined by minifiers.\n    const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = false) => {\n        // patching & not same type, unmount old tree\n        if (n1 && !isSameVNodeType(n1, n2)) {\n            anchor = getNextHostNode(n1);\n            unmount(n1, parentComponent, parentSuspense, true);\n            n1 = null;\n        }\n        if (n2.patchFlag === -2 /* BAIL */) {\n            optimized = false;\n            n2.dynamicChildren = null;\n        }\n        const { type, ref, shapeFlag } = n2;\n        switch (type) {\n            case Text:\n                processText(n1, n2, container, anchor);\n                break;\n            case Comment:\n                processCommentNode(n1, n2, container, anchor);\n                break;\n            case Static:\n                if (n1 == null) {\n                    mountStaticNode(n2, container, anchor, isSVG);\n                }\n                break;\n            case Fragment:\n                processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                break;\n            default:\n                if (shapeFlag & 1 /* ELEMENT */) {\n                    processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else if (shapeFlag & 6 /* COMPONENT */) {\n                    processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else if (shapeFlag & 64 /* TELEPORT */) {\n                    type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\n                }\n                else if (shapeFlag & 128 /* SUSPENSE */) {\n                    type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\n                }\n                else ;\n        }\n        // set ref\n        if (ref != null && parentComponent) {\n            setRef(ref, n1 && n1.ref, parentSuspense, n2);\n        }\n    };\n    const processText = (n1, n2, container, anchor) => {\n        if (n1 == null) {\n            hostInsert((n2.el = hostCreateText(n2.children)), container, anchor);\n        }\n        else {\n            const el = (n2.el = n1.el);\n            if (n2.children !== n1.children) {\n                hostSetText(el, n2.children);\n            }\n        }\n    };\n    const processCommentNode = (n1, n2, container, anchor) => {\n        if (n1 == null) {\n            hostInsert((n2.el = hostCreateComment(n2.children || '')), container, anchor);\n        }\n        else {\n            // there's no support for dynamic comments\n            n2.el = n1.el;\n        }\n    };\n    const mountStaticNode = (n2, container, anchor, isSVG) => {\n        [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\n    };\n    const moveStaticNode = ({ el, anchor }, container, nextSibling) => {\n        let next;\n        while (el && el !== anchor) {\n            next = hostNextSibling(el);\n            hostInsert(el, container, nextSibling);\n            el = next;\n        }\n        hostInsert(anchor, container, nextSibling);\n    };\n    const removeStaticNode = ({ el, anchor }) => {\n        let next;\n        while (el && el !== anchor) {\n            next = hostNextSibling(el);\n            hostRemove(el);\n            el = next;\n        }\n        hostRemove(anchor);\n    };\n    const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        isSVG = isSVG || n2.type === 'svg';\n        if (n1 == null) {\n            mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n        else {\n            patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n    };\n    const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        let el;\n        let vnodeHook;\n        const { type, props, shapeFlag, transition, patchFlag, dirs } = vnode;\n        if (\n            vnode.el &&\n            hostCloneNode !== undefined &&\n            patchFlag === -1 /* HOISTED */) {\n            // If a vnode has non-null el, it means it's being reused.\n            // Only static vnodes can be reused, so its mounted DOM nodes should be\n            // exactly the same, and we can simply do a clone here.\n            // only do this in production since cloned trees cannot be HMR updated.\n            el = vnode.el = hostCloneNode(vnode.el);\n        }\n        else {\n            el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);\n            // mount children first, since some props may rely on child content\n            // being already rendered, e.g. \\`<select value>\\`\n            if (shapeFlag & 8 /* TEXT_CHILDREN */) {\n                hostSetElementText(el, vnode.children);\n            }\n            else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized || !!vnode.dynamicChildren);\n            }\n            if (dirs) {\n                invokeDirectiveHook(vnode, null, parentComponent, 'created');\n            }\n            // props\n            if (props) {\n                for (const key in props) {\n                    if (!isReservedProp(key)) {\n                        hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                    }\n                }\n                if ((vnodeHook = props.onVnodeBeforeMount)) {\n                    invokeVNodeHook(vnodeHook, parentComponent, vnode);\n                }\n            }\n            // scopeId\n            setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);\n        }\n        if (dirs) {\n            invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\n        }\n        // #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved\n        // #1689 For inside suspense + suspense resolved case, just call it\n        const needCallTransitionHooks = (!parentSuspense || (parentSuspense && !parentSuspense.pendingBranch)) &&\n            transition &&\n            !transition.persisted;\n        if (needCallTransitionHooks) {\n            transition.beforeEnter(el);\n        }\n        hostInsert(el, container, anchor);\n        if ((vnodeHook = props && props.onVnodeMounted) ||\n            needCallTransitionHooks ||\n            dirs) {\n            queuePostRenderEffect(() => {\n                vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\n                needCallTransitionHooks && transition.enter(el);\n                dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\n            }, parentSuspense);\n        }\n    };\n    const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {\n        if (scopeId) {\n            hostSetScopeId(el, scopeId);\n        }\n        if (slotScopeIds) {\n            for (let i = 0; i < slotScopeIds.length; i++) {\n                hostSetScopeId(el, slotScopeIds[i]);\n            }\n        }\n        if (parentComponent) {\n            let subTree = parentComponent.subTree;\n            if (vnode === subTree) {\n                const parentVNode = parentComponent.vnode;\n                setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);\n            }\n        }\n    };\n    const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, optimized, slotScopeIds, start = 0) => {\n        for (let i = start; i < children.length; i++) {\n            const child = (children[i] = optimized\n                ? cloneIfMounted(children[i])\n                : normalizeVNode(children[i]));\n            patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, optimized, slotScopeIds);\n        }\n    };\n    const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        const el = (n2.el = n1.el);\n        let { patchFlag, dynamicChildren, dirs } = n2;\n        // #1426 take the old vnode's patch flag into account since user may clone a\n        // compiler-generated vnode, which de-opts to FULL_PROPS\n        patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;\n        const oldProps = n1.props || EMPTY_OBJ;\n        const newProps = n2.props || EMPTY_OBJ;\n        let vnodeHook;\n        if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {\n            invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\n        }\n        if (dirs) {\n            invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');\n        }\n        if (patchFlag > 0) {\n            // the presence of a patchFlag means this element's render code was\n            // generated by the compiler and can take the fast path.\n            // in this path old node and new node are guaranteed to have the same shape\n            // (i.e. at the exact same position in the source template)\n            if (patchFlag & 16 /* FULL_PROPS */) {\n                // element props contain dynamic keys, full diff needed\n                patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\n            }\n            else {\n                // class\n                // this flag is matched when the element has dynamic class bindings.\n                if (patchFlag & 2 /* CLASS */) {\n                    if (oldProps.class !== newProps.class) {\n                        hostPatchProp(el, 'class', null, newProps.class, isSVG);\n                    }\n                }\n                // style\n                // this flag is matched when the element has dynamic style bindings\n                if (patchFlag & 4 /* STYLE */) {\n                    hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);\n                }\n                // props\n                // This flag is matched when the element has dynamic prop/attr bindings\n                // other than class and style. The keys of dynamic prop/attrs are saved for\n                // faster iteration.\n                // Note dynamic keys like :[foo]=\\\\\"bar\\\\\" will cause this optimization to\n                // bail out and go through a full diff because we need to unset the old key\n                if (patchFlag & 8 /* PROPS */) {\n                    // if the flag is present then dynamicProps must be non-null\n                    const propsToUpdate = n2.dynamicProps;\n                    for (let i = 0; i < propsToUpdate.length; i++) {\n                        const key = propsToUpdate[i];\n                        const prev = oldProps[key];\n                        const next = newProps[key];\n                        if (next !== prev ||\n                            (hostForcePatchProp && hostForcePatchProp(el, key))) {\n                            hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);\n                        }\n                    }\n                }\n            }\n            // text\n            // This flag is matched when the element has only dynamic text children.\n            if (patchFlag & 1 /* TEXT */) {\n                if (n1.children !== n2.children) {\n                    hostSetElementText(el, n2.children);\n                }\n            }\n        }\n        else if (!optimized && dynamicChildren == null) {\n            // unoptimized, full diff\n            patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\n        }\n        const areChildrenSVG = isSVG && n2.type !== 'foreignObject';\n        if (dynamicChildren) {\n            patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);\n        }\n        else if (!optimized) {\n            // full diff\n            patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);\n        }\n        if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {\n            queuePostRenderEffect(() => {\n                vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\n                dirs && invokeDirectiveHook(n2, n1, parentComponent, 'updated');\n            }, parentSuspense);\n        }\n    };\n    // The fast path for blocks.\n    const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {\n        for (let i = 0; i < newChildren.length; i++) {\n            const oldVNode = oldChildren[i];\n            const newVNode = newChildren[i];\n            // Determine the container (parent element) for the patch.\n            const container =\n            // - In the case of a Fragment, we need to provide the actual parent\n            // of the Fragment itself so it can move its children.\n            oldVNode.type === Fragment ||\n                // - In the case of different nodes, there is going to be a replacement\n                // which also requires the correct parent container\n                !isSameVNodeType(oldVNode, newVNode) ||\n                // - In the case of a component, it could contain anything.\n                oldVNode.shapeFlag & 6 /* COMPONENT */ ||\n                oldVNode.shapeFlag & 64 /* TELEPORT */\n                ? hostParentNode(oldVNode.el)\n                : // In other cases, the parent container is not actually used so we\n                    // just pass the block element here to avoid a DOM parentNode call.\n                    fallbackContainer;\n            patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);\n        }\n    };\n    const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {\n        if (oldProps !== newProps) {\n            for (const key in newProps) {\n                // empty string is not valid prop\n                if (isReservedProp(key))\n                    continue;\n                const next = newProps[key];\n                const prev = oldProps[key];\n                if (next !== prev ||\n                    (hostForcePatchProp && hostForcePatchProp(el, key))) {\n                    hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                }\n            }\n            if (oldProps !== EMPTY_OBJ) {\n                for (const key in oldProps) {\n                    if (!isReservedProp(key) && !(key in newProps)) {\n                        hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                    }\n                }\n            }\n        }\n    };\n    const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));\n        const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));\n        let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;\n        if (patchFlag > 0) {\n            optimized = true;\n        }\n        // check if this is a slot fragment with :slotted scope ids\n        if (fragmentSlotScopeIds) {\n            slotScopeIds = slotScopeIds\n                ? slotScopeIds.concat(fragmentSlotScopeIds)\n                : fragmentSlotScopeIds;\n        }\n        if (n1 == null) {\n            hostInsert(fragmentStartAnchor, container, anchor);\n            hostInsert(fragmentEndAnchor, container, anchor);\n            // a fragment can only have array children\n            // since they are either generated by the compiler, or implicitly created\n            // from arrays.\n            mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n        else {\n            if (patchFlag > 0 &&\n                patchFlag & 64 /* STABLE_FRAGMENT */ &&\n                dynamicChildren &&\n                // #2715 the previous fragment could've been a BAILed one as a result\n                // of renderSlot() with no valid children\n                n1.dynamicChildren) {\n                // a stable fragment (template root or <template v-for>) doesn't need to\n                // patch children order, but it may contain dynamicChildren.\n                patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);\n                if (\n                // #2080 if the stable fragment has a key, it's a <template v-for> that may\n                //  get moved around. Make sure all root level vnodes inherit el.\n                // #2134 or if it's a component root, it may also get moved around\n                // as the component is being moved.\n                n2.key != null ||\n                    (parentComponent && n2 === parentComponent.subTree)) {\n                    traverseStaticChildren(n1, n2, true /* shallow */);\n                }\n            }\n            else {\n                // keyed / unkeyed, or manual fragments.\n                // for keyed & unkeyed, since they are compiler generated from v-for,\n                // each child is guaranteed to be a block so the fragment will never\n                // have dynamicChildren.\n                patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n            }\n        }\n    };\n    const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        n2.slotScopeIds = slotScopeIds;\n        if (n1 == null) {\n            if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\n                parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);\n            }\n            else {\n                mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\n            }\n        }\n        else {\n            updateComponent(n1, n2, optimized);\n        }\n    };\n    const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {\n        const instance = (initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense));\n        // inject renderer internals for keepAlive\n        if (isKeepAlive(initialVNode)) {\n            instance.ctx.renderer = internals;\n        }\n        setupComponent(instance);\n        // setup() is async. This component relies on async logic to be resolved\n        // before proceeding\n        if (instance.asyncDep) {\n            parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);\n            // Give it a placeholder if this is not hydration\n            // TODO handle self-defined fallback\n            if (!initialVNode.el) {\n                const placeholder = (instance.subTree = createVNode(Comment));\n                processCommentNode(null, placeholder, container, anchor);\n            }\n            return;\n        }\n        setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);\n    };\n    const updateComponent = (n1, n2, optimized) => {\n        const instance = (n2.component = n1.component);\n        if (shouldUpdateComponent(n1, n2, optimized)) {\n            if (instance.asyncDep &&\n                !instance.asyncResolved) {\n                updateComponentPreRender(instance, n2, optimized);\n                return;\n            }\n            else {\n                // normal update\n                instance.next = n2;\n                // in case the child component is also queued, remove it to avoid\n                // double updating the same child component in the same flush.\n                invalidateJob(instance.update);\n                // instance.update is the reactive effect runner.\n                instance.update();\n            }\n        }\n        else {\n            // no update needed. just copy over properties\n            n2.component = n1.component;\n            n2.el = n1.el;\n            instance.vnode = n2;\n        }\n    };\n    const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {\n        // create reactive effect for rendering\n        instance.update = effect(function componentEffect() {\n            if (!instance.isMounted) {\n                let vnodeHook;\n                const { el, props } = initialVNode;\n                const { bm, m, parent } = instance;\n                // beforeMount hook\n                if (bm) {\n                    invokeArrayFns(bm);\n                }\n                // onVnodeBeforeMount\n                if ((vnodeHook = props && props.onVnodeBeforeMount)) {\n                    invokeVNodeHook(vnodeHook, parent, initialVNode);\n                }\n                const subTree = (instance.subTree = renderComponentRoot(instance));\n                if (el && hydrateNode) {\n                    // vnode has adopted host node - perform hydration instead of mount.\n                    hydrateNode(initialVNode.el, subTree, instance, parentSuspense, null);\n                }\n                else {\n                    patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);\n                    initialVNode.el = subTree.el;\n                }\n                // mounted hook\n                if (m) {\n                    queuePostRenderEffect(m, parentSuspense);\n                }\n                // onVnodeMounted\n                if ((vnodeHook = props && props.onVnodeMounted)) {\n                    const scopedInitialVNode = initialVNode;\n                    queuePostRenderEffect(() => {\n                        invokeVNodeHook(vnodeHook, parent, scopedInitialVNode);\n                    }, parentSuspense);\n                }\n                // activated hook for keep-alive roots.\n                // #1742 activated hook must be accessed after first render\n                // since the hook may be injected by a child keep-alive\n                const { a } = instance;\n                if (a &&\n                    initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\n                    queuePostRenderEffect(a, parentSuspense);\n                }\n                instance.isMounted = true;\n                // #2458: deference mount-only object parameters to prevent memleaks\n                initialVNode = container = anchor = null;\n            }\n            else {\n                // updateComponent\n                // This is triggered by mutation of component's own state (next: null)\n                // OR parent calling processComponent (next: VNode)\n                let { next, bu, u, parent, vnode } = instance;\n                let originNext = next;\n                let vnodeHook;\n                if (next) {\n                    next.el = vnode.el;\n                    updateComponentPreRender(instance, next, optimized);\n                }\n                else {\n                    next = vnode;\n                }\n                // beforeUpdate hook\n                if (bu) {\n                    invokeArrayFns(bu);\n                }\n                // onVnodeBeforeUpdate\n                if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {\n                    invokeVNodeHook(vnodeHook, parent, next, vnode);\n                }\n                const nextTree = renderComponentRoot(instance);\n                const prevTree = instance.subTree;\n                instance.subTree = nextTree;\n                patch(prevTree, nextTree,\n                // parent may have changed if it's in a teleport\n                hostParentNode(prevTree.el),\n                // anchor may have changed if it's in a fragment\n                getNextHostNode(prevTree), instance, parentSuspense, isSVG);\n                next.el = nextTree.el;\n                if (originNext === null) {\n                    // self-triggered update. In case of HOC, update parent component\n                    // vnode el. HOC is indicated by parent instance's subTree pointing\n                    // to child component's vnode\n                    updateHOCHostEl(instance, nextTree.el);\n                }\n                // updated hook\n                if (u) {\n                    queuePostRenderEffect(u, parentSuspense);\n                }\n                // onVnodeUpdated\n                if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {\n                    queuePostRenderEffect(() => {\n                        invokeVNodeHook(vnodeHook, parent, next, vnode);\n                    }, parentSuspense);\n                }\n            }\n        },  prodEffectOptions);\n    };\n    const updateComponentPreRender = (instance, nextVNode, optimized) => {\n        nextVNode.component = instance;\n        const prevProps = instance.vnode.props;\n        instance.vnode = nextVNode;\n        instance.next = null;\n        updateProps(instance, nextVNode.props, prevProps, optimized);\n        updateSlots(instance, nextVNode.children, optimized);\n        pauseTracking();\n        // props update may have triggered pre-flush watchers.\n        // flush them before the render update.\n        flushPreFlushCbs(undefined, instance.update);\n        resetTracking();\n    };\n    const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {\n        const c1 = n1 && n1.children;\n        const prevShapeFlag = n1 ? n1.shapeFlag : 0;\n        const c2 = n2.children;\n        const { patchFlag, shapeFlag } = n2;\n        // fast path\n        if (patchFlag > 0) {\n            if (patchFlag & 128 /* KEYED_FRAGMENT */) {\n                // this could be either fully-keyed or mixed (some keyed some not)\n                // presence of patchFlag means children are guaranteed to be arrays\n                patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                return;\n            }\n            else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {\n                // unkeyed\n                patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                return;\n            }\n        }\n        // children has 3 possibilities: text, array or no children.\n        if (shapeFlag & 8 /* TEXT_CHILDREN */) {\n            // text children fast path\n            if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\n                unmountChildren(c1, parentComponent, parentSuspense);\n            }\n            if (c2 !== c1) {\n                hostSetElementText(container, c2);\n            }\n        }\n        else {\n            if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\n                // prev children was array\n                if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                    // two arrays, cannot assume anything, do full diff\n                    patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else {\n                    // no new children, just unmount old\n                    unmountChildren(c1, parentComponent, parentSuspense, true);\n                }\n            }\n            else {\n                // prev children was text OR null\n                // new children is array OR null\n                if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {\n                    hostSetElementText(container, '');\n                }\n                // mount new if array\n                if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                    mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n            }\n        }\n    };\n    const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        c1 = c1 || EMPTY_ARR;\n        c2 = c2 || EMPTY_ARR;\n        const oldLength = c1.length;\n        const newLength = c2.length;\n        const commonLength = Math.min(oldLength, newLength);\n        let i;\n        for (i = 0; i < commonLength; i++) {\n            const nextChild = (c2[i] = optimized\n                ? cloneIfMounted(c2[i])\n                : normalizeVNode(c2[i]));\n            patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n        if (oldLength > newLength) {\n            // remove old\n            unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);\n        }\n        else {\n            // mount new\n            mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);\n        }\n    };\n    // can be all-keyed or mixed\n    const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        let i = 0;\n        const l2 = c2.length;\n        let e1 = c1.length - 1; // prev ending index\n        let e2 = l2 - 1; // next ending index\n        // 1. sync from start\n        // (a b) c\n        // (a b) d e\n        while (i <= e1 && i <= e2) {\n            const n1 = c1[i];\n            const n2 = (c2[i] = optimized\n                ? cloneIfMounted(c2[i])\n                : normalizeVNode(c2[i]));\n            if (isSameVNodeType(n1, n2)) {\n                patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n            }\n            else {\n                break;\n            }\n            i++;\n        }\n        // 2. sync from end\n        // a (b c)\n        // d e (b c)\n        while (i <= e1 && i <= e2) {\n            const n1 = c1[e1];\n            const n2 = (c2[e2] = optimized\n                ? cloneIfMounted(c2[e2])\n                : normalizeVNode(c2[e2]));\n            if (isSameVNodeType(n1, n2)) {\n                patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n            }\n            else {\n                break;\n            }\n            e1--;\n            e2--;\n        }\n        // 3. common sequence + mount\n        // (a b)\n        // (a b) c\n        // i = 2, e1 = 1, e2 = 2\n        // (a b)\n        // c (a b)\n        // i = 0, e1 = -1, e2 = 0\n        if (i > e1) {\n            if (i <= e2) {\n                const nextPos = e2 + 1;\n                const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;\n                while (i <= e2) {\n                    patch(null, (c2[i] = optimized\n                        ? cloneIfMounted(c2[i])\n                        : normalizeVNode(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                    i++;\n                }\n            }\n        }\n        // 4. common sequence + unmount\n        // (a b) c\n        // (a b)\n        // i = 2, e1 = 2, e2 = 1\n        // a (b c)\n        // (b c)\n        // i = 0, e1 = 0, e2 = -1\n        else if (i > e2) {\n            while (i <= e1) {\n                unmount(c1[i], parentComponent, parentSuspense, true);\n                i++;\n            }\n        }\n        // 5. unknown sequence\n        // [i ... e1 + 1]: a b [c d e] f g\n        // [i ... e2 + 1]: a b [e d c h] f g\n        // i = 2, e1 = 4, e2 = 5\n        else {\n            const s1 = i; // prev starting index\n            const s2 = i; // next starting index\n            // 5.1 build key:index map for newChildren\n            const keyToNewIndexMap = new Map();\n            for (i = s2; i <= e2; i++) {\n                const nextChild = (c2[i] = optimized\n                    ? cloneIfMounted(c2[i])\n                    : normalizeVNode(c2[i]));\n                if (nextChild.key != null) {\n                    keyToNewIndexMap.set(nextChild.key, i);\n                }\n            }\n            // 5.2 loop through old children left to be patched and try to patch\n            // matching nodes & remove nodes that are no longer present\n            let j;\n            let patched = 0;\n            const toBePatched = e2 - s2 + 1;\n            let moved = false;\n            // used to track whether any node has moved\n            let maxNewIndexSoFar = 0;\n            // works as Map<newIndex, oldIndex>\n            // Note that oldIndex is offset by +1\n            // and oldIndex = 0 is a special value indicating the new node has\n            // no corresponding old node.\n            // used for determining longest stable subsequence\n            const newIndexToOldIndexMap = new Array(toBePatched);\n            for (i = 0; i < toBePatched; i++)\n                newIndexToOldIndexMap[i] = 0;\n            for (i = s1; i <= e1; i++) {\n                const prevChild = c1[i];\n                if (patched >= toBePatched) {\n                    // all new children have been patched so this can only be a removal\n                    unmount(prevChild, parentComponent, parentSuspense, true);\n                    continue;\n                }\n                let newIndex;\n                if (prevChild.key != null) {\n                    newIndex = keyToNewIndexMap.get(prevChild.key);\n                }\n                else {\n                    // key-less node, try to locate a key-less node of the same type\n                    for (j = s2; j <= e2; j++) {\n                        if (newIndexToOldIndexMap[j - s2] === 0 &&\n                            isSameVNodeType(prevChild, c2[j])) {\n                            newIndex = j;\n                            break;\n                        }\n                    }\n                }\n                if (newIndex === undefined) {\n                    unmount(prevChild, parentComponent, parentSuspense, true);\n                }\n                else {\n                    newIndexToOldIndexMap[newIndex - s2] = i + 1;\n                    if (newIndex >= maxNewIndexSoFar) {\n                        maxNewIndexSoFar = newIndex;\n                    }\n                    else {\n                        moved = true;\n                    }\n                    patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                    patched++;\n                }\n            }\n            // 5.3 move and mount\n            // generate longest stable subsequence only when nodes have moved\n            const increasingNewIndexSequence = moved\n                ? getSequence(newIndexToOldIndexMap)\n                : EMPTY_ARR;\n            j = increasingNewIndexSequence.length - 1;\n            // looping backwards so that we can use last patched node as anchor\n            for (i = toBePatched - 1; i >= 0; i--) {\n                const nextIndex = s2 + i;\n                const nextChild = c2[nextIndex];\n                const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;\n                if (newIndexToOldIndexMap[i] === 0) {\n                    // mount new\n                    patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else if (moved) {\n                    // move if:\n                    // There is no stable subsequence (e.g. a reverse)\n                    // OR current node is not among the stable sequence\n                    if (j < 0 || i !== increasingNewIndexSequence[j]) {\n                        move(nextChild, container, anchor, 2 /* REORDER */);\n                    }\n                    else {\n                        j--;\n                    }\n                }\n            }\n        }\n    };\n    const move = (vnode, container, anchor, moveType, parentSuspense = null) => {\n        const { el, type, transition, children, shapeFlag } = vnode;\n        if (shapeFlag & 6 /* COMPONENT */) {\n            move(vnode.component.subTree, container, anchor, moveType);\n            return;\n        }\n        if (shapeFlag & 128 /* SUSPENSE */) {\n            vnode.suspense.move(container, anchor, moveType);\n            return;\n        }\n        if (shapeFlag & 64 /* TELEPORT */) {\n            type.move(vnode, container, anchor, internals);\n            return;\n        }\n        if (type === Fragment) {\n            hostInsert(el, container, anchor);\n            for (let i = 0; i < children.length; i++) {\n                move(children[i], container, anchor, moveType);\n            }\n            hostInsert(vnode.anchor, container, anchor);\n            return;\n        }\n        if (type === Static) {\n            moveStaticNode(vnode, container, anchor);\n            return;\n        }\n        // single nodes\n        const needTransition = moveType !== 2 /* REORDER */ &&\n            shapeFlag & 1 /* ELEMENT */ &&\n            transition;\n        if (needTransition) {\n            if (moveType === 0 /* ENTER */) {\n                transition.beforeEnter(el);\n                hostInsert(el, container, anchor);\n                queuePostRenderEffect(() => transition.enter(el), parentSuspense);\n            }\n            else {\n                const { leave, delayLeave, afterLeave } = transition;\n                const remove = () => hostInsert(el, container, anchor);\n                const performLeave = () => {\n                    leave(el, () => {\n                        remove();\n                        afterLeave && afterLeave();\n                    });\n                };\n                if (delayLeave) {\n                    delayLeave(el, remove, performLeave);\n                }\n                else {\n                    performLeave();\n                }\n            }\n        }\n        else {\n            hostInsert(el, container, anchor);\n        }\n    };\n    const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {\n        const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode;\n        // unset ref\n        if (ref != null) {\n            setRef(ref, null, parentSuspense, null);\n        }\n        if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\n            parentComponent.ctx.deactivate(vnode);\n            return;\n        }\n        const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;\n        let vnodeHook;\n        if ((vnodeHook = props && props.onVnodeBeforeUnmount)) {\n            invokeVNodeHook(vnodeHook, parentComponent, vnode);\n        }\n        if (shapeFlag & 6 /* COMPONENT */) {\n            unmountComponent(vnode.component, parentSuspense, doRemove);\n        }\n        else {\n            if (shapeFlag & 128 /* SUSPENSE */) {\n                vnode.suspense.unmount(parentSuspense, doRemove);\n                return;\n            }\n            if (shouldInvokeDirs) {\n                invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');\n            }\n            if (shapeFlag & 64 /* TELEPORT */) {\n                vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);\n            }\n            else if (dynamicChildren &&\n                // #1153: fast path should not be taken for non-stable (v-for) fragments\n                (type !== Fragment ||\n                    (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {\n                // fast path for block nodes: only need to unmount dynamic children.\n                unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);\n            }\n            else if ((type === Fragment &&\n                (patchFlag & 128 /* KEYED_FRAGMENT */ ||\n                    patchFlag & 256 /* UNKEYED_FRAGMENT */)) ||\n                (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {\n                unmountChildren(children, parentComponent, parentSuspense);\n            }\n            if (doRemove) {\n                remove(vnode);\n            }\n        }\n        if ((vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {\n            queuePostRenderEffect(() => {\n                vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\n                shouldInvokeDirs &&\n                    invokeDirectiveHook(vnode, null, parentComponent, 'unmounted');\n            }, parentSuspense);\n        }\n    };\n    const remove = vnode => {\n        const { type, el, anchor, transition } = vnode;\n        if (type === Fragment) {\n            removeFragment(el, anchor);\n            return;\n        }\n        if (type === Static) {\n            removeStaticNode(vnode);\n            return;\n        }\n        const performRemove = () => {\n            hostRemove(el);\n            if (transition && !transition.persisted && transition.afterLeave) {\n                transition.afterLeave();\n            }\n        };\n        if (vnode.shapeFlag & 1 /* ELEMENT */ &&\n            transition &&\n            !transition.persisted) {\n            const { leave, delayLeave } = transition;\n            const performLeave = () => leave(el, performRemove);\n            if (delayLeave) {\n                delayLeave(vnode.el, performRemove, performLeave);\n            }\n            else {\n                performLeave();\n            }\n        }\n        else {\n            performRemove();\n        }\n    };\n    const removeFragment = (cur, end) => {\n        // For fragments, directly remove all contained DOM nodes.\n        // (fragment child nodes cannot have transition)\n        let next;\n        while (cur !== end) {\n            next = hostNextSibling(cur);\n            hostRemove(cur);\n            cur = next;\n        }\n        hostRemove(end);\n    };\n    const unmountComponent = (instance, parentSuspense, doRemove) => {\n        const { bum, effects, update, subTree, um } = instance;\n        // beforeUnmount hook\n        if (bum) {\n            invokeArrayFns(bum);\n        }\n        if (effects) {\n            for (let i = 0; i < effects.length; i++) {\n                stop(effects[i]);\n            }\n        }\n        // update may be null if a component is unmounted before its async\n        // setup has resolved.\n        if (update) {\n            stop(update);\n            unmount(subTree, instance, parentSuspense, doRemove);\n        }\n        // unmounted hook\n        if (um) {\n            queuePostRenderEffect(um, parentSuspense);\n        }\n        queuePostRenderEffect(() => {\n            instance.isUnmounted = true;\n        }, parentSuspense);\n        // A component with async dep inside a pending suspense is unmounted before\n        // its async dep resolves. This should remove the dep from the suspense, and\n        // cause the suspense to resolve immediately if that was the last dep.\n        if (parentSuspense &&\n            parentSuspense.pendingBranch &&\n            !parentSuspense.isUnmounted &&\n            instance.asyncDep &&\n            !instance.asyncResolved &&\n            instance.suspenseId === parentSuspense.pendingId) {\n            parentSuspense.deps--;\n            if (parentSuspense.deps === 0) {\n                parentSuspense.resolve();\n            }\n        }\n    };\n    const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {\n        for (let i = start; i < children.length; i++) {\n            unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);\n        }\n    };\n    const getNextHostNode = vnode => {\n        if (vnode.shapeFlag & 6 /* COMPONENT */) {\n            return getNextHostNode(vnode.component.subTree);\n        }\n        if (vnode.shapeFlag & 128 /* SUSPENSE */) {\n            return vnode.suspense.next();\n        }\n        return hostNextSibling((vnode.anchor || vnode.el));\n    };\n    const render = (vnode, container, isSVG) => {\n        if (vnode == null) {\n            if (container._vnode) {\n                unmount(container._vnode, null, null, true);\n            }\n        }\n        else {\n            patch(container._vnode || null, vnode, container, null, null, null, isSVG);\n        }\n        flushPostFlushCbs();\n        container._vnode = vnode;\n    };\n    const internals = {\n        p: patch,\n        um: unmount,\n        m: move,\n        r: remove,\n        mt: mountComponent,\n        mc: mountChildren,\n        pc: patchChildren,\n        pbc: patchBlockChildren,\n        n: getNextHostNode,\n        o: options\n    };\n    let hydrate;\n    let hydrateNode;\n    if (createHydrationFns) {\n        [hydrate, hydrateNode] = createHydrationFns(internals);\n    }\n    return {\n        render,\n        hydrate,\n        createApp: createAppAPI(render, hydrate)\n    };\n}\nfunction invokeVNodeHook(hook, instance, vnode, prevVNode = null) {\n    callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [\n        vnode,\n        prevVNode\n    ]);\n}\n/**\n * #1156\n * When a component is HMR-enabled, we need to make sure that all static nodes\n * inside a block also inherit the DOM element from the previous tree so that\n * HMR updates (which are full updates) can retrieve the element for patching.\n *\n * #2080\n * Inside keyed \\`template\\` fragment static children, if a fragment is moved,\n * the children will always moved so that need inherit el form previous nodes\n * to ensure correct moved position.\n */\nfunction traverseStaticChildren(n1, n2, shallow = false) {\n    const ch1 = n1.children;\n    const ch2 = n2.children;\n    if (isArray(ch1) && isArray(ch2)) {\n        for (let i = 0; i < ch1.length; i++) {\n            // this is only called in the optimized path so array children are\n            // guaranteed to be vnodes\n            const c1 = ch1[i];\n            let c2 = ch2[i];\n            if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {\n                if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {\n                    c2 = ch2[i] = cloneIfMounted(ch2[i]);\n                    c2.el = c1.el;\n                }\n                if (!shallow)\n                    traverseStaticChildren(c1, c2);\n            }\n        }\n    }\n}\n// https://en.wikipedia.org/wiki/Longest_increasing_subsequence\nfunction getSequence(arr) {\n    const p = arr.slice();\n    const result = [0];\n    let i, j, u, v, c;\n    const len = arr.length;\n    for (i = 0; i < len; i++) {\n        const arrI = arr[i];\n        if (arrI !== 0) {\n            j = result[result.length - 1];\n            if (arr[j] < arrI) {\n                p[i] = j;\n                result.push(i);\n                continue;\n            }\n            u = 0;\n            v = result.length - 1;\n            while (u < v) {\n                c = ((u + v) / 2) | 0;\n                if (arr[result[c]] < arrI) {\n                    u = c + 1;\n                }\n                else {\n                    v = c;\n                }\n            }\n            if (arrI < arr[result[u]]) {\n                if (u > 0) {\n                    p[i] = result[u - 1];\n                }\n                result[u] = i;\n            }\n        }\n    }\n    u = result.length;\n    v = result[u - 1];\n    while (u-- > 0) {\n        result[u] = v;\n        v = p[v];\n    }\n    return result;\n}\nconst isTeleport = (type) => type.__isTeleport;\nconst NULL_DYNAMIC_COMPONENT = Symbol();\nconst Fragment = Symbol( undefined);\nconst Text = Symbol( undefined);\nconst Comment = Symbol( undefined);\nconst Static = Symbol( undefined);\n// Since v-if and v-for are the two possible ways node structure can dynamically\n// change, once we consider v-if branches and each v-for fragment a block, we\n// can divide a template into nested blocks, and within each block the node\n// structure would be stable. This allows us to skip most children diffing\n// and only worry about the dynamic nodes (indicated by patch flags).\nconst blockStack = [];\nlet currentBlock = null;\n/**\n * Open a block.\n * This must be called before \\`createBlock\\`. It cannot be part of \\`createBlock\\`\n * because the children of the block are evaluated before \\`createBlock\\` itself\n * is called. The generated code typically looks like this:\n *\n * \\`\\`\\`js\n * function render() {\n *   return (openBlock(),createBlock('div', null, [...]))\n * }\n * \\`\\`\\`\n * disableTracking is true when creating a v-for fragment block, since a v-for\n * fragment always diffs its children.\n *\n * @private\n */\nfunction openBlock(disableTracking = false) {\n    blockStack.push((currentBlock = disableTracking ? null : []));\n}\nfunction closeBlock() {\n    blockStack.pop();\n    currentBlock = blockStack[blockStack.length - 1] || null;\n}\n/**\n * Create a block root vnode. Takes the same exact arguments as \\`createVNode\\`.\n * A block root keeps track of dynamic nodes within the block in the\n * \\`dynamicChildren\\` array.\n *\n * @private\n */\nfunction createBlock(type, props, children, patchFlag, dynamicProps) {\n    const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\n    // save current block children on the block vnode\n    vnode.dynamicChildren = currentBlock || EMPTY_ARR;\n    // close block\n    closeBlock();\n    // a block is always going to be patched, so track it as a child of its\n    // parent block\n    if ( currentBlock) {\n        currentBlock.push(vnode);\n    }\n    return vnode;\n}\nfunction isVNode(value) {\n    return value ? value.__v_isVNode === true : false;\n}\nfunction isSameVNodeType(n1, n2) {\n    return n1.type === n2.type && n1.key === n2.key;\n}\nconst InternalObjectKey = \\`__vInternal\\`;\nconst normalizeKey = ({ key }) => key != null ? key : null;\nconst normalizeRef = ({ ref }) => {\n    return (ref != null\n        ? isString(ref) || isRef(ref) || isFunction(ref)\n            ? { i: currentRenderingInstance, r: ref }\n            : ref\n        : null);\n};\nconst createVNode = ( _createVNode);\nfunction _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\n    if (!type || type === NULL_DYNAMIC_COMPONENT) {\n        type = Comment;\n    }\n    if (isVNode(type)) {\n        // createVNode receiving an existing vnode. This happens in cases like\n        // <component :is=\\\\\"vnode\\\\\"/>\n        // #2078 make sure to merge refs during the clone instead of overwriting it\n        const cloned = cloneVNode(type, props, true /* mergeRef: true */);\n        if (children) {\n            normalizeChildren(cloned, children);\n        }\n        return cloned;\n    }\n    // class component normalization.\n    if (isClassComponent(type)) {\n        type = type.__vccOpts;\n    }\n    // class & style normalization.\n    if (props) {\n        // for reactive or proxy objects, we need to clone it to enable mutation.\n        if (isProxy(props) || InternalObjectKey in props) {\n            props = extend({}, props);\n        }\n        let { class: klass, style } = props;\n        if (klass && !isString(klass)) {\n            props.class = normalizeClass(klass);\n        }\n        if (isObject(style)) {\n            // reactive state objects need to be cloned since they are likely to be\n            // mutated\n            if (isProxy(style) && !isArray(style)) {\n                style = extend({}, style);\n            }\n            props.style = normalizeStyle(style);\n        }\n    }\n    // encode the vnode type information into a bitmap\n    const shapeFlag = isString(type)\n        ? 1 /* ELEMENT */\n        : isSuspense(type)\n            ? 128 /* SUSPENSE */\n            : isTeleport(type)\n                ? 64 /* TELEPORT */\n                : isObject(type)\n                    ? 4 /* STATEFUL_COMPONENT */\n                    : isFunction(type)\n                        ? 2 /* FUNCTIONAL_COMPONENT */\n                        : 0;\n    const vnode = {\n        __v_isVNode: true,\n        [\\\\\"__v_skip\\\\\" /* SKIP */]: true,\n        type,\n        props,\n        key: props && normalizeKey(props),\n        ref: props && normalizeRef(props),\n        scopeId: currentScopeId,\n        slotScopeIds: null,\n        children: null,\n        component: null,\n        suspense: null,\n        ssContent: null,\n        ssFallback: null,\n        dirs: null,\n        transition: null,\n        el: null,\n        anchor: null,\n        target: null,\n        targetAnchor: null,\n        staticCount: 0,\n        shapeFlag,\n        patchFlag,\n        dynamicProps,\n        dynamicChildren: null,\n        appContext: null\n    };\n    normalizeChildren(vnode, children);\n    // normalize suspense children\n    if (shapeFlag & 128 /* SUSPENSE */) {\n        const { content, fallback } = normalizeSuspenseChildren(vnode);\n        vnode.ssContent = content;\n        vnode.ssFallback = fallback;\n    }\n    if (\n        // avoid a block node from tracking itself\n        !isBlockNode &&\n        // has current parent block\n        currentBlock &&\n        // presence of a patch flag indicates this node needs patching on updates.\n        // component nodes also should always be patched, because even if the\n        // component doesn't need to update, it needs to persist the instance on to\n        // the next vnode so that it can be properly unmounted later.\n        (patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&\n        // the EVENTS flag is only for hydration and if it is the only flag, the\n        // vnode should not be considered dynamic due to handler caching.\n        patchFlag !== 32 /* HYDRATE_EVENTS */) {\n        currentBlock.push(vnode);\n    }\n    return vnode;\n}\nfunction cloneVNode(vnode, extraProps, mergeRef = false) {\n    // This is intentionally NOT using spread or extend to avoid the runtime\n    // key enumeration cost.\n    const { props, ref, patchFlag, children } = vnode;\n    const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;\n    return {\n        __v_isVNode: true,\n        [\\\\\"__v_skip\\\\\" /* SKIP */]: true,\n        type: vnode.type,\n        props: mergedProps,\n        key: mergedProps && normalizeKey(mergedProps),\n        ref: extraProps && extraProps.ref\n            ? // #2078 in the case of <component :is=\\\\\"vnode\\\\\" ref=\\\\\"extra\\\\\"/>\n                // if the vnode itself already has a ref, cloneVNode will need to merge\n                // the refs so the single vnode can be set on multiple refs\n                mergeRef && ref\n                    ? isArray(ref)\n                        ? ref.concat(normalizeRef(extraProps))\n                        : [ref, normalizeRef(extraProps)]\n                    : normalizeRef(extraProps)\n            : ref,\n        scopeId: vnode.scopeId,\n        slotScopeIds: vnode.slotScopeIds,\n        children:  children,\n        target: vnode.target,\n        targetAnchor: vnode.targetAnchor,\n        staticCount: vnode.staticCount,\n        shapeFlag: vnode.shapeFlag,\n        // if the vnode is cloned with extra props, we can no longer assume its\n        // existing patch flag to be reliable and need to add the FULL_PROPS flag.\n        // note: perserve flag for fragments since they use the flag for children\n        // fast paths only.\n        patchFlag: extraProps && vnode.type !== Fragment\n            ? patchFlag === -1 // hoisted node\n                ? 16 /* FULL_PROPS */\n                : patchFlag | 16 /* FULL_PROPS */\n            : patchFlag,\n        dynamicProps: vnode.dynamicProps,\n        dynamicChildren: vnode.dynamicChildren,\n        appContext: vnode.appContext,\n        dirs: vnode.dirs,\n        transition: vnode.transition,\n        // These should technically only be non-null on mounted VNodes. However,\n        // they *should* be copied for kept-alive vnodes. So we just always copy\n        // them since them being non-null during a mount doesn't affect the logic as\n        // they will simply be overwritten.\n        component: vnode.component,\n        suspense: vnode.suspense,\n        ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),\n        ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),\n        el: vnode.el,\n        anchor: vnode.anchor\n    };\n}\n/**\n * @private\n */\nfunction createTextVNode(text = ' ', flag = 0) {\n    return createVNode(Text, null, text, flag);\n}\nfunction normalizeVNode(child) {\n    if (child == null || typeof child === 'boolean') {\n        // empty placeholder\n        return createVNode(Comment);\n    }\n    else if (isArray(child)) {\n        // fragment\n        return createVNode(Fragment, null, child);\n    }\n    else if (typeof child === 'object') {\n        // already vnode, this should be the most common since compiled templates\n        // always produce all-vnode children arrays\n        return child.el === null ? child : cloneVNode(child);\n    }\n    else {\n        // strings and numbers\n        return createVNode(Text, null, String(child));\n    }\n}\n// optimized normalization for template-compiled render fns\nfunction cloneIfMounted(child) {\n    return child.el === null ? child : cloneVNode(child);\n}\nfunction normalizeChildren(vnode, children) {\n    let type = 0;\n    const { shapeFlag } = vnode;\n    if (children == null) {\n        children = null;\n    }\n    else if (isArray(children)) {\n        type = 16 /* ARRAY_CHILDREN */;\n    }\n    else if (typeof children === 'object') {\n        if (shapeFlag & 1 /* ELEMENT */ || shapeFlag & 64 /* TELEPORT */) {\n            // Normalize slot to plain children for plain element and Teleport\n            const slot = children.default;\n            if (slot) {\n                // _c marker is added by withCtx() indicating this is a compiled slot\n                slot._c && setCompiledSlotRendering(1);\n                normalizeChildren(vnode, slot());\n                slot._c && setCompiledSlotRendering(-1);\n            }\n            return;\n        }\n        else {\n            type = 32 /* SLOTS_CHILDREN */;\n            const slotFlag = children._;\n            if (!slotFlag && !(InternalObjectKey in children)) {\n                children._ctx = currentRenderingInstance;\n            }\n            else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {\n                // a child component receives forwarded slots from the parent.\n                // its slot type is determined by its parent's slot type.\n                if (currentRenderingInstance.vnode.patchFlag & 1024 /* DYNAMIC_SLOTS */) {\n                    children._ = 2 /* DYNAMIC */;\n                    vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;\n                }\n                else {\n                    children._ = 1 /* STABLE */;\n                }\n            }\n        }\n    }\n    else if (isFunction(children)) {\n        children = { default: children, _ctx: currentRenderingInstance };\n        type = 32 /* SLOTS_CHILDREN */;\n    }\n    else {\n        children = String(children);\n        // force teleport children to array so it can be moved around\n        if (shapeFlag & 64 /* TELEPORT */) {\n            type = 16 /* ARRAY_CHILDREN */;\n            children = [createTextVNode(children)];\n        }\n        else {\n            type = 8 /* TEXT_CHILDREN */;\n        }\n    }\n    vnode.children = children;\n    vnode.shapeFlag |= type;\n}\nfunction mergeProps(...args) {\n    const ret = extend({}, args[0]);\n    for (let i = 1; i < args.length; i++) {\n        const toMerge = args[i];\n        for (const key in toMerge) {\n            if (key === 'class') {\n                if (ret.class !== toMerge.class) {\n                    ret.class = normalizeClass([ret.class, toMerge.class]);\n                }\n            }\n            else if (key === 'style') {\n                ret.style = normalizeStyle([ret.style, toMerge.style]);\n            }\n            else if (isOn(key)) {\n                const existing = ret[key];\n                const incoming = toMerge[key];\n                if (existing !== incoming) {\n                    ret[key] = existing\n                        ? [].concat(existing, toMerge[key])\n                        : incoming;\n                }\n            }\n            else if (key !== '') {\n                ret[key] = toMerge[key];\n            }\n        }\n    }\n    return ret;\n}\nfunction provide(key, value) {\n    if (!currentInstance) ;\n    else {\n        let provides = currentInstance.provides;\n        // by default an instance inherits its parent's provides object\n        // but when it needs to provide values of its own, it creates its\n        // own provides object using parent provides object as prototype.\n        // this way in \\`inject\\` we can simply look up injections from direct\n        // parent and let the prototype chain do the work.\n        const parentProvides = currentInstance.parent && currentInstance.parent.provides;\n        if (parentProvides === provides) {\n            provides = currentInstance.provides = Object.create(parentProvides);\n        }\n        // TS doesn't allow symbol as index type\n        provides[key] = value;\n    }\n}\nfunction inject(key, defaultValue, treatDefaultAsFactory = false) {\n    // fallback to \\`currentRenderingInstance\\` so that this can be called in\n    // a functional component\n    const instance = currentInstance || currentRenderingInstance;\n    if (instance) {\n        // #2400\n        // to support \\`app.use\\` plugins,\n        // fallback to appContext's \\`provides\\` if the intance is at root\n        const provides = instance.parent == null\n            ? instance.vnode.appContext && instance.vnode.appContext.provides\n            : instance.parent.provides;\n        if (provides && key in provides) {\n            // TS doesn't allow symbol as index type\n            return provides[key];\n        }\n        else if (arguments.length > 1) {\n            return treatDefaultAsFactory && isFunction(defaultValue)\n                ? defaultValue()\n                : defaultValue;\n        }\n        else ;\n    }\n}\nlet shouldCacheAccess = true;\nfunction applyOptions(instance, options, deferredData = [], deferredWatch = [], deferredProvide = [], asMixin = false) {\n    const {\n    // composition\n    mixins, extends: extendsOptions,\n    // state\n    data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions,\n    // assets\n    components, directives,\n    // lifecycle\n    beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured,\n    // public API\n    expose } = options;\n    const publicThis = instance.proxy;\n    const ctx = instance.ctx;\n    const globalMixins = instance.appContext.mixins;\n    if (asMixin && render && instance.render === NOOP) {\n        instance.render = render;\n    }\n    // applyOptions is called non-as-mixin once per instance\n    if (!asMixin) {\n        shouldCacheAccess = false;\n        callSyncHook('beforeCreate', \\\\\"bc\\\\\" /* BEFORE_CREATE */, options, instance, globalMixins);\n        shouldCacheAccess = true;\n        // global mixins are applied first\n        applyMixins(instance, globalMixins, deferredData, deferredWatch, deferredProvide);\n    }\n    // extending a base component...\n    if (extendsOptions) {\n        applyOptions(instance, extendsOptions, deferredData, deferredWatch, deferredProvide, true);\n    }\n    // local mixins\n    if (mixins) {\n        applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide);\n    }\n    // options initialization order (to be consistent with Vue 2):\n    // - props (already done outside of this function)\n    // - inject\n    // - methods\n    // - data (deferred since it relies on \\`this\\` access)\n    // - computed\n    // - watch (deferred since it relies on \\`this\\` access)\n    if (injectOptions) {\n        if (isArray(injectOptions)) {\n            for (let i = 0; i < injectOptions.length; i++) {\n                const key = injectOptions[i];\n                ctx[key] = inject(key);\n            }\n        }\n        else {\n            for (const key in injectOptions) {\n                const opt = injectOptions[key];\n                if (isObject(opt)) {\n                    ctx[key] = inject(opt.from || key, opt.default, true /* treat default function as factory */);\n                }\n                else {\n                    ctx[key] = inject(opt);\n                }\n            }\n        }\n    }\n    if (methods) {\n        for (const key in methods) {\n            const methodHandler = methods[key];\n            if (isFunction(methodHandler)) {\n                // In dev mode, we use the \\`createRenderContext\\` function to define methods to the proxy target,\n                // and those are read-only but reconfigurable, so it needs to be redefined here\n                {\n                    ctx[key] = methodHandler.bind(publicThis);\n                }\n            }\n        }\n    }\n    if (!asMixin) {\n        if (deferredData.length) {\n            deferredData.forEach(dataFn => resolveData(instance, dataFn, publicThis));\n        }\n        if (dataOptions) {\n            // @ts-ignore dataOptions is not fully type safe\n            resolveData(instance, dataOptions, publicThis);\n        }\n    }\n    else if (dataOptions) {\n        deferredData.push(dataOptions);\n    }\n    if (computedOptions) {\n        for (const key in computedOptions) {\n            const opt = computedOptions[key];\n            const get = isFunction(opt)\n                ? opt.bind(publicThis, publicThis)\n                : isFunction(opt.get)\n                    ? opt.get.bind(publicThis, publicThis)\n                    : NOOP;\n            const set = !isFunction(opt) && isFunction(opt.set)\n                ? opt.set.bind(publicThis)\n                :  NOOP;\n            const c = computed$1({\n                get,\n                set\n            });\n            Object.defineProperty(ctx, key, {\n                enumerable: true,\n                configurable: true,\n                get: () => c.value,\n                set: v => (c.value = v)\n            });\n        }\n    }\n    if (watchOptions) {\n        deferredWatch.push(watchOptions);\n    }\n    if (!asMixin && deferredWatch.length) {\n        deferredWatch.forEach(watchOptions => {\n            for (const key in watchOptions) {\n                createWatcher(watchOptions[key], ctx, publicThis, key);\n            }\n        });\n    }\n    if (provideOptions) {\n        deferredProvide.push(provideOptions);\n    }\n    if (!asMixin && deferredProvide.length) {\n        deferredProvide.forEach(provideOptions => {\n            const provides = isFunction(provideOptions)\n                ? provideOptions.call(publicThis)\n                : provideOptions;\n            Reflect.ownKeys(provides).forEach(key => {\n                provide(key, provides[key]);\n            });\n        });\n    }\n    // asset options.\n    // To reduce memory usage, only components with mixins or extends will have\n    // resolved asset registry attached to instance.\n    if (asMixin) {\n        if (components) {\n            extend(instance.components ||\n                (instance.components = extend({}, instance.type.components)), components);\n        }\n        if (directives) {\n            extend(instance.directives ||\n                (instance.directives = extend({}, instance.type.directives)), directives);\n        }\n    }\n    // lifecycle options\n    if (!asMixin) {\n        callSyncHook('created', \\\\\"c\\\\\" /* CREATED */, options, instance, globalMixins);\n    }\n    if (beforeMount) {\n        onBeforeMount(beforeMount.bind(publicThis));\n    }\n    if (mounted) {\n        onMounted(mounted.bind(publicThis));\n    }\n    if (beforeUpdate) {\n        onBeforeUpdate(beforeUpdate.bind(publicThis));\n    }\n    if (updated) {\n        onUpdated(updated.bind(publicThis));\n    }\n    if (activated) {\n        onActivated(activated.bind(publicThis));\n    }\n    if (deactivated) {\n        onDeactivated(deactivated.bind(publicThis));\n    }\n    if (errorCaptured) {\n        onErrorCaptured(errorCaptured.bind(publicThis));\n    }\n    if (renderTracked) {\n        onRenderTracked(renderTracked.bind(publicThis));\n    }\n    if (renderTriggered) {\n        onRenderTriggered(renderTriggered.bind(publicThis));\n    }\n    if (beforeUnmount) {\n        onBeforeUnmount(beforeUnmount.bind(publicThis));\n    }\n    if (unmounted) {\n        onUnmounted(unmounted.bind(publicThis));\n    }\n    if (isArray(expose)) {\n        if (!asMixin) {\n            if (expose.length) {\n                const exposed = instance.exposed || (instance.exposed = proxyRefs({}));\n                expose.forEach(key => {\n                    exposed[key] = toRef(publicThis, key);\n                });\n            }\n            else if (!instance.exposed) {\n                instance.exposed = EMPTY_OBJ;\n            }\n        }\n    }\n}\nfunction callSyncHook(name, type, options, instance, globalMixins) {\n    for (let i = 0; i < globalMixins.length; i++) {\n        callHookWithMixinAndExtends(name, type, globalMixins[i], instance);\n    }\n    callHookWithMixinAndExtends(name, type, options, instance);\n}\nfunction callHookWithMixinAndExtends(name, type, options, instance) {\n    const { extends: base, mixins } = options;\n    const selfHook = options[name];\n    if (base) {\n        callHookWithMixinAndExtends(name, type, base, instance);\n    }\n    if (mixins) {\n        for (let i = 0; i < mixins.length; i++) {\n            callHookWithMixinAndExtends(name, type, mixins[i], instance);\n        }\n    }\n    if (selfHook) {\n        callWithAsyncErrorHandling(selfHook.bind(instance.proxy), instance, type);\n    }\n}\nfunction applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide) {\n    for (let i = 0; i < mixins.length; i++) {\n        applyOptions(instance, mixins[i], deferredData, deferredWatch, deferredProvide, true);\n    }\n}\nfunction resolveData(instance, dataFn, publicThis) {\n    shouldCacheAccess = false;\n    const data = dataFn.call(publicThis, publicThis);\n    shouldCacheAccess = true;\n    if (!isObject(data)) ;\n    else if (instance.data === EMPTY_OBJ) {\n        instance.data = reactive(data);\n    }\n    else {\n        // existing data: this is a mixin or extends.\n        extend(instance.data, data);\n    }\n}\nfunction createWatcher(raw, ctx, publicThis, key) {\n    const getter = key.includes('.')\n        ? createPathGetter(publicThis, key)\n        : () => publicThis[key];\n    if (isString(raw)) {\n        const handler = ctx[raw];\n        if (isFunction(handler)) {\n            watch(getter, handler);\n        }\n    }\n    else if (isFunction(raw)) {\n        watch(getter, raw.bind(publicThis));\n    }\n    else if (isObject(raw)) {\n        if (isArray(raw)) {\n            raw.forEach(r => createWatcher(r, ctx, publicThis, key));\n        }\n        else {\n            const handler = isFunction(raw.handler)\n                ? raw.handler.bind(publicThis)\n                : ctx[raw.handler];\n            if (isFunction(handler)) {\n                watch(getter, handler, raw);\n            }\n        }\n    }\n    else ;\n}\nfunction createPathGetter(ctx, path) {\n    const segments = path.split('.');\n    return () => {\n        let cur = ctx;\n        for (let i = 0; i < segments.length && cur; i++) {\n            cur = cur[segments[i]];\n        }\n        return cur;\n    };\n}\nfunction resolveMergedOptions(instance) {\n    const raw = instance.type;\n    const { __merged, mixins, extends: extendsOptions } = raw;\n    if (__merged)\n        return __merged;\n    const globalMixins = instance.appContext.mixins;\n    if (!globalMixins.length && !mixins && !extendsOptions)\n        return raw;\n    const options = {};\n    globalMixins.forEach(m => mergeOptions(options, m, instance));\n    mergeOptions(options, raw, instance);\n    return (raw.__merged = options);\n}\nfunction mergeOptions(to, from, instance) {\n    const strats = instance.appContext.config.optionMergeStrategies;\n    const { mixins, extends: extendsOptions } = from;\n    extendsOptions && mergeOptions(to, extendsOptions, instance);\n    mixins &&\n        mixins.forEach((m) => mergeOptions(to, m, instance));\n    for (const key in from) {\n        if (strats && hasOwn(strats, key)) {\n            to[key] = strats[key](to[key], from[key], instance.proxy, key);\n        }\n        else {\n            to[key] = from[key];\n        }\n    }\n}\n/**\n * #2437 In Vue 3, functional components do not have a public instance proxy but\n * they exist in the internal parent chain. For code that relies on traversing\n * public $parent chains, skip functional ones and go to the parent instead.\n */\nconst getPublicInstance = (i) => {\n    if (!i)\n        return null;\n    if (isStatefulComponent(i))\n        return i.exposed ? i.exposed : i.proxy;\n    return getPublicInstance(i.parent);\n};\nconst publicPropertiesMap = extend(Object.create(null), {\n    $: i => i,\n    $el: i => i.vnode.el,\n    $data: i => i.data,\n    $props: i => ( i.props),\n    $attrs: i => ( i.attrs),\n    $slots: i => ( i.slots),\n    $refs: i => ( i.refs),\n    $parent: i => getPublicInstance(i.parent),\n    $root: i => getPublicInstance(i.root),\n    $emit: i => i.emit,\n    $options: i => ( resolveMergedOptions(i) ),\n    $forceUpdate: i => () => queueJob(i.update),\n    $nextTick: i => nextTick.bind(i.proxy),\n    $watch: i => ( instanceWatch.bind(i) )\n});\nconst PublicInstanceProxyHandlers = {\n    get({ _: instance }, key) {\n        const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\n        // let @vue/reactivity know it should never observe Vue public instances.\n        if (key === \\\\\"__v_skip\\\\\" /* SKIP */) {\n            return true;\n        }\n        // data / props / ctx\n        // This getter gets called for every property access on the render context\n        // during render and is a major hotspot. The most expensive part of this\n        // is the multiple hasOwn() calls. It's much faster to do a simple property\n        // access on a plain object, so we use an accessCache object (with null\n        // prototype) to memoize what access type a key corresponds to.\n        let normalizedProps;\n        if (key[0] !== '$') {\n            const n = accessCache[key];\n            if (n !== undefined) {\n                switch (n) {\n                    case 0 /* SETUP */:\n                        return setupState[key];\n                    case 1 /* DATA */:\n                        return data[key];\n                    case 3 /* CONTEXT */:\n                        return ctx[key];\n                    case 2 /* PROPS */:\n                        return props[key];\n                    // default: just fallthrough\n                }\n            }\n            else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\n                accessCache[key] = 0 /* SETUP */;\n                return setupState[key];\n            }\n            else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n                accessCache[key] = 1 /* DATA */;\n                return data[key];\n            }\n            else if (\n            // only cache other properties when instance has declared (thus stable)\n            // props\n            (normalizedProps = instance.propsOptions[0]) &&\n                hasOwn(normalizedProps, key)) {\n                accessCache[key] = 2 /* PROPS */;\n                return props[key];\n            }\n            else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n                accessCache[key] = 3 /* CONTEXT */;\n                return ctx[key];\n            }\n            else if ( shouldCacheAccess) {\n                accessCache[key] = 4 /* OTHER */;\n            }\n        }\n        const publicGetter = publicPropertiesMap[key];\n        let cssModule, globalProperties;\n        // public $xxx properties\n        if (publicGetter) {\n            if (key === '$attrs') {\n                track(instance, \\\\\"get\\\\\" /* GET */, key);\n            }\n            return publicGetter(instance);\n        }\n        else if (\n        // css module (injected by vue-loader)\n        (cssModule = type.__cssModules) &&\n            (cssModule = cssModule[key])) {\n            return cssModule;\n        }\n        else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n            // user may set custom properties to \\`this\\` that start with \\`$\\`\n            accessCache[key] = 3 /* CONTEXT */;\n            return ctx[key];\n        }\n        else if (\n        // global properties\n        ((globalProperties = appContext.config.globalProperties),\n            hasOwn(globalProperties, key))) {\n            return globalProperties[key];\n        }\n        else ;\n    },\n    set({ _: instance }, key, value) {\n        const { data, setupState, ctx } = instance;\n        if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\n            setupState[key] = value;\n        }\n        else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n            data[key] = value;\n        }\n        else if (hasOwn(instance.props, key)) {\n            return false;\n        }\n        if (key[0] === '$' && key.slice(1) in instance) {\n            return false;\n        }\n        else {\n            {\n                ctx[key] = value;\n            }\n        }\n        return true;\n    },\n    has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {\n        let normalizedProps;\n        return (accessCache[key] !== undefined ||\n            (data !== EMPTY_OBJ && hasOwn(data, key)) ||\n            (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||\n            ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||\n            hasOwn(ctx, key) ||\n            hasOwn(publicPropertiesMap, key) ||\n            hasOwn(appContext.config.globalProperties, key));\n    }\n};\nconst RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, {\n    get(target, key) {\n        // fast path for unscopables when using \\`with\\` block\n        if (key === Symbol.unscopables) {\n            return;\n        }\n        return PublicInstanceProxyHandlers.get(target, key, target);\n    },\n    has(_, key) {\n        const has = key[0] !== '_' && !isGloballyWhitelisted(key);\n        return has;\n    }\n});\nconst emptyAppContext = createAppContext();\nlet uid$1$1 = 0;\nfunction createComponentInstance(vnode, parent, suspense) {\n    const type = vnode.type;\n    // inherit parent app context - or - if root, adopt from root vnode\n    const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;\n    const instance = {\n        uid: uid$1$1++,\n        vnode,\n        type,\n        parent,\n        appContext,\n        root: null,\n        next: null,\n        subTree: null,\n        update: null,\n        render: null,\n        proxy: null,\n        exposed: null,\n        withProxy: null,\n        effects: null,\n        provides: parent ? parent.provides : Object.create(appContext.provides),\n        accessCache: null,\n        renderCache: [],\n        // local resovled assets\n        components: null,\n        directives: null,\n        // resolved props and emits options\n        propsOptions: normalizePropsOptions(type, appContext),\n        emitsOptions: normalizeEmitsOptions(type, appContext),\n        // emit\n        emit: null,\n        emitted: null,\n        // props default value\n        propsDefaults: EMPTY_OBJ,\n        // state\n        ctx: EMPTY_OBJ,\n        data: EMPTY_OBJ,\n        props: EMPTY_OBJ,\n        attrs: EMPTY_OBJ,\n        slots: EMPTY_OBJ,\n        refs: EMPTY_OBJ,\n        setupState: EMPTY_OBJ,\n        setupContext: null,\n        // suspense related\n        suspense,\n        suspenseId: suspense ? suspense.pendingId : 0,\n        asyncDep: null,\n        asyncResolved: false,\n        // lifecycle hooks\n        // not using enums here because it results in computed properties\n        isMounted: false,\n        isUnmounted: false,\n        isDeactivated: false,\n        bc: null,\n        c: null,\n        bm: null,\n        m: null,\n        bu: null,\n        u: null,\n        um: null,\n        bum: null,\n        da: null,\n        a: null,\n        rtg: null,\n        rtc: null,\n        ec: null\n    };\n    {\n        instance.ctx = { _: instance };\n    }\n    instance.root = parent ? parent.root : instance;\n    instance.emit = emit.bind(null, instance);\n    return instance;\n}\nlet currentInstance = null;\nconst setCurrentInstance = (instance) => {\n    currentInstance = instance;\n};\nfunction isStatefulComponent(instance) {\n    return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;\n}\nlet isInSSRComponentSetup = false;\nfunction setupComponent(instance, isSSR = false) {\n    isInSSRComponentSetup = isSSR;\n    const { props, children } = instance.vnode;\n    const isStateful = isStatefulComponent(instance);\n    initProps(instance, props, isStateful, isSSR);\n    initSlots(instance, children);\n    const setupResult = isStateful\n        ? setupStatefulComponent(instance, isSSR)\n        : undefined;\n    isInSSRComponentSetup = false;\n    return setupResult;\n}\nfunction setupStatefulComponent(instance, isSSR) {\n    const Component = instance.type;\n    // 0. create render proxy property access cache\n    instance.accessCache = Object.create(null);\n    // 1. create public instance / render proxy\n    // also mark it raw so it's never observed\n    instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);\n    // 2. call setup()\n    const { setup } = Component;\n    if (setup) {\n        const setupContext = (instance.setupContext =\n            setup.length > 1 ? createSetupContext(instance) : null);\n        currentInstance = instance;\n        pauseTracking();\n        const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [ instance.props, setupContext]);\n        resetTracking();\n        currentInstance = null;\n        if (isPromise(setupResult)) {\n            if (isSSR) {\n                // return the promise so server-renderer can wait on it\n                return setupResult\n                    .then((resolvedResult) => {\n                    handleSetupResult(instance, resolvedResult);\n                })\n                    .catch(e => {\n                    handleError(e, instance, 0 /* SETUP_FUNCTION */);\n                });\n            }\n            else {\n                // async setup returned Promise.\n                // bail here and wait for re-entry.\n                instance.asyncDep = setupResult;\n            }\n        }\n        else {\n            handleSetupResult(instance, setupResult);\n        }\n    }\n    else {\n        finishComponentSetup(instance);\n    }\n}\nfunction handleSetupResult(instance, setupResult, isSSR) {\n    if (isFunction(setupResult)) {\n        // setup returned an inline render function\n        {\n            instance.render = setupResult;\n        }\n    }\n    else if (isObject(setupResult)) {\n        instance.setupState = proxyRefs(setupResult);\n    }\n    else ;\n    finishComponentSetup(instance);\n}\nfunction finishComponentSetup(instance, isSSR) {\n    const Component = instance.type;\n    // template / render function normalization\n    if (!instance.render) {\n        instance.render = (Component.render || NOOP);\n        // for runtime-compiled render functions using \\`with\\` blocks, the render\n        // proxy used needs a different \\`has\\` handler which is more performant and\n        // also only allows a whitelist of globals to fallthrough.\n        if (instance.render._rc) {\n            instance.withProxy = new Proxy(instance.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\n        }\n    }\n    // support for 2.x options\n    {\n        currentInstance = instance;\n        pauseTracking();\n        applyOptions(instance, Component);\n        resetTracking();\n        currentInstance = null;\n    }\n}\nfunction createSetupContext(instance) {\n    const expose = exposed => {\n        instance.exposed = proxyRefs(exposed);\n    };\n    {\n        return {\n            attrs: instance.attrs,\n            slots: instance.slots,\n            emit: instance.emit,\n            expose\n        };\n    }\n}\n// record effects created during a component's setup() so that they can be\n// stopped when the component unmounts\nfunction recordInstanceBoundEffect(effect, instance = currentInstance) {\n    if (instance) {\n        (instance.effects || (instance.effects = [])).push(effect);\n    }\n}\nconst classifyRE = /(?:^|[-_])(\\\\\\\\w)/g;\nconst classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');\nfunction getComponentName(Component) {\n    return isFunction(Component)\n        ? Component.displayName || Component.name\n        : Component.name;\n}\nfunction formatComponentName(instance, Component, isRoot = false) {\n    let name = getComponentName(Component);\n    if (!name && Component.__file) {\n        const match = Component.__file.match(/([^/\\\\\\\\\\\\\\\\]+)\\\\\\\\.\\\\\\\\w+$/);\n        if (match) {\n            name = match[1];\n        }\n    }\n    if (!name && instance && instance.parent) {\n        // try to infer the name based on reverse resolution\n        const inferFromRegistry = (registry) => {\n            for (const key in registry) {\n                if (registry[key] === Component) {\n                    return key;\n                }\n            }\n        };\n        name =\n            inferFromRegistry(instance.components ||\n                instance.parent.type.components) || inferFromRegistry(instance.appContext.components);\n    }\n    return name ? classify(name) : isRoot ? \\`App\\` : \\`Anonymous\\`;\n}\nfunction isClassComponent(value) {\n    return isFunction(value) && '__vccOpts' in value;\n}\nfunction computed$1(getterOrOptions) {\n    const c = computed(getterOrOptions);\n    recordInstanceBoundEffect(c.effect);\n    return c;\n}\n// Core API ------------------------------------------------------------------\nconst version = \\\\\"3.0.11\\\\\";\nconst svgNS = 'http://www.w3.org/2000/svg';\nconst doc = (typeof document !== 'undefined' ? document : null);\nlet tempContainer;\nlet tempSVGContainer;\nconst nodeOps = {\n    insert: (child, parent, anchor) => {\n        parent.insertBefore(child, anchor || null);\n    },\n    remove: child => {\n        const parent = child.parentNode;\n        if (parent) {\n            parent.removeChild(child);\n        }\n    },\n    createElement: (tag, isSVG, is, props) => {\n        const el = isSVG\n            ? doc.createElementNS(svgNS, tag)\n            : doc.createElement(tag, is ? { is } : undefined);\n        if (tag === 'select' && props && props.multiple != null) {\n            el.setAttribute('multiple', props.multiple);\n        }\n        return el;\n    },\n    createText: text => doc.createTextNode(text),\n    createComment: text => doc.createComment(text),\n    setText: (node, text) => {\n        node.nodeValue = text;\n    },\n    setElementText: (el, text) => {\n        el.textContent = text;\n    },\n    parentNode: node => node.parentNode,\n    nextSibling: node => node.nextSibling,\n    querySelector: selector => doc.querySelector(selector),\n    setScopeId(el, id) {\n        el.setAttribute(id, '');\n    },\n    cloneNode(el) {\n        const cloned = el.cloneNode(true);\n        // #3072\n        // - in \\`patchDOMProp\\`, we store the actual value in the \\`el._value\\` property.\n        // - normally, elements using \\`:value\\` bindings will not be hoisted, but if\n        //   the bound value is a constant, e.g. \\`:value=\\\\\"true\\\\\"\\` - they do get\n        //   hoisted.\n        // - in production, hoisted nodes are cloned when subsequent inserts, but\n        //   cloneNode() does not copy the custom property we attached.\n        // - This may need to account for other custom DOM properties we attach to\n        //   elements in addition to \\`_value\\` in the future.\n        if (\\`_value\\` in el) {\n            cloned._value = el._value;\n        }\n        return cloned;\n    },\n    // __UNSAFE__\n    // Reason: innerHTML.\n    // Static content here can only come from compiled templates.\n    // As long as the user only uses trusted templates, this is safe.\n    insertStaticContent(content, parent, anchor, isSVG) {\n        const temp = isSVG\n            ? tempSVGContainer ||\n                (tempSVGContainer = doc.createElementNS(svgNS, 'svg'))\n            : tempContainer || (tempContainer = doc.createElement('div'));\n        temp.innerHTML = content;\n        const first = temp.firstChild;\n        let node = first;\n        let last = node;\n        while (node) {\n            last = node;\n            nodeOps.insert(node, parent, anchor);\n            node = temp.firstChild;\n        }\n        return [first, last];\n    }\n};\n// compiler should normalize class + :class bindings on the same element\n// into a single binding ['staticClass', dynamic]\nfunction patchClass(el, value, isSVG) {\n    if (value == null) {\n        value = '';\n    }\n    if (isSVG) {\n        el.setAttribute('class', value);\n    }\n    else {\n        // directly setting className should be faster than setAttribute in theory\n        // if this is an element during a transition, take the temporary transition\n        // classes into account.\n        const transitionClasses = el._vtc;\n        if (transitionClasses) {\n            value = (value\n                ? [value, ...transitionClasses]\n                : [...transitionClasses]).join(' ');\n        }\n        el.className = value;\n    }\n}\nfunction patchStyle(el, prev, next) {\n    const style = el.style;\n    if (!next) {\n        el.removeAttribute('style');\n    }\n    else if (isString(next)) {\n        if (prev !== next) {\n            const current = style.display;\n            style.cssText = next;\n            // indicates that the \\`display\\` of the element is controlled by \\`v-show\\`,\n            // so we always keep the current \\`display\\` value regardless of the \\`style\\` value,\n            // thus handing over control to \\`v-show\\`.\n            if ('_vod' in el) {\n                style.display = current;\n            }\n        }\n    }\n    else {\n        for (const key in next) {\n            setStyle(style, key, next[key]);\n        }\n        if (prev && !isString(prev)) {\n            for (const key in prev) {\n                if (next[key] == null) {\n                    setStyle(style, key, '');\n                }\n            }\n        }\n    }\n}\nconst importantRE = /\\\\\\\\s*!important$/;\nfunction setStyle(style, name, val) {\n    if (isArray(val)) {\n        val.forEach(v => setStyle(style, name, v));\n    }\n    else {\n        if (name.startsWith('--')) {\n            // custom property definition\n            style.setProperty(name, val);\n        }\n        else {\n            const prefixed = autoPrefix(style, name);\n            if (importantRE.test(val)) {\n                // !important\n                style.setProperty(hyphenate(prefixed), val.replace(importantRE, ''), 'important');\n            }\n            else {\n                style[prefixed] = val;\n            }\n        }\n    }\n}\nconst prefixes = ['Webkit', 'Moz', 'ms'];\nconst prefixCache = {};\nfunction autoPrefix(style, rawName) {\n    const cached = prefixCache[rawName];\n    if (cached) {\n        return cached;\n    }\n    let name = camelize(rawName);\n    if (name !== 'filter' && name in style) {\n        return (prefixCache[rawName] = name);\n    }\n    name = capitalize(name);\n    for (let i = 0; i < prefixes.length; i++) {\n        const prefixed = prefixes[i] + name;\n        if (prefixed in style) {\n            return (prefixCache[rawName] = prefixed);\n        }\n    }\n    return rawName;\n}\nconst xlinkNS = 'http://www.w3.org/1999/xlink';\nfunction patchAttr(el, key, value, isSVG) {\n    if (isSVG && key.startsWith('xlink:')) {\n        if (value == null) {\n            el.removeAttributeNS(xlinkNS, key.slice(6, key.length));\n        }\n        else {\n            el.setAttributeNS(xlinkNS, key, value);\n        }\n    }\n    else {\n        // note we are only checking boolean attributes that don't have a\n        // corresponding dom prop of the same name here.\n        const isBoolean = isSpecialBooleanAttr(key);\n        if (value == null || (isBoolean && value === false)) {\n            el.removeAttribute(key);\n        }\n        else {\n            el.setAttribute(key, isBoolean ? '' : value);\n        }\n    }\n}\n// __UNSAFE__\n// functions. The user is responsible for using them with only trusted content.\nfunction patchDOMProp(el, key, value,\n// the following args are passed only due to potential innerHTML/textContent\n// overriding existing VNodes, in which case the old tree must be properly\n// unmounted.\nprevChildren, parentComponent, parentSuspense, unmountChildren) {\n    if (key === 'innerHTML' || key === 'textContent') {\n        if (prevChildren) {\n            unmountChildren(prevChildren, parentComponent, parentSuspense);\n        }\n        el[key] = value == null ? '' : value;\n        return;\n    }\n    if (key === 'value' && el.tagName !== 'PROGRESS') {\n        // store value as _value as well since\n        // non-string values will be stringified.\n        el._value = value;\n        const newValue = value == null ? '' : value;\n        if (el.value !== newValue) {\n            el.value = newValue;\n        }\n        return;\n    }\n    if (value === '' || value == null) {\n        const type = typeof el[key];\n        if (value === '' && type === 'boolean') {\n            // e.g. <select multiple> compiles to { multiple: '' }\n            el[key] = true;\n            return;\n        }\n        else if (value == null && type === 'string') {\n            // e.g. <div :id=\\\\\"null\\\\\">\n            el[key] = '';\n            el.removeAttribute(key);\n            return;\n        }\n        else if (type === 'number') {\n            // e.g. <img :width=\\\\\"null\\\\\">\n            el[key] = 0;\n            el.removeAttribute(key);\n            return;\n        }\n    }\n    // some properties perform value validation and throw\n    try {\n        el[key] = value;\n    }\n    catch (e) {\n    }\n}\n// Async edge case fix requires storing an event listener's attach timestamp.\nlet _getNow = Date.now;\nlet skipTimestampCheck = false;\nif (typeof window !== 'undefined') {\n    // Determine what event timestamp the browser is using. Annoyingly, the\n    // timestamp can either be hi-res (relative to page load) or low-res\n    // (relative to UNIX epoch), so in order to compare time we have to use the\n    // same timestamp type when saving the flush timestamp.\n    if (_getNow() > document.createEvent('Event').timeStamp) {\n        // if the low-res timestamp which is bigger than the event timestamp\n        // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\n        // and we need to use the hi-res version for event listeners as well.\n        _getNow = () => performance.now();\n    }\n    // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation\n    // and does not fire microtasks in between event propagation, so safe to exclude.\n    const ffMatch = navigator.userAgent.match(/firefox\\\\\\\\/(\\\\\\\\d+)/i);\n    skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);\n}\n// To avoid the overhead of repeatedly calling performance.now(), we cache\n// and use the same timestamp for all event listeners attached in the same tick.\nlet cachedNow = 0;\nconst p = Promise.resolve();\nconst reset = () => {\n    cachedNow = 0;\n};\nconst getNow = () => cachedNow || (p.then(reset), (cachedNow = _getNow()));\nfunction addEventListener(el, event, handler, options) {\n    el.addEventListener(event, handler, options);\n}\nfunction removeEventListener(el, event, handler, options) {\n    el.removeEventListener(event, handler, options);\n}\nfunction patchEvent(el, rawName, prevValue, nextValue, instance = null) {\n    // vei = vue event invokers\n    const invokers = el._vei || (el._vei = {});\n    const existingInvoker = invokers[rawName];\n    if (nextValue && existingInvoker) {\n        // patch\n        existingInvoker.value = nextValue;\n    }\n    else {\n        const [name, options] = parseName(rawName);\n        if (nextValue) {\n            // add\n            const invoker = (invokers[rawName] = createInvoker(nextValue, instance));\n            addEventListener(el, name, invoker, options);\n        }\n        else if (existingInvoker) {\n            // remove\n            removeEventListener(el, name, existingInvoker, options);\n            invokers[rawName] = undefined;\n        }\n    }\n}\nconst optionsModifierRE = /(?:Once|Passive|Capture)$/;\nfunction parseName(name) {\n    let options;\n    if (optionsModifierRE.test(name)) {\n        options = {};\n        let m;\n        while ((m = name.match(optionsModifierRE))) {\n            name = name.slice(0, name.length - m[0].length);\n            options[m[0].toLowerCase()] = true;\n        }\n    }\n    return [hyphenate(name.slice(2)), options];\n}\nfunction createInvoker(initialValue, instance) {\n    const invoker = (e) => {\n        // async edge case #6566: inner click event triggers patch, event handler\n        // attached to outer element during patch, and triggered again. This\n        // happens because browsers fire microtask ticks between event propagation.\n        // the solution is simple: we save the timestamp when a handler is attached,\n        // and the handler would only fire if the event passed to it was fired\n        // AFTER it was attached.\n        const timeStamp = e.timeStamp || _getNow();\n        if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {\n            callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);\n        }\n    };\n    invoker.value = initialValue;\n    invoker.attached = getNow();\n    return invoker;\n}\nfunction patchStopImmediatePropagation(e, value) {\n    if (isArray(value)) {\n        const originalStop = e.stopImmediatePropagation;\n        e.stopImmediatePropagation = () => {\n            originalStop.call(e);\n            e._stopped = true;\n        };\n        return value.map(fn => (e) => !e._stopped && fn(e));\n    }\n    else {\n        return value;\n    }\n}\nconst nativeOnRE = /^on[a-z]/;\nconst forcePatchProp = (_, key) => key === 'value';\nconst patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {\n    switch (key) {\n        // special\n        case 'class':\n            patchClass(el, nextValue, isSVG);\n            break;\n        case 'style':\n            patchStyle(el, prevValue, nextValue);\n            break;\n        default:\n            if (isOn(key)) {\n                // ignore v-model listeners\n                if (!isModelListener(key)) {\n                    patchEvent(el, key, prevValue, nextValue, parentComponent);\n                }\n            }\n            else if (shouldSetAsProp(el, key, nextValue, isSVG)) {\n                patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);\n            }\n            else {\n                // special case for <input v-model type=\\\\\"checkbox\\\\\"> with\n                // :true-value & :false-value\n                // store value as dom properties since non-string values will be\n                // stringified.\n                if (key === 'true-value') {\n                    el._trueValue = nextValue;\n                }\n                else if (key === 'false-value') {\n                    el._falseValue = nextValue;\n                }\n                patchAttr(el, key, nextValue, isSVG);\n            }\n            break;\n    }\n};\nfunction shouldSetAsProp(el, key, value, isSVG) {\n    if (isSVG) {\n        // most keys must be set as attribute on svg elements to work\n        // ...except innerHTML\n        if (key === 'innerHTML') {\n            return true;\n        }\n        // or native onclick with function values\n        if (key in el && nativeOnRE.test(key) && isFunction(value)) {\n            return true;\n        }\n        return false;\n    }\n    // spellcheck and draggable are numerated attrs, however their\n    // corresponding DOM properties are actually booleans - this leads to\n    // setting it with a string \\\\\"false\\\\\" value leading it to be coerced to\n    // \\`true\\`, so we need to always treat them as attributes.\n    // Note that \\`contentEditable\\` doesn't have this problem: its DOM\n    // property is also enumerated string values.\n    if (key === 'spellcheck' || key === 'draggable') {\n        return false;\n    }\n    // #1787, #2840 form property on form elements is readonly and must be set as\n    // attribute.\n    if (key === 'form') {\n        return false;\n    }\n    // #1526 <input list> must be set as attribute\n    if (key === 'list' && el.tagName === 'INPUT') {\n        return false;\n    }\n    // #2766 <textarea type> must be set as attribute\n    if (key === 'type' && el.tagName === 'TEXTAREA') {\n        return false;\n    }\n    // native onclick with string value, must be set as attribute\n    if (nativeOnRE.test(key) && isString(value)) {\n        return false;\n    }\n    return key in el;\n}\nconst rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);\n// lazy create the renderer - this makes core renderer logic tree-shakable\n// in case the user only imports reactivity utilities from Vue.\nlet renderer;\nfunction ensureRenderer() {\n    return renderer || (renderer = createRenderer(rendererOptions));\n}\nconst createApp = ((...args) => {\n    const app = ensureRenderer().createApp(...args);\n    const { mount } = app;\n    app.mount = (containerOrSelector) => {\n        const container = normalizeContainer(containerOrSelector);\n        if (!container)\n            return;\n        const component = app._component;\n        if (!isFunction(component) && !component.render && !component.template) {\n            component.template = container.innerHTML;\n        }\n        // clear content before mounting\n        container.innerHTML = '';\n        const proxy = mount(container, false, container instanceof SVGElement);\n        if (container instanceof Element) {\n            container.removeAttribute('v-cloak');\n            container.setAttribute('data-v-app', '');\n        }\n        return proxy;\n    };\n    return app;\n});\nfunction normalizeContainer(container) {\n    if (isString(container)) {\n        const res = document.querySelector(container);\n        return res;\n    }\n    return container;\n}\nexport { createApp, createBlock, createTextVNode, createVNode, openBlock, toDisplayString };\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: allFiles 1`] = `\nArray [\n  \"_snowpack/env.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/vue.js\",\n  \"dist/App.vue.css\",\n  \"dist/App.vue.css.proxy.js\",\n  \"dist/App.vue.js\",\n  \"dist/index.js\",\n  \"favicon-32x32.png\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"logo.svg\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-vue > build: dist/App.vue.css 1`] = `\n\"\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n@keyframes App-logo-spin {\nfrom {\n    transform: scale(1);\n}\nto {\n    transform: scale(1.06);\n}\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: dist/App.vue.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\".App {  text-align: center;}.App-header {  background-color: #f9f6f6;  color: #32485f;  min-height: 100vh;  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  font-size: calc(10px + 2vmin);}.App-link {  color: #00c185;}.App-logo {  height: 40vmin;  pointer-events: none;  margin-bottom: 1rem;  animation: App-logo-spin infinite 1.6s ease-in-out alternate;}@keyframes App-logo-spin {from {    transform: scale(1);}to {    transform: scale(1.06);}}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: dist/App.vue.js 1`] = `\n\"import './App.vue.css.proxy.js';\nconst defaultExport = {\n  data() {\n    return {\n      message: \\\\\"Learn Vue\\\\\"\n    };\n  }\n};\nimport { createVNode as _createVNode, createTextVNode as _createTextVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createBlock as _createBlock } from \\\\\"../_snowpack/pkg/vue.js\\\\\"\nconst _hoisted_1 = { class: \\\\\"App\\\\\" }\nconst _hoisted_2 = { class: \\\\\"App-header\\\\\" }\nconst _hoisted_3 = /*#__PURE__*/_createVNode(\\\\\"img\\\\\", {\n  src: \\\\\"/logo.svg\\\\\",\n  class: \\\\\"App-logo\\\\\",\n  alt: \\\\\"logo\\\\\"\n}, null, -1)\nconst _hoisted_4 = /*#__PURE__*/_createVNode(\\\\\"p\\\\\", null, [\n  /*#__PURE__*/_createTextVNode(\\\\\" Edit \\\\\"),\n  /*#__PURE__*/_createVNode(\\\\\"code\\\\\", null, \\\\\"src/App.vue\\\\\"),\n  /*#__PURE__*/_createTextVNode(\\\\\" and save to reload. \\\\\")\n], -1)\nconst _hoisted_5 = {\n  class: \\\\\"App-link\\\\\",\n  href: \\\\\"https://vuejs.org\\\\\",\n  target: \\\\\"_blank\\\\\",\n  rel: \\\\\"noopener noreferrer\\\\\"\n}\nexport function render(_ctx, _cache) {\n  return (_openBlock(), _createBlock(\\\\\"div\\\\\", _hoisted_1, [\n    _createVNode(\\\\\"header\\\\\", _hoisted_2, [\n      _hoisted_3,\n      _hoisted_4,\n      _createVNode(\\\\\"a\\\\\", _hoisted_5, _toDisplayString(_ctx.message), 1)\n    ])\n  ]))\n};\ndefaultExport.render = render;\nexport default defaultExport;\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: dist/index.js 1`] = `\n\"import * as __SNOWPACK_ENV__ from '../_snowpack/env.js';\nimport.meta.env = __SNOWPACK_ENV__;\nimport {createApp} from '../_snowpack/pkg/vue.js';\nimport App from './App.vue.js';\nconst app = createApp(App);\napp.mount('#app');\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (undefined /* [snowpack] import.meta.hot */ ) {\n  undefined /* [snowpack] import.meta.hot */ .accept();\n  undefined /* [snowpack] import.meta.hot */ .dispose(() => {\n    app.unmount();\n  });\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" type=\\\\\"image/png\\\\\" sizes=\\\\\"32x32\\\\\" href=\\\\\"/favicon-32x32.png\\\\\">\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\\\\\"app\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: _snowpack/env.js 1`] = `\n\"export const MODE = \\\\\"production\\\\\";\nexport const NODE_ENV = \\\\\"production\\\\\";\nexport const SSR = false;\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: _snowpack/pkg/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"vue\\\\\": \\\\\"./vue.js\\\\\"\n  }\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: _snowpack/pkg/vue.js 1`] = `\n\"/**\n * Make a map and return a function for checking if a key\n * is in that map.\n * IMPORTANT: all calls of this function must be prefixed with\n * \\\\\\\\/\\\\\\\\*#\\\\\\\\_\\\\\\\\_PURE\\\\\\\\_\\\\\\\\_\\\\\\\\*\\\\\\\\/\n * So that rollup can tree-shake them if necessary.\n */\nfunction makeMap(str, expectsLowerCase) {\n    const map = Object.create(null);\n    const list = str.split(',');\n    for (let i = 0; i < list.length; i++) {\n        map[list[i]] = true;\n    }\n    return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];\n}\nconst GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +\n    'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +\n    'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';\nconst isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);\n/**\n * On the client we only need to offer special cases for boolean attributes that\n * have different names from their corresponding dom properties:\n * - itemscope -> N/A\n * - allowfullscreen -> allowFullscreen\n * - formnovalidate -> formNoValidate\n * - ismap -> isMap\n * - nomodule -> noModule\n * - novalidate -> noValidate\n * - readonly -> readOnly\n */\nconst specialBooleanAttrs = \\`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly\\`;\nconst isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);\nfunction normalizeStyle(value) {\n    if (isArray(value)) {\n        const res = {};\n        for (let i = 0; i < value.length; i++) {\n            const item = value[i];\n            const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);\n            if (normalized) {\n                for (const key in normalized) {\n                    res[key] = normalized[key];\n                }\n            }\n        }\n        return res;\n    }\n    else if (isObject(value)) {\n        return value;\n    }\n}\nconst listDelimiterRE = /;(?![^(]*\\\\\\\\))/g;\nconst propertyDelimiterRE = /:(.+)/;\nfunction parseStringStyle(cssText) {\n    const ret = {};\n    cssText.split(listDelimiterRE).forEach(item => {\n        if (item) {\n            const tmp = item.split(propertyDelimiterRE);\n            tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n        }\n    });\n    return ret;\n}\nfunction normalizeClass(value) {\n    let res = '';\n    if (isString(value)) {\n        res = value;\n    }\n    else if (isArray(value)) {\n        for (let i = 0; i < value.length; i++) {\n            const normalized = normalizeClass(value[i]);\n            if (normalized) {\n                res += normalized + ' ';\n            }\n        }\n    }\n    else if (isObject(value)) {\n        for (const name in value) {\n            if (value[name]) {\n                res += name + ' ';\n            }\n        }\n    }\n    return res.trim();\n}\n/**\n * For converting {{ interpolation }} values to displayed strings.\n * @private\n */\nconst toDisplayString = (val) => {\n    return val == null\n        ? ''\n        : isObject(val)\n            ? JSON.stringify(val, replacer, 2)\n            : String(val);\n};\nconst replacer = (_key, val) => {\n    if (isMap(val)) {\n        return {\n            [\\`Map(\\${val.size})\\`]: [...val.entries()].reduce((entries, [key, val]) => {\n                entries[\\`\\${key} =>\\`] = val;\n                return entries;\n            }, {})\n        };\n    }\n    else if (isSet(val)) {\n        return {\n            [\\`Set(\\${val.size})\\`]: [...val.values()]\n        };\n    }\n    else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n        return String(val);\n    }\n    return val;\n};\nconst EMPTY_OBJ =  {};\nconst EMPTY_ARR =  [];\nconst NOOP = () => { };\n/**\n * Always return false.\n */\nconst NO = () => false;\nconst onRE = /^on[^a-z]/;\nconst isOn = (key) => onRE.test(key);\nconst isModelListener = (key) => key.startsWith('onUpdate:');\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n    const i = arr.indexOf(el);\n    if (i > -1) {\n        arr.splice(i, 1);\n    }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === '[object Map]';\nconst isSet = (val) => toTypeString(val) === '[object Set]';\nconst isFunction = (val) => typeof val === 'function';\nconst isString = (val) => typeof val === 'string';\nconst isSymbol = (val) => typeof val === 'symbol';\nconst isObject = (val) => val !== null && typeof val === 'object';\nconst isPromise = (val) => {\n    return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n    // extract \\\\\"RawType\\\\\" from strings like \\\\\"[object RawType]\\\\\"\n    return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === '[object Object]';\nconst isIntegerKey = (key) => isString(key) &&\n    key !== 'NaN' &&\n    key[0] !== '-' &&\n    '' + parseInt(key, 10) === key;\nconst isReservedProp = /*#__PURE__*/ makeMap(\n// the leading comma is intentional so empty string \\\\\"\\\\\" is also included\n',key,ref,' +\n    'onVnodeBeforeMount,onVnodeMounted,' +\n    'onVnodeBeforeUpdate,onVnodeUpdated,' +\n    'onVnodeBeforeUnmount,onVnodeUnmounted');\nconst cacheStringFunction = (fn) => {\n    const cache = Object.create(null);\n    return ((str) => {\n        const hit = cache[str];\n        return hit || (cache[str] = fn(str));\n    });\n};\nconst camelizeRE = /-(\\\\\\\\w)/g;\n/**\n * @private\n */\nconst camelize = cacheStringFunction((str) => {\n    return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\n});\nconst hyphenateRE = /\\\\\\\\B([A-Z])/g;\n/**\n * @private\n */\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());\n/**\n * @private\n */\nconst capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\n/**\n * @private\n */\nconst toHandlerKey = cacheStringFunction((str) => (str ? \\`on\\${capitalize(str)}\\` : \\`\\`));\n// compare whether a value has changed, accounting for NaN.\nconst hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\nconst invokeArrayFns = (fns, arg) => {\n    for (let i = 0; i < fns.length; i++) {\n        fns[i](arg);\n    }\n};\nconst def = (obj, key, value) => {\n    Object.defineProperty(obj, key, {\n        configurable: true,\n        enumerable: false,\n        value\n    });\n};\nconst toNumber = (val) => {\n    const n = parseFloat(val);\n    return isNaN(n) ? val : n;\n};\nconst targetMap = new WeakMap();\nconst effectStack = [];\nlet activeEffect;\nconst ITERATE_KEY = Symbol( '');\nconst MAP_KEY_ITERATE_KEY = Symbol( '');\nfunction isEffect(fn) {\n    return fn && fn._isEffect === true;\n}\nfunction effect(fn, options = EMPTY_OBJ) {\n    if (isEffect(fn)) {\n        fn = fn.raw;\n    }\n    const effect = createReactiveEffect(fn, options);\n    if (!options.lazy) {\n        effect();\n    }\n    return effect;\n}\nfunction stop(effect) {\n    if (effect.active) {\n        cleanup(effect);\n        if (effect.options.onStop) {\n            effect.options.onStop();\n        }\n        effect.active = false;\n    }\n}\nlet uid = 0;\nfunction createReactiveEffect(fn, options) {\n    const effect = function reactiveEffect() {\n        if (!effect.active) {\n            return options.scheduler ? undefined : fn();\n        }\n        if (!effectStack.includes(effect)) {\n            cleanup(effect);\n            try {\n                enableTracking();\n                effectStack.push(effect);\n                activeEffect = effect;\n                return fn();\n            }\n            finally {\n                effectStack.pop();\n                resetTracking();\n                activeEffect = effectStack[effectStack.length - 1];\n            }\n        }\n    };\n    effect.id = uid++;\n    effect.allowRecurse = !!options.allowRecurse;\n    effect._isEffect = true;\n    effect.active = true;\n    effect.raw = fn;\n    effect.deps = [];\n    effect.options = options;\n    return effect;\n}\nfunction cleanup(effect) {\n    const { deps } = effect;\n    if (deps.length) {\n        for (let i = 0; i < deps.length; i++) {\n            deps[i].delete(effect);\n        }\n        deps.length = 0;\n    }\n}\nlet shouldTrack = true;\nconst trackStack = [];\nfunction pauseTracking() {\n    trackStack.push(shouldTrack);\n    shouldTrack = false;\n}\nfunction enableTracking() {\n    trackStack.push(shouldTrack);\n    shouldTrack = true;\n}\nfunction resetTracking() {\n    const last = trackStack.pop();\n    shouldTrack = last === undefined ? true : last;\n}\nfunction track(target, type, key) {\n    if (!shouldTrack || activeEffect === undefined) {\n        return;\n    }\n    let depsMap = targetMap.get(target);\n    if (!depsMap) {\n        targetMap.set(target, (depsMap = new Map()));\n    }\n    let dep = depsMap.get(key);\n    if (!dep) {\n        depsMap.set(key, (dep = new Set()));\n    }\n    if (!dep.has(activeEffect)) {\n        dep.add(activeEffect);\n        activeEffect.deps.push(dep);\n    }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n    const depsMap = targetMap.get(target);\n    if (!depsMap) {\n        // never been tracked\n        return;\n    }\n    const effects = new Set();\n    const add = (effectsToAdd) => {\n        if (effectsToAdd) {\n            effectsToAdd.forEach(effect => {\n                if (effect !== activeEffect || effect.allowRecurse) {\n                    effects.add(effect);\n                }\n            });\n        }\n    };\n    if (type === \\\\\"clear\\\\\" /* CLEAR */) {\n        // collection being cleared\n        // trigger all effects for target\n        depsMap.forEach(add);\n    }\n    else if (key === 'length' && isArray(target)) {\n        depsMap.forEach((dep, key) => {\n            if (key === 'length' || key >= newValue) {\n                add(dep);\n            }\n        });\n    }\n    else {\n        // schedule runs for SET | ADD | DELETE\n        if (key !== void 0) {\n            add(depsMap.get(key));\n        }\n        // also run for iteration key on ADD | DELETE | Map.SET\n        switch (type) {\n            case \\\\\"add\\\\\" /* ADD */:\n                if (!isArray(target)) {\n                    add(depsMap.get(ITERATE_KEY));\n                    if (isMap(target)) {\n                        add(depsMap.get(MAP_KEY_ITERATE_KEY));\n                    }\n                }\n                else if (isIntegerKey(key)) {\n                    // new index added to array -> length changes\n                    add(depsMap.get('length'));\n                }\n                break;\n            case \\\\\"delete\\\\\" /* DELETE */:\n                if (!isArray(target)) {\n                    add(depsMap.get(ITERATE_KEY));\n                    if (isMap(target)) {\n                        add(depsMap.get(MAP_KEY_ITERATE_KEY));\n                    }\n                }\n                break;\n            case \\\\\"set\\\\\" /* SET */:\n                if (isMap(target)) {\n                    add(depsMap.get(ITERATE_KEY));\n                }\n                break;\n        }\n    }\n    const run = (effect) => {\n        if (effect.options.scheduler) {\n            effect.options.scheduler(effect);\n        }\n        else {\n            effect();\n        }\n    };\n    effects.forEach(run);\n}\nconst isNonTrackableKeys = /*#__PURE__*/ makeMap(\\`__proto__,__v_isRef,__isVue\\`);\nconst builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)\n    .map(key => Symbol[key])\n    .filter(isSymbol));\nconst get = /*#__PURE__*/ createGetter();\nconst shallowGet = /*#__PURE__*/ createGetter(false, true);\nconst readonlyGet = /*#__PURE__*/ createGetter(true);\nconst shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);\nconst arrayInstrumentations = {};\n['includes', 'indexOf', 'lastIndexOf'].forEach(key => {\n    const method = Array.prototype[key];\n    arrayInstrumentations[key] = function (...args) {\n        const arr = toRaw(this);\n        for (let i = 0, l = this.length; i < l; i++) {\n            track(arr, \\\\\"get\\\\\" /* GET */, i + '');\n        }\n        // we run the method using the original args first (which may be reactive)\n        const res = method.apply(arr, args);\n        if (res === -1 || res === false) {\n            // if that didn't work, run it again using raw values.\n            return method.apply(arr, args.map(toRaw));\n        }\n        else {\n            return res;\n        }\n    };\n});\n['push', 'pop', 'shift', 'unshift', 'splice'].forEach(key => {\n    const method = Array.prototype[key];\n    arrayInstrumentations[key] = function (...args) {\n        pauseTracking();\n        const res = method.apply(this, args);\n        resetTracking();\n        return res;\n    };\n});\nfunction createGetter(isReadonly = false, shallow = false) {\n    return function get(target, key, receiver) {\n        if (key === \\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */) {\n            return !isReadonly;\n        }\n        else if (key === \\\\\"__v_isReadonly\\\\\" /* IS_READONLY */) {\n            return isReadonly;\n        }\n        else if (key === \\\\\"__v_raw\\\\\" /* RAW */ &&\n            receiver ===\n                (isReadonly\n                    ? shallow\n                        ? shallowReadonlyMap\n                        : readonlyMap\n                    : shallow\n                        ? shallowReactiveMap\n                        : reactiveMap).get(target)) {\n            return target;\n        }\n        const targetIsArray = isArray(target);\n        if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {\n            return Reflect.get(arrayInstrumentations, key, receiver);\n        }\n        const res = Reflect.get(target, key, receiver);\n        if (isSymbol(key)\n            ? builtInSymbols.has(key)\n            : isNonTrackableKeys(key)) {\n            return res;\n        }\n        if (!isReadonly) {\n            track(target, \\\\\"get\\\\\" /* GET */, key);\n        }\n        if (shallow) {\n            return res;\n        }\n        if (isRef(res)) {\n            // ref unwrapping - does not apply for Array + integer key.\n            const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\n            return shouldUnwrap ? res.value : res;\n        }\n        if (isObject(res)) {\n            // Convert returned value into a proxy as well. we do the isObject check\n            // here to avoid invalid value warning. Also need to lazy access readonly\n            // and reactive here to avoid circular dependency.\n            return isReadonly ? readonly(res) : reactive(res);\n        }\n        return res;\n    };\n}\nconst set = /*#__PURE__*/ createSetter();\nconst shallowSet = /*#__PURE__*/ createSetter(true);\nfunction createSetter(shallow = false) {\n    return function set(target, key, value, receiver) {\n        let oldValue = target[key];\n        if (!shallow) {\n            value = toRaw(value);\n            oldValue = toRaw(oldValue);\n            if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n                oldValue.value = value;\n                return true;\n            }\n        }\n        const hadKey = isArray(target) && isIntegerKey(key)\n            ? Number(key) < target.length\n            : hasOwn(target, key);\n        const result = Reflect.set(target, key, value, receiver);\n        // don't trigger if target is something up in the prototype chain of original\n        if (target === toRaw(receiver)) {\n            if (!hadKey) {\n                trigger(target, \\\\\"add\\\\\" /* ADD */, key, value);\n            }\n            else if (hasChanged(value, oldValue)) {\n                trigger(target, \\\\\"set\\\\\" /* SET */, key, value);\n            }\n        }\n        return result;\n    };\n}\nfunction deleteProperty(target, key) {\n    const hadKey = hasOwn(target, key);\n    const oldValue = target[key];\n    const result = Reflect.deleteProperty(target, key);\n    if (result && hadKey) {\n        trigger(target, \\\\\"delete\\\\\" /* DELETE */, key, undefined);\n    }\n    return result;\n}\nfunction has(target, key) {\n    const result = Reflect.has(target, key);\n    if (!isSymbol(key) || !builtInSymbols.has(key)) {\n        track(target, \\\\\"has\\\\\" /* HAS */, key);\n    }\n    return result;\n}\nfunction ownKeys(target) {\n    track(target, \\\\\"iterate\\\\\" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);\n    return Reflect.ownKeys(target);\n}\nconst mutableHandlers = {\n    get,\n    set,\n    deleteProperty,\n    has,\n    ownKeys\n};\nconst readonlyHandlers = {\n    get: readonlyGet,\n    set(target, key) {\n        return true;\n    },\n    deleteProperty(target, key) {\n        return true;\n    }\n};\nconst shallowReactiveHandlers = extend({}, mutableHandlers, {\n    get: shallowGet,\n    set: shallowSet\n});\n// Props handlers are special in the sense that it should not unwrap top-level\n// refs (in order to allow refs to be explicitly passed down), but should\n// retain the reactivity of the normal readonly object.\nconst shallowReadonlyHandlers = extend({}, readonlyHandlers, {\n    get: shallowReadonlyGet\n});\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\nconst toShallow = (value) => value;\nconst getProto = (v) => Reflect.getPrototypeOf(v);\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\n    // #1772: readonly(reactive(Map)) should return readonly + reactive version\n    // of the value\n    target = target[\\\\\"__v_raw\\\\\" /* RAW */];\n    const rawTarget = toRaw(target);\n    const rawKey = toRaw(key);\n    if (key !== rawKey) {\n        !isReadonly && track(rawTarget, \\\\\"get\\\\\" /* GET */, key);\n    }\n    !isReadonly && track(rawTarget, \\\\\"get\\\\\" /* GET */, rawKey);\n    const { has } = getProto(rawTarget);\n    const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n    if (has.call(rawTarget, key)) {\n        return wrap(target.get(key));\n    }\n    else if (has.call(rawTarget, rawKey)) {\n        return wrap(target.get(rawKey));\n    }\n}\nfunction has$1(key, isReadonly = false) {\n    const target = this[\\\\\"__v_raw\\\\\" /* RAW */];\n    const rawTarget = toRaw(target);\n    const rawKey = toRaw(key);\n    if (key !== rawKey) {\n        !isReadonly && track(rawTarget, \\\\\"has\\\\\" /* HAS */, key);\n    }\n    !isReadonly && track(rawTarget, \\\\\"has\\\\\" /* HAS */, rawKey);\n    return key === rawKey\n        ? target.has(key)\n        : target.has(key) || target.has(rawKey);\n}\nfunction size(target, isReadonly = false) {\n    target = target[\\\\\"__v_raw\\\\\" /* RAW */];\n    !isReadonly && track(toRaw(target), \\\\\"iterate\\\\\" /* ITERATE */, ITERATE_KEY);\n    return Reflect.get(target, 'size', target);\n}\nfunction add(value) {\n    value = toRaw(value);\n    const target = toRaw(this);\n    const proto = getProto(target);\n    const hadKey = proto.has.call(target, value);\n    if (!hadKey) {\n        target.add(value);\n        trigger(target, \\\\\"add\\\\\" /* ADD */, value, value);\n    }\n    return this;\n}\nfunction set$1(key, value) {\n    value = toRaw(value);\n    const target = toRaw(this);\n    const { has, get } = getProto(target);\n    let hadKey = has.call(target, key);\n    if (!hadKey) {\n        key = toRaw(key);\n        hadKey = has.call(target, key);\n    }\n    const oldValue = get.call(target, key);\n    target.set(key, value);\n    if (!hadKey) {\n        trigger(target, \\\\\"add\\\\\" /* ADD */, key, value);\n    }\n    else if (hasChanged(value, oldValue)) {\n        trigger(target, \\\\\"set\\\\\" /* SET */, key, value);\n    }\n    return this;\n}\nfunction deleteEntry(key) {\n    const target = toRaw(this);\n    const { has, get } = getProto(target);\n    let hadKey = has.call(target, key);\n    if (!hadKey) {\n        key = toRaw(key);\n        hadKey = has.call(target, key);\n    }\n    const oldValue = get ? get.call(target, key) : undefined;\n    // forward the operation before queueing reactions\n    const result = target.delete(key);\n    if (hadKey) {\n        trigger(target, \\\\\"delete\\\\\" /* DELETE */, key, undefined);\n    }\n    return result;\n}\nfunction clear() {\n    const target = toRaw(this);\n    const hadItems = target.size !== 0;\n    // forward the operation before queueing reactions\n    const result = target.clear();\n    if (hadItems) {\n        trigger(target, \\\\\"clear\\\\\" /* CLEAR */, undefined, undefined);\n    }\n    return result;\n}\nfunction createForEach(isReadonly, isShallow) {\n    return function forEach(callback, thisArg) {\n        const observed = this;\n        const target = observed[\\\\\"__v_raw\\\\\" /* RAW */];\n        const rawTarget = toRaw(target);\n        const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n        !isReadonly && track(rawTarget, \\\\\"iterate\\\\\" /* ITERATE */, ITERATE_KEY);\n        return target.forEach((value, key) => {\n            // important: make sure the callback is\n            // 1. invoked with the reactive map as \\`this\\` and 3rd arg\n            // 2. the value received should be a corresponding reactive/readonly.\n            return callback.call(thisArg, wrap(value), wrap(key), observed);\n        });\n    };\n}\nfunction createIterableMethod(method, isReadonly, isShallow) {\n    return function (...args) {\n        const target = this[\\\\\"__v_raw\\\\\" /* RAW */];\n        const rawTarget = toRaw(target);\n        const targetIsMap = isMap(rawTarget);\n        const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);\n        const isKeyOnly = method === 'keys' && targetIsMap;\n        const innerIterator = target[method](...args);\n        const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n        !isReadonly &&\n            track(rawTarget, \\\\\"iterate\\\\\" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\n        // return a wrapped iterator which returns observed versions of the\n        // values emitted from the real iterator\n        return {\n            // iterator protocol\n            next() {\n                const { value, done } = innerIterator.next();\n                return done\n                    ? { value, done }\n                    : {\n                        value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n                        done\n                    };\n            },\n            // iterable protocol\n            [Symbol.iterator]() {\n                return this;\n            }\n        };\n    };\n}\nfunction createReadonlyMethod(type) {\n    return function (...args) {\n        return type === \\\\\"delete\\\\\" /* DELETE */ ? false : this;\n    };\n}\nconst mutableInstrumentations = {\n    get(key) {\n        return get$1(this, key);\n    },\n    get size() {\n        return size(this);\n    },\n    has: has$1,\n    add,\n    set: set$1,\n    delete: deleteEntry,\n    clear,\n    forEach: createForEach(false, false)\n};\nconst shallowInstrumentations = {\n    get(key) {\n        return get$1(this, key, false, true);\n    },\n    get size() {\n        return size(this);\n    },\n    has: has$1,\n    add,\n    set: set$1,\n    delete: deleteEntry,\n    clear,\n    forEach: createForEach(false, true)\n};\nconst readonlyInstrumentations = {\n    get(key) {\n        return get$1(this, key, true);\n    },\n    get size() {\n        return size(this, true);\n    },\n    has(key) {\n        return has$1.call(this, key, true);\n    },\n    add: createReadonlyMethod(\\\\\"add\\\\\" /* ADD */),\n    set: createReadonlyMethod(\\\\\"set\\\\\" /* SET */),\n    delete: createReadonlyMethod(\\\\\"delete\\\\\" /* DELETE */),\n    clear: createReadonlyMethod(\\\\\"clear\\\\\" /* CLEAR */),\n    forEach: createForEach(true, false)\n};\nconst shallowReadonlyInstrumentations = {\n    get(key) {\n        return get$1(this, key, true, true);\n    },\n    get size() {\n        return size(this, true);\n    },\n    has(key) {\n        return has$1.call(this, key, true);\n    },\n    add: createReadonlyMethod(\\\\\"add\\\\\" /* ADD */),\n    set: createReadonlyMethod(\\\\\"set\\\\\" /* SET */),\n    delete: createReadonlyMethod(\\\\\"delete\\\\\" /* DELETE */),\n    clear: createReadonlyMethod(\\\\\"clear\\\\\" /* CLEAR */),\n    forEach: createForEach(true, true)\n};\nconst iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];\niteratorMethods.forEach(method => {\n    mutableInstrumentations[method] = createIterableMethod(method, false, false);\n    readonlyInstrumentations[method] = createIterableMethod(method, true, false);\n    shallowInstrumentations[method] = createIterableMethod(method, false, true);\n    shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);\n});\nfunction createInstrumentationGetter(isReadonly, shallow) {\n    const instrumentations = shallow\n        ? isReadonly\n            ? shallowReadonlyInstrumentations\n            : shallowInstrumentations\n        : isReadonly\n            ? readonlyInstrumentations\n            : mutableInstrumentations;\n    return (target, key, receiver) => {\n        if (key === \\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */) {\n            return !isReadonly;\n        }\n        else if (key === \\\\\"__v_isReadonly\\\\\" /* IS_READONLY */) {\n            return isReadonly;\n        }\n        else if (key === \\\\\"__v_raw\\\\\" /* RAW */) {\n            return target;\n        }\n        return Reflect.get(hasOwn(instrumentations, key) && key in target\n            ? instrumentations\n            : target, key, receiver);\n    };\n}\nconst mutableCollectionHandlers = {\n    get: createInstrumentationGetter(false, false)\n};\nconst shallowCollectionHandlers = {\n    get: createInstrumentationGetter(false, true)\n};\nconst readonlyCollectionHandlers = {\n    get: createInstrumentationGetter(true, false)\n};\nconst reactiveMap = new WeakMap();\nconst shallowReactiveMap = new WeakMap();\nconst readonlyMap = new WeakMap();\nconst shallowReadonlyMap = new WeakMap();\nfunction targetTypeMap(rawType) {\n    switch (rawType) {\n        case 'Object':\n        case 'Array':\n            return 1 /* COMMON */;\n        case 'Map':\n        case 'Set':\n        case 'WeakMap':\n        case 'WeakSet':\n            return 2 /* COLLECTION */;\n        default:\n            return 0 /* INVALID */;\n    }\n}\nfunction getTargetType(value) {\n    return value[\\\\\"__v_skip\\\\\" /* SKIP */] || !Object.isExtensible(value)\n        ? 0 /* INVALID */\n        : targetTypeMap(toRawType(value));\n}\nfunction reactive(target) {\n    // if trying to observe a readonly proxy, return the readonly version.\n    if (target && target[\\\\\"__v_isReadonly\\\\\" /* IS_READONLY */]) {\n        return target;\n    }\n    return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\n}\n/**\n * Return a shallowly-reactive copy of the original object, where only the root\n * level properties are reactive. It also does not auto-unwrap refs (even at the\n * root level).\n */\nfunction shallowReactive(target) {\n    return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);\n}\n/**\n * Creates a readonly copy of the original object. Note the returned copy is not\n * made reactive, but \\`readonly\\` can be called on an already reactive object.\n */\nfunction readonly(target) {\n    return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\n    if (!isObject(target)) {\n        return target;\n    }\n    // target is already a Proxy, return it.\n    // exception: calling readonly() on a reactive object\n    if (target[\\\\\"__v_raw\\\\\" /* RAW */] &&\n        !(isReadonly && target[\\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */])) {\n        return target;\n    }\n    // target already has corresponding Proxy\n    const existingProxy = proxyMap.get(target);\n    if (existingProxy) {\n        return existingProxy;\n    }\n    // only a whitelist of value types can be observed.\n    const targetType = getTargetType(target);\n    if (targetType === 0 /* INVALID */) {\n        return target;\n    }\n    const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);\n    proxyMap.set(target, proxy);\n    return proxy;\n}\nfunction isReactive(value) {\n    if (isReadonly(value)) {\n        return isReactive(value[\\\\\"__v_raw\\\\\" /* RAW */]);\n    }\n    return !!(value && value[\\\\\"__v_isReactive\\\\\" /* IS_REACTIVE */]);\n}\nfunction isReadonly(value) {\n    return !!(value && value[\\\\\"__v_isReadonly\\\\\" /* IS_READONLY */]);\n}\nfunction isProxy(value) {\n    return isReactive(value) || isReadonly(value);\n}\nfunction toRaw(observed) {\n    return ((observed && toRaw(observed[\\\\\"__v_raw\\\\\" /* RAW */])) || observed);\n}\nfunction isRef(r) {\n    return Boolean(r && r.__v_isRef === true);\n}\nfunction unref(ref) {\n    return isRef(ref) ? ref.value : ref;\n}\nconst shallowUnwrapHandlers = {\n    get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\n    set: (target, key, value, receiver) => {\n        const oldValue = target[key];\n        if (isRef(oldValue) && !isRef(value)) {\n            oldValue.value = value;\n            return true;\n        }\n        else {\n            return Reflect.set(target, key, value, receiver);\n        }\n    }\n};\nfunction proxyRefs(objectWithRefs) {\n    return isReactive(objectWithRefs)\n        ? objectWithRefs\n        : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n}\nclass ObjectRefImpl {\n    constructor(_object, _key) {\n        this._object = _object;\n        this._key = _key;\n        this.__v_isRef = true;\n    }\n    get value() {\n        return this._object[this._key];\n    }\n    set value(newVal) {\n        this._object[this._key] = newVal;\n    }\n}\nfunction toRef(object, key) {\n    return isRef(object[key])\n        ? object[key]\n        : new ObjectRefImpl(object, key);\n}\nclass ComputedRefImpl {\n    constructor(getter, _setter, isReadonly) {\n        this._setter = _setter;\n        this._dirty = true;\n        this.__v_isRef = true;\n        this.effect = effect(getter, {\n            lazy: true,\n            scheduler: () => {\n                if (!this._dirty) {\n                    this._dirty = true;\n                    trigger(toRaw(this), \\\\\"set\\\\\" /* SET */, 'value');\n                }\n            }\n        });\n        this[\\\\\"__v_isReadonly\\\\\" /* IS_READONLY */] = isReadonly;\n    }\n    get value() {\n        // the computed ref may get wrapped by other proxies e.g. readonly() #3376\n        const self = toRaw(this);\n        if (self._dirty) {\n            self._value = this.effect();\n            self._dirty = false;\n        }\n        track(self, \\\\\"get\\\\\" /* GET */, 'value');\n        return self._value;\n    }\n    set value(newValue) {\n        this._setter(newValue);\n    }\n}\nfunction computed(getterOrOptions) {\n    let getter;\n    let setter;\n    if (isFunction(getterOrOptions)) {\n        getter = getterOrOptions;\n        setter =  NOOP;\n    }\n    else {\n        getter = getterOrOptions.get;\n        setter = getterOrOptions.set;\n    }\n    return new ComputedRefImpl(getter, setter, isFunction(getterOrOptions) || !getterOrOptions.set);\n}\nconst stack = [];\nfunction warn(msg, ...args) {\n    // avoid props formatting or warn handler tracking deps that might be mutated\n    // during patch, leading to infinite recursion.\n    pauseTracking();\n    const instance = stack.length ? stack[stack.length - 1].component : null;\n    const appWarnHandler = instance && instance.appContext.config.warnHandler;\n    const trace = getComponentTrace();\n    if (appWarnHandler) {\n        callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [\n            msg + args.join(''),\n            instance && instance.proxy,\n            trace\n                .map(({ vnode }) => \\`at <\\${formatComponentName(instance, vnode.type)}>\\`)\n                .join(''),\n            trace\n        ]);\n    }\n    else {\n        const warnArgs = [\\`[Vue warn]: \\${msg}\\`, ...args];\n        if (trace.length &&\n            // avoid spamming console during tests\n            !false) {\n            warnArgs.push(\\`\\`, ...formatTrace(trace));\n        }\n        console.warn(...warnArgs);\n    }\n    resetTracking();\n}\nfunction getComponentTrace() {\n    let currentVNode = stack[stack.length - 1];\n    if (!currentVNode) {\n        return [];\n    }\n    // we can't just use the stack because it will be incomplete during updates\n    // that did not start from the root. Re-construct the parent chain using\n    // instance parent pointers.\n    const normalizedStack = [];\n    while (currentVNode) {\n        const last = normalizedStack[0];\n        if (last && last.vnode === currentVNode) {\n            last.recurseCount++;\n        }\n        else {\n            normalizedStack.push({\n                vnode: currentVNode,\n                recurseCount: 0\n            });\n        }\n        const parentInstance = currentVNode.component && currentVNode.component.parent;\n        currentVNode = parentInstance && parentInstance.vnode;\n    }\n    return normalizedStack;\n}\nfunction formatTrace(trace) {\n    const logs = [];\n    trace.forEach((entry, i) => {\n        logs.push(...(i === 0 ? [] : [\\`\\`]), ...formatTraceEntry(entry));\n    });\n    return logs;\n}\nfunction formatTraceEntry({ vnode, recurseCount }) {\n    const postfix = recurseCount > 0 ? \\`... (\\${recurseCount} recursive calls)\\` : \\`\\`;\n    const isRoot = vnode.component ? vnode.component.parent == null : false;\n    const open = \\` at <\\${formatComponentName(vnode.component, vnode.type, isRoot)}\\`;\n    const close = \\`>\\` + postfix;\n    return vnode.props\n        ? [open, ...formatProps(vnode.props), close]\n        : [open + close];\n}\nfunction formatProps(props) {\n    const res = [];\n    const keys = Object.keys(props);\n    keys.slice(0, 3).forEach(key => {\n        res.push(...formatProp(key, props[key]));\n    });\n    if (keys.length > 3) {\n        res.push(\\` ...\\`);\n    }\n    return res;\n}\nfunction formatProp(key, value, raw) {\n    if (isString(value)) {\n        value = JSON.stringify(value);\n        return raw ? value : [\\`\\${key}=\\${value}\\`];\n    }\n    else if (typeof value === 'number' ||\n        typeof value === 'boolean' ||\n        value == null) {\n        return raw ? value : [\\`\\${key}=\\${value}\\`];\n    }\n    else if (isRef(value)) {\n        value = formatProp(key, toRaw(value.value), true);\n        return raw ? value : [\\`\\${key}=Ref<\\`, value, \\`>\\`];\n    }\n    else if (isFunction(value)) {\n        return [\\`\\${key}=fn\\${value.name ? \\`<\\${value.name}>\\` : \\`\\`}\\`];\n    }\n    else {\n        value = toRaw(value);\n        return raw ? value : [\\`\\${key}=\\`, value];\n    }\n}\nfunction callWithErrorHandling(fn, instance, type, args) {\n    let res;\n    try {\n        res = args ? fn(...args) : fn();\n    }\n    catch (err) {\n        handleError(err, instance, type);\n    }\n    return res;\n}\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\n    if (isFunction(fn)) {\n        const res = callWithErrorHandling(fn, instance, type, args);\n        if (res && isPromise(res)) {\n            res.catch(err => {\n                handleError(err, instance, type);\n            });\n        }\n        return res;\n    }\n    const values = [];\n    for (let i = 0; i < fn.length; i++) {\n        values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\n    }\n    return values;\n}\nfunction handleError(err, instance, type, throwInDev = true) {\n    const contextVNode = instance ? instance.vnode : null;\n    if (instance) {\n        let cur = instance.parent;\n        // the exposed instance is the render proxy to keep it consistent with 2.x\n        const exposedInstance = instance.proxy;\n        // in production the hook receives only the error code\n        const errorInfo =  type;\n        while (cur) {\n            const errorCapturedHooks = cur.ec;\n            if (errorCapturedHooks) {\n                for (let i = 0; i < errorCapturedHooks.length; i++) {\n                    if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\n                        return;\n                    }\n                }\n            }\n            cur = cur.parent;\n        }\n        // app-level handling\n        const appErrorHandler = instance.appContext.config.errorHandler;\n        if (appErrorHandler) {\n            callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);\n            return;\n        }\n    }\n    logError(err, type, contextVNode, throwInDev);\n}\nfunction logError(err, type, contextVNode, throwInDev = true) {\n    {\n        // recover in prod to reduce the impact on end-user\n        console.error(err);\n    }\n}\nlet isFlushing = false;\nlet isFlushPending = false;\nconst queue = [];\nlet flushIndex = 0;\nconst pendingPreFlushCbs = [];\nlet activePreFlushCbs = null;\nlet preFlushIndex = 0;\nconst pendingPostFlushCbs = [];\nlet activePostFlushCbs = null;\nlet postFlushIndex = 0;\nconst resolvedPromise = Promise.resolve();\nlet currentFlushPromise = null;\nlet currentPreFlushParentJob = null;\nconst RECURSION_LIMIT = 100;\nfunction nextTick(fn) {\n    const p = currentFlushPromise || resolvedPromise;\n    return fn ? p.then(this ? fn.bind(this) : fn) : p;\n}\n// #2768\n// Use binary-search to find a suitable position in the queue,\n// so that the queue maintains the increasing order of job's id,\n// which can prevent the job from being skipped and also can avoid repeated patching.\nfunction findInsertionIndex(job) {\n    // the start index should be \\`flushIndex + 1\\`\n    let start = flushIndex + 1;\n    let end = queue.length;\n    const jobId = getId(job);\n    while (start < end) {\n        const middle = (start + end) >>> 1;\n        const middleJobId = getId(queue[middle]);\n        middleJobId < jobId ? (start = middle + 1) : (end = middle);\n    }\n    return start;\n}\nfunction queueJob(job) {\n    // the dedupe search uses the startIndex argument of Array.includes()\n    // by default the search index includes the current job that is being run\n    // so it cannot recursively trigger itself again.\n    // if the job is a watch() callback, the search will start with a +1 index to\n    // allow it recursively trigger itself - it is the user's responsibility to\n    // ensure it doesn't end up in an infinite loop.\n    if ((!queue.length ||\n        !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&\n        job !== currentPreFlushParentJob) {\n        const pos = findInsertionIndex(job);\n        if (pos > -1) {\n            queue.splice(pos, 0, job);\n        }\n        else {\n            queue.push(job);\n        }\n        queueFlush();\n    }\n}\nfunction queueFlush() {\n    if (!isFlushing && !isFlushPending) {\n        isFlushPending = true;\n        currentFlushPromise = resolvedPromise.then(flushJobs);\n    }\n}\nfunction invalidateJob(job) {\n    const i = queue.indexOf(job);\n    if (i > flushIndex) {\n        queue.splice(i, 1);\n    }\n}\nfunction queueCb(cb, activeQueue, pendingQueue, index) {\n    if (!isArray(cb)) {\n        if (!activeQueue ||\n            !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {\n            pendingQueue.push(cb);\n        }\n    }\n    else {\n        // if cb is an array, it is a component lifecycle hook which can only be\n        // triggered by a job, which is already deduped in the main queue, so\n        // we can skip duplicate check here to improve perf\n        pendingQueue.push(...cb);\n    }\n    queueFlush();\n}\nfunction queuePreFlushCb(cb) {\n    queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);\n}\nfunction queuePostFlushCb(cb) {\n    queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);\n}\nfunction flushPreFlushCbs(seen, parentJob = null) {\n    if (pendingPreFlushCbs.length) {\n        currentPreFlushParentJob = parentJob;\n        activePreFlushCbs = [...new Set(pendingPreFlushCbs)];\n        pendingPreFlushCbs.length = 0;\n        for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {\n            activePreFlushCbs[preFlushIndex]();\n        }\n        activePreFlushCbs = null;\n        preFlushIndex = 0;\n        currentPreFlushParentJob = null;\n        // recursively flush until it drains\n        flushPreFlushCbs(seen, parentJob);\n    }\n}\nfunction flushPostFlushCbs(seen) {\n    if (pendingPostFlushCbs.length) {\n        const deduped = [...new Set(pendingPostFlushCbs)];\n        pendingPostFlushCbs.length = 0;\n        // #1947 already has active queue, nested flushPostFlushCbs call\n        if (activePostFlushCbs) {\n            activePostFlushCbs.push(...deduped);\n            return;\n        }\n        activePostFlushCbs = deduped;\n        activePostFlushCbs.sort((a, b) => getId(a) - getId(b));\n        for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\n            activePostFlushCbs[postFlushIndex]();\n        }\n        activePostFlushCbs = null;\n        postFlushIndex = 0;\n    }\n}\nconst getId = (job) => job.id == null ? Infinity : job.id;\nfunction flushJobs(seen) {\n    isFlushPending = false;\n    isFlushing = true;\n    flushPreFlushCbs(seen);\n    // Sort queue before flush.\n    // This ensures that:\n    // 1. Components are updated from parent to child. (because parent is always\n    //    created before the child so its render effect will have smaller\n    //    priority number)\n    // 2. If a component is unmounted during a parent component's update,\n    //    its update can be skipped.\n    queue.sort((a, b) => getId(a) - getId(b));\n    try {\n        for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\n            const job = queue[flushIndex];\n            if (job) {\n                if ((\\\\\"production\\\\\" !== 'production')) ;\n                callWithErrorHandling(job, null, 14 /* SCHEDULER */);\n            }\n        }\n    }\n    finally {\n        flushIndex = 0;\n        queue.length = 0;\n        flushPostFlushCbs();\n        isFlushing = false;\n        currentFlushPromise = null;\n        // some postFlushCb queued jobs!\n        // keep flushing until it drains.\n        if (queue.length || pendingPostFlushCbs.length) {\n            flushJobs(seen);\n        }\n    }\n}\nfunction checkRecursiveUpdates(seen, fn) {\n    if (!seen.has(fn)) {\n        seen.set(fn, 1);\n    }\n    else {\n        const count = seen.get(fn);\n        if (count > RECURSION_LIMIT) {\n            throw new Error(\\`Maximum recursive updates exceeded. \\` +\n                \\`This means you have a reactive effect that is mutating its own \\` +\n                \\`dependencies and thus recursively triggering itself. Possible sources \\` +\n                \\`include component template, render function, updated hook or \\` +\n                \\`watcher source function.\\`);\n        }\n        else {\n            seen.set(fn, count + 1);\n        }\n    }\n}\nfunction emit(instance, event, ...rawArgs) {\n    const props = instance.vnode.props || EMPTY_OBJ;\n    let args = rawArgs;\n    const isModelListener = event.startsWith('update:');\n    // for v-model update:xxx events, apply modifiers on args\n    const modelArg = isModelListener && event.slice(7);\n    if (modelArg && modelArg in props) {\n        const modifiersKey = \\`\\${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers\\`;\n        const { number, trim } = props[modifiersKey] || EMPTY_OBJ;\n        if (trim) {\n            args = rawArgs.map(a => a.trim());\n        }\n        else if (number) {\n            args = rawArgs.map(toNumber);\n        }\n    }\n    let handlerName;\n    let handler = props[(handlerName = toHandlerKey(event))] ||\n        // also try camelCase event handler (#2249)\n        props[(handlerName = toHandlerKey(camelize(event)))];\n    // for v-model update:xxx events, also trigger kebab-case equivalent\n    // for props passed via kebab-case\n    if (!handler && isModelListener) {\n        handler = props[(handlerName = toHandlerKey(hyphenate(event)))];\n    }\n    if (handler) {\n        callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\n    }\n    const onceHandler = props[handlerName + \\`Once\\`];\n    if (onceHandler) {\n        if (!instance.emitted) {\n            (instance.emitted = {})[handlerName] = true;\n        }\n        else if (instance.emitted[handlerName]) {\n            return;\n        }\n        callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\n    }\n}\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\n    if (!appContext.deopt && comp.__emits !== undefined) {\n        return comp.__emits;\n    }\n    const raw = comp.emits;\n    let normalized = {};\n    // apply mixin/extends props\n    let hasExtends = false;\n    if ( !isFunction(comp)) {\n        const extendEmits = (raw) => {\n            const normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true);\n            if (normalizedFromExtend) {\n                hasExtends = true;\n                extend(normalized, normalizedFromExtend);\n            }\n        };\n        if (!asMixin && appContext.mixins.length) {\n            appContext.mixins.forEach(extendEmits);\n        }\n        if (comp.extends) {\n            extendEmits(comp.extends);\n        }\n        if (comp.mixins) {\n            comp.mixins.forEach(extendEmits);\n        }\n    }\n    if (!raw && !hasExtends) {\n        return (comp.__emits = null);\n    }\n    if (isArray(raw)) {\n        raw.forEach(key => (normalized[key] = null));\n    }\n    else {\n        extend(normalized, raw);\n    }\n    return (comp.__emits = normalized);\n}\n// Check if an incoming prop key is a declared emit event listener.\n// e.g. With \\`emits: { click: null }\\`, props named \\`onClick\\` and \\`onclick\\` are\n// both considered matched listeners.\nfunction isEmitListener(options, key) {\n    if (!options || !isOn(key)) {\n        return false;\n    }\n    key = key.slice(2).replace(/Once$/, '');\n    return (hasOwn(options, key[0].toLowerCase() + key.slice(1)) ||\n        hasOwn(options, hyphenate(key)) ||\n        hasOwn(options, key));\n}\nlet isRenderingCompiledSlot = 0;\nconst setCompiledSlotRendering = (n) => (isRenderingCompiledSlot += n);\n/**\n * mark the current rendering instance for asset resolution (e.g.\n * resolveComponent, resolveDirective) during render\n */\nlet currentRenderingInstance = null;\nlet currentScopeId = null;\n/**\n * Note: rendering calls maybe nested. The function returns the parent rendering\n * instance if present, which should be restored after the render is done:\n *\n * \\`\\`\\`js\n * const prev = setCurrentRenderingInstance(i)\n * // ...render\n * setCurrentRenderingInstance(prev)\n * \\`\\`\\`\n */\nfunction setCurrentRenderingInstance(instance) {\n    const prev = currentRenderingInstance;\n    currentRenderingInstance = instance;\n    currentScopeId = (instance && instance.type.__scopeId) || null;\n    return prev;\n}\n/**\n * Wrap a slot function to memoize current rendering instance\n * @private compiler helper\n */\nfunction withCtx(fn, ctx = currentRenderingInstance) {\n    if (!ctx)\n        return fn;\n    const renderFnWithContext = (...args) => {\n        // If a user calls a compiled slot inside a template expression (#1745), it\n        // can mess up block tracking, so by default we need to push a null block to\n        // avoid that. This isn't necessary if rendering a compiled \\`<slot>\\`.\n        if (!isRenderingCompiledSlot) {\n            openBlock(true /* null block that disables tracking */);\n        }\n        const prevInstance = setCurrentRenderingInstance(ctx);\n        const res = fn(...args);\n        setCurrentRenderingInstance(prevInstance);\n        if (!isRenderingCompiledSlot) {\n            closeBlock();\n        }\n        return res;\n    };\n    // mark this as a compiled slot function.\n    // this is used in vnode.ts -> normalizeChildren() to set the slot\n    // rendering flag.\n    renderFnWithContext._c = true;\n    return renderFnWithContext;\n}\n/**\n * dev only flag to track whether $attrs was used during render.\n * If $attrs was used during render then the warning for failed attrs\n * fallthrough can be suppressed.\n */\nlet accessedAttrs = false;\nfunction markAttrsAccessed() {\n    accessedAttrs = true;\n}\nfunction renderComponentRoot(instance) {\n    const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx } = instance;\n    let result;\n    const prev = setCurrentRenderingInstance(instance);\n    try {\n        let fallthroughAttrs;\n        if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\n            // withProxy is a proxy with a different \\`has\\` trap only for\n            // runtime-compiled render functions using \\`with\\` block.\n            const proxyToUse = withProxy || proxy;\n            result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));\n            fallthroughAttrs = attrs;\n        }\n        else {\n            // functional\n            const render = Component;\n            // in dev, mark attrs accessed if optional props (attrs === props)\n            if ((\\\\\"production\\\\\" !== 'production') && attrs === props) ;\n            result = normalizeVNode(render.length > 1\n                ? render(props, (\\\\\"production\\\\\" !== 'production')\n                    ? {\n                        get attrs() {\n                            markAttrsAccessed();\n                            return attrs;\n                        },\n                        slots,\n                        emit\n                    }\n                    : { attrs, slots, emit })\n                : render(props, null /* we know it doesn't need it */));\n            fallthroughAttrs = Component.props\n                ? attrs\n                : getFunctionalFallthrough(attrs);\n        }\n        // attr merging\n        // in dev mode, comments are preserved, and it's possible for a template\n        // to have comments along side the root element which makes it a fragment\n        let root = result;\n        let setRoot = undefined;\n        if ((\\\\\"production\\\\\" !== 'production') &&\n            result.patchFlag > 0 &&\n            result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) ;\n        if (Component.inheritAttrs !== false && fallthroughAttrs) {\n            const keys = Object.keys(fallthroughAttrs);\n            const { shapeFlag } = root;\n            if (keys.length) {\n                if (shapeFlag & 1 /* ELEMENT */ ||\n                    shapeFlag & 6 /* COMPONENT */) {\n                    if (propsOptions && keys.some(isModelListener)) {\n                        // If a v-model listener (onUpdate:xxx) has a corresponding declared\n                        // prop, it indicates this component expects to handle v-model and\n                        // it should not fallthrough.\n                        // related: #1543, #1643, #1989\n                        fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);\n                    }\n                    root = cloneVNode(root, fallthroughAttrs);\n                }\n                else if ((\\\\\"production\\\\\" !== 'production') && !accessedAttrs && root.type !== Comment) ;\n            }\n        }\n        // inherit directives\n        if (vnode.dirs) {\n            if ((\\\\\"production\\\\\" !== 'production') && !isElementRoot(root)) ;\n            root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\n        }\n        // inherit transition data\n        if (vnode.transition) {\n            if ((\\\\\"production\\\\\" !== 'production') && !isElementRoot(root)) ;\n            root.transition = vnode.transition;\n        }\n        if ((\\\\\"production\\\\\" !== 'production') && setRoot) ;\n        else {\n            result = root;\n        }\n    }\n    catch (err) {\n        blockStack.length = 0;\n        handleError(err, instance, 1 /* RENDER_FUNCTION */);\n        result = createVNode(Comment);\n    }\n    setCurrentRenderingInstance(prev);\n    return result;\n}\n/**\n * dev only\n * In dev mode, template root level comments are rendered, which turns the\n * template into a fragment root, but we need to locate the single element\n * root for attrs and scope id processing.\n */\nconst getChildRoot = (vnode) => {\n    const rawChildren = vnode.children;\n    const dynamicChildren = vnode.dynamicChildren;\n    const childRoot = filterSingleRoot(rawChildren);\n    if (!childRoot) {\n        return [vnode, undefined];\n    }\n    const index = rawChildren.indexOf(childRoot);\n    const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\n    const setRoot = (updatedRoot) => {\n        rawChildren[index] = updatedRoot;\n        if (dynamicChildren) {\n            if (dynamicIndex > -1) {\n                dynamicChildren[dynamicIndex] = updatedRoot;\n            }\n            else if (updatedRoot.patchFlag > 0) {\n                vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\n            }\n        }\n    };\n    return [normalizeVNode(childRoot), setRoot];\n};\nfunction filterSingleRoot(children) {\n    let singleRoot;\n    for (let i = 0; i < children.length; i++) {\n        const child = children[i];\n        if (isVNode(child)) {\n            // ignore user comment\n            if (child.type !== Comment || child.children === 'v-if') {\n                if (singleRoot) {\n                    // has more than 1 non-comment child, return now\n                    return;\n                }\n                else {\n                    singleRoot = child;\n                }\n            }\n        }\n        else {\n            return;\n        }\n    }\n    return singleRoot;\n}\nconst getFunctionalFallthrough = (attrs) => {\n    let res;\n    for (const key in attrs) {\n        if (key === 'class' || key === 'style' || isOn(key)) {\n            (res || (res = {}))[key] = attrs[key];\n        }\n    }\n    return res;\n};\nconst filterModelListeners = (attrs, props) => {\n    const res = {};\n    for (const key in attrs) {\n        if (!isModelListener(key) || !(key.slice(9) in props)) {\n            res[key] = attrs[key];\n        }\n    }\n    return res;\n};\nconst isElementRoot = (vnode) => {\n    return (vnode.shapeFlag & 6 /* COMPONENT */ ||\n        vnode.shapeFlag & 1 /* ELEMENT */ ||\n        vnode.type === Comment // potential v-if branch switch\n    );\n};\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\n    const { props: prevProps, children: prevChildren, component } = prevVNode;\n    const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\n    const emits = component.emitsOptions;\n    // force child update for runtime directive or transition on component vnode.\n    if (nextVNode.dirs || nextVNode.transition) {\n        return true;\n    }\n    if (optimized && patchFlag >= 0) {\n        if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {\n            // slot content that references values that might have changed,\n            // e.g. in a v-for\n            return true;\n        }\n        if (patchFlag & 16 /* FULL_PROPS */) {\n            if (!prevProps) {\n                return !!nextProps;\n            }\n            // presence of this flag indicates props are always non-null\n            return hasPropsChanged(prevProps, nextProps, emits);\n        }\n        else if (patchFlag & 8 /* PROPS */) {\n            const dynamicProps = nextVNode.dynamicProps;\n            for (let i = 0; i < dynamicProps.length; i++) {\n                const key = dynamicProps[i];\n                if (nextProps[key] !== prevProps[key] &&\n                    !isEmitListener(emits, key)) {\n                    return true;\n                }\n            }\n        }\n    }\n    else {\n        // this path is only taken by manually written render functions\n        // so presence of any children leads to a forced update\n        if (prevChildren || nextChildren) {\n            if (!nextChildren || !nextChildren.$stable) {\n                return true;\n            }\n        }\n        if (prevProps === nextProps) {\n            return false;\n        }\n        if (!prevProps) {\n            return !!nextProps;\n        }\n        if (!nextProps) {\n            return true;\n        }\n        return hasPropsChanged(prevProps, nextProps, emits);\n    }\n    return false;\n}\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\n    const nextKeys = Object.keys(nextProps);\n    if (nextKeys.length !== Object.keys(prevProps).length) {\n        return true;\n    }\n    for (let i = 0; i < nextKeys.length; i++) {\n        const key = nextKeys[i];\n        if (nextProps[key] !== prevProps[key] &&\n            !isEmitListener(emitsOptions, key)) {\n            return true;\n        }\n    }\n    return false;\n}\nfunction updateHOCHostEl({ vnode, parent }, el // HostNode\n) {\n    while (parent && parent.subTree === vnode) {\n        (vnode = parent.vnode).el = el;\n        parent = parent.parent;\n    }\n}\nconst isSuspense = (type) => type.__isSuspense;\nfunction normalizeSuspenseChildren(vnode) {\n    const { shapeFlag, children } = vnode;\n    let content;\n    let fallback;\n    if (shapeFlag & 32 /* SLOTS_CHILDREN */) {\n        content = normalizeSuspenseSlot(children.default);\n        fallback = normalizeSuspenseSlot(children.fallback);\n    }\n    else {\n        content = normalizeSuspenseSlot(children);\n        fallback = normalizeVNode(null);\n    }\n    return {\n        content,\n        fallback\n    };\n}\nfunction normalizeSuspenseSlot(s) {\n    if (isFunction(s)) {\n        s = s();\n    }\n    if (isArray(s)) {\n        const singleChild = filterSingleRoot(s);\n        s = singleChild;\n    }\n    return normalizeVNode(s);\n}\nfunction queueEffectWithSuspense(fn, suspense) {\n    if (suspense && suspense.pendingBranch) {\n        if (isArray(fn)) {\n            suspense.effects.push(...fn);\n        }\n        else {\n            suspense.effects.push(fn);\n        }\n    }\n    else {\n        queuePostFlushCb(fn);\n    }\n}\nfunction initProps(instance, rawProps, isStateful, // result of bitwise flag comparison\nisSSR = false) {\n    const props = {};\n    const attrs = {};\n    def(attrs, InternalObjectKey, 1);\n    instance.propsDefaults = Object.create(null);\n    setFullProps(instance, rawProps, props, attrs);\n    if (isStateful) {\n        // stateful\n        instance.props = isSSR ? props : shallowReactive(props);\n    }\n    else {\n        if (!instance.type.props) {\n            // functional w/ optional props, props === attrs\n            instance.props = attrs;\n        }\n        else {\n            // functional w/ declared props\n            instance.props = props;\n        }\n    }\n    instance.attrs = attrs;\n}\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\n    const { props, attrs, vnode: { patchFlag } } = instance;\n    const rawCurrentProps = toRaw(props);\n    const [options] = instance.propsOptions;\n    if (\n    // always force full diff in dev\n    // - #1942 if hmr is enabled with sfc component\n    // - vite#872 non-sfc component used by sfc component\n        (optimized || patchFlag > 0) &&\n        !(patchFlag & 16 /* FULL_PROPS */)) {\n        if (patchFlag & 8 /* PROPS */) {\n            // Compiler-generated props & no keys change, just set the updated\n            // the props.\n            const propsToUpdate = instance.vnode.dynamicProps;\n            for (let i = 0; i < propsToUpdate.length; i++) {\n                const key = propsToUpdate[i];\n                // PROPS flag guarantees rawProps to be non-null\n                const value = rawProps[key];\n                if (options) {\n                    // attr / props separation was done on init and will be consistent\n                    // in this code path, so just check if attrs have it.\n                    if (hasOwn(attrs, key)) {\n                        attrs[key] = value;\n                    }\n                    else {\n                        const camelizedKey = camelize(key);\n                        props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance);\n                    }\n                }\n                else {\n                    attrs[key] = value;\n                }\n            }\n        }\n    }\n    else {\n        // full props update.\n        setFullProps(instance, rawProps, props, attrs);\n        // in case of dynamic props, check if we need to delete keys from\n        // the props object\n        let kebabKey;\n        for (const key in rawCurrentProps) {\n            if (!rawProps ||\n                // for camelCase\n                (!hasOwn(rawProps, key) &&\n                    // it's possible the original props was passed in as kebab-case\n                    // and converted to camelCase (#955)\n                    ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))) {\n                if (options) {\n                    if (rawPrevProps &&\n                        // for camelCase\n                        (rawPrevProps[key] !== undefined ||\n                            // for kebab-case\n                            rawPrevProps[kebabKey] !== undefined)) {\n                        props[key] = resolvePropValue(options, rawProps || EMPTY_OBJ, key, undefined, instance);\n                    }\n                }\n                else {\n                    delete props[key];\n                }\n            }\n        }\n        // in the case of functional component w/o props declaration, props and\n        // attrs point to the same object so it should already have been updated.\n        if (attrs !== rawCurrentProps) {\n            for (const key in attrs) {\n                if (!rawProps || !hasOwn(rawProps, key)) {\n                    delete attrs[key];\n                }\n            }\n        }\n    }\n    // trigger updates for $attrs in case it's used in component slots\n    trigger(instance, \\\\\"set\\\\\" /* SET */, '$attrs');\n}\nfunction setFullProps(instance, rawProps, props, attrs) {\n    const [options, needCastKeys] = instance.propsOptions;\n    if (rawProps) {\n        for (const key in rawProps) {\n            const value = rawProps[key];\n            // key, ref are reserved and never passed down\n            if (isReservedProp(key)) {\n                continue;\n            }\n            // prop option names are camelized during normalization, so to support\n            // kebab -> camel conversion here we need to camelize the key.\n            let camelKey;\n            if (options && hasOwn(options, (camelKey = camelize(key)))) {\n                props[camelKey] = value;\n            }\n            else if (!isEmitListener(instance.emitsOptions, key)) {\n                // Any non-declared (either as a prop or an emitted event) props are put\n                // into a separate \\`attrs\\` object for spreading. Make sure to preserve\n                // original key casing\n                attrs[key] = value;\n            }\n        }\n    }\n    if (needCastKeys) {\n        const rawCurrentProps = toRaw(props);\n        for (let i = 0; i < needCastKeys.length; i++) {\n            const key = needCastKeys[i];\n            props[key] = resolvePropValue(options, rawCurrentProps, key, rawCurrentProps[key], instance);\n        }\n    }\n}\nfunction resolvePropValue(options, props, key, value, instance) {\n    const opt = options[key];\n    if (opt != null) {\n        const hasDefault = hasOwn(opt, 'default');\n        // default values\n        if (hasDefault && value === undefined) {\n            const defaultValue = opt.default;\n            if (opt.type !== Function && isFunction(defaultValue)) {\n                const { propsDefaults } = instance;\n                if (key in propsDefaults) {\n                    value = propsDefaults[key];\n                }\n                else {\n                    setCurrentInstance(instance);\n                    value = propsDefaults[key] = defaultValue(props);\n                    setCurrentInstance(null);\n                }\n            }\n            else {\n                value = defaultValue;\n            }\n        }\n        // boolean casting\n        if (opt[0 /* shouldCast */]) {\n            if (!hasOwn(props, key) && !hasDefault) {\n                value = false;\n            }\n            else if (opt[1 /* shouldCastTrue */] &&\n                (value === '' || value === hyphenate(key))) {\n                value = true;\n            }\n        }\n    }\n    return value;\n}\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\n    if (!appContext.deopt && comp.__props) {\n        return comp.__props;\n    }\n    const raw = comp.props;\n    const normalized = {};\n    const needCastKeys = [];\n    // apply mixin/extends props\n    let hasExtends = false;\n    if ( !isFunction(comp)) {\n        const extendProps = (raw) => {\n            hasExtends = true;\n            const [props, keys] = normalizePropsOptions(raw, appContext, true);\n            extend(normalized, props);\n            if (keys)\n                needCastKeys.push(...keys);\n        };\n        if (!asMixin && appContext.mixins.length) {\n            appContext.mixins.forEach(extendProps);\n        }\n        if (comp.extends) {\n            extendProps(comp.extends);\n        }\n        if (comp.mixins) {\n            comp.mixins.forEach(extendProps);\n        }\n    }\n    if (!raw && !hasExtends) {\n        return (comp.__props = EMPTY_ARR);\n    }\n    if (isArray(raw)) {\n        for (let i = 0; i < raw.length; i++) {\n            const normalizedKey = camelize(raw[i]);\n            if (validatePropName(normalizedKey)) {\n                normalized[normalizedKey] = EMPTY_OBJ;\n            }\n        }\n    }\n    else if (raw) {\n        for (const key in raw) {\n            const normalizedKey = camelize(key);\n            if (validatePropName(normalizedKey)) {\n                const opt = raw[key];\n                const prop = (normalized[normalizedKey] =\n                    isArray(opt) || isFunction(opt) ? { type: opt } : opt);\n                if (prop) {\n                    const booleanIndex = getTypeIndex(Boolean, prop.type);\n                    const stringIndex = getTypeIndex(String, prop.type);\n                    prop[0 /* shouldCast */] = booleanIndex > -1;\n                    prop[1 /* shouldCastTrue */] =\n                        stringIndex < 0 || booleanIndex < stringIndex;\n                    // if the prop needs boolean casting or default value\n                    if (booleanIndex > -1 || hasOwn(prop, 'default')) {\n                        needCastKeys.push(normalizedKey);\n                    }\n                }\n            }\n        }\n    }\n    return (comp.__props = [normalized, needCastKeys]);\n}\nfunction validatePropName(key) {\n    if (key[0] !== '$') {\n        return true;\n    }\n    return false;\n}\n// use function string name to check type constructors\n// so that it works across vms / iframes.\nfunction getType(ctor) {\n    const match = ctor && ctor.toString().match(/^\\\\\\\\s*function (\\\\\\\\w+)/);\n    return match ? match[1] : '';\n}\nfunction isSameType(a, b) {\n    return getType(a) === getType(b);\n}\nfunction getTypeIndex(type, expectedTypes) {\n    if (isArray(expectedTypes)) {\n        return expectedTypes.findIndex(t => isSameType(t, type));\n    }\n    else if (isFunction(expectedTypes)) {\n        return isSameType(expectedTypes, type) ? 0 : -1;\n    }\n    return -1;\n}\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\n    if (target) {\n        const hooks = target[type] || (target[type] = []);\n        // cache the error handling wrapper for injected hooks so the same hook\n        // can be properly deduped by the scheduler. \\\\\"__weh\\\\\" stands for \\\\\"with error\n        // handling\\\\\".\n        const wrappedHook = hook.__weh ||\n            (hook.__weh = (...args) => {\n                if (target.isUnmounted) {\n                    return;\n                }\n                // disable tracking inside all lifecycle hooks\n                // since they can potentially be called inside effects.\n                pauseTracking();\n                // Set currentInstance during hook invocation.\n                // This assumes the hook does not synchronously trigger other hooks, which\n                // can only be false when the user does something really funky.\n                setCurrentInstance(target);\n                const res = callWithAsyncErrorHandling(hook, target, type, args);\n                setCurrentInstance(null);\n                resetTracking();\n                return res;\n            });\n        if (prepend) {\n            hooks.unshift(wrappedHook);\n        }\n        else {\n            hooks.push(wrappedHook);\n        }\n        return wrappedHook;\n    }\n}\nconst createHook = (lifecycle) => (hook, target = currentInstance) =>\n// post-create lifecycle registrations are noops during SSR\n!isInSSRComponentSetup && injectHook(lifecycle, hook, target);\nconst onBeforeMount = createHook(\\\\\"bm\\\\\" /* BEFORE_MOUNT */);\nconst onMounted = createHook(\\\\\"m\\\\\" /* MOUNTED */);\nconst onBeforeUpdate = createHook(\\\\\"bu\\\\\" /* BEFORE_UPDATE */);\nconst onUpdated = createHook(\\\\\"u\\\\\" /* UPDATED */);\nconst onBeforeUnmount = createHook(\\\\\"bum\\\\\" /* BEFORE_UNMOUNT */);\nconst onUnmounted = createHook(\\\\\"um\\\\\" /* UNMOUNTED */);\nconst onRenderTriggered = createHook(\\\\\"rtg\\\\\" /* RENDER_TRIGGERED */);\nconst onRenderTracked = createHook(\\\\\"rtc\\\\\" /* RENDER_TRACKED */);\nconst onErrorCaptured = (hook, target = currentInstance) => {\n    injectHook(\\\\\"ec\\\\\" /* ERROR_CAPTURED */, hook, target);\n};\n// initial value for watchers to trigger on undefined initial values\nconst INITIAL_WATCHER_VALUE = {};\n// implementation\nfunction watch(source, cb, options) {\n    return doWatch(source, cb, options);\n}\nfunction doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {\n    let getter;\n    let forceTrigger = false;\n    if (isRef(source)) {\n        getter = () => source.value;\n        forceTrigger = !!source._shallow;\n    }\n    else if (isReactive(source)) {\n        getter = () => source;\n        deep = true;\n    }\n    else if (isArray(source)) {\n        getter = () => source.map(s => {\n            if (isRef(s)) {\n                return s.value;\n            }\n            else if (isReactive(s)) {\n                return traverse(s);\n            }\n            else if (isFunction(s)) {\n                return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */, [\n                    instance && instance.proxy\n                ]);\n            }\n            else ;\n        });\n    }\n    else if (isFunction(source)) {\n        if (cb) {\n            // getter with cb\n            getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */, [\n                instance && instance.proxy\n            ]);\n        }\n        else {\n            // no cb -> simple effect\n            getter = () => {\n                if (instance && instance.isUnmounted) {\n                    return;\n                }\n                if (cleanup) {\n                    cleanup();\n                }\n                return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);\n            };\n        }\n    }\n    else {\n        getter = NOOP;\n    }\n    if (cb && deep) {\n        const baseGetter = getter;\n        getter = () => traverse(baseGetter());\n    }\n    let cleanup;\n    let onInvalidate = (fn) => {\n        cleanup = runner.options.onStop = () => {\n            callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);\n        };\n    };\n    let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;\n    const job = () => {\n        if (!runner.active) {\n            return;\n        }\n        if (cb) {\n            // watch(source, cb)\n            const newValue = runner();\n            if (deep || forceTrigger || hasChanged(newValue, oldValue)) {\n                // cleanup before running cb again\n                if (cleanup) {\n                    cleanup();\n                }\n                callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [\n                    newValue,\n                    // pass undefined as the old value when it's changed for the first time\n                    oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\n                    onInvalidate\n                ]);\n                oldValue = newValue;\n            }\n        }\n        else {\n            // watchEffect\n            runner();\n        }\n    };\n    // important: mark the job as a watcher callback so that scheduler knows\n    // it is allowed to self-trigger (#1727)\n    job.allowRecurse = !!cb;\n    let scheduler;\n    if (flush === 'sync') {\n        scheduler = job;\n    }\n    else if (flush === 'post') {\n        scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);\n    }\n    else {\n        // default: 'pre'\n        scheduler = () => {\n            if (!instance || instance.isMounted) {\n                queuePreFlushCb(job);\n            }\n            else {\n                // with 'pre' option, the first call must happen before\n                // the component is mounted so it is called synchronously.\n                job();\n            }\n        };\n    }\n    const runner = effect(getter, {\n        lazy: true,\n        onTrack,\n        onTrigger,\n        scheduler\n    });\n    recordInstanceBoundEffect(runner, instance);\n    // initial run\n    if (cb) {\n        if (immediate) {\n            job();\n        }\n        else {\n            oldValue = runner();\n        }\n    }\n    else if (flush === 'post') {\n        queuePostRenderEffect(runner, instance && instance.suspense);\n    }\n    else {\n        runner();\n    }\n    return () => {\n        stop(runner);\n        if (instance) {\n            remove(instance.effects, runner);\n        }\n    };\n}\n// this.$watch\nfunction instanceWatch(source, cb, options) {\n    const publicThis = this.proxy;\n    const getter = isString(source)\n        ? () => publicThis[source]\n        : source.bind(publicThis);\n    return doWatch(getter, cb.bind(publicThis), options, this);\n}\nfunction traverse(value, seen = new Set()) {\n    if (!isObject(value) || seen.has(value)) {\n        return value;\n    }\n    seen.add(value);\n    if (isRef(value)) {\n        traverse(value.value, seen);\n    }\n    else if (isArray(value)) {\n        for (let i = 0; i < value.length; i++) {\n            traverse(value[i], seen);\n        }\n    }\n    else if (isSet(value) || isMap(value)) {\n        value.forEach((v) => {\n            traverse(v, seen);\n        });\n    }\n    else {\n        for (const key in value) {\n            traverse(value[key], seen);\n        }\n    }\n    return value;\n}\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\nfunction onActivated(hook, target) {\n    registerKeepAliveHook(hook, \\\\\"a\\\\\" /* ACTIVATED */, target);\n}\nfunction onDeactivated(hook, target) {\n    registerKeepAliveHook(hook, \\\\\"da\\\\\" /* DEACTIVATED */, target);\n}\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\n    // cache the deactivate branch check wrapper for injected hooks so the same\n    // hook can be properly deduped by the scheduler. \\\\\"__wdc\\\\\" stands for \\\\\"with\n    // deactivation check\\\\\".\n    const wrappedHook = hook.__wdc ||\n        (hook.__wdc = () => {\n            // only fire the hook if the target instance is NOT in a deactivated branch.\n            let current = target;\n            while (current) {\n                if (current.isDeactivated) {\n                    return;\n                }\n                current = current.parent;\n            }\n            hook();\n        });\n    injectHook(type, wrappedHook, target);\n    // In addition to registering it on the target instance, we walk up the parent\n    // chain and register it on all ancestor instances that are keep-alive roots.\n    // This avoids the need to walk the entire component tree when invoking these\n    // hooks, and more importantly, avoids the need to track child components in\n    // arrays.\n    if (target) {\n        let current = target.parent;\n        while (current && current.parent) {\n            if (isKeepAlive(current.parent.vnode)) {\n                injectToKeepAliveRoot(wrappedHook, type, target, current);\n            }\n            current = current.parent;\n        }\n    }\n}\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\n    // injectHook wraps the original for error handling, so make sure to remove\n    // the wrapped version.\n    const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */);\n    onUnmounted(() => {\n        remove(keepAliveRoot[type], injected);\n    }, target);\n}\nconst isInternalKey = (key) => key[0] === '_' || key === '$stable';\nconst normalizeSlotValue = (value) => isArray(value)\n    ? value.map(normalizeVNode)\n    : [normalizeVNode(value)];\nconst normalizeSlot = (key, rawSlot, ctx) => withCtx((props) => {\n    return normalizeSlotValue(rawSlot(props));\n}, ctx);\nconst normalizeObjectSlots = (rawSlots, slots) => {\n    const ctx = rawSlots._ctx;\n    for (const key in rawSlots) {\n        if (isInternalKey(key))\n            continue;\n        const value = rawSlots[key];\n        if (isFunction(value)) {\n            slots[key] = normalizeSlot(key, value, ctx);\n        }\n        else if (value != null) {\n            const normalized = normalizeSlotValue(value);\n            slots[key] = () => normalized;\n        }\n    }\n};\nconst normalizeVNodeSlots = (instance, children) => {\n    const normalized = normalizeSlotValue(children);\n    instance.slots.default = () => normalized;\n};\nconst initSlots = (instance, children) => {\n    if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\n        const type = children._;\n        if (type) {\n            instance.slots = children;\n            // make compiler marker non-enumerable\n            def(children, '_', type);\n        }\n        else {\n            normalizeObjectSlots(children, (instance.slots = {}));\n        }\n    }\n    else {\n        instance.slots = {};\n        if (children) {\n            normalizeVNodeSlots(instance, children);\n        }\n    }\n    def(instance.slots, InternalObjectKey, 1);\n};\nconst updateSlots = (instance, children, optimized) => {\n    const { vnode, slots } = instance;\n    let needDeletionCheck = true;\n    let deletionComparisonTarget = EMPTY_OBJ;\n    if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\n        const type = children._;\n        if (type) {\n            // compiled slots.\n            if (optimized && type === 1 /* STABLE */) {\n                // compiled AND stable.\n                // no need to update, and skip stale slots removal.\n                needDeletionCheck = false;\n            }\n            else {\n                // compiled but dynamic (v-if/v-for on slots) - update slots, but skip\n                // normalization.\n                extend(slots, children);\n                // #2893\n                // when rendering the optimized slots by manually written render function,\n                // we need to delete the \\`slots._\\` flag if necessary to make subsequent updates reliable,\n                // i.e. let the \\`renderSlot\\` create the bailed Fragment\n                if (!optimized && type === 1 /* STABLE */) {\n                    delete slots._;\n                }\n            }\n        }\n        else {\n            needDeletionCheck = !children.$stable;\n            normalizeObjectSlots(children, slots);\n        }\n        deletionComparisonTarget = children;\n    }\n    else if (children) {\n        // non slot object children (direct value) passed to a component\n        normalizeVNodeSlots(instance, children);\n        deletionComparisonTarget = { default: 1 };\n    }\n    // delete stale slots\n    if (needDeletionCheck) {\n        for (const key in slots) {\n            if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {\n                delete slots[key];\n            }\n        }\n    }\n};\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\n    const bindings = vnode.dirs;\n    const oldBindings = prevVNode && prevVNode.dirs;\n    for (let i = 0; i < bindings.length; i++) {\n        const binding = bindings[i];\n        if (oldBindings) {\n            binding.oldValue = oldBindings[i].value;\n        }\n        const hook = binding.dir[name];\n        if (hook) {\n            callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [\n                vnode.el,\n                binding,\n                vnode,\n                prevVNode\n            ]);\n        }\n    }\n}\nfunction createAppContext() {\n    return {\n        app: null,\n        config: {\n            isNativeTag: NO,\n            performance: false,\n            globalProperties: {},\n            optionMergeStrategies: {},\n            isCustomElement: NO,\n            errorHandler: undefined,\n            warnHandler: undefined\n        },\n        mixins: [],\n        components: {},\n        directives: {},\n        provides: Object.create(null)\n    };\n}\nlet uid$1 = 0;\nfunction createAppAPI(render, hydrate) {\n    return function createApp(rootComponent, rootProps = null) {\n        if (rootProps != null && !isObject(rootProps)) {\n            rootProps = null;\n        }\n        const context = createAppContext();\n        const installedPlugins = new Set();\n        let isMounted = false;\n        const app = (context.app = {\n            _uid: uid$1++,\n            _component: rootComponent,\n            _props: rootProps,\n            _container: null,\n            _context: context,\n            version,\n            get config() {\n                return context.config;\n            },\n            set config(v) {\n            },\n            use(plugin, ...options) {\n                if (installedPlugins.has(plugin)) ;\n                else if (plugin && isFunction(plugin.install)) {\n                    installedPlugins.add(plugin);\n                    plugin.install(app, ...options);\n                }\n                else if (isFunction(plugin)) {\n                    installedPlugins.add(plugin);\n                    plugin(app, ...options);\n                }\n                else ;\n                return app;\n            },\n            mixin(mixin) {\n                {\n                    if (!context.mixins.includes(mixin)) {\n                        context.mixins.push(mixin);\n                        // global mixin with props/emits de-optimizes props/emits\n                        // normalization caching.\n                        if (mixin.props || mixin.emits) {\n                            context.deopt = true;\n                        }\n                    }\n                }\n                return app;\n            },\n            component(name, component) {\n                if (!component) {\n                    return context.components[name];\n                }\n                context.components[name] = component;\n                return app;\n            },\n            directive(name, directive) {\n                if (!directive) {\n                    return context.directives[name];\n                }\n                context.directives[name] = directive;\n                return app;\n            },\n            mount(rootContainer, isHydrate, isSVG) {\n                if (!isMounted) {\n                    const vnode = createVNode(rootComponent, rootProps);\n                    // store app context on the root VNode.\n                    // this will be set on the root instance on initial mount.\n                    vnode.appContext = context;\n                    if (isHydrate && hydrate) {\n                        hydrate(vnode, rootContainer);\n                    }\n                    else {\n                        render(vnode, rootContainer, isSVG);\n                    }\n                    isMounted = true;\n                    app._container = rootContainer;\n                    rootContainer.__vue_app__ = app;\n                    return vnode.component.proxy;\n                }\n            },\n            unmount() {\n                if (isMounted) {\n                    render(null, app._container);\n                    delete app._container.__vue_app__;\n                }\n            },\n            provide(key, value) {\n                // TypeScript doesn't allow symbols as index type\n                // https://github.com/Microsoft/TypeScript/issues/24587\n                context.provides[key] = value;\n                return app;\n            }\n        });\n        return app;\n    };\n}\n// implementation, close to no-op\nfunction defineComponent(options) {\n    return isFunction(options) ? { setup: options, name: options.name } : options;\n}\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\nconst prodEffectOptions = {\n    scheduler: queueJob,\n    // #1801, #2043 component render effects should allow recursive updates\n    allowRecurse: true\n};\nconst queuePostRenderEffect = queueEffectWithSuspense\n    ;\nconst setRef = (rawRef, oldRawRef, parentSuspense, vnode) => {\n    if (isArray(rawRef)) {\n        rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode));\n        return;\n    }\n    let value;\n    if (!vnode) {\n        // means unmount\n        value = null;\n    }\n    else if (isAsyncWrapper(vnode)) {\n        // when mounting async components, nothing needs to be done,\n        // because the template ref is forwarded to inner component\n        return;\n    }\n    else if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\n        value = vnode.component.exposed || vnode.component.proxy;\n    }\n    else {\n        value = vnode.el;\n    }\n    const { i: owner, r: ref } = rawRef;\n    const oldRef = oldRawRef && oldRawRef.r;\n    const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\n    const setupState = owner.setupState;\n    // unset old ref\n    if (oldRef != null && oldRef !== ref) {\n        if (isString(oldRef)) {\n            refs[oldRef] = null;\n            if (hasOwn(setupState, oldRef)) {\n                setupState[oldRef] = null;\n            }\n        }\n        else if (isRef(oldRef)) {\n            oldRef.value = null;\n        }\n    }\n    if (isString(ref)) {\n        const doSet = () => {\n            refs[ref] = value;\n            if (hasOwn(setupState, ref)) {\n                setupState[ref] = value;\n            }\n        };\n        // #1789: for non-null values, set them after render\n        // null values means this is unmount and it should not overwrite another\n        // ref with the same key\n        if (value) {\n            doSet.id = -1;\n            queuePostRenderEffect(doSet, parentSuspense);\n        }\n        else {\n            doSet();\n        }\n    }\n    else if (isRef(ref)) {\n        const doSet = () => {\n            ref.value = value;\n        };\n        if (value) {\n            doSet.id = -1;\n            queuePostRenderEffect(doSet, parentSuspense);\n        }\n        else {\n            doSet();\n        }\n    }\n    else if (isFunction(ref)) {\n        callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);\n    }\n    else ;\n};\n/**\n * The createRenderer function accepts two generic arguments:\n * HostNode and HostElement, corresponding to Node and Element types in the\n * host environment. For example, for runtime-dom, HostNode would be the DOM\n * \\`Node\\` interface and HostElement would be the DOM \\`Element\\` interface.\n *\n * Custom renderers can pass in the platform specific types like this:\n *\n * \\`\\`\\` js\n * const { render, createApp } = createRenderer<Node, Element>({\n *   patchProp,\n *   ...nodeOps\n * })\n * \\`\\`\\`\n */\nfunction createRenderer(options) {\n    return baseCreateRenderer(options);\n}\n// implementation\nfunction baseCreateRenderer(options, createHydrationFns) {\n    const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;\n    // Note: functions inside this closure should use \\`const xxx = () => {}\\`\n    // style in order to prevent being inlined by minifiers.\n    const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = false) => {\n        // patching & not same type, unmount old tree\n        if (n1 && !isSameVNodeType(n1, n2)) {\n            anchor = getNextHostNode(n1);\n            unmount(n1, parentComponent, parentSuspense, true);\n            n1 = null;\n        }\n        if (n2.patchFlag === -2 /* BAIL */) {\n            optimized = false;\n            n2.dynamicChildren = null;\n        }\n        const { type, ref, shapeFlag } = n2;\n        switch (type) {\n            case Text:\n                processText(n1, n2, container, anchor);\n                break;\n            case Comment:\n                processCommentNode(n1, n2, container, anchor);\n                break;\n            case Static:\n                if (n1 == null) {\n                    mountStaticNode(n2, container, anchor, isSVG);\n                }\n                break;\n            case Fragment:\n                processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                break;\n            default:\n                if (shapeFlag & 1 /* ELEMENT */) {\n                    processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else if (shapeFlag & 6 /* COMPONENT */) {\n                    processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else if (shapeFlag & 64 /* TELEPORT */) {\n                    type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\n                }\n                else if (shapeFlag & 128 /* SUSPENSE */) {\n                    type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\n                }\n                else ;\n        }\n        // set ref\n        if (ref != null && parentComponent) {\n            setRef(ref, n1 && n1.ref, parentSuspense, n2);\n        }\n    };\n    const processText = (n1, n2, container, anchor) => {\n        if (n1 == null) {\n            hostInsert((n2.el = hostCreateText(n2.children)), container, anchor);\n        }\n        else {\n            const el = (n2.el = n1.el);\n            if (n2.children !== n1.children) {\n                hostSetText(el, n2.children);\n            }\n        }\n    };\n    const processCommentNode = (n1, n2, container, anchor) => {\n        if (n1 == null) {\n            hostInsert((n2.el = hostCreateComment(n2.children || '')), container, anchor);\n        }\n        else {\n            // there's no support for dynamic comments\n            n2.el = n1.el;\n        }\n    };\n    const mountStaticNode = (n2, container, anchor, isSVG) => {\n        [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\n    };\n    const moveStaticNode = ({ el, anchor }, container, nextSibling) => {\n        let next;\n        while (el && el !== anchor) {\n            next = hostNextSibling(el);\n            hostInsert(el, container, nextSibling);\n            el = next;\n        }\n        hostInsert(anchor, container, nextSibling);\n    };\n    const removeStaticNode = ({ el, anchor }) => {\n        let next;\n        while (el && el !== anchor) {\n            next = hostNextSibling(el);\n            hostRemove(el);\n            el = next;\n        }\n        hostRemove(anchor);\n    };\n    const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        isSVG = isSVG || n2.type === 'svg';\n        if (n1 == null) {\n            mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n        else {\n            patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n    };\n    const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        let el;\n        let vnodeHook;\n        const { type, props, shapeFlag, transition, patchFlag, dirs } = vnode;\n        if (\n            vnode.el &&\n            hostCloneNode !== undefined &&\n            patchFlag === -1 /* HOISTED */) {\n            // If a vnode has non-null el, it means it's being reused.\n            // Only static vnodes can be reused, so its mounted DOM nodes should be\n            // exactly the same, and we can simply do a clone here.\n            // only do this in production since cloned trees cannot be HMR updated.\n            el = vnode.el = hostCloneNode(vnode.el);\n        }\n        else {\n            el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);\n            // mount children first, since some props may rely on child content\n            // being already rendered, e.g. \\`<select value>\\`\n            if (shapeFlag & 8 /* TEXT_CHILDREN */) {\n                hostSetElementText(el, vnode.children);\n            }\n            else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized || !!vnode.dynamicChildren);\n            }\n            if (dirs) {\n                invokeDirectiveHook(vnode, null, parentComponent, 'created');\n            }\n            // props\n            if (props) {\n                for (const key in props) {\n                    if (!isReservedProp(key)) {\n                        hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                    }\n                }\n                if ((vnodeHook = props.onVnodeBeforeMount)) {\n                    invokeVNodeHook(vnodeHook, parentComponent, vnode);\n                }\n            }\n            // scopeId\n            setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);\n        }\n        if (dirs) {\n            invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\n        }\n        // #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved\n        // #1689 For inside suspense + suspense resolved case, just call it\n        const needCallTransitionHooks = (!parentSuspense || (parentSuspense && !parentSuspense.pendingBranch)) &&\n            transition &&\n            !transition.persisted;\n        if (needCallTransitionHooks) {\n            transition.beforeEnter(el);\n        }\n        hostInsert(el, container, anchor);\n        if ((vnodeHook = props && props.onVnodeMounted) ||\n            needCallTransitionHooks ||\n            dirs) {\n            queuePostRenderEffect(() => {\n                vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\n                needCallTransitionHooks && transition.enter(el);\n                dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\n            }, parentSuspense);\n        }\n    };\n    const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {\n        if (scopeId) {\n            hostSetScopeId(el, scopeId);\n        }\n        if (slotScopeIds) {\n            for (let i = 0; i < slotScopeIds.length; i++) {\n                hostSetScopeId(el, slotScopeIds[i]);\n            }\n        }\n        if (parentComponent) {\n            let subTree = parentComponent.subTree;\n            if (vnode === subTree) {\n                const parentVNode = parentComponent.vnode;\n                setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);\n            }\n        }\n    };\n    const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, optimized, slotScopeIds, start = 0) => {\n        for (let i = start; i < children.length; i++) {\n            const child = (children[i] = optimized\n                ? cloneIfMounted(children[i])\n                : normalizeVNode(children[i]));\n            patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, optimized, slotScopeIds);\n        }\n    };\n    const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        const el = (n2.el = n1.el);\n        let { patchFlag, dynamicChildren, dirs } = n2;\n        // #1426 take the old vnode's patch flag into account since user may clone a\n        // compiler-generated vnode, which de-opts to FULL_PROPS\n        patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;\n        const oldProps = n1.props || EMPTY_OBJ;\n        const newProps = n2.props || EMPTY_OBJ;\n        let vnodeHook;\n        if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {\n            invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\n        }\n        if (dirs) {\n            invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');\n        }\n        if (patchFlag > 0) {\n            // the presence of a patchFlag means this element's render code was\n            // generated by the compiler and can take the fast path.\n            // in this path old node and new node are guaranteed to have the same shape\n            // (i.e. at the exact same position in the source template)\n            if (patchFlag & 16 /* FULL_PROPS */) {\n                // element props contain dynamic keys, full diff needed\n                patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\n            }\n            else {\n                // class\n                // this flag is matched when the element has dynamic class bindings.\n                if (patchFlag & 2 /* CLASS */) {\n                    if (oldProps.class !== newProps.class) {\n                        hostPatchProp(el, 'class', null, newProps.class, isSVG);\n                    }\n                }\n                // style\n                // this flag is matched when the element has dynamic style bindings\n                if (patchFlag & 4 /* STYLE */) {\n                    hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);\n                }\n                // props\n                // This flag is matched when the element has dynamic prop/attr bindings\n                // other than class and style. The keys of dynamic prop/attrs are saved for\n                // faster iteration.\n                // Note dynamic keys like :[foo]=\\\\\"bar\\\\\" will cause this optimization to\n                // bail out and go through a full diff because we need to unset the old key\n                if (patchFlag & 8 /* PROPS */) {\n                    // if the flag is present then dynamicProps must be non-null\n                    const propsToUpdate = n2.dynamicProps;\n                    for (let i = 0; i < propsToUpdate.length; i++) {\n                        const key = propsToUpdate[i];\n                        const prev = oldProps[key];\n                        const next = newProps[key];\n                        if (next !== prev ||\n                            (hostForcePatchProp && hostForcePatchProp(el, key))) {\n                            hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);\n                        }\n                    }\n                }\n            }\n            // text\n            // This flag is matched when the element has only dynamic text children.\n            if (patchFlag & 1 /* TEXT */) {\n                if (n1.children !== n2.children) {\n                    hostSetElementText(el, n2.children);\n                }\n            }\n        }\n        else if (!optimized && dynamicChildren == null) {\n            // unoptimized, full diff\n            patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\n        }\n        const areChildrenSVG = isSVG && n2.type !== 'foreignObject';\n        if (dynamicChildren) {\n            patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);\n        }\n        else if (!optimized) {\n            // full diff\n            patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);\n        }\n        if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {\n            queuePostRenderEffect(() => {\n                vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\n                dirs && invokeDirectiveHook(n2, n1, parentComponent, 'updated');\n            }, parentSuspense);\n        }\n    };\n    // The fast path for blocks.\n    const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {\n        for (let i = 0; i < newChildren.length; i++) {\n            const oldVNode = oldChildren[i];\n            const newVNode = newChildren[i];\n            // Determine the container (parent element) for the patch.\n            const container =\n            // - In the case of a Fragment, we need to provide the actual parent\n            // of the Fragment itself so it can move its children.\n            oldVNode.type === Fragment ||\n                // - In the case of different nodes, there is going to be a replacement\n                // which also requires the correct parent container\n                !isSameVNodeType(oldVNode, newVNode) ||\n                // - In the case of a component, it could contain anything.\n                oldVNode.shapeFlag & 6 /* COMPONENT */ ||\n                oldVNode.shapeFlag & 64 /* TELEPORT */\n                ? hostParentNode(oldVNode.el)\n                : // In other cases, the parent container is not actually used so we\n                    // just pass the block element here to avoid a DOM parentNode call.\n                    fallbackContainer;\n            patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);\n        }\n    };\n    const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {\n        if (oldProps !== newProps) {\n            for (const key in newProps) {\n                // empty string is not valid prop\n                if (isReservedProp(key))\n                    continue;\n                const next = newProps[key];\n                const prev = oldProps[key];\n                if (next !== prev ||\n                    (hostForcePatchProp && hostForcePatchProp(el, key))) {\n                    hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                }\n            }\n            if (oldProps !== EMPTY_OBJ) {\n                for (const key in oldProps) {\n                    if (!isReservedProp(key) && !(key in newProps)) {\n                        hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\n                    }\n                }\n            }\n        }\n    };\n    const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));\n        const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));\n        let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;\n        if (patchFlag > 0) {\n            optimized = true;\n        }\n        // check if this is a slot fragment with :slotted scope ids\n        if (fragmentSlotScopeIds) {\n            slotScopeIds = slotScopeIds\n                ? slotScopeIds.concat(fragmentSlotScopeIds)\n                : fragmentSlotScopeIds;\n        }\n        if (n1 == null) {\n            hostInsert(fragmentStartAnchor, container, anchor);\n            hostInsert(fragmentEndAnchor, container, anchor);\n            // a fragment can only have array children\n            // since they are either generated by the compiler, or implicitly created\n            // from arrays.\n            mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n        else {\n            if (patchFlag > 0 &&\n                patchFlag & 64 /* STABLE_FRAGMENT */ &&\n                dynamicChildren &&\n                // #2715 the previous fragment could've been a BAILed one as a result\n                // of renderSlot() with no valid children\n                n1.dynamicChildren) {\n                // a stable fragment (template root or <template v-for>) doesn't need to\n                // patch children order, but it may contain dynamicChildren.\n                patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);\n                if (\n                // #2080 if the stable fragment has a key, it's a <template v-for> that may\n                //  get moved around. Make sure all root level vnodes inherit el.\n                // #2134 or if it's a component root, it may also get moved around\n                // as the component is being moved.\n                n2.key != null ||\n                    (parentComponent && n2 === parentComponent.subTree)) {\n                    traverseStaticChildren(n1, n2, true /* shallow */);\n                }\n            }\n            else {\n                // keyed / unkeyed, or manual fragments.\n                // for keyed & unkeyed, since they are compiler generated from v-for,\n                // each child is guaranteed to be a block so the fragment will never\n                // have dynamicChildren.\n                patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n            }\n        }\n    };\n    const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        n2.slotScopeIds = slotScopeIds;\n        if (n1 == null) {\n            if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\n                parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);\n            }\n            else {\n                mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\n            }\n        }\n        else {\n            updateComponent(n1, n2, optimized);\n        }\n    };\n    const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {\n        const instance = (initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense));\n        // inject renderer internals for keepAlive\n        if (isKeepAlive(initialVNode)) {\n            instance.ctx.renderer = internals;\n        }\n        setupComponent(instance);\n        // setup() is async. This component relies on async logic to be resolved\n        // before proceeding\n        if (instance.asyncDep) {\n            parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);\n            // Give it a placeholder if this is not hydration\n            // TODO handle self-defined fallback\n            if (!initialVNode.el) {\n                const placeholder = (instance.subTree = createVNode(Comment));\n                processCommentNode(null, placeholder, container, anchor);\n            }\n            return;\n        }\n        setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);\n    };\n    const updateComponent = (n1, n2, optimized) => {\n        const instance = (n2.component = n1.component);\n        if (shouldUpdateComponent(n1, n2, optimized)) {\n            if (instance.asyncDep &&\n                !instance.asyncResolved) {\n                updateComponentPreRender(instance, n2, optimized);\n                return;\n            }\n            else {\n                // normal update\n                instance.next = n2;\n                // in case the child component is also queued, remove it to avoid\n                // double updating the same child component in the same flush.\n                invalidateJob(instance.update);\n                // instance.update is the reactive effect runner.\n                instance.update();\n            }\n        }\n        else {\n            // no update needed. just copy over properties\n            n2.component = n1.component;\n            n2.el = n1.el;\n            instance.vnode = n2;\n        }\n    };\n    const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {\n        // create reactive effect for rendering\n        instance.update = effect(function componentEffect() {\n            if (!instance.isMounted) {\n                let vnodeHook;\n                const { el, props } = initialVNode;\n                const { bm, m, parent } = instance;\n                // beforeMount hook\n                if (bm) {\n                    invokeArrayFns(bm);\n                }\n                // onVnodeBeforeMount\n                if ((vnodeHook = props && props.onVnodeBeforeMount)) {\n                    invokeVNodeHook(vnodeHook, parent, initialVNode);\n                }\n                const subTree = (instance.subTree = renderComponentRoot(instance));\n                if (el && hydrateNode) {\n                    // vnode has adopted host node - perform hydration instead of mount.\n                    hydrateNode(initialVNode.el, subTree, instance, parentSuspense, null);\n                }\n                else {\n                    patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);\n                    initialVNode.el = subTree.el;\n                }\n                // mounted hook\n                if (m) {\n                    queuePostRenderEffect(m, parentSuspense);\n                }\n                // onVnodeMounted\n                if ((vnodeHook = props && props.onVnodeMounted)) {\n                    const scopedInitialVNode = initialVNode;\n                    queuePostRenderEffect(() => {\n                        invokeVNodeHook(vnodeHook, parent, scopedInitialVNode);\n                    }, parentSuspense);\n                }\n                // activated hook for keep-alive roots.\n                // #1742 activated hook must be accessed after first render\n                // since the hook may be injected by a child keep-alive\n                const { a } = instance;\n                if (a &&\n                    initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\n                    queuePostRenderEffect(a, parentSuspense);\n                }\n                instance.isMounted = true;\n                // #2458: deference mount-only object parameters to prevent memleaks\n                initialVNode = container = anchor = null;\n            }\n            else {\n                // updateComponent\n                // This is triggered by mutation of component's own state (next: null)\n                // OR parent calling processComponent (next: VNode)\n                let { next, bu, u, parent, vnode } = instance;\n                let originNext = next;\n                let vnodeHook;\n                if (next) {\n                    next.el = vnode.el;\n                    updateComponentPreRender(instance, next, optimized);\n                }\n                else {\n                    next = vnode;\n                }\n                // beforeUpdate hook\n                if (bu) {\n                    invokeArrayFns(bu);\n                }\n                // onVnodeBeforeUpdate\n                if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {\n                    invokeVNodeHook(vnodeHook, parent, next, vnode);\n                }\n                const nextTree = renderComponentRoot(instance);\n                const prevTree = instance.subTree;\n                instance.subTree = nextTree;\n                patch(prevTree, nextTree,\n                // parent may have changed if it's in a teleport\n                hostParentNode(prevTree.el),\n                // anchor may have changed if it's in a fragment\n                getNextHostNode(prevTree), instance, parentSuspense, isSVG);\n                next.el = nextTree.el;\n                if (originNext === null) {\n                    // self-triggered update. In case of HOC, update parent component\n                    // vnode el. HOC is indicated by parent instance's subTree pointing\n                    // to child component's vnode\n                    updateHOCHostEl(instance, nextTree.el);\n                }\n                // updated hook\n                if (u) {\n                    queuePostRenderEffect(u, parentSuspense);\n                }\n                // onVnodeUpdated\n                if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {\n                    queuePostRenderEffect(() => {\n                        invokeVNodeHook(vnodeHook, parent, next, vnode);\n                    }, parentSuspense);\n                }\n            }\n        },  prodEffectOptions);\n    };\n    const updateComponentPreRender = (instance, nextVNode, optimized) => {\n        nextVNode.component = instance;\n        const prevProps = instance.vnode.props;\n        instance.vnode = nextVNode;\n        instance.next = null;\n        updateProps(instance, nextVNode.props, prevProps, optimized);\n        updateSlots(instance, nextVNode.children, optimized);\n        pauseTracking();\n        // props update may have triggered pre-flush watchers.\n        // flush them before the render update.\n        flushPreFlushCbs(undefined, instance.update);\n        resetTracking();\n    };\n    const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {\n        const c1 = n1 && n1.children;\n        const prevShapeFlag = n1 ? n1.shapeFlag : 0;\n        const c2 = n2.children;\n        const { patchFlag, shapeFlag } = n2;\n        // fast path\n        if (patchFlag > 0) {\n            if (patchFlag & 128 /* KEYED_FRAGMENT */) {\n                // this could be either fully-keyed or mixed (some keyed some not)\n                // presence of patchFlag means children are guaranteed to be arrays\n                patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                return;\n            }\n            else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {\n                // unkeyed\n                patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                return;\n            }\n        }\n        // children has 3 possibilities: text, array or no children.\n        if (shapeFlag & 8 /* TEXT_CHILDREN */) {\n            // text children fast path\n            if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\n                unmountChildren(c1, parentComponent, parentSuspense);\n            }\n            if (c2 !== c1) {\n                hostSetElementText(container, c2);\n            }\n        }\n        else {\n            if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\n                // prev children was array\n                if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                    // two arrays, cannot assume anything, do full diff\n                    patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else {\n                    // no new children, just unmount old\n                    unmountChildren(c1, parentComponent, parentSuspense, true);\n                }\n            }\n            else {\n                // prev children was text OR null\n                // new children is array OR null\n                if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {\n                    hostSetElementText(container, '');\n                }\n                // mount new if array\n                if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\n                    mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n            }\n        }\n    };\n    const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        c1 = c1 || EMPTY_ARR;\n        c2 = c2 || EMPTY_ARR;\n        const oldLength = c1.length;\n        const newLength = c2.length;\n        const commonLength = Math.min(oldLength, newLength);\n        let i;\n        for (i = 0; i < commonLength; i++) {\n            const nextChild = (c2[i] = optimized\n                ? cloneIfMounted(c2[i])\n                : normalizeVNode(c2[i]));\n            patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n        }\n        if (oldLength > newLength) {\n            // remove old\n            unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);\n        }\n        else {\n            // mount new\n            mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);\n        }\n    };\n    // can be all-keyed or mixed\n    const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\n        let i = 0;\n        const l2 = c2.length;\n        let e1 = c1.length - 1; // prev ending index\n        let e2 = l2 - 1; // next ending index\n        // 1. sync from start\n        // (a b) c\n        // (a b) d e\n        while (i <= e1 && i <= e2) {\n            const n1 = c1[i];\n            const n2 = (c2[i] = optimized\n                ? cloneIfMounted(c2[i])\n                : normalizeVNode(c2[i]));\n            if (isSameVNodeType(n1, n2)) {\n                patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n            }\n            else {\n                break;\n            }\n            i++;\n        }\n        // 2. sync from end\n        // a (b c)\n        // d e (b c)\n        while (i <= e1 && i <= e2) {\n            const n1 = c1[e1];\n            const n2 = (c2[e2] = optimized\n                ? cloneIfMounted(c2[e2])\n                : normalizeVNode(c2[e2]));\n            if (isSameVNodeType(n1, n2)) {\n                patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n            }\n            else {\n                break;\n            }\n            e1--;\n            e2--;\n        }\n        // 3. common sequence + mount\n        // (a b)\n        // (a b) c\n        // i = 2, e1 = 1, e2 = 2\n        // (a b)\n        // c (a b)\n        // i = 0, e1 = -1, e2 = 0\n        if (i > e1) {\n            if (i <= e2) {\n                const nextPos = e2 + 1;\n                const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;\n                while (i <= e2) {\n                    patch(null, (c2[i] = optimized\n                        ? cloneIfMounted(c2[i])\n                        : normalizeVNode(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                    i++;\n                }\n            }\n        }\n        // 4. common sequence + unmount\n        // (a b) c\n        // (a b)\n        // i = 2, e1 = 2, e2 = 1\n        // a (b c)\n        // (b c)\n        // i = 0, e1 = 0, e2 = -1\n        else if (i > e2) {\n            while (i <= e1) {\n                unmount(c1[i], parentComponent, parentSuspense, true);\n                i++;\n            }\n        }\n        // 5. unknown sequence\n        // [i ... e1 + 1]: a b [c d e] f g\n        // [i ... e2 + 1]: a b [e d c h] f g\n        // i = 2, e1 = 4, e2 = 5\n        else {\n            const s1 = i; // prev starting index\n            const s2 = i; // next starting index\n            // 5.1 build key:index map for newChildren\n            const keyToNewIndexMap = new Map();\n            for (i = s2; i <= e2; i++) {\n                const nextChild = (c2[i] = optimized\n                    ? cloneIfMounted(c2[i])\n                    : normalizeVNode(c2[i]));\n                if (nextChild.key != null) {\n                    keyToNewIndexMap.set(nextChild.key, i);\n                }\n            }\n            // 5.2 loop through old children left to be patched and try to patch\n            // matching nodes & remove nodes that are no longer present\n            let j;\n            let patched = 0;\n            const toBePatched = e2 - s2 + 1;\n            let moved = false;\n            // used to track whether any node has moved\n            let maxNewIndexSoFar = 0;\n            // works as Map<newIndex, oldIndex>\n            // Note that oldIndex is offset by +1\n            // and oldIndex = 0 is a special value indicating the new node has\n            // no corresponding old node.\n            // used for determining longest stable subsequence\n            const newIndexToOldIndexMap = new Array(toBePatched);\n            for (i = 0; i < toBePatched; i++)\n                newIndexToOldIndexMap[i] = 0;\n            for (i = s1; i <= e1; i++) {\n                const prevChild = c1[i];\n                if (patched >= toBePatched) {\n                    // all new children have been patched so this can only be a removal\n                    unmount(prevChild, parentComponent, parentSuspense, true);\n                    continue;\n                }\n                let newIndex;\n                if (prevChild.key != null) {\n                    newIndex = keyToNewIndexMap.get(prevChild.key);\n                }\n                else {\n                    // key-less node, try to locate a key-less node of the same type\n                    for (j = s2; j <= e2; j++) {\n                        if (newIndexToOldIndexMap[j - s2] === 0 &&\n                            isSameVNodeType(prevChild, c2[j])) {\n                            newIndex = j;\n                            break;\n                        }\n                    }\n                }\n                if (newIndex === undefined) {\n                    unmount(prevChild, parentComponent, parentSuspense, true);\n                }\n                else {\n                    newIndexToOldIndexMap[newIndex - s2] = i + 1;\n                    if (newIndex >= maxNewIndexSoFar) {\n                        maxNewIndexSoFar = newIndex;\n                    }\n                    else {\n                        moved = true;\n                    }\n                    patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                    patched++;\n                }\n            }\n            // 5.3 move and mount\n            // generate longest stable subsequence only when nodes have moved\n            const increasingNewIndexSequence = moved\n                ? getSequence(newIndexToOldIndexMap)\n                : EMPTY_ARR;\n            j = increasingNewIndexSequence.length - 1;\n            // looping backwards so that we can use last patched node as anchor\n            for (i = toBePatched - 1; i >= 0; i--) {\n                const nextIndex = s2 + i;\n                const nextChild = c2[nextIndex];\n                const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;\n                if (newIndexToOldIndexMap[i] === 0) {\n                    // mount new\n                    patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\n                }\n                else if (moved) {\n                    // move if:\n                    // There is no stable subsequence (e.g. a reverse)\n                    // OR current node is not among the stable sequence\n                    if (j < 0 || i !== increasingNewIndexSequence[j]) {\n                        move(nextChild, container, anchor, 2 /* REORDER */);\n                    }\n                    else {\n                        j--;\n                    }\n                }\n            }\n        }\n    };\n    const move = (vnode, container, anchor, moveType, parentSuspense = null) => {\n        const { el, type, transition, children, shapeFlag } = vnode;\n        if (shapeFlag & 6 /* COMPONENT */) {\n            move(vnode.component.subTree, container, anchor, moveType);\n            return;\n        }\n        if (shapeFlag & 128 /* SUSPENSE */) {\n            vnode.suspense.move(container, anchor, moveType);\n            return;\n        }\n        if (shapeFlag & 64 /* TELEPORT */) {\n            type.move(vnode, container, anchor, internals);\n            return;\n        }\n        if (type === Fragment) {\n            hostInsert(el, container, anchor);\n            for (let i = 0; i < children.length; i++) {\n                move(children[i], container, anchor, moveType);\n            }\n            hostInsert(vnode.anchor, container, anchor);\n            return;\n        }\n        if (type === Static) {\n            moveStaticNode(vnode, container, anchor);\n            return;\n        }\n        // single nodes\n        const needTransition = moveType !== 2 /* REORDER */ &&\n            shapeFlag & 1 /* ELEMENT */ &&\n            transition;\n        if (needTransition) {\n            if (moveType === 0 /* ENTER */) {\n                transition.beforeEnter(el);\n                hostInsert(el, container, anchor);\n                queuePostRenderEffect(() => transition.enter(el), parentSuspense);\n            }\n            else {\n                const { leave, delayLeave, afterLeave } = transition;\n                const remove = () => hostInsert(el, container, anchor);\n                const performLeave = () => {\n                    leave(el, () => {\n                        remove();\n                        afterLeave && afterLeave();\n                    });\n                };\n                if (delayLeave) {\n                    delayLeave(el, remove, performLeave);\n                }\n                else {\n                    performLeave();\n                }\n            }\n        }\n        else {\n            hostInsert(el, container, anchor);\n        }\n    };\n    const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {\n        const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode;\n        // unset ref\n        if (ref != null) {\n            setRef(ref, null, parentSuspense, null);\n        }\n        if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\n            parentComponent.ctx.deactivate(vnode);\n            return;\n        }\n        const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;\n        let vnodeHook;\n        if ((vnodeHook = props && props.onVnodeBeforeUnmount)) {\n            invokeVNodeHook(vnodeHook, parentComponent, vnode);\n        }\n        if (shapeFlag & 6 /* COMPONENT */) {\n            unmountComponent(vnode.component, parentSuspense, doRemove);\n        }\n        else {\n            if (shapeFlag & 128 /* SUSPENSE */) {\n                vnode.suspense.unmount(parentSuspense, doRemove);\n                return;\n            }\n            if (shouldInvokeDirs) {\n                invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');\n            }\n            if (shapeFlag & 64 /* TELEPORT */) {\n                vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);\n            }\n            else if (dynamicChildren &&\n                // #1153: fast path should not be taken for non-stable (v-for) fragments\n                (type !== Fragment ||\n                    (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {\n                // fast path for block nodes: only need to unmount dynamic children.\n                unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);\n            }\n            else if ((type === Fragment &&\n                (patchFlag & 128 /* KEYED_FRAGMENT */ ||\n                    patchFlag & 256 /* UNKEYED_FRAGMENT */)) ||\n                (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {\n                unmountChildren(children, parentComponent, parentSuspense);\n            }\n            if (doRemove) {\n                remove(vnode);\n            }\n        }\n        if ((vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {\n            queuePostRenderEffect(() => {\n                vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\n                shouldInvokeDirs &&\n                    invokeDirectiveHook(vnode, null, parentComponent, 'unmounted');\n            }, parentSuspense);\n        }\n    };\n    const remove = vnode => {\n        const { type, el, anchor, transition } = vnode;\n        if (type === Fragment) {\n            removeFragment(el, anchor);\n            return;\n        }\n        if (type === Static) {\n            removeStaticNode(vnode);\n            return;\n        }\n        const performRemove = () => {\n            hostRemove(el);\n            if (transition && !transition.persisted && transition.afterLeave) {\n                transition.afterLeave();\n            }\n        };\n        if (vnode.shapeFlag & 1 /* ELEMENT */ &&\n            transition &&\n            !transition.persisted) {\n            const { leave, delayLeave } = transition;\n            const performLeave = () => leave(el, performRemove);\n            if (delayLeave) {\n                delayLeave(vnode.el, performRemove, performLeave);\n            }\n            else {\n                performLeave();\n            }\n        }\n        else {\n            performRemove();\n        }\n    };\n    const removeFragment = (cur, end) => {\n        // For fragments, directly remove all contained DOM nodes.\n        // (fragment child nodes cannot have transition)\n        let next;\n        while (cur !== end) {\n            next = hostNextSibling(cur);\n            hostRemove(cur);\n            cur = next;\n        }\n        hostRemove(end);\n    };\n    const unmountComponent = (instance, parentSuspense, doRemove) => {\n        const { bum, effects, update, subTree, um } = instance;\n        // beforeUnmount hook\n        if (bum) {\n            invokeArrayFns(bum);\n        }\n        if (effects) {\n            for (let i = 0; i < effects.length; i++) {\n                stop(effects[i]);\n            }\n        }\n        // update may be null if a component is unmounted before its async\n        // setup has resolved.\n        if (update) {\n            stop(update);\n            unmount(subTree, instance, parentSuspense, doRemove);\n        }\n        // unmounted hook\n        if (um) {\n            queuePostRenderEffect(um, parentSuspense);\n        }\n        queuePostRenderEffect(() => {\n            instance.isUnmounted = true;\n        }, parentSuspense);\n        // A component with async dep inside a pending suspense is unmounted before\n        // its async dep resolves. This should remove the dep from the suspense, and\n        // cause the suspense to resolve immediately if that was the last dep.\n        if (parentSuspense &&\n            parentSuspense.pendingBranch &&\n            !parentSuspense.isUnmounted &&\n            instance.asyncDep &&\n            !instance.asyncResolved &&\n            instance.suspenseId === parentSuspense.pendingId) {\n            parentSuspense.deps--;\n            if (parentSuspense.deps === 0) {\n                parentSuspense.resolve();\n            }\n        }\n    };\n    const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {\n        for (let i = start; i < children.length; i++) {\n            unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);\n        }\n    };\n    const getNextHostNode = vnode => {\n        if (vnode.shapeFlag & 6 /* COMPONENT */) {\n            return getNextHostNode(vnode.component.subTree);\n        }\n        if (vnode.shapeFlag & 128 /* SUSPENSE */) {\n            return vnode.suspense.next();\n        }\n        return hostNextSibling((vnode.anchor || vnode.el));\n    };\n    const render = (vnode, container, isSVG) => {\n        if (vnode == null) {\n            if (container._vnode) {\n                unmount(container._vnode, null, null, true);\n            }\n        }\n        else {\n            patch(container._vnode || null, vnode, container, null, null, null, isSVG);\n        }\n        flushPostFlushCbs();\n        container._vnode = vnode;\n    };\n    const internals = {\n        p: patch,\n        um: unmount,\n        m: move,\n        r: remove,\n        mt: mountComponent,\n        mc: mountChildren,\n        pc: patchChildren,\n        pbc: patchBlockChildren,\n        n: getNextHostNode,\n        o: options\n    };\n    let hydrate;\n    let hydrateNode;\n    if (createHydrationFns) {\n        [hydrate, hydrateNode] = createHydrationFns(internals);\n    }\n    return {\n        render,\n        hydrate,\n        createApp: createAppAPI(render, hydrate)\n    };\n}\nfunction invokeVNodeHook(hook, instance, vnode, prevVNode = null) {\n    callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [\n        vnode,\n        prevVNode\n    ]);\n}\n/**\n * #1156\n * When a component is HMR-enabled, we need to make sure that all static nodes\n * inside a block also inherit the DOM element from the previous tree so that\n * HMR updates (which are full updates) can retrieve the element for patching.\n *\n * #2080\n * Inside keyed \\`template\\` fragment static children, if a fragment is moved,\n * the children will always moved so that need inherit el form previous nodes\n * to ensure correct moved position.\n */\nfunction traverseStaticChildren(n1, n2, shallow = false) {\n    const ch1 = n1.children;\n    const ch2 = n2.children;\n    if (isArray(ch1) && isArray(ch2)) {\n        for (let i = 0; i < ch1.length; i++) {\n            // this is only called in the optimized path so array children are\n            // guaranteed to be vnodes\n            const c1 = ch1[i];\n            let c2 = ch2[i];\n            if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {\n                if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {\n                    c2 = ch2[i] = cloneIfMounted(ch2[i]);\n                    c2.el = c1.el;\n                }\n                if (!shallow)\n                    traverseStaticChildren(c1, c2);\n            }\n        }\n    }\n}\n// https://en.wikipedia.org/wiki/Longest_increasing_subsequence\nfunction getSequence(arr) {\n    const p = arr.slice();\n    const result = [0];\n    let i, j, u, v, c;\n    const len = arr.length;\n    for (i = 0; i < len; i++) {\n        const arrI = arr[i];\n        if (arrI !== 0) {\n            j = result[result.length - 1];\n            if (arr[j] < arrI) {\n                p[i] = j;\n                result.push(i);\n                continue;\n            }\n            u = 0;\n            v = result.length - 1;\n            while (u < v) {\n                c = ((u + v) / 2) | 0;\n                if (arr[result[c]] < arrI) {\n                    u = c + 1;\n                }\n                else {\n                    v = c;\n                }\n            }\n            if (arrI < arr[result[u]]) {\n                if (u > 0) {\n                    p[i] = result[u - 1];\n                }\n                result[u] = i;\n            }\n        }\n    }\n    u = result.length;\n    v = result[u - 1];\n    while (u-- > 0) {\n        result[u] = v;\n        v = p[v];\n    }\n    return result;\n}\nconst isTeleport = (type) => type.__isTeleport;\nconst COMPONENTS = 'components';\n/**\n * @private\n */\nfunction resolveComponent(name, maybeSelfReference) {\n    return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\n}\nconst NULL_DYNAMIC_COMPONENT = Symbol();\n// implementation\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\n    const instance = currentRenderingInstance || currentInstance;\n    if (instance) {\n        const Component = instance.type;\n        // explicit self name has highest priority\n        if (type === COMPONENTS) {\n            const selfName = getComponentName(Component);\n            if (selfName &&\n                (selfName === name ||\n                    selfName === camelize(name) ||\n                    selfName === capitalize(camelize(name)))) {\n                return Component;\n            }\n        }\n        const res =\n        // local registration\n        // check instance[type] first for components with mixin or extends.\n        resolve(instance[type] || Component[type], name) ||\n            // global registration\n            resolve(instance.appContext[type], name);\n        if (!res && maybeSelfReference) {\n            // fallback to implicit self-reference\n            return Component;\n        }\n        return res;\n    }\n}\nfunction resolve(registry, name) {\n    return (registry &&\n        (registry[name] ||\n            registry[camelize(name)] ||\n            registry[capitalize(camelize(name))]));\n}\nconst Fragment = Symbol( undefined);\nconst Text = Symbol( undefined);\nconst Comment = Symbol( undefined);\nconst Static = Symbol( undefined);\n// Since v-if and v-for are the two possible ways node structure can dynamically\n// change, once we consider v-if branches and each v-for fragment a block, we\n// can divide a template into nested blocks, and within each block the node\n// structure would be stable. This allows us to skip most children diffing\n// and only worry about the dynamic nodes (indicated by patch flags).\nconst blockStack = [];\nlet currentBlock = null;\n/**\n * Open a block.\n * This must be called before \\`createBlock\\`. It cannot be part of \\`createBlock\\`\n * because the children of the block are evaluated before \\`createBlock\\` itself\n * is called. The generated code typically looks like this:\n *\n * \\`\\`\\`js\n * function render() {\n *   return (openBlock(),createBlock('div', null, [...]))\n * }\n * \\`\\`\\`\n * disableTracking is true when creating a v-for fragment block, since a v-for\n * fragment always diffs its children.\n *\n * @private\n */\nfunction openBlock(disableTracking = false) {\n    blockStack.push((currentBlock = disableTracking ? null : []));\n}\nfunction closeBlock() {\n    blockStack.pop();\n    currentBlock = blockStack[blockStack.length - 1] || null;\n}\n/**\n * Create a block root vnode. Takes the same exact arguments as \\`createVNode\\`.\n * A block root keeps track of dynamic nodes within the block in the\n * \\`dynamicChildren\\` array.\n *\n * @private\n */\nfunction createBlock(type, props, children, patchFlag, dynamicProps) {\n    const vnode = createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */);\n    // save current block children on the block vnode\n    vnode.dynamicChildren = currentBlock || EMPTY_ARR;\n    // close block\n    closeBlock();\n    // a block is always going to be patched, so track it as a child of its\n    // parent block\n    if ( currentBlock) {\n        currentBlock.push(vnode);\n    }\n    return vnode;\n}\nfunction isVNode(value) {\n    return value ? value.__v_isVNode === true : false;\n}\nfunction isSameVNodeType(n1, n2) {\n    return n1.type === n2.type && n1.key === n2.key;\n}\nconst InternalObjectKey = \\`__vInternal\\`;\nconst normalizeKey = ({ key }) => key != null ? key : null;\nconst normalizeRef = ({ ref }) => {\n    return (ref != null\n        ? isString(ref) || isRef(ref) || isFunction(ref)\n            ? { i: currentRenderingInstance, r: ref }\n            : ref\n        : null);\n};\nconst createVNode = ( _createVNode);\nfunction _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\n    if (!type || type === NULL_DYNAMIC_COMPONENT) {\n        type = Comment;\n    }\n    if (isVNode(type)) {\n        // createVNode receiving an existing vnode. This happens in cases like\n        // <component :is=\\\\\"vnode\\\\\"/>\n        // #2078 make sure to merge refs during the clone instead of overwriting it\n        const cloned = cloneVNode(type, props, true /* mergeRef: true */);\n        if (children) {\n            normalizeChildren(cloned, children);\n        }\n        return cloned;\n    }\n    // class component normalization.\n    if (isClassComponent(type)) {\n        type = type.__vccOpts;\n    }\n    // class & style normalization.\n    if (props) {\n        // for reactive or proxy objects, we need to clone it to enable mutation.\n        if (isProxy(props) || InternalObjectKey in props) {\n            props = extend({}, props);\n        }\n        let { class: klass, style } = props;\n        if (klass && !isString(klass)) {\n            props.class = normalizeClass(klass);\n        }\n        if (isObject(style)) {\n            // reactive state objects need to be cloned since they are likely to be\n            // mutated\n            if (isProxy(style) && !isArray(style)) {\n                style = extend({}, style);\n            }\n            props.style = normalizeStyle(style);\n        }\n    }\n    // encode the vnode type information into a bitmap\n    const shapeFlag = isString(type)\n        ? 1 /* ELEMENT */\n        : isSuspense(type)\n            ? 128 /* SUSPENSE */\n            : isTeleport(type)\n                ? 64 /* TELEPORT */\n                : isObject(type)\n                    ? 4 /* STATEFUL_COMPONENT */\n                    : isFunction(type)\n                        ? 2 /* FUNCTIONAL_COMPONENT */\n                        : 0;\n    const vnode = {\n        __v_isVNode: true,\n        [\\\\\"__v_skip\\\\\" /* SKIP */]: true,\n        type,\n        props,\n        key: props && normalizeKey(props),\n        ref: props && normalizeRef(props),\n        scopeId: currentScopeId,\n        slotScopeIds: null,\n        children: null,\n        component: null,\n        suspense: null,\n        ssContent: null,\n        ssFallback: null,\n        dirs: null,\n        transition: null,\n        el: null,\n        anchor: null,\n        target: null,\n        targetAnchor: null,\n        staticCount: 0,\n        shapeFlag,\n        patchFlag,\n        dynamicProps,\n        dynamicChildren: null,\n        appContext: null\n    };\n    normalizeChildren(vnode, children);\n    // normalize suspense children\n    if (shapeFlag & 128 /* SUSPENSE */) {\n        const { content, fallback } = normalizeSuspenseChildren(vnode);\n        vnode.ssContent = content;\n        vnode.ssFallback = fallback;\n    }\n    if (\n        // avoid a block node from tracking itself\n        !isBlockNode &&\n        // has current parent block\n        currentBlock &&\n        // presence of a patch flag indicates this node needs patching on updates.\n        // component nodes also should always be patched, because even if the\n        // component doesn't need to update, it needs to persist the instance on to\n        // the next vnode so that it can be properly unmounted later.\n        (patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&\n        // the EVENTS flag is only for hydration and if it is the only flag, the\n        // vnode should not be considered dynamic due to handler caching.\n        patchFlag !== 32 /* HYDRATE_EVENTS */) {\n        currentBlock.push(vnode);\n    }\n    return vnode;\n}\nfunction cloneVNode(vnode, extraProps, mergeRef = false) {\n    // This is intentionally NOT using spread or extend to avoid the runtime\n    // key enumeration cost.\n    const { props, ref, patchFlag, children } = vnode;\n    const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;\n    return {\n        __v_isVNode: true,\n        [\\\\\"__v_skip\\\\\" /* SKIP */]: true,\n        type: vnode.type,\n        props: mergedProps,\n        key: mergedProps && normalizeKey(mergedProps),\n        ref: extraProps && extraProps.ref\n            ? // #2078 in the case of <component :is=\\\\\"vnode\\\\\" ref=\\\\\"extra\\\\\"/>\n                // if the vnode itself already has a ref, cloneVNode will need to merge\n                // the refs so the single vnode can be set on multiple refs\n                mergeRef && ref\n                    ? isArray(ref)\n                        ? ref.concat(normalizeRef(extraProps))\n                        : [ref, normalizeRef(extraProps)]\n                    : normalizeRef(extraProps)\n            : ref,\n        scopeId: vnode.scopeId,\n        slotScopeIds: vnode.slotScopeIds,\n        children:  children,\n        target: vnode.target,\n        targetAnchor: vnode.targetAnchor,\n        staticCount: vnode.staticCount,\n        shapeFlag: vnode.shapeFlag,\n        // if the vnode is cloned with extra props, we can no longer assume its\n        // existing patch flag to be reliable and need to add the FULL_PROPS flag.\n        // note: perserve flag for fragments since they use the flag for children\n        // fast paths only.\n        patchFlag: extraProps && vnode.type !== Fragment\n            ? patchFlag === -1 // hoisted node\n                ? 16 /* FULL_PROPS */\n                : patchFlag | 16 /* FULL_PROPS */\n            : patchFlag,\n        dynamicProps: vnode.dynamicProps,\n        dynamicChildren: vnode.dynamicChildren,\n        appContext: vnode.appContext,\n        dirs: vnode.dirs,\n        transition: vnode.transition,\n        // These should technically only be non-null on mounted VNodes. However,\n        // they *should* be copied for kept-alive vnodes. So we just always copy\n        // them since them being non-null during a mount doesn't affect the logic as\n        // they will simply be overwritten.\n        component: vnode.component,\n        suspense: vnode.suspense,\n        ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),\n        ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),\n        el: vnode.el,\n        anchor: vnode.anchor\n    };\n}\n/**\n * @private\n */\nfunction createTextVNode(text = ' ', flag = 0) {\n    return createVNode(Text, null, text, flag);\n}\nfunction normalizeVNode(child) {\n    if (child == null || typeof child === 'boolean') {\n        // empty placeholder\n        return createVNode(Comment);\n    }\n    else if (isArray(child)) {\n        // fragment\n        return createVNode(Fragment, null, child);\n    }\n    else if (typeof child === 'object') {\n        // already vnode, this should be the most common since compiled templates\n        // always produce all-vnode children arrays\n        return child.el === null ? child : cloneVNode(child);\n    }\n    else {\n        // strings and numbers\n        return createVNode(Text, null, String(child));\n    }\n}\n// optimized normalization for template-compiled render fns\nfunction cloneIfMounted(child) {\n    return child.el === null ? child : cloneVNode(child);\n}\nfunction normalizeChildren(vnode, children) {\n    let type = 0;\n    const { shapeFlag } = vnode;\n    if (children == null) {\n        children = null;\n    }\n    else if (isArray(children)) {\n        type = 16 /* ARRAY_CHILDREN */;\n    }\n    else if (typeof children === 'object') {\n        if (shapeFlag & 1 /* ELEMENT */ || shapeFlag & 64 /* TELEPORT */) {\n            // Normalize slot to plain children for plain element and Teleport\n            const slot = children.default;\n            if (slot) {\n                // _c marker is added by withCtx() indicating this is a compiled slot\n                slot._c && setCompiledSlotRendering(1);\n                normalizeChildren(vnode, slot());\n                slot._c && setCompiledSlotRendering(-1);\n            }\n            return;\n        }\n        else {\n            type = 32 /* SLOTS_CHILDREN */;\n            const slotFlag = children._;\n            if (!slotFlag && !(InternalObjectKey in children)) {\n                children._ctx = currentRenderingInstance;\n            }\n            else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {\n                // a child component receives forwarded slots from the parent.\n                // its slot type is determined by its parent's slot type.\n                if (currentRenderingInstance.vnode.patchFlag & 1024 /* DYNAMIC_SLOTS */) {\n                    children._ = 2 /* DYNAMIC */;\n                    vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;\n                }\n                else {\n                    children._ = 1 /* STABLE */;\n                }\n            }\n        }\n    }\n    else if (isFunction(children)) {\n        children = { default: children, _ctx: currentRenderingInstance };\n        type = 32 /* SLOTS_CHILDREN */;\n    }\n    else {\n        children = String(children);\n        // force teleport children to array so it can be moved around\n        if (shapeFlag & 64 /* TELEPORT */) {\n            type = 16 /* ARRAY_CHILDREN */;\n            children = [createTextVNode(children)];\n        }\n        else {\n            type = 8 /* TEXT_CHILDREN */;\n        }\n    }\n    vnode.children = children;\n    vnode.shapeFlag |= type;\n}\nfunction mergeProps(...args) {\n    const ret = extend({}, args[0]);\n    for (let i = 1; i < args.length; i++) {\n        const toMerge = args[i];\n        for (const key in toMerge) {\n            if (key === 'class') {\n                if (ret.class !== toMerge.class) {\n                    ret.class = normalizeClass([ret.class, toMerge.class]);\n                }\n            }\n            else if (key === 'style') {\n                ret.style = normalizeStyle([ret.style, toMerge.style]);\n            }\n            else if (isOn(key)) {\n                const existing = ret[key];\n                const incoming = toMerge[key];\n                if (existing !== incoming) {\n                    ret[key] = existing\n                        ? [].concat(existing, toMerge[key])\n                        : incoming;\n                }\n            }\n            else if (key !== '') {\n                ret[key] = toMerge[key];\n            }\n        }\n    }\n    return ret;\n}\nfunction provide(key, value) {\n    if (!currentInstance) ;\n    else {\n        let provides = currentInstance.provides;\n        // by default an instance inherits its parent's provides object\n        // but when it needs to provide values of its own, it creates its\n        // own provides object using parent provides object as prototype.\n        // this way in \\`inject\\` we can simply look up injections from direct\n        // parent and let the prototype chain do the work.\n        const parentProvides = currentInstance.parent && currentInstance.parent.provides;\n        if (parentProvides === provides) {\n            provides = currentInstance.provides = Object.create(parentProvides);\n        }\n        // TS doesn't allow symbol as index type\n        provides[key] = value;\n    }\n}\nfunction inject(key, defaultValue, treatDefaultAsFactory = false) {\n    // fallback to \\`currentRenderingInstance\\` so that this can be called in\n    // a functional component\n    const instance = currentInstance || currentRenderingInstance;\n    if (instance) {\n        // #2400\n        // to support \\`app.use\\` plugins,\n        // fallback to appContext's \\`provides\\` if the intance is at root\n        const provides = instance.parent == null\n            ? instance.vnode.appContext && instance.vnode.appContext.provides\n            : instance.parent.provides;\n        if (provides && key in provides) {\n            // TS doesn't allow symbol as index type\n            return provides[key];\n        }\n        else if (arguments.length > 1) {\n            return treatDefaultAsFactory && isFunction(defaultValue)\n                ? defaultValue()\n                : defaultValue;\n        }\n        else ;\n    }\n}\nlet shouldCacheAccess = true;\nfunction applyOptions(instance, options, deferredData = [], deferredWatch = [], deferredProvide = [], asMixin = false) {\n    const {\n    // composition\n    mixins, extends: extendsOptions,\n    // state\n    data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions,\n    // assets\n    components, directives,\n    // lifecycle\n    beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured,\n    // public API\n    expose } = options;\n    const publicThis = instance.proxy;\n    const ctx = instance.ctx;\n    const globalMixins = instance.appContext.mixins;\n    if (asMixin && render && instance.render === NOOP) {\n        instance.render = render;\n    }\n    // applyOptions is called non-as-mixin once per instance\n    if (!asMixin) {\n        shouldCacheAccess = false;\n        callSyncHook('beforeCreate', \\\\\"bc\\\\\" /* BEFORE_CREATE */, options, instance, globalMixins);\n        shouldCacheAccess = true;\n        // global mixins are applied first\n        applyMixins(instance, globalMixins, deferredData, deferredWatch, deferredProvide);\n    }\n    // extending a base component...\n    if (extendsOptions) {\n        applyOptions(instance, extendsOptions, deferredData, deferredWatch, deferredProvide, true);\n    }\n    // local mixins\n    if (mixins) {\n        applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide);\n    }\n    // options initialization order (to be consistent with Vue 2):\n    // - props (already done outside of this function)\n    // - inject\n    // - methods\n    // - data (deferred since it relies on \\`this\\` access)\n    // - computed\n    // - watch (deferred since it relies on \\`this\\` access)\n    if (injectOptions) {\n        if (isArray(injectOptions)) {\n            for (let i = 0; i < injectOptions.length; i++) {\n                const key = injectOptions[i];\n                ctx[key] = inject(key);\n            }\n        }\n        else {\n            for (const key in injectOptions) {\n                const opt = injectOptions[key];\n                if (isObject(opt)) {\n                    ctx[key] = inject(opt.from || key, opt.default, true /* treat default function as factory */);\n                }\n                else {\n                    ctx[key] = inject(opt);\n                }\n            }\n        }\n    }\n    if (methods) {\n        for (const key in methods) {\n            const methodHandler = methods[key];\n            if (isFunction(methodHandler)) {\n                // In dev mode, we use the \\`createRenderContext\\` function to define methods to the proxy target,\n                // and those are read-only but reconfigurable, so it needs to be redefined here\n                {\n                    ctx[key] = methodHandler.bind(publicThis);\n                }\n            }\n        }\n    }\n    if (!asMixin) {\n        if (deferredData.length) {\n            deferredData.forEach(dataFn => resolveData(instance, dataFn, publicThis));\n        }\n        if (dataOptions) {\n            // @ts-ignore dataOptions is not fully type safe\n            resolveData(instance, dataOptions, publicThis);\n        }\n    }\n    else if (dataOptions) {\n        deferredData.push(dataOptions);\n    }\n    if (computedOptions) {\n        for (const key in computedOptions) {\n            const opt = computedOptions[key];\n            const get = isFunction(opt)\n                ? opt.bind(publicThis, publicThis)\n                : isFunction(opt.get)\n                    ? opt.get.bind(publicThis, publicThis)\n                    : NOOP;\n            const set = !isFunction(opt) && isFunction(opt.set)\n                ? opt.set.bind(publicThis)\n                :  NOOP;\n            const c = computed$1({\n                get,\n                set\n            });\n            Object.defineProperty(ctx, key, {\n                enumerable: true,\n                configurable: true,\n                get: () => c.value,\n                set: v => (c.value = v)\n            });\n        }\n    }\n    if (watchOptions) {\n        deferredWatch.push(watchOptions);\n    }\n    if (!asMixin && deferredWatch.length) {\n        deferredWatch.forEach(watchOptions => {\n            for (const key in watchOptions) {\n                createWatcher(watchOptions[key], ctx, publicThis, key);\n            }\n        });\n    }\n    if (provideOptions) {\n        deferredProvide.push(provideOptions);\n    }\n    if (!asMixin && deferredProvide.length) {\n        deferredProvide.forEach(provideOptions => {\n            const provides = isFunction(provideOptions)\n                ? provideOptions.call(publicThis)\n                : provideOptions;\n            Reflect.ownKeys(provides).forEach(key => {\n                provide(key, provides[key]);\n            });\n        });\n    }\n    // asset options.\n    // To reduce memory usage, only components with mixins or extends will have\n    // resolved asset registry attached to instance.\n    if (asMixin) {\n        if (components) {\n            extend(instance.components ||\n                (instance.components = extend({}, instance.type.components)), components);\n        }\n        if (directives) {\n            extend(instance.directives ||\n                (instance.directives = extend({}, instance.type.directives)), directives);\n        }\n    }\n    // lifecycle options\n    if (!asMixin) {\n        callSyncHook('created', \\\\\"c\\\\\" /* CREATED */, options, instance, globalMixins);\n    }\n    if (beforeMount) {\n        onBeforeMount(beforeMount.bind(publicThis));\n    }\n    if (mounted) {\n        onMounted(mounted.bind(publicThis));\n    }\n    if (beforeUpdate) {\n        onBeforeUpdate(beforeUpdate.bind(publicThis));\n    }\n    if (updated) {\n        onUpdated(updated.bind(publicThis));\n    }\n    if (activated) {\n        onActivated(activated.bind(publicThis));\n    }\n    if (deactivated) {\n        onDeactivated(deactivated.bind(publicThis));\n    }\n    if (errorCaptured) {\n        onErrorCaptured(errorCaptured.bind(publicThis));\n    }\n    if (renderTracked) {\n        onRenderTracked(renderTracked.bind(publicThis));\n    }\n    if (renderTriggered) {\n        onRenderTriggered(renderTriggered.bind(publicThis));\n    }\n    if (beforeUnmount) {\n        onBeforeUnmount(beforeUnmount.bind(publicThis));\n    }\n    if (unmounted) {\n        onUnmounted(unmounted.bind(publicThis));\n    }\n    if (isArray(expose)) {\n        if (!asMixin) {\n            if (expose.length) {\n                const exposed = instance.exposed || (instance.exposed = proxyRefs({}));\n                expose.forEach(key => {\n                    exposed[key] = toRef(publicThis, key);\n                });\n            }\n            else if (!instance.exposed) {\n                instance.exposed = EMPTY_OBJ;\n            }\n        }\n    }\n}\nfunction callSyncHook(name, type, options, instance, globalMixins) {\n    for (let i = 0; i < globalMixins.length; i++) {\n        callHookWithMixinAndExtends(name, type, globalMixins[i], instance);\n    }\n    callHookWithMixinAndExtends(name, type, options, instance);\n}\nfunction callHookWithMixinAndExtends(name, type, options, instance) {\n    const { extends: base, mixins } = options;\n    const selfHook = options[name];\n    if (base) {\n        callHookWithMixinAndExtends(name, type, base, instance);\n    }\n    if (mixins) {\n        for (let i = 0; i < mixins.length; i++) {\n            callHookWithMixinAndExtends(name, type, mixins[i], instance);\n        }\n    }\n    if (selfHook) {\n        callWithAsyncErrorHandling(selfHook.bind(instance.proxy), instance, type);\n    }\n}\nfunction applyMixins(instance, mixins, deferredData, deferredWatch, deferredProvide) {\n    for (let i = 0; i < mixins.length; i++) {\n        applyOptions(instance, mixins[i], deferredData, deferredWatch, deferredProvide, true);\n    }\n}\nfunction resolveData(instance, dataFn, publicThis) {\n    shouldCacheAccess = false;\n    const data = dataFn.call(publicThis, publicThis);\n    shouldCacheAccess = true;\n    if (!isObject(data)) ;\n    else if (instance.data === EMPTY_OBJ) {\n        instance.data = reactive(data);\n    }\n    else {\n        // existing data: this is a mixin or extends.\n        extend(instance.data, data);\n    }\n}\nfunction createWatcher(raw, ctx, publicThis, key) {\n    const getter = key.includes('.')\n        ? createPathGetter(publicThis, key)\n        : () => publicThis[key];\n    if (isString(raw)) {\n        const handler = ctx[raw];\n        if (isFunction(handler)) {\n            watch(getter, handler);\n        }\n    }\n    else if (isFunction(raw)) {\n        watch(getter, raw.bind(publicThis));\n    }\n    else if (isObject(raw)) {\n        if (isArray(raw)) {\n            raw.forEach(r => createWatcher(r, ctx, publicThis, key));\n        }\n        else {\n            const handler = isFunction(raw.handler)\n                ? raw.handler.bind(publicThis)\n                : ctx[raw.handler];\n            if (isFunction(handler)) {\n                watch(getter, handler, raw);\n            }\n        }\n    }\n    else ;\n}\nfunction createPathGetter(ctx, path) {\n    const segments = path.split('.');\n    return () => {\n        let cur = ctx;\n        for (let i = 0; i < segments.length && cur; i++) {\n            cur = cur[segments[i]];\n        }\n        return cur;\n    };\n}\nfunction resolveMergedOptions(instance) {\n    const raw = instance.type;\n    const { __merged, mixins, extends: extendsOptions } = raw;\n    if (__merged)\n        return __merged;\n    const globalMixins = instance.appContext.mixins;\n    if (!globalMixins.length && !mixins && !extendsOptions)\n        return raw;\n    const options = {};\n    globalMixins.forEach(m => mergeOptions(options, m, instance));\n    mergeOptions(options, raw, instance);\n    return (raw.__merged = options);\n}\nfunction mergeOptions(to, from, instance) {\n    const strats = instance.appContext.config.optionMergeStrategies;\n    const { mixins, extends: extendsOptions } = from;\n    extendsOptions && mergeOptions(to, extendsOptions, instance);\n    mixins &&\n        mixins.forEach((m) => mergeOptions(to, m, instance));\n    for (const key in from) {\n        if (strats && hasOwn(strats, key)) {\n            to[key] = strats[key](to[key], from[key], instance.proxy, key);\n        }\n        else {\n            to[key] = from[key];\n        }\n    }\n}\n/**\n * #2437 In Vue 3, functional components do not have a public instance proxy but\n * they exist in the internal parent chain. For code that relies on traversing\n * public $parent chains, skip functional ones and go to the parent instead.\n */\nconst getPublicInstance = (i) => {\n    if (!i)\n        return null;\n    if (isStatefulComponent(i))\n        return i.exposed ? i.exposed : i.proxy;\n    return getPublicInstance(i.parent);\n};\nconst publicPropertiesMap = extend(Object.create(null), {\n    $: i => i,\n    $el: i => i.vnode.el,\n    $data: i => i.data,\n    $props: i => ( i.props),\n    $attrs: i => ( i.attrs),\n    $slots: i => ( i.slots),\n    $refs: i => ( i.refs),\n    $parent: i => getPublicInstance(i.parent),\n    $root: i => getPublicInstance(i.root),\n    $emit: i => i.emit,\n    $options: i => ( resolveMergedOptions(i) ),\n    $forceUpdate: i => () => queueJob(i.update),\n    $nextTick: i => nextTick.bind(i.proxy),\n    $watch: i => ( instanceWatch.bind(i) )\n});\nconst PublicInstanceProxyHandlers = {\n    get({ _: instance }, key) {\n        const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\n        // let @vue/reactivity know it should never observe Vue public instances.\n        if (key === \\\\\"__v_skip\\\\\" /* SKIP */) {\n            return true;\n        }\n        // data / props / ctx\n        // This getter gets called for every property access on the render context\n        // during render and is a major hotspot. The most expensive part of this\n        // is the multiple hasOwn() calls. It's much faster to do a simple property\n        // access on a plain object, so we use an accessCache object (with null\n        // prototype) to memoize what access type a key corresponds to.\n        let normalizedProps;\n        if (key[0] !== '$') {\n            const n = accessCache[key];\n            if (n !== undefined) {\n                switch (n) {\n                    case 0 /* SETUP */:\n                        return setupState[key];\n                    case 1 /* DATA */:\n                        return data[key];\n                    case 3 /* CONTEXT */:\n                        return ctx[key];\n                    case 2 /* PROPS */:\n                        return props[key];\n                    // default: just fallthrough\n                }\n            }\n            else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\n                accessCache[key] = 0 /* SETUP */;\n                return setupState[key];\n            }\n            else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n                accessCache[key] = 1 /* DATA */;\n                return data[key];\n            }\n            else if (\n            // only cache other properties when instance has declared (thus stable)\n            // props\n            (normalizedProps = instance.propsOptions[0]) &&\n                hasOwn(normalizedProps, key)) {\n                accessCache[key] = 2 /* PROPS */;\n                return props[key];\n            }\n            else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n                accessCache[key] = 3 /* CONTEXT */;\n                return ctx[key];\n            }\n            else if ( shouldCacheAccess) {\n                accessCache[key] = 4 /* OTHER */;\n            }\n        }\n        const publicGetter = publicPropertiesMap[key];\n        let cssModule, globalProperties;\n        // public $xxx properties\n        if (publicGetter) {\n            if (key === '$attrs') {\n                track(instance, \\\\\"get\\\\\" /* GET */, key);\n            }\n            return publicGetter(instance);\n        }\n        else if (\n        // css module (injected by vue-loader)\n        (cssModule = type.__cssModules) &&\n            (cssModule = cssModule[key])) {\n            return cssModule;\n        }\n        else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n            // user may set custom properties to \\`this\\` that start with \\`$\\`\n            accessCache[key] = 3 /* CONTEXT */;\n            return ctx[key];\n        }\n        else if (\n        // global properties\n        ((globalProperties = appContext.config.globalProperties),\n            hasOwn(globalProperties, key))) {\n            return globalProperties[key];\n        }\n        else ;\n    },\n    set({ _: instance }, key, value) {\n        const { data, setupState, ctx } = instance;\n        if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {\n            setupState[key] = value;\n        }\n        else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n            data[key] = value;\n        }\n        else if (hasOwn(instance.props, key)) {\n            return false;\n        }\n        if (key[0] === '$' && key.slice(1) in instance) {\n            return false;\n        }\n        else {\n            {\n                ctx[key] = value;\n            }\n        }\n        return true;\n    },\n    has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {\n        let normalizedProps;\n        return (accessCache[key] !== undefined ||\n            (data !== EMPTY_OBJ && hasOwn(data, key)) ||\n            (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||\n            ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||\n            hasOwn(ctx, key) ||\n            hasOwn(publicPropertiesMap, key) ||\n            hasOwn(appContext.config.globalProperties, key));\n    }\n};\nconst RuntimeCompiledPublicInstanceProxyHandlers = extend({}, PublicInstanceProxyHandlers, {\n    get(target, key) {\n        // fast path for unscopables when using \\`with\\` block\n        if (key === Symbol.unscopables) {\n            return;\n        }\n        return PublicInstanceProxyHandlers.get(target, key, target);\n    },\n    has(_, key) {\n        const has = key[0] !== '_' && !isGloballyWhitelisted(key);\n        return has;\n    }\n});\nconst emptyAppContext = createAppContext();\nlet uid$1$1 = 0;\nfunction createComponentInstance(vnode, parent, suspense) {\n    const type = vnode.type;\n    // inherit parent app context - or - if root, adopt from root vnode\n    const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;\n    const instance = {\n        uid: uid$1$1++,\n        vnode,\n        type,\n        parent,\n        appContext,\n        root: null,\n        next: null,\n        subTree: null,\n        update: null,\n        render: null,\n        proxy: null,\n        exposed: null,\n        withProxy: null,\n        effects: null,\n        provides: parent ? parent.provides : Object.create(appContext.provides),\n        accessCache: null,\n        renderCache: [],\n        // local resovled assets\n        components: null,\n        directives: null,\n        // resolved props and emits options\n        propsOptions: normalizePropsOptions(type, appContext),\n        emitsOptions: normalizeEmitsOptions(type, appContext),\n        // emit\n        emit: null,\n        emitted: null,\n        // props default value\n        propsDefaults: EMPTY_OBJ,\n        // state\n        ctx: EMPTY_OBJ,\n        data: EMPTY_OBJ,\n        props: EMPTY_OBJ,\n        attrs: EMPTY_OBJ,\n        slots: EMPTY_OBJ,\n        refs: EMPTY_OBJ,\n        setupState: EMPTY_OBJ,\n        setupContext: null,\n        // suspense related\n        suspense,\n        suspenseId: suspense ? suspense.pendingId : 0,\n        asyncDep: null,\n        asyncResolved: false,\n        // lifecycle hooks\n        // not using enums here because it results in computed properties\n        isMounted: false,\n        isUnmounted: false,\n        isDeactivated: false,\n        bc: null,\n        c: null,\n        bm: null,\n        m: null,\n        bu: null,\n        u: null,\n        um: null,\n        bum: null,\n        da: null,\n        a: null,\n        rtg: null,\n        rtc: null,\n        ec: null\n    };\n    {\n        instance.ctx = { _: instance };\n    }\n    instance.root = parent ? parent.root : instance;\n    instance.emit = emit.bind(null, instance);\n    return instance;\n}\nlet currentInstance = null;\nconst setCurrentInstance = (instance) => {\n    currentInstance = instance;\n};\nfunction isStatefulComponent(instance) {\n    return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;\n}\nlet isInSSRComponentSetup = false;\nfunction setupComponent(instance, isSSR = false) {\n    isInSSRComponentSetup = isSSR;\n    const { props, children } = instance.vnode;\n    const isStateful = isStatefulComponent(instance);\n    initProps(instance, props, isStateful, isSSR);\n    initSlots(instance, children);\n    const setupResult = isStateful\n        ? setupStatefulComponent(instance, isSSR)\n        : undefined;\n    isInSSRComponentSetup = false;\n    return setupResult;\n}\nfunction setupStatefulComponent(instance, isSSR) {\n    const Component = instance.type;\n    // 0. create render proxy property access cache\n    instance.accessCache = Object.create(null);\n    // 1. create public instance / render proxy\n    // also mark it raw so it's never observed\n    instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);\n    // 2. call setup()\n    const { setup } = Component;\n    if (setup) {\n        const setupContext = (instance.setupContext =\n            setup.length > 1 ? createSetupContext(instance) : null);\n        currentInstance = instance;\n        pauseTracking();\n        const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [ instance.props, setupContext]);\n        resetTracking();\n        currentInstance = null;\n        if (isPromise(setupResult)) {\n            if (isSSR) {\n                // return the promise so server-renderer can wait on it\n                return setupResult\n                    .then((resolvedResult) => {\n                    handleSetupResult(instance, resolvedResult);\n                })\n                    .catch(e => {\n                    handleError(e, instance, 0 /* SETUP_FUNCTION */);\n                });\n            }\n            else {\n                // async setup returned Promise.\n                // bail here and wait for re-entry.\n                instance.asyncDep = setupResult;\n            }\n        }\n        else {\n            handleSetupResult(instance, setupResult);\n        }\n    }\n    else {\n        finishComponentSetup(instance);\n    }\n}\nfunction handleSetupResult(instance, setupResult, isSSR) {\n    if (isFunction(setupResult)) {\n        // setup returned an inline render function\n        {\n            instance.render = setupResult;\n        }\n    }\n    else if (isObject(setupResult)) {\n        instance.setupState = proxyRefs(setupResult);\n    }\n    else ;\n    finishComponentSetup(instance);\n}\nfunction finishComponentSetup(instance, isSSR) {\n    const Component = instance.type;\n    // template / render function normalization\n    if (!instance.render) {\n        instance.render = (Component.render || NOOP);\n        // for runtime-compiled render functions using \\`with\\` blocks, the render\n        // proxy used needs a different \\`has\\` handler which is more performant and\n        // also only allows a whitelist of globals to fallthrough.\n        if (instance.render._rc) {\n            instance.withProxy = new Proxy(instance.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\n        }\n    }\n    // support for 2.x options\n    {\n        currentInstance = instance;\n        pauseTracking();\n        applyOptions(instance, Component);\n        resetTracking();\n        currentInstance = null;\n    }\n}\nfunction createSetupContext(instance) {\n    const expose = exposed => {\n        instance.exposed = proxyRefs(exposed);\n    };\n    {\n        return {\n            attrs: instance.attrs,\n            slots: instance.slots,\n            emit: instance.emit,\n            expose\n        };\n    }\n}\n// record effects created during a component's setup() so that they can be\n// stopped when the component unmounts\nfunction recordInstanceBoundEffect(effect, instance = currentInstance) {\n    if (instance) {\n        (instance.effects || (instance.effects = [])).push(effect);\n    }\n}\nconst classifyRE = /(?:^|[-_])(\\\\\\\\w)/g;\nconst classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');\nfunction getComponentName(Component) {\n    return isFunction(Component)\n        ? Component.displayName || Component.name\n        : Component.name;\n}\nfunction formatComponentName(instance, Component, isRoot = false) {\n    let name = getComponentName(Component);\n    if (!name && Component.__file) {\n        const match = Component.__file.match(/([^/\\\\\\\\\\\\\\\\]+)\\\\\\\\.\\\\\\\\w+$/);\n        if (match) {\n            name = match[1];\n        }\n    }\n    if (!name && instance && instance.parent) {\n        // try to infer the name based on reverse resolution\n        const inferFromRegistry = (registry) => {\n            for (const key in registry) {\n                if (registry[key] === Component) {\n                    return key;\n                }\n            }\n        };\n        name =\n            inferFromRegistry(instance.components ||\n                instance.parent.type.components) || inferFromRegistry(instance.appContext.components);\n    }\n    return name ? classify(name) : isRoot ? \\`App\\` : \\`Anonymous\\`;\n}\nfunction isClassComponent(value) {\n    return isFunction(value) && '__vccOpts' in value;\n}\nfunction computed$1(getterOrOptions) {\n    const c = computed(getterOrOptions);\n    recordInstanceBoundEffect(c.effect);\n    return c;\n}\n// Core API ------------------------------------------------------------------\nconst version = \\\\\"3.0.11\\\\\";\nconst svgNS = 'http://www.w3.org/2000/svg';\nconst doc = (typeof document !== 'undefined' ? document : null);\nlet tempContainer;\nlet tempSVGContainer;\nconst nodeOps = {\n    insert: (child, parent, anchor) => {\n        parent.insertBefore(child, anchor || null);\n    },\n    remove: child => {\n        const parent = child.parentNode;\n        if (parent) {\n            parent.removeChild(child);\n        }\n    },\n    createElement: (tag, isSVG, is, props) => {\n        const el = isSVG\n            ? doc.createElementNS(svgNS, tag)\n            : doc.createElement(tag, is ? { is } : undefined);\n        if (tag === 'select' && props && props.multiple != null) {\n            el.setAttribute('multiple', props.multiple);\n        }\n        return el;\n    },\n    createText: text => doc.createTextNode(text),\n    createComment: text => doc.createComment(text),\n    setText: (node, text) => {\n        node.nodeValue = text;\n    },\n    setElementText: (el, text) => {\n        el.textContent = text;\n    },\n    parentNode: node => node.parentNode,\n    nextSibling: node => node.nextSibling,\n    querySelector: selector => doc.querySelector(selector),\n    setScopeId(el, id) {\n        el.setAttribute(id, '');\n    },\n    cloneNode(el) {\n        const cloned = el.cloneNode(true);\n        // #3072\n        // - in \\`patchDOMProp\\`, we store the actual value in the \\`el._value\\` property.\n        // - normally, elements using \\`:value\\` bindings will not be hoisted, but if\n        //   the bound value is a constant, e.g. \\`:value=\\\\\"true\\\\\"\\` - they do get\n        //   hoisted.\n        // - in production, hoisted nodes are cloned when subsequent inserts, but\n        //   cloneNode() does not copy the custom property we attached.\n        // - This may need to account for other custom DOM properties we attach to\n        //   elements in addition to \\`_value\\` in the future.\n        if (\\`_value\\` in el) {\n            cloned._value = el._value;\n        }\n        return cloned;\n    },\n    // __UNSAFE__\n    // Reason: innerHTML.\n    // Static content here can only come from compiled templates.\n    // As long as the user only uses trusted templates, this is safe.\n    insertStaticContent(content, parent, anchor, isSVG) {\n        const temp = isSVG\n            ? tempSVGContainer ||\n                (tempSVGContainer = doc.createElementNS(svgNS, 'svg'))\n            : tempContainer || (tempContainer = doc.createElement('div'));\n        temp.innerHTML = content;\n        const first = temp.firstChild;\n        let node = first;\n        let last = node;\n        while (node) {\n            last = node;\n            nodeOps.insert(node, parent, anchor);\n            node = temp.firstChild;\n        }\n        return [first, last];\n    }\n};\n// compiler should normalize class + :class bindings on the same element\n// into a single binding ['staticClass', dynamic]\nfunction patchClass(el, value, isSVG) {\n    if (value == null) {\n        value = '';\n    }\n    if (isSVG) {\n        el.setAttribute('class', value);\n    }\n    else {\n        // directly setting className should be faster than setAttribute in theory\n        // if this is an element during a transition, take the temporary transition\n        // classes into account.\n        const transitionClasses = el._vtc;\n        if (transitionClasses) {\n            value = (value\n                ? [value, ...transitionClasses]\n                : [...transitionClasses]).join(' ');\n        }\n        el.className = value;\n    }\n}\nfunction patchStyle(el, prev, next) {\n    const style = el.style;\n    if (!next) {\n        el.removeAttribute('style');\n    }\n    else if (isString(next)) {\n        if (prev !== next) {\n            const current = style.display;\n            style.cssText = next;\n            // indicates that the \\`display\\` of the element is controlled by \\`v-show\\`,\n            // so we always keep the current \\`display\\` value regardless of the \\`style\\` value,\n            // thus handing over control to \\`v-show\\`.\n            if ('_vod' in el) {\n                style.display = current;\n            }\n        }\n    }\n    else {\n        for (const key in next) {\n            setStyle(style, key, next[key]);\n        }\n        if (prev && !isString(prev)) {\n            for (const key in prev) {\n                if (next[key] == null) {\n                    setStyle(style, key, '');\n                }\n            }\n        }\n    }\n}\nconst importantRE = /\\\\\\\\s*!important$/;\nfunction setStyle(style, name, val) {\n    if (isArray(val)) {\n        val.forEach(v => setStyle(style, name, v));\n    }\n    else {\n        if (name.startsWith('--')) {\n            // custom property definition\n            style.setProperty(name, val);\n        }\n        else {\n            const prefixed = autoPrefix(style, name);\n            if (importantRE.test(val)) {\n                // !important\n                style.setProperty(hyphenate(prefixed), val.replace(importantRE, ''), 'important');\n            }\n            else {\n                style[prefixed] = val;\n            }\n        }\n    }\n}\nconst prefixes = ['Webkit', 'Moz', 'ms'];\nconst prefixCache = {};\nfunction autoPrefix(style, rawName) {\n    const cached = prefixCache[rawName];\n    if (cached) {\n        return cached;\n    }\n    let name = camelize(rawName);\n    if (name !== 'filter' && name in style) {\n        return (prefixCache[rawName] = name);\n    }\n    name = capitalize(name);\n    for (let i = 0; i < prefixes.length; i++) {\n        const prefixed = prefixes[i] + name;\n        if (prefixed in style) {\n            return (prefixCache[rawName] = prefixed);\n        }\n    }\n    return rawName;\n}\nconst xlinkNS = 'http://www.w3.org/1999/xlink';\nfunction patchAttr(el, key, value, isSVG) {\n    if (isSVG && key.startsWith('xlink:')) {\n        if (value == null) {\n            el.removeAttributeNS(xlinkNS, key.slice(6, key.length));\n        }\n        else {\n            el.setAttributeNS(xlinkNS, key, value);\n        }\n    }\n    else {\n        // note we are only checking boolean attributes that don't have a\n        // corresponding dom prop of the same name here.\n        const isBoolean = isSpecialBooleanAttr(key);\n        if (value == null || (isBoolean && value === false)) {\n            el.removeAttribute(key);\n        }\n        else {\n            el.setAttribute(key, isBoolean ? '' : value);\n        }\n    }\n}\n// __UNSAFE__\n// functions. The user is responsible for using them with only trusted content.\nfunction patchDOMProp(el, key, value,\n// the following args are passed only due to potential innerHTML/textContent\n// overriding existing VNodes, in which case the old tree must be properly\n// unmounted.\nprevChildren, parentComponent, parentSuspense, unmountChildren) {\n    if (key === 'innerHTML' || key === 'textContent') {\n        if (prevChildren) {\n            unmountChildren(prevChildren, parentComponent, parentSuspense);\n        }\n        el[key] = value == null ? '' : value;\n        return;\n    }\n    if (key === 'value' && el.tagName !== 'PROGRESS') {\n        // store value as _value as well since\n        // non-string values will be stringified.\n        el._value = value;\n        const newValue = value == null ? '' : value;\n        if (el.value !== newValue) {\n            el.value = newValue;\n        }\n        return;\n    }\n    if (value === '' || value == null) {\n        const type = typeof el[key];\n        if (value === '' && type === 'boolean') {\n            // e.g. <select multiple> compiles to { multiple: '' }\n            el[key] = true;\n            return;\n        }\n        else if (value == null && type === 'string') {\n            // e.g. <div :id=\\\\\"null\\\\\">\n            el[key] = '';\n            el.removeAttribute(key);\n            return;\n        }\n        else if (type === 'number') {\n            // e.g. <img :width=\\\\\"null\\\\\">\n            el[key] = 0;\n            el.removeAttribute(key);\n            return;\n        }\n    }\n    // some properties perform value validation and throw\n    try {\n        el[key] = value;\n    }\n    catch (e) {\n    }\n}\n// Async edge case fix requires storing an event listener's attach timestamp.\nlet _getNow = Date.now;\nlet skipTimestampCheck = false;\nif (typeof window !== 'undefined') {\n    // Determine what event timestamp the browser is using. Annoyingly, the\n    // timestamp can either be hi-res (relative to page load) or low-res\n    // (relative to UNIX epoch), so in order to compare time we have to use the\n    // same timestamp type when saving the flush timestamp.\n    if (_getNow() > document.createEvent('Event').timeStamp) {\n        // if the low-res timestamp which is bigger than the event timestamp\n        // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\n        // and we need to use the hi-res version for event listeners as well.\n        _getNow = () => performance.now();\n    }\n    // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation\n    // and does not fire microtasks in between event propagation, so safe to exclude.\n    const ffMatch = navigator.userAgent.match(/firefox\\\\\\\\/(\\\\\\\\d+)/i);\n    skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);\n}\n// To avoid the overhead of repeatedly calling performance.now(), we cache\n// and use the same timestamp for all event listeners attached in the same tick.\nlet cachedNow = 0;\nconst p = Promise.resolve();\nconst reset = () => {\n    cachedNow = 0;\n};\nconst getNow = () => cachedNow || (p.then(reset), (cachedNow = _getNow()));\nfunction addEventListener(el, event, handler, options) {\n    el.addEventListener(event, handler, options);\n}\nfunction removeEventListener(el, event, handler, options) {\n    el.removeEventListener(event, handler, options);\n}\nfunction patchEvent(el, rawName, prevValue, nextValue, instance = null) {\n    // vei = vue event invokers\n    const invokers = el._vei || (el._vei = {});\n    const existingInvoker = invokers[rawName];\n    if (nextValue && existingInvoker) {\n        // patch\n        existingInvoker.value = nextValue;\n    }\n    else {\n        const [name, options] = parseName(rawName);\n        if (nextValue) {\n            // add\n            const invoker = (invokers[rawName] = createInvoker(nextValue, instance));\n            addEventListener(el, name, invoker, options);\n        }\n        else if (existingInvoker) {\n            // remove\n            removeEventListener(el, name, existingInvoker, options);\n            invokers[rawName] = undefined;\n        }\n    }\n}\nconst optionsModifierRE = /(?:Once|Passive|Capture)$/;\nfunction parseName(name) {\n    let options;\n    if (optionsModifierRE.test(name)) {\n        options = {};\n        let m;\n        while ((m = name.match(optionsModifierRE))) {\n            name = name.slice(0, name.length - m[0].length);\n            options[m[0].toLowerCase()] = true;\n        }\n    }\n    return [hyphenate(name.slice(2)), options];\n}\nfunction createInvoker(initialValue, instance) {\n    const invoker = (e) => {\n        // async edge case #6566: inner click event triggers patch, event handler\n        // attached to outer element during patch, and triggered again. This\n        // happens because browsers fire microtask ticks between event propagation.\n        // the solution is simple: we save the timestamp when a handler is attached,\n        // and the handler would only fire if the event passed to it was fired\n        // AFTER it was attached.\n        const timeStamp = e.timeStamp || _getNow();\n        if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {\n            callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);\n        }\n    };\n    invoker.value = initialValue;\n    invoker.attached = getNow();\n    return invoker;\n}\nfunction patchStopImmediatePropagation(e, value) {\n    if (isArray(value)) {\n        const originalStop = e.stopImmediatePropagation;\n        e.stopImmediatePropagation = () => {\n            originalStop.call(e);\n            e._stopped = true;\n        };\n        return value.map(fn => (e) => !e._stopped && fn(e));\n    }\n    else {\n        return value;\n    }\n}\nconst nativeOnRE = /^on[a-z]/;\nconst forcePatchProp = (_, key) => key === 'value';\nconst patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {\n    switch (key) {\n        // special\n        case 'class':\n            patchClass(el, nextValue, isSVG);\n            break;\n        case 'style':\n            patchStyle(el, prevValue, nextValue);\n            break;\n        default:\n            if (isOn(key)) {\n                // ignore v-model listeners\n                if (!isModelListener(key)) {\n                    patchEvent(el, key, prevValue, nextValue, parentComponent);\n                }\n            }\n            else if (shouldSetAsProp(el, key, nextValue, isSVG)) {\n                patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);\n            }\n            else {\n                // special case for <input v-model type=\\\\\"checkbox\\\\\"> with\n                // :true-value & :false-value\n                // store value as dom properties since non-string values will be\n                // stringified.\n                if (key === 'true-value') {\n                    el._trueValue = nextValue;\n                }\n                else if (key === 'false-value') {\n                    el._falseValue = nextValue;\n                }\n                patchAttr(el, key, nextValue, isSVG);\n            }\n            break;\n    }\n};\nfunction shouldSetAsProp(el, key, value, isSVG) {\n    if (isSVG) {\n        // most keys must be set as attribute on svg elements to work\n        // ...except innerHTML\n        if (key === 'innerHTML') {\n            return true;\n        }\n        // or native onclick with function values\n        if (key in el && nativeOnRE.test(key) && isFunction(value)) {\n            return true;\n        }\n        return false;\n    }\n    // spellcheck and draggable are numerated attrs, however their\n    // corresponding DOM properties are actually booleans - this leads to\n    // setting it with a string \\\\\"false\\\\\" value leading it to be coerced to\n    // \\`true\\`, so we need to always treat them as attributes.\n    // Note that \\`contentEditable\\` doesn't have this problem: its DOM\n    // property is also enumerated string values.\n    if (key === 'spellcheck' || key === 'draggable') {\n        return false;\n    }\n    // #1787, #2840 form property on form elements is readonly and must be set as\n    // attribute.\n    if (key === 'form') {\n        return false;\n    }\n    // #1526 <input list> must be set as attribute\n    if (key === 'list' && el.tagName === 'INPUT') {\n        return false;\n    }\n    // #2766 <textarea type> must be set as attribute\n    if (key === 'type' && el.tagName === 'TEXTAREA') {\n        return false;\n    }\n    // native onclick with string value, must be set as attribute\n    if (nativeOnRE.test(key) && isString(value)) {\n        return false;\n    }\n    return key in el;\n}\nconst rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps);\n// lazy create the renderer - this makes core renderer logic tree-shakable\n// in case the user only imports reactivity utilities from Vue.\nlet renderer;\nfunction ensureRenderer() {\n    return renderer || (renderer = createRenderer(rendererOptions));\n}\nconst createApp = ((...args) => {\n    const app = ensureRenderer().createApp(...args);\n    const { mount } = app;\n    app.mount = (containerOrSelector) => {\n        const container = normalizeContainer(containerOrSelector);\n        if (!container)\n            return;\n        const component = app._component;\n        if (!isFunction(component) && !component.render && !component.template) {\n            component.template = container.innerHTML;\n        }\n        // clear content before mounting\n        container.innerHTML = '';\n        const proxy = mount(container, false, container instanceof SVGElement);\n        if (container instanceof Element) {\n            container.removeAttribute('v-cloak');\n            container.setAttribute('data-v-app', '');\n        }\n        return proxy;\n    };\n    return app;\n});\nfunction normalizeContainer(container) {\n    if (isString(container)) {\n        const res = document.querySelector(container);\n        return res;\n    }\n    return container;\n}\nexport { createApp, createBlock, createTextVNode, createVNode, defineComponent, openBlock, reactive, resolveComponent, toDisplayString };\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: allFiles 1`] = `\nArray [\n  \"_snowpack/env.js\",\n  \"_snowpack/pkg/import-map.json\",\n  \"_snowpack/pkg/vue.js\",\n  \"dist/App.vue.css\",\n  \"dist/App.vue.css.proxy.js\",\n  \"dist/App.vue.js\",\n  \"dist/index.js\",\n  \"favicon-32x32.png\",\n  \"favicon.ico\",\n  \"index.html\",\n  \"logo.svg\",\n  \"robots.txt\",\n]\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: dist/App.vue.css 1`] = `\n\"\n.App {\n  text-align: center;\n}\n.App-header {\n  background-color: #f9f6f6;\n  color: #32485f;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n}\n.App-link {\n  color: #00c185;\n}\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n  margin-bottom: 1rem;\n  animation: App-logo-spin infinite 1.6s ease-in-out alternate;\n}\n.App-tsx {\n  display: flex;\n}\n.App-tsx > div {\n  margin-left: 30px;\n  font-size: 16px;\n}\n@keyframes App-logo-spin {\nfrom {\n    transform: scale(1);\n}\nto {\n    transform: scale(1.06);\n}\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: dist/App.vue.css.proxy.js 1`] = `\n\"// [snowpack] add styles to the page (skip if no document exists)\nif (typeof document !== 'undefined') {\n  const code = \\\\\".App {  text-align: center;}.App-header {  background-color: #f9f6f6;  color: #32485f;  min-height: 100vh;  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  font-size: calc(10px + 2vmin);}.App-link {  color: #00c185;}.App-logo {  height: 40vmin;  pointer-events: none;  margin-bottom: 1rem;  animation: App-logo-spin infinite 1.6s ease-in-out alternate;}.App-tsx {  display: flex;}.App-tsx > div {  margin-left: 30px;  font-size: 16px;}@keyframes App-logo-spin {from {    transform: scale(1);}to {    transform: scale(1.06);}}\\\\\";\n  const styleEl = document.createElement(\\\\\"style\\\\\");\n  const codeEl = document.createTextNode(code);\n  styleEl.type = 'text/css';\n  styleEl.appendChild(codeEl);\n  document.head.appendChild(styleEl);\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: dist/App.vue.js 1`] = `\n\"import './App.vue.css.proxy.js';\nimport {defineComponent, reactive} from \\\\\"../_snowpack/pkg/vue.js\\\\\";\nconst defaultExport = defineComponent({\n  setup() {\n    const state = reactive({\n      message: \\\\\"Learn Vue\\\\\"\n    });\n    return {\n      state\n    };\n  }\n});\nimport { createVNode as _createVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, toDisplayString as _toDisplayString, openBlock as _openBlock, createBlock as _createBlock } from \\\\\"../_snowpack/pkg/vue.js\\\\\"\nconst _hoisted_1 = { class: \\\\\"App\\\\\" }\nconst _hoisted_2 = { class: \\\\\"App-header\\\\\" }\nconst _hoisted_3 = /*#__PURE__*/_createVNode(\\\\\"img\\\\\", {\n  src: \\\\\"/logo.svg\\\\\",\n  class: \\\\\"App-logo\\\\\",\n  alt: \\\\\"logo\\\\\"\n}, null, -1)\nconst _hoisted_4 = /*#__PURE__*/_createVNode(\\\\\"p\\\\\", null, [\n  /*#__PURE__*/_createTextVNode(\\\\\" Edit \\\\\"),\n  /*#__PURE__*/_createVNode(\\\\\"code\\\\\", null, \\\\\"src/App.vue\\\\\"),\n  /*#__PURE__*/_createTextVNode(\\\\\" and save to reload. \\\\\")\n], -1)\nconst _hoisted_5 = { class: \\\\\"App-tsx\\\\\" }\nconst _hoisted_6 = {\n  class: \\\\\"App-link\\\\\",\n  href: \\\\\"https://vuejs.org\\\\\",\n  target: \\\\\"_blank\\\\\",\n  rel: \\\\\"noopener noreferrer\\\\\"\n}\nexport function render(_ctx, _cache) {\n  const _component_FooTsxVue = _resolveComponent(\\\\\"FooTsxVue\\\\\")\n  const _component_FooTsx = _resolveComponent(\\\\\"FooTsx\\\\\")\n  const _component_BarJsxVue = _resolveComponent(\\\\\"BarJsxVue\\\\\")\n  const _component_BarJsx = _resolveComponent(\\\\\"BarJsx\\\\\")\n  return (_openBlock(), _createBlock(\\\\\"div\\\\\", _hoisted_1, [\n    _createVNode(\\\\\"header\\\\\", _hoisted_2, [\n      _hoisted_3,\n      _hoisted_4,\n      _createVNode(\\\\\"p\\\\\", _hoisted_5, [\n        _createVNode(_component_FooTsxVue),\n        _createVNode(_component_FooTsx),\n        _createVNode(_component_BarJsxVue),\n        _createVNode(_component_BarJsx)\n      ]),\n      _createVNode(\\\\\"a\\\\\", _hoisted_6, _toDisplayString(_ctx.state.message), 1)\n    ])\n  ]))\n};\ndefaultExport.render = render;\nexport default defaultExport;\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: dist/index.js 1`] = `\n\"import * as __SNOWPACK_ENV__ from '../_snowpack/env.js';\nimport.meta.env = __SNOWPACK_ENV__;\nimport {createApp} from '../_snowpack/pkg/vue.js';\nimport App from './App.vue.js';\nconst app = createApp(App);\napp.mount('#app');\n// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n// Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\nif (undefined /* [snowpack] import.meta.hot */ ) {\n  undefined /* [snowpack] import.meta.hot */ .accept();\n  undefined /* [snowpack] import.meta.hot */ .dispose(() => {\n    app.unmount();\n  });\n}\"\n`;\n\nexports[`create-snowpack-app app-template-vue-typescript > build: index.html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" type=\\\\\"image/png\\\\\" sizes=\\\\\"32x32\\\\\" href=\\\\\"/favicon-32x32.png\\\\\">\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <div id=\\\\\"app\\\\\"></div>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/dist/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\"\n`;\n"
  },
  {
    "path": "test/create-snowpack-app/create-snowpack-app.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst execa = require('execa');\nconst rimraf = require('rimraf');\nconst glob = require('glob');\n\nconst TEMPLATES_DIR = path.resolve(__dirname, '..', '..', 'create-snowpack-app');\nconst templates = fs.readdirSync(TEMPLATES_DIR).filter((dir) => dir.startsWith('app-template-'));\nconst STRIP_CSS_MODULES = /_[\\d\\w]{5}_[\\d]{1,3}/g;\n\nconst format = (stdout) =>\n  stdout\n    .replace(/([\\w\\-]+\\-)[a-z0-9]{8}(\\.js)/g, '$1XXXXXXXX$2') // strip chunk hash\n    .replace(/((\\s+$)|((\\\\r\\\\n)|(\\\\n)))/gm, '') // strip whitespace chars\n    .replace(/\\n\\s*\\/\\*[^*]+\\*\\/\\s*\\n/gm, '\\n'); // strip full-line comments (throws Svelte test)\n\ndescribe('create-snowpack-app', () => {\n  // Increase timeout for slow tests\n  jest.setTimeout(60 * 1000);\n\n  // test npx create-snowpack-app bin\n  it('npx create-snowpack-app', async () => {\n    const template = 'app-template-preact'; // any template will do\n    const installDir = path.resolve(__dirname, 'test-install');\n\n    rimraf.sync(installDir);\n\n    // run the local create-snowpack-app bin\n    console.log(\n      await execa(\n        'node',\n        [\n          './create-snowpack-app/cli',\n          `./test/create-snowpack-app/test-install`,\n          '--template',\n          `./create-snowpack-app/${template}`,\n          '--use-yarn', // we use Yarn for this repo\n        ],\n        {cwd: path.resolve(__dirname, '..', '..')},\n      ),\n    );\n\n    // snowpack.config.json is a file we can test for to assume successful\n    // install, since it’s added at the end.\n    const snowpackConfigExists =\n      (await fs.promises.stat(path.join(installDir, 'snowpack.config.json')).catch(() => false)) ||\n      (await fs.promises.stat(path.join(installDir, 'snowpack.config.js')).catch(() => false));\n    expect(snowpackConfigExists).toBeDefined();\n\n    // install node_modules by default\n    console.log(path.join(installDir, 'node_modules'));\n    const modulesExist = await fs.promises\n      .stat(path.join(installDir, 'node_modules'))\n      .catch(() => false);\n    expect(modulesExist).toBeDefined();\n  });\n\n  // test `--no-install` option\n  it('npx create-snowpack-app --no-install', async () => {\n    const template = 'app-template-preact'; // any template will do\n    const installDir = path.resolve(__dirname, 'test-install');\n\n    rimraf.sync(installDir);\n\n    // run the local create-snowpack-app bin\n    await execa(\n      'node',\n      [\n        './create-snowpack-app/cli',\n        `./test/create-snowpack-app/test-install`,\n        '--template',\n        `./create-snowpack-app/${template}`,\n        '--use-yarn', // we use Yarn for this repo\n        '--no-install',\n      ],\n      {cwd: path.resolve(__dirname, '..', '..')},\n    );\n\n    // snowpack.config.json is a file we can test for to assume successful\n    // install, since it’s added at the end.\n    const snowpackConfigExists =\n      (await fs.promises.stat(path.join(installDir, 'snowpack.config.json')).catch(() => false)) ||\n      (await fs.promises.stat(path.join(installDir, 'snowpack.config.js')).catch(() => false));\n    expect(snowpackConfigExists).toBeDefined();\n\n    // install node_modules by default\n    const modulesExist = await fs.promises\n      .stat(path.join(installDir, 'node_modules'))\n      .catch(() => false);\n    expect(modulesExist).toBeDefined();\n  });\n\n  // template snapshots\n  templates.forEach((template) => {\n    const cwd = path.join(TEMPLATES_DIR, template);\n\n    it(`${template} > build`, async () => {\n      await execa('yarn', ['build', '--clean'], {\n        // Jest sets NODE_ENV to \"test\" by default, but this should be undefined in real-world use\n        env: {NODE_ENV: undefined},\n        cwd,\n      });\n\n      const actual = path.join(cwd, 'build');\n      const allFiles = glob.sync(`**/*`, {\n        ignore: ['**/common/**/*'],\n        cwd: actual,\n        nodir: true,\n      });\n\n      if (allFiles.length === 0) {\n        throw new Error('Empty build directory!');\n      }\n\n      expect(allFiles.map((f) => f.replace(/\\\\/g, '/'))).toMatchSnapshot('allFiles');\n\n      // If any diffs are detected, we'll assert the difference so that we get nice output.\n      for (const entry of allFiles) {\n        if (\n          entry.endsWith('.css') ||\n          entry.endsWith('.html') ||\n          entry.endsWith('.js') ||\n          entry.endsWith('.json')\n        ) {\n          let f1 = fs.readFileSync(path.resolve(actual, entry), {encoding: 'utf8'});\n          // Add special handling for CSS module hashes\n          if (entry.includes('.module.css')) {\n            f1 = f1.replace(STRIP_CSS_MODULES, '_XXXXX_XX');\n          }\n          expect(format(f1)).toMatchSnapshot(entry.replace(/\\\\/g, '/'));\n        }\n      }\n    });\n\n    /**\n     * Note: this is disabled because the test times out before completing. The Snowpack install step cuts into the test time, and it never completes in CI.\n     * As of 2021-04-29 (this message), all templates’s test suites are passing\n     */\n    it.skip(`${template} > test`, async () => {\n      rimraf.sync(path.join(cwd, 'node_modules', '.cache'));\n      const {stdout, stderr, all, exitCode} = await execa('yarn', ['test'], {\n        cwd,\n        // Jest sets NODE_ENV to \"test\" by default, but this should be undefined in real-world use\n        env: {NODE_ENV: undefined},\n        reject: false,\n        all: true,\n      });\n\n      // Ignore templates that have no test runner installed.\n      if (all.includes('This template does not include a test runner by default.')) {\n        return;\n      }\n\n      // If tests didn't pass, output some relevant info into the test logs.\n      if (exitCode !== 0) {\n        console.error({msg: `FAILED TEMPLATE: ${template}`, stdout, stderr});\n      }\n\n      expect(exitCode).toEqual(0);\n\n      // NOTE(fks) Keeping these for future reference, more santization was needed,\n      // and decision was made to just check exitCode for pass/fail.\n      // expect(\n      //   strpAnsi(stderr).replace(/[\\d\\.]+\\s*m?s/g, 'XXXXXXms').replace(/((\\s+$)|((\\\\r\\\\n)|(\\\\n)))/gm, '').replace(/Time:.*$/m, ''),\n      // ).toMatchSnapshot('stderr');\n    });\n  });\n});\n"
  },
  {
    "path": "test/esinstall/alias/alias.test.js",
    "content": "const path = require('path');\nconst {readFiles} = require('../../test-utils');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('config-alias', () => {\n  it('uses aliases when specified', async () => {\n    await runTest(['react', 'react-dom', 'vue', 'vue-currency-input'], {\n      alias: {\n        react: 'preact/compat',\n        'react-dom': 'preact/compat',\n        vue: 'vue/dist/vue.esm.browser.js',\n        'vue-currency-input': 'vue-currency-input/dist/vue-currency-input.esm.js',\n      },\n      cwd: __dirname,\n    });\n\n    const files = readFiles(path.join(__dirname, 'web_modules'));\n\n    // positive test: verify aliases were used\n    expect(files['/preact/compat.js']).toBeTruthy();\n    expect(files['/vue/dist/vue.esm.browser.js']).toBeTruthy();\n    expect(files['/vue-currency-input/dist/vue-currency-input.esm.js']).toBeTruthy();\n\n    // inverse test: verify unaliased packages weren’t also installed\n    expect(files['/react/react.js']).toBeUndefined();\n    expect(files['/react-dom/react-dom.js']).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/alias/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-config-alias\",\n  \"description\": \"Handle deep imports to package entrypoints\",\n  \"dependencies\": {\n    \"preact\": \"^10.0.0\",\n    \"vue\": \"^2.6.12\",\n    \"vue-currency-input\": \"^1.21.0\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/cjs-autodetect-exports.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\n// This test simulates what keyboard-key is doing.\ndescribe('Auto-detecting CJS exports', () => {\n  it('should not convert invalid identifiers as exports', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-cjs-invalid-exports');\n    const spec = 'cjs-invalid-exports';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n    });\n\n    const output = fs.readFileSync(path.join(dest, `${spec}.js`), 'utf8');\n    expect(output).toEqual(\n      // This shouldn't contain the \")\" export\n      expect.stringContaining(`export { entrypoint as __moduleExports, a }`),\n    );\n  });\n\n  it('should convert package with valid identifiers as exports', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-cjs-valid-exports');\n    const spec = 'cjs-valid-exports';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n    });\n\n    const output = fs.readFileSync(path.join(dest, `${spec}.js`), 'utf8');\n    expect(output).toEqual(\n      // Correctly exports the valid identifiers as tree-shakeable identifiers\n      expect.stringContaining(`export { entrypoint as __moduleExports, a, b, d };`),\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-autodetect-cjs\",\n  \"dependencies\": {\n    \"cjs-invalid-exports\": \"file:./packages/cjs-invalid-exports\",\n    \"cjs-valid-exports\": \"file:./packages/cjs-valid-exports\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/packages/cjs-invalid-exports/entrypoint.js",
    "content": "\nvar mod = {\n  \"a\": \"b\",\n  \")\": \"ooops, this is an invalid identifier\"\n};\n\nmodule.exports = mod;"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/packages/cjs-invalid-exports/package.json",
    "content": "{\n  \"version\": \"1.0.0\",\n  \"name\": \"cjs-invalid-exports\",\n  \"main\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/packages/cjs-valid-exports/entrypoint.js",
    "content": "\nvar mod = {\n  \"a\": \"b\",\n  \"b\": \"c\",\n  \"d\": \"see, these are all valid\"\n};\n\nmodule.exports = mod;"
  },
  {
    "path": "test/esinstall/cjs-autodetect-exports/packages/cjs-valid-exports/package.json",
    "content": "{\n  \"version\": \"1.0.0\",\n  \"name\": \"cjs-valid-exports\",\n  \"main\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/config-package-svelte/config-package-svelte.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\n\nrequire('jest-specific-snapshot'); // allows to call expect().toMatchSpecificSnapshot(filename, snapshotName)\n\ndescribe('config-package-svelte', () => {\n  it('fails when no svelte plugin provided', async () => {\n    return expect(() =>\n      runTest(['simple-svelte-autocomplete'], {cwd: __dirname, packageLookupFields: ['svelte']}),\n    ).rejects.toThrowError(`Install failed.`);\n    // TODO:\n    // Assert the reason: Failed to load ../../../node_modules/simple-svelte-autocomplete/src/SimpleAutocomplete.svelte\n    // Try installing rollup-plugin-vue and adding it to Snowpack (https://www.snowpack.dev/guides/vue)\n  });\n\n  it('succeeds when svelte plugin is provided', async () => {\n    const result = await runTest(['simple-svelte-autocomplete'], {\n      cwd: __dirname,\n      packageLookupFields: ['svelte'],\n      rollup: {\n        plugins: [require('rollup-plugin-svelte')({include: /\\.svelte$/})],\n      },\n    });\n    return expect(result.importMap).toEqual({\n      imports: {'simple-svelte-autocomplete': './simple-svelte-autocomplete.js'},\n    });\n  });\n});\n"
  },
  {
    "path": "test/esinstall/config-package-svelte/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-config-package-svelte\",\n  \"description\": \"Handle svelte packages\",\n  \"dependencies\": {\n    \"simple-svelte-autocomplete\": \"1.2.4\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/config-package-svelte/src/index.js",
    "content": "import 'simple-svelte-autocomplete';\n"
  },
  {
    "path": "test/esinstall/dep-list-simple/__snapshots__",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`dep-list-simple matches the snapshot: allFiles 1`] = `\nArray [\n  \"async.js\",\n  \"import-map.json\",\n]\n`;\n\nexports[`dep-list-simple matches the snapshot: cli output 1`] = `\"\"`;\n\nexports[`dep-list-simple matches the snapshot: web_modules/async.js 1`] = `\n\"/* SNOWPACK PROCESS POLYFILL (based on https://github.com/calvinmetcalf/node-process-es6) */\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\nvar cachedSetTimeout = defaultSetTimout;\nvar cachedClearTimeout = defaultClearTimeout;\nvar globalContext;\nif (typeof window !== 'undefined') {\n    globalContext = window;\n} else if (typeof self !== 'undefined') {\n    globalContext = self;\n} else {\n    globalContext = {};\n}\nif (typeof globalContext.setTimeout === 'function') {\n    cachedSetTimeout = setTimeout;\n}\nif (typeof globalContext.clearTimeout === 'function') {\n    cachedClearTimeout = clearTimeout;\n}\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\nfunction nextTick(fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nvar title = 'browser';\nvar platform = 'browser';\nvar browser = true;\nvar argv = [];\nvar version = ''; // empty string to avoid regexp issues\nvar versions = {};\nvar release = {};\nvar config = {};\nfunction noop() {}\nvar on = noop;\nvar addListener = noop;\nvar once = noop;\nvar off = noop;\nvar removeListener = noop;\nvar removeAllListeners = noop;\nvar emit = noop;\nfunction binding(name) {\n    throw new Error('process.binding is not supported');\n}\nfunction cwd () { return '/' }\nfunction chdir (dir) {\n    throw new Error('process.chdir is not supported');\n}function umask() { return 0; }\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = globalContext.performance || {};\nvar performanceNow =\n  performance.now        ||\n  performance.mozNow     ||\n  performance.msNow      ||\n  performance.oNow       ||\n  performance.webkitNow  ||\n  function(){ return (new Date()).getTime() };\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nfunction hrtime(previousTimestamp){\n  var clocktime = performanceNow.call(performance)*1e-3;\n  var seconds = Math.floor(clocktime);\n  var nanoseconds = Math.floor((clocktime%1)*1e9);\n  if (previousTimestamp) {\n    seconds = seconds - previousTimestamp[0];\n    nanoseconds = nanoseconds - previousTimestamp[1];\n    if (nanoseconds<0) {\n      seconds--;\n      nanoseconds += 1e9;\n    }\n  }\n  return [seconds,nanoseconds]\n}\nvar startTime = new Date();\nfunction uptime() {\n  var currentTime = new Date();\n  var dif = currentTime - startTime;\n  return dif / 1000;\n}\nvar process = {\n  nextTick: nextTick,\n  title: title,\n  browser: browser,\n  env: {\\\\\"NODE_ENV\\\\\":\\\\\"test\\\\\"},\n  argv: argv,\n  version: version,\n  versions: versions,\n  on: on,\n  addListener: addListener,\n  once: once,\n  off: off,\n  removeListener: removeListener,\n  removeAllListeners: removeAllListeners,\n  emit: emit,\n  binding: binding,\n  cwd: cwd,\n  chdir: chdir,\n  umask: umask,\n  hrtime: hrtime,\n  platform: platform,\n  release: release,\n  config: config,\n  uptime: uptime\n};\n/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n *     async.apply(fs.writeFile, 'testfile1', 'test1'),\n *     async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n *     function(callback) {\n *         fs.writeFile('testfile1', 'test1', callback);\n *     },\n *     function(callback) {\n *         fs.writeFile('testfile2', 'test2', callback);\n *     }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nfunction apply(fn, ...args) {\n    return (...callArgs) => fn(...args,...callArgs);\n}\nfunction initialParams (fn) {\n    return function (...args/*, callback*/) {\n        var callback = args.pop();\n        return fn.call(this, args, callback);\n    };\n}\n/* istanbul ignore file */\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\nfunction fallback(fn) {\n    setTimeout(fn, 0);\n}\nfunction wrap(defer) {\n    return (fn, ...args) => defer(() => fn(...args));\n}\nvar _defer;\nif (hasSetImmediate) {\n    _defer = setImmediate;\n} else if (hasNextTick) {\n    _defer = process.nextTick;\n} else {\n    _defer = fallback;\n}\nvar setImmediate$1 = wrap(_defer);\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to \\`asyncify\\` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 \\`async\\` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the \\`func\\`. To be\n * invoked with \\`(args..., callback)\\`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n *     async.apply(fs.readFile, filename, \\\\\"utf8\\\\\"),\n *     async.asyncify(JSON.parse),\n *     function (data, next) {\n *         // data is the result of parsing the text.\n *         // If there was a parsing error, it would have been caught.\n *     }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n *     async.apply(fs.readFile, filename, \\\\\"utf8\\\\\"),\n *     async.asyncify(function (contents) {\n *         return db.model.create(contents);\n *     }),\n *     function (model, next) {\n *         // \\`model\\` is the instantiated model object.\n *         // If there was an error, this function would be skipped.\n *     }\n * ], callback);\n *\n * // es2017 example, though \\`asyncify\\` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n *     var intermediateStep = await processFile(file);\n *     return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n    if (isAsync(func)) {\n        return function (...args/*, callback*/) {\n            const callback = args.pop();\n            const promise = func.apply(this, args);\n            return handlePromise(promise, callback)\n        }\n    }\n    return initialParams(function (args, callback) {\n        var result;\n        try {\n            result = func.apply(this, args);\n        } catch (e) {\n            return callback(e);\n        }\n        // if result is Promise object\n        if (result && typeof result.then === 'function') {\n            return handlePromise(result, callback)\n        } else {\n            callback(null, result);\n        }\n    });\n}\nfunction handlePromise(promise, callback) {\n    return promise.then(value => {\n        invokeCallback(callback, null, value);\n    }, err => {\n        invokeCallback(callback, err && err.message ? err : new Error(err));\n    });\n}\nfunction invokeCallback(callback, error, value) {\n    try {\n        callback(error, value);\n    } catch (err) {\n        setImmediate$1(e => { throw e }, err);\n    }\n}\nfunction isAsync(fn) {\n    return fn[Symbol.toStringTag] === 'AsyncFunction';\n}\nfunction isAsyncGenerator(fn) {\n    return fn[Symbol.toStringTag] === 'AsyncGenerator';\n}\nfunction isAsyncIterable(obj) {\n    return typeof obj[Symbol.asyncIterator] === 'function';\n}\nfunction wrapAsync(asyncFn) {\n    if (typeof asyncFn !== 'function') throw new Error('expected a function')\n    return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n// conditionally promisify a function.\n// only return a promise if a callback is omitted\nfunction awaitify (asyncFn, arity = asyncFn.length) {\n    if (!arity) throw new Error('arity is undefined')\n    function awaitable (...args) {\n        if (typeof args[arity - 1] === 'function') {\n            return asyncFn.apply(this, args)\n        }\n        return new Promise((resolve, reject) => {\n            args[arity - 1] = (err, ...cbArgs) => {\n                if (err) return reject(err)\n                resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]);\n            };\n            asyncFn.apply(this, args);\n        })\n    }\n    Object.defineProperty(awaitable, 'name', {\n        value: \\`awaitable(\\${asyncFn.name})\\`\n    });\n    return awaitable\n}\nfunction applyEach (eachfn) {\n    return function applyEach(fns, ...callArgs) {\n        const go = awaitify(function (callback) {\n            var that = this;\n            return eachfn(fns, (fn, cb) => {\n                wrapAsync(fn).apply(that, callArgs.concat(cb));\n            }, callback);\n        });\n        return go;\n    };\n}\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n    arr = arr || [];\n    var results = [];\n    var counter = 0;\n    var _iteratee = wrapAsync(iteratee);\n    return eachfn(arr, (value, _, iterCb) => {\n        var index = counter++;\n        _iteratee(value, (err, v) => {\n            results[index] = v;\n            iterCb(err);\n        });\n    }, err => {\n        callback(err, results);\n    });\n}\nfunction isArrayLike(value) {\n    return value &&\n        typeof value.length === 'number' &&\n        value.length >= 0 &&\n        value.length % 1 === 0;\n}\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nconst breakLoop = {};\nfunction once$1(fn) {\n    function wrapper (...args) {\n        if (fn === null) return;\n        var callFn = fn;\n        fn = null;\n        callFn.apply(this, args);\n    }\n    Object.assign(wrapper, fn);\n    return wrapper\n}\nfunction getIterator (coll) {\n    return coll[Symbol.iterator] && coll[Symbol.iterator]();\n}\nfunction createArrayIterator(coll) {\n    var i = -1;\n    var len = coll.length;\n    return function next() {\n        return ++i < len ? {value: coll[i], key: i} : null;\n    }\n}\nfunction createES2015Iterator(iterator) {\n    var i = -1;\n    return function next() {\n        var item = iterator.next();\n        if (item.done)\n            return null;\n        i++;\n        return {value: item.value, key: i};\n    }\n}\nfunction createObjectIterator(obj) {\n    var okeys = obj ? Object.keys(obj) : [];\n    var i = -1;\n    var len = okeys.length;\n    return function next() {\n        var key = okeys[++i];\n        return i < len ? {value: obj[key], key} : null;\n    };\n}\nfunction createIterator(coll) {\n    if (isArrayLike(coll)) {\n        return createArrayIterator(coll);\n    }\n    var iterator = getIterator(coll);\n    return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\nfunction onlyOnce(fn) {\n    return function (...args) {\n        if (fn === null) throw new Error(\\\\\"Callback was already called.\\\\\");\n        var callFn = fn;\n        fn = null;\n        callFn.apply(this, args);\n    };\n}\n// for async generators\nfunction asyncEachOfLimit(generator, limit, iteratee, callback) {\n    let done = false;\n    let canceled = false;\n    let awaiting = false;\n    let running = 0;\n    let idx = 0;\n    function replenish() {\n        //console.log('replenish')\n        if (running >= limit || awaiting || done) return\n        //console.log('replenish awaiting')\n        awaiting = true;\n        generator.next().then(({value, done: iterDone}) => {\n            //console.log('got value', value)\n            if (canceled || done) return\n            awaiting = false;\n            if (iterDone) {\n                done = true;\n                if (running <= 0) {\n                    //console.log('done nextCb')\n                    callback(null);\n                }\n                return;\n            }\n            running++;\n            iteratee(value, idx, iterateeCallback);\n            idx++;\n            replenish();\n        }).catch(handleError);\n    }\n    function iterateeCallback(err, result) {\n        //console.log('iterateeCallback')\n        running -= 1;\n        if (canceled) return\n        if (err) return handleError(err)\n        if (err === false) {\n            done = true;\n            canceled = true;\n            return\n        }\n        if (result === breakLoop || (done && running <= 0)) {\n            done = true;\n            //console.log('done iterCb')\n            return callback(null);\n        }\n        replenish();\n    }\n    function handleError(err) {\n        if (canceled) return\n        awaiting = false;\n        done = true;\n        callback(err);\n    }\n    replenish();\n}\nvar eachOfLimit = (limit) => {\n    return (obj, iteratee, callback) => {\n        callback = once$1(callback);\n        if (limit <= 0) {\n            throw new RangeError('concurrency limit cannot be less than 1')\n        }\n        if (!obj) {\n            return callback(null);\n        }\n        if (isAsyncGenerator(obj)) {\n            return asyncEachOfLimit(obj, limit, iteratee, callback)\n        }\n        if (isAsyncIterable(obj)) {\n            return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback)\n        }\n        var nextElem = createIterator(obj);\n        var done = false;\n        var canceled = false;\n        var running = 0;\n        var looping = false;\n        function iterateeCallback(err, value) {\n            if (canceled) return\n            running -= 1;\n            if (err) {\n                done = true;\n                callback(err);\n            }\n            else if (err === false) {\n                done = true;\n                canceled = true;\n            }\n            else if (value === breakLoop || (done && running <= 0)) {\n                done = true;\n                return callback(null);\n            }\n            else if (!looping) {\n                replenish();\n            }\n        }\n        function replenish () {\n            looping = true;\n            while (running < limit && !done) {\n                var elem = nextElem();\n                if (elem === null) {\n                    done = true;\n                    if (running <= 0) {\n                        callback(null);\n                    }\n                    return;\n                }\n                running += 1;\n                iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n            }\n            looping = false;\n        }\n        replenish();\n    };\n};\n/**\n * The same as [\\`eachOf\\`]{@link module:Collections.eachOf} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in \\`coll\\`. The \\`key\\` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * \\`iteratee\\` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfLimit$1(coll, limit, iteratee, callback) {\n    return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);\n}\nvar eachOfLimit$2 = awaitify(eachOfLimit$1, 4);\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n    callback = once$1(callback);\n    var index = 0,\n        completed = 0,\n        {length} = coll,\n        canceled = false;\n    if (length === 0) {\n        callback(null);\n    }\n    function iteratorCallback(err, value) {\n        if (err === false) {\n            canceled = true;\n        }\n        if (canceled === true) return\n        if (err) {\n            callback(err);\n        } else if ((++completed === length) || value === breakLoop) {\n            callback(null);\n        }\n    }\n    for (; index < length; index++) {\n        iteratee(coll[index], index, onlyOnce(iteratorCallback));\n    }\n}\n// a generic version of eachOf which can handle array, object, and iterator cases.\nfunction eachOfGeneric (coll, iteratee, callback) {\n    return eachOfLimit$2(coll, Infinity, iteratee, callback);\n}\n/**\n * Like [\\`each\\`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in \\`coll\\`.\n * The \\`key\\` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * \\`iteratee\\` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * var obj = {dev: \\\\\"/dev.json\\\\\", test: \\\\\"/test.json\\\\\", prod: \\\\\"/prod.json\\\\\"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n *     fs.readFile(__dirname + value, \\\\\"utf8\\\\\", function (err, data) {\n *         if (err) return callback(err);\n *         try {\n *             configs[key] = JSON.parse(data);\n *         } catch (e) {\n *             return callback(e);\n *         }\n *         callback();\n *     });\n * }, function (err) {\n *     if (err) console.error(err.message);\n *     // configs is now a map of JSON data\n *     doSomethingWith(configs);\n * });\n */\nfunction eachOf(coll, iteratee, callback) {\n    var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n    return eachOfImplementation(coll, wrapAsync(iteratee), callback);\n}\nvar eachOf$1 = awaitify(eachOf, 3);\n/**\n * Produces a new collection of values by mapping each value in \\`coll\\` through\n * the \\`iteratee\\` function. The \\`iteratee\\` is called with an item from \\`coll\\`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an \\`error\\`, and the transformed item from \\`coll\\`. If\n * \\`iteratee\\` passes an error to its callback, the main \\`callback\\` (for the\n * \\`map\\` function) is immediately called with the error.\n *\n * Note, that since this function applies the \\`iteratee\\` to each item in\n * parallel, there is no guarantee that the \\`iteratee\\` functions will complete\n * in order. However, the results array will be in the same order as the\n * original \\`coll\\`.\n *\n * If \\`map\\` is passed an Object, the results will be an Array.  The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the \\`coll\\`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n *     // results is now an array of stats for each file\n * });\n */\nfunction map (coll, iteratee, callback) {\n    return _asyncMap(eachOf$1, coll, iteratee, callback)\n}\nvar map$1 = awaitify(map, 3);\n/**\n * Applies the provided arguments to each function in the array, calling\n * \\`callback\\` after all functions have completed. If you only provide the first\n * argument, \\`fns\\`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, \\`callback\\` is required while \\`args\\` is still optional. The results\n * for each of the applied async functions are passed to the final callback\n * as an array.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - Returns a function that takes no args other than\n * an optional callback, that is the result of applying the \\`args\\` to each\n * of the functions.\n * @example\n *\n * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket')\n *\n * appliedFn((err, results) => {\n *     // results[0] is the results for \\`enableSearch\\`\n *     // results[1] is the results for \\`updateSchema\\`\n * });\n *\n * // partial application example:\n * async.each(\n *     buckets,\n *     async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(),\n *     callback\n * );\n */\nvar applyEach$1 = applyEach(map$1);\n/**\n * The same as [\\`eachOf\\`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachOfSeries(coll, iteratee, callback) {\n    return eachOfLimit$2(coll, 1, iteratee, callback)\n}\nvar eachOfSeries$1 = awaitify(eachOfSeries, 3);\n/**\n * The same as [\\`map\\`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the \\`coll\\`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapSeries (coll, iteratee, callback) {\n    return _asyncMap(eachOfSeries$1, coll, iteratee, callback)\n}\nvar mapSeries$1 = awaitify(mapSeries, 3);\n/**\n * The same as [\\`applyEach\\`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {AsyncFunction} - A function, that when called, is the result of\n * appling the \\`args\\` to the list of functions.  It takes no args, other than\n * a callback.\n */\nvar applyEachSeries = applyEach(mapSeries$1);\nconst PROMISE_SYMBOL = Symbol('promiseCallback');\nfunction promiseCallback () {\n    let resolve, reject;\n    function callback (err, ...args) {\n        if (err) return reject(err)\n        resolve(args.length > 1 ? args : args[0]);\n    }\n    callback[PROMISE_SYMBOL] = new Promise((res, rej) => {\n        resolve = res,\n        reject = rej;\n    });\n    return callback\n}\n/**\n * Determines the best order for running the {@link AsyncFunction}s in \\`tasks\\`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the \\`auto\\` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main \\`callback\\` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a \\`results\\` object, containing the results of the previously executed\n *   functions, only passed if the task has any dependencies,\n * * a \\`callback(err, result)\\` function, which must be called when finished,\n *   passing an \\`error\\` (which can be \\`null\\`) and the result of the function's\n *   execution.\n * @param {number} [concurrency=Infinity] - An optional \\`integer\\` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the \\`err\\` argument if any \\`tasks\\`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further \\`tasks\\` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n * @example\n *\n * async.auto({\n *     // this function will just be passed a callback\n *     readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),\n *     showData: ['readData', function(results, cb) {\n *         // results.readData is the file's contents\n *         // ...\n *     }]\n * }, callback);\n *\n * async.auto({\n *     get_data: function(callback) {\n *         console.log('in get_data');\n *         // async code to get some data\n *         callback(null, 'data', 'converted to array');\n *     },\n *     make_folder: function(callback) {\n *         console.log('in make_folder');\n *         // async code to create a directory to store a file in\n *         // this is run at the same time as getting the data\n *         callback(null, 'folder');\n *     },\n *     write_file: ['get_data', 'make_folder', function(results, callback) {\n *         console.log('in write_file', JSON.stringify(results));\n *         // once there is some data and the directory exists,\n *         // write the data to a file in the directory\n *         callback(null, 'filename');\n *     }],\n *     email_link: ['write_file', function(results, callback) {\n *         console.log('in email_link', JSON.stringify(results));\n *         // once the file is written let's email a link to it...\n *         // results.write_file contains the filename returned by write_file.\n *         callback(null, {'file':results.write_file, 'email':'user@example.com'});\n *     }]\n * }, function(err, results) {\n *     console.log('err = ', err);\n *     console.log('results = ', results);\n * });\n */\nfunction auto(tasks, concurrency, callback) {\n    if (typeof concurrency !== 'number') {\n        // concurrency is optional, shift the args.\n        callback = concurrency;\n        concurrency = null;\n    }\n    callback = once$1(callback || promiseCallback());\n    var numTasks = Object.keys(tasks).length;\n    if (!numTasks) {\n        return callback(null);\n    }\n    if (!concurrency) {\n        concurrency = numTasks;\n    }\n    var results = {};\n    var runningTasks = 0;\n    var canceled = false;\n    var hasError = false;\n    var listeners = Object.create(null);\n    var readyTasks = [];\n    // for cycle detection:\n    var readyToCheck = []; // tasks that have been identified as reachable\n    // without the possibility of returning to an ancestor task\n    var uncheckedDependencies = {};\n    Object.keys(tasks).forEach(key => {\n        var task = tasks[key];\n        if (!Array.isArray(task)) {\n            // no dependencies\n            enqueueTask(key, [task]);\n            readyToCheck.push(key);\n            return;\n        }\n        var dependencies = task.slice(0, task.length - 1);\n        var remainingDependencies = dependencies.length;\n        if (remainingDependencies === 0) {\n            enqueueTask(key, task);\n            readyToCheck.push(key);\n            return;\n        }\n        uncheckedDependencies[key] = remainingDependencies;\n        dependencies.forEach(dependencyName => {\n            if (!tasks[dependencyName]) {\n                throw new Error('async.auto task \\`' + key +\n                    '\\` has a non-existent dependency \\`' +\n                    dependencyName + '\\` in ' +\n                    dependencies.join(', '));\n            }\n            addListener(dependencyName, () => {\n                remainingDependencies--;\n                if (remainingDependencies === 0) {\n                    enqueueTask(key, task);\n                }\n            });\n        });\n    });\n    checkForDeadlocks();\n    processQueue();\n    function enqueueTask(key, task) {\n        readyTasks.push(() => runTask(key, task));\n    }\n    function processQueue() {\n        if (canceled) return\n        if (readyTasks.length === 0 && runningTasks === 0) {\n            return callback(null, results);\n        }\n        while(readyTasks.length && runningTasks < concurrency) {\n            var run = readyTasks.shift();\n            run();\n        }\n    }\n    function addListener(taskName, fn) {\n        var taskListeners = listeners[taskName];\n        if (!taskListeners) {\n            taskListeners = listeners[taskName] = [];\n        }\n        taskListeners.push(fn);\n    }\n    function taskComplete(taskName) {\n        var taskListeners = listeners[taskName] || [];\n        taskListeners.forEach(fn => fn());\n        processQueue();\n    }\n    function runTask(key, task) {\n        if (hasError) return;\n        var taskCallback = onlyOnce((err, ...result) => {\n            runningTasks--;\n            if (err === false) {\n                canceled = true;\n                return\n            }\n            if (result.length < 2) {\n                [result] = result;\n            }\n            if (err) {\n                var safeResults = {};\n                Object.keys(results).forEach(rkey => {\n                    safeResults[rkey] = results[rkey];\n                });\n                safeResults[key] = result;\n                hasError = true;\n                listeners = Object.create(null);\n                if (canceled) return\n                callback(err, safeResults);\n            } else {\n                results[key] = result;\n                taskComplete(key);\n            }\n        });\n        runningTasks++;\n        var taskFn = wrapAsync(task[task.length - 1]);\n        if (task.length > 1) {\n            taskFn(results, taskCallback);\n        } else {\n            taskFn(taskCallback);\n        }\n    }\n    function checkForDeadlocks() {\n        // Kahn's algorithm\n        // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n        // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n        var currentTask;\n        var counter = 0;\n        while (readyToCheck.length) {\n            currentTask = readyToCheck.pop();\n            counter++;\n            getDependents(currentTask).forEach(dependent => {\n                if (--uncheckedDependencies[dependent] === 0) {\n                    readyToCheck.push(dependent);\n                }\n            });\n        }\n        if (counter !== numTasks) {\n            throw new Error(\n                'async.auto cannot execute tasks due to a recursive dependency'\n            );\n        }\n    }\n    function getDependents(taskName) {\n        var result = [];\n        Object.keys(tasks).forEach(key => {\n            const task = tasks[key];\n            if (Array.isArray(task) && task.indexOf(taskName) >= 0) {\n                result.push(key);\n            }\n        });\n        return result;\n    }\n    return callback[PROMISE_SYMBOL]\n}\nvar FN_ARGS = /^(?:async\\\\\\\\s+)?(?:function)?\\\\\\\\s*\\\\\\\\w*\\\\\\\\s*\\\\\\\\(\\\\\\\\s*([^)]+)\\\\\\\\s*\\\\\\\\)(?:\\\\\\\\s*{)/;\nvar ARROW_FN_ARGS = /^(?:async\\\\\\\\s+)?\\\\\\\\(?\\\\\\\\s*([^)=]+)\\\\\\\\s*\\\\\\\\)?(?:\\\\\\\\s*=>)/;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\\\\\\\s*)$/;\nvar STRIP_COMMENTS = /((\\\\\\\\/\\\\\\\\/.*$)|(\\\\\\\\/\\\\\\\\*[\\\\\\\\s\\\\\\\\S]*?\\\\\\\\*\\\\\\\\/))/mg;\nfunction parseParams(func) {\n    const src = func.toString().replace(STRIP_COMMENTS, '');\n    let match = src.match(FN_ARGS);\n    if (!match) {\n        match = src.match(ARROW_FN_ARGS);\n    }\n    if (!match) throw new Error('could not parse args in autoInjectSource:' + src)\n    let [, args] = match;\n    return args\n        .replace(/\\\\\\\\s/g, '')\n        .split(FN_ARG_SPLIT)\n        .map((arg) => arg.replace(FN_ARG, '').trim());\n}\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The \\`callback\\` parameter is a \\`callback(err, result)\\` which must be called\n *   when finished, passing an \\`error\\` (which can be \\`null\\`) and the result of\n *   the function's execution. The remaining parameters name other tasks on\n *   which the task is dependent, and the results from those tasks are the\n *   arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the \\`err\\` argument if any \\`tasks\\`\n * pass an error to their callback, and a \\`results\\` object with any completed\n * task results, similar to \\`auto\\`.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * //  The example from \\`auto\\` can be rewritten as follows:\n * async.autoInject({\n *     get_data: function(callback) {\n *         // async code to get some data\n *         callback(null, 'data', 'converted to array');\n *     },\n *     make_folder: function(callback) {\n *         // async code to create a directory to store a file in\n *         // this is run at the same time as getting the data\n *         callback(null, 'folder');\n *     },\n *     write_file: function(get_data, make_folder, callback) {\n *         // once there is some data and the directory exists,\n *         // write the data to a file in the directory\n *         callback(null, 'filename');\n *     },\n *     email_link: function(write_file, callback) {\n *         // once the file is written let's email a link to it...\n *         // write_file contains the filename returned by write_file.\n *         callback(null, {'file':write_file, 'email':'user@example.com'});\n *     }\n * }, function(err, results) {\n *     console.log('err = ', err);\n *     console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, \\`autoInject\\`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier.  To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain \\`auto\\`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n *     //...\n *     write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n *         callback(null, 'filename');\n *     }],\n *     email_link: ['write_file', function(write_file, callback) {\n *         callback(null, {'file':write_file, 'email':'user@example.com'});\n *     }]\n *     //...\n * }, function(err, results) {\n *     console.log('err = ', err);\n *     console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n    var newTasks = {};\n    Object.keys(tasks).forEach(key => {\n        var taskFn = tasks[key];\n        var params;\n        var fnIsAsync = isAsync(taskFn);\n        var hasNoDeps =\n            (!fnIsAsync && taskFn.length === 1) ||\n            (fnIsAsync && taskFn.length === 0);\n        if (Array.isArray(taskFn)) {\n            params = [...taskFn];\n            taskFn = params.pop();\n            newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n        } else if (hasNoDeps) {\n            // no dependencies, use the function as-is\n            newTasks[key] = taskFn;\n        } else {\n            params = parseParams(taskFn);\n            if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) {\n                throw new Error(\\\\\"autoInject task functions require explicit parameters.\\\\\");\n            }\n            // remove callback param\n            if (!fnIsAsync) params.pop();\n            newTasks[key] = params.concat(newTask);\n        }\n        function newTask(results, taskCb) {\n            var newArgs = params.map(name => results[name]);\n            newArgs.push(taskCb);\n            wrapAsync(taskFn)(...newArgs);\n        }\n    });\n    return auto(newTasks, callback);\n}\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nclass DLL {\n    constructor() {\n        this.head = this.tail = null;\n        this.length = 0;\n    }\n    removeLink(node) {\n        if (node.prev) node.prev.next = node.next;\n        else this.head = node.next;\n        if (node.next) node.next.prev = node.prev;\n        else this.tail = node.prev;\n        node.prev = node.next = null;\n        this.length -= 1;\n        return node;\n    }\n    empty () {\n        while(this.head) this.shift();\n        return this;\n    }\n    insertAfter(node, newNode) {\n        newNode.prev = node;\n        newNode.next = node.next;\n        if (node.next) node.next.prev = newNode;\n        else this.tail = newNode;\n        node.next = newNode;\n        this.length += 1;\n    }\n    insertBefore(node, newNode) {\n        newNode.prev = node.prev;\n        newNode.next = node;\n        if (node.prev) node.prev.next = newNode;\n        else this.head = newNode;\n        node.prev = newNode;\n        this.length += 1;\n    }\n    unshift(node) {\n        if (this.head) this.insertBefore(this.head, node);\n        else setInitial(this, node);\n    }\n    push(node) {\n        if (this.tail) this.insertAfter(this.tail, node);\n        else setInitial(this, node);\n    }\n    shift() {\n        return this.head && this.removeLink(this.head);\n    }\n    pop() {\n        return this.tail && this.removeLink(this.tail);\n    }\n    toArray() {\n        return [...this]\n    }\n    *[Symbol.iterator] () {\n        var cur = this.head;\n        while (cur) {\n            yield cur.data;\n            cur = cur.next;\n        }\n    }\n    remove (testFn) {\n        var curr = this.head;\n        while(curr) {\n            var {next} = curr;\n            if (testFn(curr)) {\n                this.removeLink(curr);\n            }\n            curr = next;\n        }\n        return this;\n    }\n}\nfunction setInitial(dll, node) {\n    dll.length = 1;\n    dll.head = dll.tail = node;\n}\nfunction queue$1(worker, concurrency, payload) {\n    if (concurrency == null) {\n        concurrency = 1;\n    }\n    else if(concurrency === 0) {\n        throw new RangeError('Concurrency must not be zero');\n    }\n    var _worker = wrapAsync(worker);\n    var numRunning = 0;\n    var workersList = [];\n    const events = {\n        error: [],\n        drain: [],\n        saturated: [],\n        unsaturated: [],\n        empty: []\n    };\n    function on (event, handler) {\n        events[event].push(handler);\n    }\n    function once (event, handler) {\n        const handleAndRemove = (...args) => {\n            off(event, handleAndRemove);\n            handler(...args);\n        };\n        events[event].push(handleAndRemove);\n    }\n    function off (event, handler) {\n        if (!event) return Object.keys(events).forEach(ev => events[ev] = [])\n        if (!handler) return events[event] = []\n        events[event] = events[event].filter(ev => ev !== handler);\n    }\n    function trigger (event, ...args) {\n        events[event].forEach(handler => handler(...args));\n    }\n    var processingScheduled = false;\n    function _insert(data, insertAtFront, rejectOnError, callback) {\n        if (callback != null && typeof callback !== 'function') {\n            throw new Error('task callback must be a function');\n        }\n        q.started = true;\n        var res, rej;\n        function promiseCallback (err, ...args) {\n            // we don't care about the error, let the global error handler\n            // deal with it\n            if (err) return rejectOnError ? rej(err) : res()\n            if (args.length <= 1) return res(args[0])\n            res(args);\n        }\n        var item = {\n            data,\n            callback: rejectOnError ?\n                promiseCallback :\n                (callback || promiseCallback)\n        };\n        if (insertAtFront) {\n            q._tasks.unshift(item);\n        } else {\n            q._tasks.push(item);\n        }\n        if (!processingScheduled) {\n            processingScheduled = true;\n            setImmediate$1(() => {\n                processingScheduled = false;\n                q.process();\n            });\n        }\n        if (rejectOnError || !callback) {\n            return new Promise((resolve, reject) => {\n                res = resolve;\n                rej = reject;\n            })\n        }\n    }\n    function _createCB(tasks) {\n        return function (err, ...args) {\n            numRunning -= 1;\n            for (var i = 0, l = tasks.length; i < l; i++) {\n                var task = tasks[i];\n                var index = workersList.indexOf(task);\n                if (index === 0) {\n                    workersList.shift();\n                } else if (index > 0) {\n                    workersList.splice(index, 1);\n                }\n                task.callback(err, ...args);\n                if (err != null) {\n                    trigger('error', err, task.data);\n                }\n            }\n            if (numRunning <= (q.concurrency - q.buffer) ) {\n                trigger('unsaturated');\n            }\n            if (q.idle()) {\n                trigger('drain');\n            }\n            q.process();\n        };\n    }\n    function _maybeDrain(data) {\n        if (data.length === 0 && q.idle()) {\n            // call drain immediately if there are no tasks\n            setImmediate$1(() => trigger('drain'));\n            return true\n        }\n        return false\n    }\n    const eventMethod = (name) => (handler) => {\n        if (!handler) {\n            return new Promise((resolve, reject) => {\n                once(name, (err, data) => {\n                    if (err) return reject(err)\n                    resolve(data);\n                });\n            })\n        }\n        off(name);\n        on(name, handler);\n    };\n    var isProcessing = false;\n    var q = {\n        _tasks: new DLL(),\n        *[Symbol.iterator] () {\n            yield* q._tasks[Symbol.iterator]();\n        },\n        concurrency,\n        payload,\n        buffer: concurrency / 4,\n        started: false,\n        paused: false,\n        push (data, callback) {\n            if (Array.isArray(data)) {\n                if (_maybeDrain(data)) return\n                return data.map(datum => _insert(datum, false, false, callback))\n            }\n            return _insert(data, false, false, callback);\n        },\n        pushAsync (data, callback) {\n            if (Array.isArray(data)) {\n                if (_maybeDrain(data)) return\n                return data.map(datum => _insert(datum, false, true, callback))\n            }\n            return _insert(data, false, true, callback);\n        },\n        kill () {\n            off();\n            q._tasks.empty();\n        },\n        unshift (data, callback) {\n            if (Array.isArray(data)) {\n                if (_maybeDrain(data)) return\n                return data.map(datum => _insert(datum, true, false, callback))\n            }\n            return _insert(data, true, false, callback);\n        },\n        unshiftAsync (data, callback) {\n            if (Array.isArray(data)) {\n                if (_maybeDrain(data)) return\n                return data.map(datum => _insert(datum, true, true, callback))\n            }\n            return _insert(data, true, true, callback);\n        },\n        remove (testFn) {\n            q._tasks.remove(testFn);\n        },\n        process () {\n            // Avoid trying to start too many processing operations. This can occur\n            // when callbacks resolve synchronously (#1267).\n            if (isProcessing) {\n                return;\n            }\n            isProcessing = true;\n            while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n                var tasks = [], data = [];\n                var l = q._tasks.length;\n                if (q.payload) l = Math.min(l, q.payload);\n                for (var i = 0; i < l; i++) {\n                    var node = q._tasks.shift();\n                    tasks.push(node);\n                    workersList.push(node);\n                    data.push(node.data);\n                }\n                numRunning += 1;\n                if (q._tasks.length === 0) {\n                    trigger('empty');\n                }\n                if (numRunning === q.concurrency) {\n                    trigger('saturated');\n                }\n                var cb = onlyOnce(_createCB(tasks));\n                _worker(data, cb);\n            }\n            isProcessing = false;\n        },\n        length () {\n            return q._tasks.length;\n        },\n        running () {\n            return numRunning;\n        },\n        workersList () {\n            return workersList;\n        },\n        idle() {\n            return q._tasks.length + numRunning === 0;\n        },\n        pause () {\n            q.paused = true;\n        },\n        resume () {\n            if (q.paused === false) { return; }\n            q.paused = false;\n            setImmediate$1(q.process);\n        }\n    };\n    // define these as fixed properties, so people get useful errors when updating\n    Object.defineProperties(q, {\n        saturated: {\n            writable: false,\n            value: eventMethod('saturated')\n        },\n        unsaturated: {\n            writable: false,\n            value: eventMethod('unsaturated')\n        },\n        empty: {\n            writable: false,\n            value: eventMethod('empty')\n        },\n        drain: {\n            writable: false,\n            value: eventMethod('drain')\n        },\n        error: {\n            writable: false,\n            value: eventMethod('error')\n        },\n    });\n    return q;\n}\n/**\n * Creates a \\`cargo\\` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the \\`payload\\` limit). If the\n * \\`worker\\` is in progress, the task is queued until it becomes available. Once\n * the \\`worker\\` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how \\`cargo\\` and \\`queue\\` work.\n *\n * While [\\`queue\\`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with \\`(tasks, callback)\\`.\n * @param {number} [payload=Infinity] - An optional \\`integer\\` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n *     for (var i=0; i<tasks.length; i++) {\n *         console.log('hello ' + tasks[i].name);\n *     }\n *     callback();\n * }, 2);\n *\n * // add some items\n * cargo.push({name: 'foo'}, function(err) {\n *     console.log('finished processing foo');\n * });\n * cargo.push({name: 'bar'}, function(err) {\n *     console.log('finished processing bar');\n * });\n * await cargo.push({name: 'baz'});\n * console.log('finished processing baz');\n */\nfunction cargo(worker, payload) {\n    return queue$1(worker, 1, payload);\n}\n/**\n * Creates a \\`cargoQueue\\` object with the specified payload. Tasks added to the\n * cargoQueue will be processed together (up to the \\`payload\\` limit) in \\`concurrency\\` parallel workers.\n * If the all \\`workers\\` are in progress, the task is queued until one becomes available. Once\n * a \\`worker\\` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how \\`cargo\\` and \\`queue\\` work.\n *\n * While [\\`queue\\`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, and [\\`cargo\\`]{@link module:ControlFlow.cargo} passes an array of tasks to a single worker,\n * the cargoQueue passes an array of tasks to multiple parallel workers.\n *\n * @name cargoQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @see [async.cargo]{@link module:ControlFLow.cargo}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with \\`(tasks, callback)\\`.\n * @param {number} [concurrency=1] - An \\`integer\\` for determining how many\n * \\`worker\\` functions should be run in parallel.  If omitted, the concurrency\n * defaults to \\`1\\`.  If the concurrency is \\`0\\`, an error is thrown.\n * @param {number} [payload=Infinity] - An optional \\`integer\\` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.CargoObject} A cargoQueue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargoQueue and inner queue.\n * @example\n *\n * // create a cargoQueue object with payload 2 and concurrency 2\n * var cargoQueue = async.cargoQueue(function(tasks, callback) {\n *     for (var i=0; i<tasks.length; i++) {\n *         console.log('hello ' + tasks[i].name);\n *     }\n *     callback();\n * }, 2, 2);\n *\n * // add some items\n * cargoQueue.push({name: 'foo'}, function(err) {\n *     console.log('finished processing foo');\n * });\n * cargoQueue.push({name: 'bar'}, function(err) {\n *     console.log('finished processing bar');\n * });\n * cargoQueue.push({name: 'baz'}, function(err) {\n *     console.log('finished processing baz');\n * });\n * cargoQueue.push({name: 'boo'}, function(err) {\n *     console.log('finished processing boo');\n * });\n */\nfunction cargo$1(worker, concurrency, payload) {\n    return queue$1(worker, concurrency, payload);\n}\n/**\n * Reduces \\`coll\\` into a single value using an async \\`iteratee\\` to return each\n * successive step. \\`memo\\` is the initial state of the reduction. This function\n * only operates in series.\n *\n * For performance reasons, it may make sense to split a call to this function\n * into a parallel map, and then use the normal \\`Array.prototype.reduce\\` on the\n * results. This function is for situations where each step in the reduction\n * needs to be async; if you can get the data before reducing it, then it's\n * probably a good idea to do so.\n *\n * @name reduce\n * @static\n * @memberOf module:Collections\n * @method\n * @alias inject\n * @alias foldl\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The \\`iteratee\\` should complete with the next state of the reduction.\n * If the iteratee complete with an error, the reduction is stopped and the\n * main \\`callback\\` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * async.reduce([1,2,3], 0, function(memo, item, callback) {\n *     // pointless async:\n *     process.nextTick(function() {\n *         callback(null, memo + item)\n *     });\n * }, function(err, result) {\n *     // result is now equal to the last value of memo, which is 6\n * });\n */\nfunction reduce(coll, memo, iteratee, callback) {\n    callback = once$1(callback);\n    var _iteratee = wrapAsync(iteratee);\n    return eachOfSeries$1(coll, (x, i, iterCb) => {\n        _iteratee(memo, x, (err, v) => {\n            memo = v;\n            iterCb(err);\n        });\n    }, err => callback(err, memo));\n}\nvar reduce$1 = awaitify(reduce, 4);\n/**\n * Version of the compose function that is more natural to read. Each function\n * consumes the return value of the previous function. It is the equivalent of\n * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n *\n * Each function is executed with the \\`this\\` binding of the composed function.\n *\n * @name seq\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.compose]{@link module:ControlFlow.compose}\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} a function that composes the \\`functions\\` in order\n * @example\n *\n * // Requires lodash (or underscore), express3 and dresende's orm2.\n * // Part of an app, that fetches cats of the logged user.\n * // This example uses \\`seq\\` function to avoid overnesting and error\n * // handling clutter.\n * app.get('/cats', function(request, response) {\n *     var User = request.models.User;\n *     async.seq(\n *         _.bind(User.get, User),  // 'User.get' has signature (id, callback(err, data))\n *         function(user, fn) {\n *             user.getCats(fn);      // 'getCats' has signature (callback(err, data))\n *         }\n *     )(req.session.user_id, function (err, cats) {\n *         if (err) {\n *             console.error(err);\n *             response.json({ status: 'error', message: err.message });\n *         } else {\n *             response.json({ status: 'ok', message: 'Cats found', data: cats });\n *         }\n *     });\n * });\n */\nfunction seq(...functions) {\n    var _functions = functions.map(wrapAsync);\n    return function (...args) {\n        var that = this;\n        var cb = args[args.length - 1];\n        if (typeof cb == 'function') {\n            args.pop();\n        } else {\n            cb = promiseCallback();\n        }\n        reduce$1(_functions, args, (newargs, fn, iterCb) => {\n            fn.apply(that, newargs.concat((err, ...nextargs) => {\n                iterCb(err, nextargs);\n            }));\n        },\n        (err, results) => cb(err, ...results));\n        return cb[PROMISE_SYMBOL]\n    };\n}\n/**\n * Creates a function which is a composition of the passed asynchronous\n * functions. Each function consumes the return value of the function that\n * follows. Composing functions \\`f()\\`, \\`g()\\`, and \\`h()\\` would produce the result\n * of \\`f(g(h()))\\`, only this version uses callbacks to obtain the return values.\n *\n * If the last argument to the composed function is not a function, a promise\n * is returned when you call it.\n *\n * Each function is executed with the \\`this\\` binding of the composed function.\n *\n * @name compose\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} an asynchronous function that is the composed\n * asynchronous \\`functions\\`\n * @example\n *\n * function add1(n, callback) {\n *     setTimeout(function () {\n *         callback(null, n + 1);\n *     }, 10);\n * }\n *\n * function mul3(n, callback) {\n *     setTimeout(function () {\n *         callback(null, n * 3);\n *     }, 10);\n * }\n *\n * var add1mul3 = async.compose(mul3, add1);\n * add1mul3(4, function (err, result) {\n *     // result now equals 15\n * });\n */\nfunction compose(...args) {\n    return seq(...args.reverse());\n}\n/**\n * The same as [\\`map\\`]{@link module:Collections.map} but runs a maximum of \\`limit\\` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the \\`coll\\`. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapLimit (coll, limit, iteratee, callback) {\n    return _asyncMap(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar mapLimit$1 = awaitify(mapLimit, 4);\n/**\n * The same as [\\`concat\\`]{@link module:Collections.concat} but runs a maximum of \\`limit\\` async operations at a time.\n *\n * @name concatLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapLimit\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each item in \\`coll\\`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the \\`iteratee\\` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatLimit(coll, limit, iteratee, callback) {\n    var _iteratee = wrapAsync(iteratee);\n    return mapLimit$1(coll, limit, (val, iterCb) => {\n        _iteratee(val, (err, ...args) => {\n            if (err) return iterCb(err);\n            return iterCb(err, args);\n        });\n    }, (err, mapResults) => {\n        var result = [];\n        for (var i = 0; i < mapResults.length; i++) {\n            if (mapResults[i]) {\n                result = result.concat(...mapResults[i]);\n            }\n        }\n        return callback(err, result);\n    });\n}\nvar concatLimit$1 = awaitify(concatLimit, 4);\n/**\n * Applies \\`iteratee\\` to each item in \\`coll\\`, concatenating the results. Returns\n * the concatenated list. The \\`iteratee\\`s are called in parallel, and the\n * results are concatenated as they return. The results array will be returned in\n * the original order of \\`coll\\` passed to the \\`iteratee\\` function.\n *\n * @name concat\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @alias flatMap\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in \\`coll\\`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the \\`iteratee\\` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n * @example\n *\n * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {\n *     // files is now a list of filenames that exist in the 3 directories\n * });\n */\nfunction concat(coll, iteratee, callback) {\n    return concatLimit$1(coll, Infinity, iteratee, callback)\n}\nvar concat$1 = awaitify(concat, 3);\n/**\n * The same as [\\`concat\\`]{@link module:Collections.concat} but runs only a single async operation at a time.\n *\n * @name concatSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @alias flatMapSeries\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in \\`coll\\`.\n * The iteratee should complete with an array an array of results.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the \\`iteratee\\` function. Invoked with\n * (err, results).\n * @returns A Promise, if no callback is passed\n */\nfunction concatSeries(coll, iteratee, callback) {\n    return concatLimit$1(coll, 1, iteratee, callback)\n}\nvar concatSeries$1 = awaitify(concatSeries, 3);\n/**\n * Returns a function that when called, calls-back with the values provided.\n * Useful as the first function in a [\\`waterfall\\`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n * [\\`auto\\`]{@link module:ControlFlow.auto}.\n *\n * @name constant\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {...*} arguments... - Any number of arguments to automatically invoke\n * callback with.\n * @returns {AsyncFunction} Returns a function that when invoked, automatically\n * invokes the callback with the previous given arguments.\n * @example\n *\n * async.waterfall([\n *     async.constant(42),\n *     function (value, next) {\n *         // value === 42\n *     },\n *     //...\n * ], callback);\n *\n * async.waterfall([\n *     async.constant(filename, \\\\\"utf8\\\\\"),\n *     fs.readFile,\n *     function (fileData, next) {\n *         //...\n *     }\n *     //...\n * ], callback);\n *\n * async.auto({\n *     hostname: async.constant(\\\\\"https://server.net/\\\\\"),\n *     port: findFreePort,\n *     launchServer: [\\\\\"hostname\\\\\", \\\\\"port\\\\\", function (options, cb) {\n *         startServer(options, cb);\n *     }],\n *     //...\n * }, callback);\n */\nfunction constant(...args) {\n    return function (...ignoredArgs/*, callback*/) {\n        var callback = ignoredArgs.pop();\n        return callback(null, ...args);\n    };\n}\nfunction _createTester(check, getResult) {\n    return (eachfn, arr, _iteratee, cb) => {\n        var testPassed = false;\n        var testResult;\n        const iteratee = wrapAsync(_iteratee);\n        eachfn(arr, (value, _, callback) => {\n            iteratee(value, (err, result) => {\n                if (err || err === false) return callback(err);\n                if (check(result) && !testResult) {\n                    testPassed = true;\n                    testResult = getResult(true, value);\n                    return callback(null, breakLoop);\n                }\n                callback();\n            });\n        }, err => {\n            if (err) return cb(err);\n            cb(null, testPassed ? testResult : getResult(false));\n        });\n    };\n}\n/**\n * Returns the first value in \\`coll\\` that passes an async truth test. The\n * \\`iteratee\\` is applied in parallel, meaning the first iteratee to return\n * \\`true\\` will fire the detect \\`callback\\` with that result. That means the\n * result might not be the first item in the original \\`coll\\` (in terms of order)\n * that passes the test.\n * If order within the original \\`coll\\` is important, then look at\n * [\\`detectSeries\\`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in \\`coll\\`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns \\`true\\`, or after all the \\`iteratee\\` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value \\`undefined\\` if none passed. Invoked with\n * (err, result).\n * @returns A Promise, if no callback is passed\n * @example\n *\n * async.detect(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // result now equals the first file in the list that exists\n * });\n */\nfunction detect(coll, iteratee, callback) {\n    return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback)\n}\nvar detect$1 = awaitify(detect, 3);\n/**\n * The same as [\\`detect\\`]{@link module:Collections.detect} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in \\`coll\\`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns \\`true\\`, or after all the \\`iteratee\\` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value \\`undefined\\` if none passed. Invoked with\n * (err, result).\n * @returns a Promise if no callback is passed\n */\nfunction detectLimit(coll, limit, iteratee, callback) {\n    return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar detectLimit$1 = awaitify(detectLimit, 4);\n/**\n * The same as [\\`detect\\`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in \\`coll\\`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns \\`true\\`, or after all the \\`iteratee\\` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value \\`undefined\\` if none passed. Invoked with\n * (err, result).\n * @returns a Promise if no callback is passed\n */\nfunction detectSeries(coll, iteratee, callback) {\n    return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback)\n}\nvar detectSeries$1 = awaitify(detectSeries, 3);\nfunction consoleFunc(name) {\n    return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {\n        if (typeof console === 'object') {\n            if (err) {\n                if (console.error) {\n                    console.error(err);\n                }\n            } else if (console[name]) {\n                resultArgs.forEach(x => console[name](x));\n            }\n        }\n    })\n}\n/**\n * Logs the result of an [\\`async\\` function]{@link AsyncFunction} to the\n * \\`console\\` using \\`console.dir\\` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support \\`console.dir\\` and\n * \\`console.error\\` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * \\`console.dir\\` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n *     setTimeout(function() {\n *         callback(null, {hello: name});\n *     }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n/**\n * The post-check version of [\\`whilst\\`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments \\`test\\` and \\`iteratee\\` are switched.\n *\n * \\`doWhilst\\` is to \\`whilst\\` as \\`do while\\` is to \\`while\\` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time \\`test\\`\n * passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of \\`iteratee\\`. Invoked with (...args, callback), where \\`...args\\` are the\n * non-error args from the previous callback of \\`iteratee\\`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of \\`iteratee\\` has stopped.\n * \\`callback\\` will be passed an error and any arguments passed to the final\n * \\`iteratee\\`'s callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doWhilst(iteratee, test, callback) {\n    callback = onlyOnce(callback);\n    var _fn = wrapAsync(iteratee);\n    var _test = wrapAsync(test);\n    var results;\n    function next(err, ...args) {\n        if (err) return callback(err);\n        if (err === false) return;\n        results = args;\n        _test(...args, check);\n    }\n    function check(err, truth) {\n        if (err) return callback(err);\n        if (err === false) return;\n        if (!truth) return callback(null, ...results);\n        _fn(next);\n    }\n    return check(null, true);\n}\nvar doWhilst$1 = awaitify(doWhilst, 3);\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the \\`test\\` is inverted. Note the\n * argument ordering differs from \\`until\\`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * \\`test\\` fails. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform after each\n * execution of \\`iteratee\\`. Invoked with (...args, callback), where \\`...args\\` are the\n * non-error args from the previous callback of \\`iteratee\\`\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of \\`iteratee\\` has stopped. \\`callback\\`\n * will be passed an error and any arguments passed to the final \\`iteratee\\`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction doUntil(iteratee, test, callback) {\n    const _test = wrapAsync(test);\n    return doWhilst$1(iteratee, (...args) => {\n        const cb = args.pop();\n        _test(...args, (err, truth) => cb (err, !truth));\n    }, callback);\n}\nfunction _withoutIndex(iteratee) {\n    return (value, index, callback) => iteratee(value, callback);\n}\n/**\n * Applies the function \\`iteratee\\` to each item in \\`coll\\`, in parallel.\n * The \\`iteratee\\` is called with an item from the list, and a callback for when\n * it has finished. If the \\`iteratee\\` passes an error to its \\`callback\\`, the\n * main \\`callback\\` (for the \\`each\\` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies \\`iteratee\\` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in \\`coll\\`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use \\`eachOf\\`.\n * @param {Function} [callback] - A callback which is called when all\n * \\`iteratee\\` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n *   // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n *     // Perform operation on file here.\n *     console.log('Processing file ' + file);\n *\n *     if( file.length > 32 ) {\n *       console.log('This file name is too long');\n *       callback('File name too long');\n *     } else {\n *       // Do work to process file here\n *       console.log('File processed');\n *       callback();\n *     }\n * }, function(err) {\n *     // if any of the file processing produced an error, err would equal that error\n *     if( err ) {\n *       // One of the iterations produced an error.\n *       // All processing will now stop.\n *       console.log('A file failed to process');\n *     } else {\n *       console.log('All files have been processed successfully');\n *     }\n * });\n */\nfunction eachLimit(coll, iteratee, callback) {\n    return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\nvar each = awaitify(eachLimit, 3);\n/**\n * The same as [\\`each\\`]{@link module:Collections.each} but runs a maximum of \\`limit\\` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The array index is not passed to the iteratee.\n * If you need the index, use \\`eachOfLimit\\`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * \\`iteratee\\` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachLimit$1(coll, limit, iteratee, callback) {\n    return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\nvar eachLimit$2 = awaitify(eachLimit$1, 4);\n/**\n * The same as [\\`each\\`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * Note, that unlike [\\`each\\`]{@link module:Collections.each}, this function applies iteratee to each item\n * in series and therefore the iteratee functions will complete in order.\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in \\`coll\\`.\n * The array index is not passed to the iteratee.\n * If you need the index, use \\`eachOfSeries\\`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * \\`iteratee\\` functions have finished, or an error occurs. Invoked with (err).\n * @returns {Promise} a promise, if a callback is omitted\n */\nfunction eachSeries(coll, iteratee, callback) {\n    return eachLimit$2(coll, 1, iteratee, callback)\n}\nvar eachSeries$1 = awaitify(eachSeries, 3);\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop.  If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (\\`RangeError: Maximum call stack size exceeded\\`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 \\`async\\` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n *     if (cache[arg]) {\n *         return callback(null, cache[arg]); // this would be synchronous!!\n *     } else {\n *         doSomeIO(arg, callback); // this IO would be asynchronous\n *     }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n    if (isAsync(fn)) return fn;\n    return function (...args/*, callback*/) {\n        var callback = args.pop();\n        var sync = true;\n        args.push((...innerArgs) => {\n            if (sync) {\n                setImmediate$1(() => callback(...innerArgs));\n            } else {\n                callback(...innerArgs);\n            }\n        });\n        fn.apply(this, args);\n        sync = false;\n    };\n}\n/**\n * Returns \\`true\\` if every element in \\`coll\\` satisfies an async test. If any\n * iteratee call returns \\`false\\`, the main \\`callback\\` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Result will be either \\`true\\` or \\`false\\`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * async.every(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // if result is true then every file exists\n * });\n */\nfunction every(coll, iteratee, callback) {\n    return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback)\n}\nvar every$1 = awaitify(every, 3);\n/**\n * The same as [\\`every\\`]{@link module:Collections.every} but runs a maximum of \\`limit\\` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Result will be either \\`true\\` or \\`false\\`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everyLimit(coll, limit, iteratee, callback) {\n    return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar everyLimit$1 = awaitify(everyLimit, 4);\n/**\n * The same as [\\`every\\`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Result will be either \\`true\\` or \\`false\\`\n * depending on the values of the async tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction everySeries(coll, iteratee, callback) {\n    return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar everySeries$1 = awaitify(everySeries, 3);\nfunction filterArray(eachfn, arr, iteratee, callback) {\n    var truthValues = new Array(arr.length);\n    eachfn(arr, (x, index, iterCb) => {\n        iteratee(x, (err, v) => {\n            truthValues[index] = !!v;\n            iterCb(err);\n        });\n    }, err => {\n        if (err) return callback(err);\n        var results = [];\n        for (var i = 0; i < arr.length; i++) {\n            if (truthValues[i]) results.push(arr[i]);\n        }\n        callback(null, results);\n    });\n}\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n    var results = [];\n    eachfn(coll, (x, index, iterCb) => {\n        iteratee(x, (err, v) => {\n            if (err) return iterCb(err);\n            if (v) {\n                results.push({index, value: x});\n            }\n            iterCb(err);\n        });\n    }, err => {\n        if (err) return callback(err);\n        callback(null, results\n            .sort((a, b) => a.index - b.index)\n            .map(v => v.value));\n    });\n}\nfunction _filter(eachfn, coll, iteratee, callback) {\n    var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n    return filter(eachfn, coll, wrapAsync(iteratee), callback);\n}\n/**\n * Returns a new array of all the values in \\`coll\\` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in \\`coll\\`.\n * The \\`iteratee\\` is passed a \\`callback(err, truthValue)\\`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * async.filter(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, results) {\n *     // results now equals an array of the existing files\n * });\n */\nfunction filter (coll, iteratee, callback) {\n    return _filter(eachOf$1, coll, iteratee, callback)\n}\nvar filter$1 = awaitify(filter, 3);\n/**\n * The same as [\\`filter\\`]{@link module:Collections.filter} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in \\`coll\\`.\n * The \\`iteratee\\` is passed a \\`callback(err, truthValue)\\`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterLimit (coll, limit, iteratee, callback) {\n    return _filter(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar filterLimit$1 = awaitify(filterLimit, 4);\n/**\n * The same as [\\`filter\\`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in \\`coll\\`.\n * The \\`iteratee\\` is passed a \\`callback(err, truthValue)\\`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Invoked with (err, results)\n * @returns {Promise} a promise, if no callback provided\n */\nfunction filterSeries (coll, iteratee, callback) {\n    return _filter(eachOfSeries$1, coll, iteratee, callback)\n}\nvar filterSeries$1 = awaitify(filterSeries, 3);\n/**\n * Calls the asynchronous function \\`fn\\` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n * If an error is passed to the callback then \\`errback\\` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when \\`fn\\` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @returns {Promise} a promise that rejects if an error occurs and an errback\n * is not passed\n * @example\n *\n * async.forever(\n *     function(next) {\n *         // next is suitable for passing to things that need a callback(err [, whatever]);\n *         // it will result in this function being called again.\n *     },\n *     function(err) {\n *         // if next is called with a value in its first parameter, it will appear\n *         // in here as 'err', and execution will stop.\n *     }\n * );\n */\nfunction forever(fn, errback) {\n    var done = onlyOnce(errback);\n    var task = wrapAsync(ensureAsync(fn));\n    function next(err) {\n        if (err) return done(err);\n        if (err === false) return;\n        task(next);\n    }\n    return next();\n}\nvar forever$1 = awaitify(forever, 2);\n/**\n * The same as [\\`groupBy\\`]{@link module:Collections.groupBy} but runs a maximum of \\`limit\\` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with a \\`key\\` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Result is an \\`Object\\` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupByLimit(coll, limit, iteratee, callback) {\n    var _iteratee = wrapAsync(iteratee);\n    return mapLimit$1(coll, limit, (val, iterCb) => {\n        _iteratee(val, (err, key) => {\n            if (err) return iterCb(err);\n            return iterCb(err, {key, val});\n        });\n    }, (err, mapResults) => {\n        var result = {};\n        // from MDN, handle object having an \\`hasOwnProperty\\` prop\n        var {hasOwnProperty} = Object.prototype;\n        for (var i = 0; i < mapResults.length; i++) {\n            if (mapResults[i]) {\n                var {key} = mapResults[i];\n                var {val} = mapResults[i];\n                if (hasOwnProperty.call(result, key)) {\n                    result[key].push(val);\n                } else {\n                    result[key] = [val];\n                }\n            }\n        }\n        return callback(err, result);\n    });\n}\nvar groupByLimit$1 = awaitify(groupByLimit, 4);\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * \\`coll\\`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the \\`iteratee\\` callback.\n *\n * Note: Since this function applies the \\`iteratee\\` to each item in parallel,\n * there is no guarantee that the \\`iteratee\\` functions will complete in order.\n * However, the values for each key in the \\`result\\` will be in the same order as\n * the original \\`coll\\`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with a \\`key\\` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Result is an \\`Object\\` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {\n *     db.findById(userId, function(err, user) {\n *         if (err) return callback(err);\n *         return callback(null, user.age);\n *     });\n * }, function(err, result) {\n *     // result is object containing the userIds grouped by age\n *     // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};\n * });\n */\nfunction groupBy (coll, iteratee, callback) {\n    return groupByLimit$1(coll, Infinity, iteratee, callback)\n}\n/**\n * The same as [\\`groupBy\\`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with a \\`key\\` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. Result is an \\`Object\\` whoses\n * properties are arrays of values which returned the corresponding key.\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction groupBySeries (coll, iteratee, callback) {\n    return groupByLimit$1(coll, 1, iteratee, callback)\n}\n/**\n * Logs the result of an \\`async\\` function to the \\`console\\`. Only works in\n * Node.js or in browsers that support \\`console.log\\` and \\`console.error\\` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, \\`console.log\\` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n *     setTimeout(function() {\n *         callback(null, 'hello ' + name);\n *     }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n/**\n * The same as [\\`mapValues\\`]{@link module:Collections.mapValues} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in \\`coll\\`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. \\`result\\` is a new object consisting\n * of each key from \\`obj\\`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n    callback = once$1(callback);\n    var newObj = {};\n    var _iteratee = wrapAsync(iteratee);\n    return eachOfLimit(limit)(obj, (val, key, next) => {\n        _iteratee(val, key, (err, result) => {\n            if (err) return next(err);\n            newObj[key] = result;\n            next(err);\n        });\n    }, err => callback(err, newObj));\n}\nvar mapValuesLimit$1 = awaitify(mapValuesLimit, 4);\n/**\n * A relative of [\\`map\\`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of \\`obj\\` through the \\`iteratee\\`\n * function. The \\`iteratee\\` is called each \\`value\\` and \\`key\\` from \\`obj\\` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an \\`error\\`, and the transformed item from \\`obj\\`. If \\`iteratee\\`\n * passes an error to its callback, the main \\`callback\\` (for the \\`mapValues\\`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed.  The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in \\`coll\\`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. \\`result\\` is a new object consisting\n * of each key from \\`obj\\`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * async.mapValues({\n *     f1: 'file1',\n *     f2: 'file2',\n *     f3: 'file3'\n * }, function (file, key, callback) {\n *   fs.stat(file, callback);\n * }, function(err, result) {\n *     // result is now a map of stats for each file, e.g.\n *     // {\n *     //     f1: [stats for file1],\n *     //     f2: [stats for file2],\n *     //     f3: [stats for file3]\n *     // }\n * });\n */\nfunction mapValues(obj, iteratee, callback) {\n    return mapValuesLimit$1(obj, Infinity, iteratee, callback)\n}\n/**\n * The same as [\\`mapValues\\`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in \\`coll\\`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all \\`iteratee\\`\n * functions have finished, or an error occurs. \\`result\\` is a new object consisting\n * of each key from \\`obj\\`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction mapValuesSeries(obj, iteratee, callback) {\n    return mapValuesLimit$1(obj, 1, iteratee, callback)\n}\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * **Note: if the async function errs, the result will not be cached and\n * subsequent calls will call the wrapped function.**\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the \\`memo\\` property of the function\n * returned by \\`memoize\\`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of \\`fn\\`\n * @example\n *\n * var slow_fn = function(name, callback) {\n *     // do something\n *     callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n *     // callback\n * });\n */\nfunction memoize(fn, hasher = v => v) {\n    var memo = Object.create(null);\n    var queues = Object.create(null);\n    var _fn = wrapAsync(fn);\n    var memoized = initialParams((args, callback) => {\n        var key = hasher(...args);\n        if (key in memo) {\n            setImmediate$1(() => callback(null, ...memo[key]));\n        } else if (key in queues) {\n            queues[key].push(callback);\n        } else {\n            queues[key] = [callback];\n            _fn(...args, (err, ...resultArgs) => {\n                // #1465 don't memoize if an error occurred\n                if (!err) {\n                    memo[key] = resultArgs;\n                }\n                var q = queues[key];\n                delete queues[key];\n                for (var i = 0, l = q.length; i < l; i++) {\n                    q[i](err, ...resultArgs);\n                }\n            });\n        }\n    });\n    memoized.memo = memo;\n    memoized.unmemoized = fn;\n    return memoized;\n}\n/**\n * Calls \\`callback\\` on a later loop around the event loop. In Node.js this just\n * calls \\`process.nextTick\\`.  In the browser it will use \\`setImmediate\\` if\n * available, otherwise \\`setTimeout(callback, 0)\\`, which means other higher\n * priority events may precede the execution of \\`callback\\`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n *     call_order.push('two');\n *     // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n *     // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer$1;\nif (hasNextTick) {\n    _defer$1 = process.nextTick;\n} else if (hasSetImmediate) {\n    _defer$1 = setImmediate;\n} else {\n    _defer$1 = fallback;\n}\nvar nextTick$1 = wrap(_defer$1);\nvar _parallel = awaitify((eachfn, tasks, callback) => {\n    var results = isArrayLike(tasks) ? [] : {};\n    eachfn(tasks, (task, key, taskCb) => {\n        wrapAsync(task)((err, ...result) => {\n            if (result.length < 2) {\n                [result] = result;\n            }\n            results[key] = result;\n            taskCb(err);\n        });\n    }, err => callback(err, results));\n}, 3);\n/**\n * Run the \\`tasks\\` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main \\`callback\\` is immediately called with the value of the\n * error. Once the \\`tasks\\` have completed, the results are passed to the final\n * \\`callback\\` as an array.\n *\n * **Note:** \\`parallel\\` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code.  If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series.  Any synchronous setup\n * sections for each task will happen one after the other.  JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [\\`reflect\\`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final \\`callback\\`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional \\`result\\` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n * async.parallel([\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     // the results array will equal ['one','two'] even though\n *     // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 1);\n *         }, 200);\n *     },\n *     two: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 2);\n *         }, 100);\n *     }\n * }, function(err, results) {\n *     // results is now equals to: {one: 1, two: 2}\n * });\n */\nfunction parallel(tasks, callback) {\n    return _parallel(eachOf$1, tasks, callback);\n}\n/**\n * The same as [\\`parallel\\`]{@link module:ControlFlow.parallel} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional \\`result\\` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n * @returns {Promise} a promise, if a callback is not passed\n */\nfunction parallelLimit(tasks, limit, callback) {\n    return _parallel(eachOfLimit(limit), tasks, callback);\n}\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Iterable} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with \\`queue.length()\\`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with \\`queue.running()\\`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with \\`queue.workersList()\\`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with \\`queue.idle()\\`.\n * @property {number} concurrency - an integer for determining how many \\`worker\\`\n * functions should be run in parallel. This property can be changed after a\n * \\`queue\\` is created to alter the concurrency on-the-fly.\n * @property {number} payload - an integer that specifies how many items are\n * passed to the worker function at a time. only applies if this is a\n * [cargo]{@link module:ControlFlow.cargo} object\n * @property {AsyncFunction} push - add a new task to the \\`queue\\`. Calls \\`callback\\`\n * once the \\`worker\\` has finished processing the task. Instead of a single task,\n * a \\`tasks\\` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with \\`queue.push(task, [callback])\\`,\n * @property {AsyncFunction} unshift - add a new task to the front of the \\`queue\\`.\n * Invoke with \\`queue.unshift(task, [callback])\\`.\n * @property {AsyncFunction} pushAsync - the same as \\`q.push\\`, except this returns\n * a promise that rejects if an error occurs.\n * @property {AsyncFunction} unshirtAsync - the same as \\`q.unshift\\`, except this returns\n * a promise that rejects if an error occurs.\n * @property {Function} remove - remove items from the queue that match a test\n * function.  The test function will be passed an object with a \\`data\\` property,\n * and a \\`priority\\` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with \\`queue.remove(testFn)\\`, where \\`testFn\\` is of the form\n * \\`function ({data, priority}) {}\\` and returns a Boolean.\n * @property {Function} saturated - a function that sets a callback that is\n * called when the number of running workers hits the \\`concurrency\\` limit, and\n * further tasks will be queued.  If the callback is omitted, \\`q.saturated()\\`\n * returns a promise for the next occurrence.\n * @property {Function} unsaturated - a function that sets a callback that is\n * called when the number of running workers is less than the \\`concurrency\\` &\n * \\`buffer\\` limits, and further tasks will not be queued. If the callback is\n * omitted, \\`q.unsaturated()\\` returns a promise for the next occurrence.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the \\`queue\\` is \\`unsaturated\\`.\n * @property {Function} empty - a function that sets a callback that is called\n * when the last item from the \\`queue\\` is given to a \\`worker\\`. If the callback\n * is omitted, \\`q.empty()\\` returns a promise for the next occurrence.\n * @property {Function} drain - a function that sets a callback that is called\n * when the last item from the \\`queue\\` has returned from the \\`worker\\`. If the\n * callback is omitted, \\`q.drain()\\` returns a promise for the next occurrence.\n * @property {Function} error - a function that sets a callback that is called\n * when a task errors. Has the signature \\`function(error, task)\\`. If the\n * callback is omitted, \\`error()\\` returns a promise that rejects on the next\n * error.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until \\`resume()\\` is called. Invoke with \\`queue.pause()\\`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with \\`queue.resume()\\`.\n * @property {Function} kill - a function that removes the \\`drain\\` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with \\`queue.kill()\\`.\n *\n * @example\n * const q = aync.queue(worker, 2)\n * q.push(item1)\n * q.push(item2)\n * q.push(item3)\n * // queues are iterable, spread into an array to inspect\n * const items = [...q] // [item1, item2, item3]\n * // or use for of\n * for (let item of q) {\n *     console.log(item)\n * }\n *\n * q.drain(() => {\n *     console.log('all done')\n * })\n * // or\n * await q.drain()\n */\n/**\n * Creates a \\`queue\\` object with the specified \\`concurrency\\`. Tasks added to the\n * \\`queue\\` are processed in parallel (up to the \\`concurrency\\` limit). If all\n * \\`worker\\`s are in progress, the task is queued until one becomes available.\n * Once a \\`worker\\` completes a \\`task\\`, that \\`task\\`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * \\`q.push()\\`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An \\`integer\\` for determining how many\n * \\`worker\\` functions should be run in parallel.  If omitted, the concurrency\n * defaults to \\`1\\`.  If the concurrency is \\`0\\`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n *     console.log('hello ' + task.name);\n *     callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain(function() {\n *     console.log('all items have been processed');\n * });\n * // or await the end\n * await q.drain()\n *\n * // assign an error callback\n * q.error(function(err, task) {\n *     console.error('task experienced an error');\n * });\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n *     console.log('finished processing foo');\n * });\n * // callback is optional\n * q.push({name: 'bar'});\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n *     console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n *     console.log('finished processing bar');\n * });\n */\nfunction queue$1$1 (worker, concurrency) {\n    var _worker = wrapAsync(worker);\n    return queue$1((items, cb) => {\n        _worker(items[0], cb);\n    }, concurrency, 1);\n}\n// Binary min-heap implementation used for priority queue.\n// Implementation is stable, i.e. push time is considered for equal priorities\nclass Heap {\n    constructor() {\n        this.heap = [];\n        this.pushCount = Number.MIN_SAFE_INTEGER;\n    }\n    get length() {\n        return this.heap.length;\n    }\n    empty () {\n        this.heap = [];\n        return this;\n    }\n    percUp(index) {\n        let p;\n        while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) {\n            let t = this.heap[index];\n            this.heap[index] = this.heap[p];\n            this.heap[p] = t;\n            index = p;\n        }\n    }\n    percDown(index) {\n        let l;\n        while ((l=leftChi(index)) < this.heap.length) {\n            if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) {\n                l = l+1;\n            }\n            if (smaller(this.heap[index], this.heap[l])) {\n                break;\n            }\n            let t = this.heap[index];\n            this.heap[index] = this.heap[l];\n            this.heap[l] = t;\n            index = l;\n        }\n    }\n    push(node) {\n        node.pushCount = ++this.pushCount;\n        this.heap.push(node);\n        this.percUp(this.heap.length-1);\n    }\n    unshift(node) {\n        return this.heap.push(node);\n    }\n    shift() {\n        let [top] = this.heap;\n        this.heap[0] = this.heap[this.heap.length-1];\n        this.heap.pop();\n        this.percDown(0);\n        return top;\n    }\n    toArray() {\n        return [...this];\n    }\n    *[Symbol.iterator] () {\n        for (let i = 0; i < this.heap.length; i++) {\n            yield this.heap[i].data;\n        }\n    }\n    remove (testFn) {\n        let j = 0;\n        for (let i = 0; i < this.heap.length; i++) {\n            if (!testFn(this.heap[i])) {\n                this.heap[j] = this.heap[i];\n                j++;\n            }\n        }\n        this.heap.splice(j);\n        for (let i = parent(this.heap.length-1); i >= 0; i--) {\n            this.percDown(i);\n        }\n        return this;\n    }\n}\nfunction leftChi(i) {\n    return (i<<1)+1;\n}\nfunction parent(i) {\n    return ((i+1)>>1)-1;\n}\nfunction smaller(x, y) {\n    if (x.priority !== y.priority) {\n        return x.priority < y.priority;\n    }\n    else {\n        return x.pushCount < y.pushCount;\n    }\n}\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * \\`q.push()\\`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An \\`integer\\` for determining how many \\`worker\\`\n * functions should be run in parallel.  If omitted, the concurrency defaults to\n * \\`1\\`.  If the concurrency is \\`0\\`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two\n * differences between \\`queue\\` and \\`priorityQueue\\` objects:\n * * \\`push(task, priority, [callback])\\` - \\`priority\\` should be a number. If an\n *   array of \\`tasks\\` is given, all tasks will be assigned the same priority.\n * * The \\`unshift\\` method was removed.\n */\nfunction priorityQueue(worker, concurrency) {\n    // Start with a normal queue\n    var q = queue$1$1(worker, concurrency);\n    q._tasks = new Heap();\n    // Override push to accept second parameter representing priority\n    q.push = function(data, priority = 0, callback = () => {}) {\n        if (typeof callback !== 'function') {\n            throw new Error('task callback must be a function');\n        }\n        q.started = true;\n        if (!Array.isArray(data)) {\n            data = [data];\n        }\n        if (data.length === 0 && q.idle()) {\n            // call drain immediately if there are no tasks\n            return setImmediate$1(() => q.drain());\n        }\n        for (var i = 0, l = data.length; i < l; i++) {\n            var item = {\n                data: data[i],\n                priority,\n                callback\n            };\n            q._tasks.push(item);\n        }\n        setImmediate$1(q.process);\n    };\n    // Remove unshift function\n    delete q.unshift;\n    return q;\n}\n/**\n * Runs the \\`tasks\\` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the \\`tasks\\` complete or pass an\n * error to its callback, the main \\`callback\\` is immediately called. It's\n * equivalent to \\`Promise.race()\\`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional \\`result\\` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns undefined\n * @example\n *\n * async.race([\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ],\n * // main callback\n * function(err, result) {\n *     // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n    callback = once$1(callback);\n    if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n    if (!tasks.length) return callback();\n    for (var i = 0, l = tasks.length; i < l; i++) {\n        wrapAsync(tasks[i])(callback);\n    }\n}\nvar race$1 = awaitify(race, 2);\n/**\n * Same as [\\`reduce\\`]{@link module:Collections.reduce}, only operates on \\`array\\` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The \\`iteratee\\` should complete with the next state of the reduction.\n * If the iteratee complete with an error, the reduction is stopped and the\n * main \\`callback\\` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n    var reversed = [...array].reverse();\n    return reduce$1(reversed, memo, iteratee, callback);\n}\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property \\`error\\` or \\`value\\`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an \\`object\\` with\n * either an \\`error\\` or a \\`value\\` property.\n * @example\n *\n * async.parallel([\n *     async.reflect(function(callback) {\n *         // do some stuff ...\n *         callback(null, 'one');\n *     }),\n *     async.reflect(function(callback) {\n *         // do some more stuff but error ...\n *         callback('bad stuff happened');\n *     }),\n *     async.reflect(function(callback) {\n *         // do some more stuff ...\n *         callback(null, 'two');\n *     })\n * ],\n * // optional callback\n * function(err, results) {\n *     // values\n *     // results[0].value = 'one'\n *     // results[1].error = 'bad stuff happened'\n *     // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n    var _fn = wrapAsync(fn);\n    return initialParams(function reflectOn(args, reflectCallback) {\n        args.push((error, ...cbArgs) => {\n            let retVal = {};\n            if (error) {\n                retVal.error = error;\n            }\n            if (cbArgs.length > 0){\n                var value = cbArgs;\n                if (cbArgs.length <= 1) {\n                    [value] = cbArgs;\n                }\n                retVal.value = value;\n            }\n            reflectCallback(null, retVal);\n        });\n        return _fn.apply(this, args);\n    });\n}\n/**\n * A helper function that wraps an array or an object of functions with \\`reflect\\`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in \\`async.reflect\\`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * \\`async.reflect\\`\n * @example\n *\n * let tasks = [\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         // do some more stuff but error ...\n *         callback(new Error('bad stuff happened'));\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n *     // values\n *     // results[0].value = 'one'\n *     // results[1].error = Error('bad stuff happened')\n *     // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     two: function(callback) {\n *         callback('two');\n *     },\n *     three: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'three');\n *         }, 100);\n *     }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n *     // values\n *     // results.one.value = 'one'\n *     // results.two.error = 'two'\n *     // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n    var results;\n    if (Array.isArray(tasks)) {\n        results = tasks.map(reflect);\n    } else {\n        results = {};\n        Object.keys(tasks).forEach(key => {\n            results[key] = reflect.call(this, tasks[key]);\n        });\n    }\n    return results;\n}\nfunction reject(eachfn, arr, _iteratee, callback) {\n    const iteratee = wrapAsync(_iteratee);\n    return _filter(eachfn, arr, (value, cb) => {\n        iteratee(value, (err, v) => {\n            cb(err, !v);\n        });\n    }, callback);\n}\n/**\n * The opposite of [\\`filter\\`]{@link module:Collections.filter}. Removes values that pass an \\`async\\` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * \\`coll\\`.\n * The should complete with a boolean value as its \\`result\\`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * async.reject(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, results) {\n *     // results now equals an array of missing files\n *     createFiles(results);\n * });\n */\nfunction reject$1 (coll, iteratee, callback) {\n    return reject(eachOf$1, coll, iteratee, callback)\n}\nvar reject$2 = awaitify(reject$1, 3);\n/**\n * The same as [\\`reject\\`]{@link module:Collections.reject} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * \\`coll\\`.\n * The should complete with a boolean value as its \\`result\\`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectLimit (coll, limit, iteratee, callback) {\n    return reject(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar rejectLimit$1 = awaitify(rejectLimit, 4);\n/**\n * The same as [\\`reject\\`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * \\`coll\\`.\n * The should complete with a boolean value as its \\`result\\`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback is passed\n */\nfunction rejectSeries (coll, iteratee, callback) {\n    return reject(eachOfSeries$1, coll, iteratee, callback)\n}\nvar rejectSeries$1 = awaitify(rejectSeries, 3);\nfunction constant$1(value) {\n    return function () {\n        return value;\n    }\n}\n/**\n * Attempts to get a successful response from \\`task\\` no more than \\`times\\` times\n * before returning an error. If the task is successful, the \\`callback\\` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with \\`times\\` and \\`interval\\` or a number.\n * * \\`times\\` - The number of attempts to make before giving up.  The default\n *   is \\`5\\`.\n * * \\`interval\\` - The time to wait between retries, in milliseconds.  The\n *   default is \\`0\\`. The interval may also be specified as a function of the\n *   retry count (see example).\n * * \\`errorFilter\\` - An optional synchronous function that is invoked on\n *   erroneous result. If it returns \\`true\\` the retry attempts will continue;\n *   if the function returns \\`false\\` the retry flow is aborted with the current\n *   attempt's error and result being returned to the final callback.\n *   Invoked with (err).\n * * If \\`opts\\` is a number, the number specifies the number of times to retry,\n *   with the default interval of \\`0\\`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the \\`err\\`\n * and \\`result\\` arguments of the last attempt at completing the \\`task\\`. Invoked\n * with (err, results).\n * @returns {Promise} a promise if no callback provided\n *\n * @example\n *\n * // The \\`retry\\` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n *   times: 10,\n *   interval: function(retryCount) {\n *     return 50 * Math.pow(2, retryCount);\n *   }\n * }, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n *   errorFilter: function(err) {\n *     return err.message === 'Temporary error'; // only retry on a specific error\n *   }\n * }, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the \\`retryable\\` wrapper:\n * async.auto({\n *     users: api.getUsers.bind(api),\n *     payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n *     // do something with the results\n * });\n *\n */\nconst DEFAULT_TIMES = 5;\nconst DEFAULT_INTERVAL = 0;\nfunction retry(opts, task, callback) {\n    var options = {\n        times: DEFAULT_TIMES,\n        intervalFunc: constant$1(DEFAULT_INTERVAL)\n    };\n    if (arguments.length < 3 && typeof opts === 'function') {\n        callback = task || promiseCallback();\n        task = opts;\n    } else {\n        parseTimes(options, opts);\n        callback = callback || promiseCallback();\n    }\n    if (typeof task !== 'function') {\n        throw new Error(\\\\\"Invalid arguments for async.retry\\\\\");\n    }\n    var _task = wrapAsync(task);\n    var attempt = 1;\n    function retryAttempt() {\n        _task((err, ...args) => {\n            if (err === false) return\n            if (err && attempt++ < options.times &&\n                (typeof options.errorFilter != 'function' ||\n                    options.errorFilter(err))) {\n                setTimeout(retryAttempt, options.intervalFunc(attempt - 1));\n            } else {\n                callback(err, ...args);\n            }\n        });\n    }\n    retryAttempt();\n    return callback[PROMISE_SYMBOL]\n}\nfunction parseTimes(acc, t) {\n    if (typeof t === 'object') {\n        acc.times = +t.times || DEFAULT_TIMES;\n        acc.intervalFunc = typeof t.interval === 'function' ?\n            t.interval :\n            constant$1(+t.interval || DEFAULT_INTERVAL);\n        acc.errorFilter = t.errorFilter;\n    } else if (typeof t === 'number' || typeof t === 'string') {\n        acc.times = +t || DEFAULT_TIMES;\n    } else {\n        throw new Error(\\\\\"Invalid arguments for async.retry\\\\\");\n    }\n}\n/**\n * A close relative of [\\`retry\\`]{@link module:ControlFlow.retry}.  This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from \\`retry\\`, except for a \\`opts.arity\\` that\n * is the arity of the \\`task\\` function, defaulting to \\`task.length\\`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in \\`opts\\`.\n * This function will accept the same parameters as \\`task\\`.\n * @example\n *\n * async.auto({\n *     dep1: async.retryable(3, getFromFlakyService),\n *     process: [\\\\\"dep1\\\\\", async.retryable(3, function (results, cb) {\n *         maybeProcessData(results.dep1, cb);\n *     })]\n * }, callback);\n */\nfunction retryable (opts, task) {\n    if (!task) {\n        task = opts;\n        opts = null;\n    }\n    let arity = (opts && opts.arity) || task.length;\n    if (isAsync(task)) {\n        arity += 1;\n    }\n    var _task = wrapAsync(task);\n    return initialParams((args, callback) => {\n        if (args.length < arity - 1 || callback == null) {\n            args.push(callback);\n            callback = promiseCallback();\n        }\n        function taskFn(cb) {\n            _task(...args, cb);\n        }\n        if (opts) retry(opts, taskFn, callback);\n        else retry(taskFn, callback);\n        return callback[PROMISE_SYMBOL]\n    });\n}\n/**\n * Run the functions in the \\`tasks\\` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and \\`callback\\` is\n * immediately called with the value of the error. Otherwise, \\`callback\\`\n * receives an array of results when \\`tasks\\` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final \\`callback\\`\n * as an object instead of an array. This can be a more readable way of handling\n *  results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional \\`result\\` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the \\`task\\` callbacks. Invoked\n * with (err, result).\n * @return {Promise} a promise, if no callback is passed\n * @example\n * async.series([\n *     function(callback) {\n *         // do some stuff ...\n *         callback(null, 'one');\n *     },\n *     function(callback) {\n *         // do some more stuff ...\n *         callback(null, 'two');\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     // results is now equal to ['one', 'two']\n * });\n *\n * async.series({\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 1);\n *         }, 200);\n *     },\n *     two: function(callback){\n *         setTimeout(function() {\n *             callback(null, 2);\n *         }, 100);\n *     }\n * }, function(err, results) {\n *     // results is now equal to: {one: 1, two: 2}\n * });\n */\nfunction series(tasks, callback) {\n    return _parallel(eachOfSeries$1, tasks, callback);\n}\n/**\n * Returns \\`true\\` if at least one element in the \\`coll\\` satisfies an async test.\n * If any iteratee call returns \\`true\\`, the main \\`callback\\` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean \\`result\\` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns \\`true\\`, or after all the iteratee functions have finished.\n * Result will be either \\`true\\` or \\`false\\` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * async.some(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // if result is true then at least one of the files exists\n * });\n */\nfunction some(coll, iteratee, callback) {\n    return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback)\n}\nvar some$1 = awaitify(some, 3);\n/**\n * The same as [\\`some\\`]{@link module:Collections.some} but runs a maximum of \\`limit\\` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean \\`result\\` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns \\`true\\`, or after all the iteratee functions have finished.\n * Result will be either \\`true\\` or \\`false\\` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someLimit(coll, limit, iteratee, callback) {\n    return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback)\n}\nvar someLimit$1 = awaitify(someLimit, 4);\n/**\n * The same as [\\`some\\`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean \\`result\\` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns \\`true\\`, or after all the iteratee functions have finished.\n * Result will be either \\`true\\` or \\`false\\` depending on the values of the async\n * tests. Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n */\nfunction someSeries(coll, iteratee, callback) {\n    return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback)\n}\nvar someSeries$1 = awaitify(someSeries, 3);\n/**\n * Sorts a list by the results of running each \\`coll\\` value through an async\n * \\`iteratee\\`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * \\`coll\\`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its \\`result\\`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * \\`iteratee\\` functions have finished, or an error occurs. Results is the items\n * from the original \\`coll\\` sorted by the values returned by the \\`iteratee\\`\n * calls. Invoked with (err, results).\n * @returns {Promise} a promise, if no callback passed\n * @example\n *\n * async.sortBy(['file1','file2','file3'], function(file, callback) {\n *     fs.stat(file, function(err, stats) {\n *         callback(err, stats.mtime);\n *     });\n * }, function(err, results) {\n *     // results is now the original array of files sorted by\n *     // modified date\n * });\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n *     callback(null, x);\n * }, function(err,result) {\n *     // result callback\n * });\n *\n * // descending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n *     callback(null, x*-1);    //<- x*-1 instead of x, turns the order around\n * }, function(err,result) {\n *     // result callback\n * });\n */\nfunction sortBy (coll, iteratee, callback) {\n    var _iteratee = wrapAsync(iteratee);\n    return map$1(coll, (x, iterCb) => {\n        _iteratee(x, (err, criteria) => {\n            if (err) return iterCb(err);\n            iterCb(err, {value: x, criteria});\n        });\n    }, (err, results) => {\n        if (err) return callback(err);\n        callback(null, results.sort(comparator).map(v => v.value));\n    });\n    function comparator(left, right) {\n        var a = left.criteria, b = right.criteria;\n        return a < b ? -1 : a > b ? 1 : 0;\n    }\n}\nvar sortBy$1 = awaitify(sortBy, 3);\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be \\`'ETIMEDOUT'\\`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (\\`string\\`, \\`object\\`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would \\`asyncFunc\\`.\n * @example\n *\n * function myFunction(foo, callback) {\n *     doAsyncTask(foo, function(err, data) {\n *         // handle errors\n *         if (err) return callback(err);\n *\n *         // do some stuff ...\n *\n *         // return processed data\n *         return callback(null, data);\n *     });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call \\`wrapped\\` as you would \\`myFunction\\`\n * wrapped({ bar: 'bar' }, function(err, data) {\n *     // if \\`myFunction\\` takes < 1000 ms to execute, \\`err\\`\n *     // and \\`data\\` will have their expected values\n *\n *     // else \\`err\\` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n    var fn = wrapAsync(asyncFn);\n    return initialParams((args, callback) => {\n        var timedOut = false;\n        var timer;\n        function timeoutCallback() {\n            var name = asyncFn.name || 'anonymous';\n            var error  = new Error('Callback function \\\\\"' + name + '\\\\\" timed out.');\n            error.code = 'ETIMEDOUT';\n            if (info) {\n                error.info = info;\n            }\n            timedOut = true;\n            callback(error);\n        }\n        args.push((...cbArgs) => {\n            if (!timedOut) {\n                callback(...cbArgs);\n                clearTimeout(timer);\n            }\n        });\n        // setup timer and call original function\n        timer = setTimeout(timeoutCallback, milliseconds);\n        fn(...args);\n    });\n}\nfunction range(size) {\n    var result = Array(size);\n    while (size--) {\n        result[size] = size;\n    }\n    return result;\n}\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of \\`limit\\` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call \\`n\\` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesLimit(count, limit, iteratee, callback) {\n    var _iteratee = wrapAsync(iteratee);\n    return mapLimit$1(range(count), limit, _iteratee, callback);\n}\n/**\n * Calls the \\`iteratee\\` function \\`n\\` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call \\`n\\` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n *     callback(null, {\n *         id: 'user' + id\n *     });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n *     createUser(n, function(err, user) {\n *         next(err, user);\n *     });\n * }, function(err, users) {\n *     // we should now have 5 users\n * });\n */\nfunction times (n, iteratee, callback) {\n    return timesLimit(n, Infinity, iteratee, callback)\n}\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call \\`n\\` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @returns {Promise} a promise, if no callback is provided\n */\nfunction timesSeries (n, iteratee, callback) {\n    return timesLimit(n, 1, iteratee, callback)\n}\n/**\n * A relative of \\`reduce\\`.  Takes an Object or Array, and iterates over each\n * element in parallel, each step potentially mutating an \\`accumulator\\` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform.  If omitted,\n * it will default to an empty Object or Array, depending on the type of \\`coll\\`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * \\`iteratee\\` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @returns {Promise} a promise, if no callback provided\n * @example\n *\n * async.transform([1,2,3], function(acc, item, index, callback) {\n *     // pointless async:\n *     process.nextTick(function() {\n *         acc[index] = item * 2\n *         callback(null)\n *     });\n * }, function(err, result) {\n *     // result is now equal to [2, 4, 6]\n * });\n *\n * @example\n *\n * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {\n *     setImmediate(function () {\n *         obj[key] = val * 2;\n *         callback();\n *     })\n * }, function (err, result) {\n *     // result is equal to {a: 2, b: 4, c: 6}\n * })\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n    if (arguments.length <= 3 && typeof accumulator === 'function') {\n        callback = iteratee;\n        iteratee = accumulator;\n        accumulator = Array.isArray(coll) ? [] : {};\n    }\n    callback = once$1(callback || promiseCallback());\n    var _iteratee = wrapAsync(iteratee);\n    eachOf$1(coll, (v, k, cb) => {\n        _iteratee(accumulator, v, k, cb);\n    }, err => callback(err, accumulator));\n    return callback[PROMISE_SYMBOL]\n}\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the \\`callback\\` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to\n * run, each function is passed a \\`callback(err, result)\\` it must call on\n * completion with an error \\`err\\` (which can be \\`null\\`) and an optional \\`result\\`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the \\`err\\` and\n * \\`result\\` arguments of the last attempt at completing the \\`task\\`. Invoked with\n * (err, results).\n * @returns {Promise} a promise, if no callback is passed\n * @example\n * async.tryEach([\n *     function getDataFromFirstWebsite(callback) {\n *         // Try getting the data from the first website\n *         callback(err, data);\n *     },\n *     function getDataFromSecondWebsite(callback) {\n *         // First website failed,\n *         // Try getting the data from the backup website\n *         callback(err, data);\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n    var error = null;\n    var result;\n    return eachSeries$1(tasks, (task, taskCb) => {\n        wrapAsync(task)((err, ...args) => {\n            if (err === false) return taskCb(err);\n            if (args.length < 2) {\n                [result] = args;\n            } else {\n                result = args;\n            }\n            error = err;\n            taskCb(err ? null : {});\n        });\n    }, () => callback(error, result));\n}\nvar tryEach$1 = awaitify(tryEach);\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n    return (...args) => {\n        return (fn.unmemoized || fn)(...args);\n    };\n}\n/**\n * Repeatedly call \\`iteratee\\`, while \\`test\\` returns \\`true\\`. Calls \\`callback\\` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of \\`iteratee\\`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * \\`test\\` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of \\`iteratee\\` has stopped. \\`callback\\`\n * will be passed an error and any arguments passed to the final \\`iteratee\\`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if no callback is passed\n * @example\n *\n * var count = 0;\n * async.whilst(\n *     function test(cb) { cb(null, count < 5;) },\n *     function iter(callback) {\n *         count++;\n *         setTimeout(function() {\n *             callback(null, count);\n *         }, 1000);\n *     },\n *     function (err, n) {\n *         // 5 seconds have passed, n = 5\n *     }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n    callback = onlyOnce(callback);\n    var _fn = wrapAsync(iteratee);\n    var _test = wrapAsync(test);\n    var results = [];\n    function next(err, ...rest) {\n        if (err) return callback(err);\n        results = rest;\n        if (err === false) return;\n        _test(check);\n    }\n    function check(err, truth) {\n        if (err) return callback(err);\n        if (err === false) return;\n        if (!truth) return callback(null, ...results);\n        _fn(next);\n    }\n    return _test(check);\n}\nvar whilst$1 = awaitify(whilst, 3);\n/**\n * Repeatedly call \\`iteratee\\` until \\`test\\` returns \\`true\\`. Calls \\`callback\\` when\n * stopped, or an error occurs. \\`callback\\` will be passed an error and any\n * arguments passed to the final \\`iteratee\\`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of \\`iteratee\\`. Invoked with (callback).\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * \\`test\\` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of \\`iteratee\\` has stopped. \\`callback\\`\n * will be passed an error and any arguments passed to the final \\`iteratee\\`'s\n * callback. Invoked with (err, [results]);\n * @returns {Promise} a promise, if a callback is not passed\n *\n * @example\n * const results = []\n * async.until(function test(page, cb) {\n *     cb(null, page.next == null)\n * }, function iter(next) {\n *     fetchPage(url, (err, body) => {\n *         if (err) return next(err)\n *         results = results.concat(body.objects)\n *         next(err, body)\n *     })\n * }, function done (err) {\n *     // all pages have been fetched\n * })\n */\nfunction until(test, iteratee, callback) {\n    const _test = wrapAsync(test);\n    return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback);\n}\n/**\n * Runs the \\`tasks\\` array of functions in series, each passing their results to\n * the next in the array. However, if any of the \\`tasks\\` pass an error to their\n * own callback, the next function is not executed, and the main \\`callback\\` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of \\`result\\` values.\n * The \\`result\\` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns undefined\n * @example\n *\n * async.waterfall([\n *     function(callback) {\n *         callback(null, 'one', 'two');\n *     },\n *     function(arg1, arg2, callback) {\n *         // arg1 now equals 'one' and arg2 now equals 'two'\n *         callback(null, 'three');\n *     },\n *     function(arg1, callback) {\n *         // arg1 now equals 'three'\n *         callback(null, 'done');\n *     }\n * ], function (err, result) {\n *     // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n *     myFirstFunction,\n *     mySecondFunction,\n *     myLastFunction,\n * ], function (err, result) {\n *     // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n *     callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n *     // arg1 now equals 'one' and arg2 now equals 'two'\n *     callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n *     // arg1 now equals 'three'\n *     callback(null, 'done');\n * }\n */\nfunction waterfall (tasks, callback) {\n    callback = once$1(callback);\n    if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n    if (!tasks.length) return callback();\n    var taskIndex = 0;\n    function nextTask(args) {\n        var task = wrapAsync(tasks[taskIndex++]);\n        task(...args, onlyOnce(next));\n    }\n    function next(err, ...args) {\n        if (err === false) return\n        if (err || taskIndex === tasks.length) {\n            return callback(err, ...args);\n        }\n        nextTask(args);\n    }\n    nextTask([]);\n}\nvar waterfall$1 = awaitify(waterfall);\n/**\n * An \\\\\"async function\\\\\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (\\`function (arg1, arg2, ..., callback) {}\\`)\n * The final callback is of the form \\`callback(err, results...)\\`, which must be\n * called once the function is completed.  The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with \\`null\\` as the first\n * argument, and any additional \\`result\\` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \\\\\"Node-style async function\\\\\",\n * or a \\\\\"continuation passing-style function\\\\\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 \\`async\\` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the \\`async\\` function will not be passed a final callback\n * argument, and any thrown error will be used as the \\`err\\` argument of the\n * implicit callback, and the return value will be used as the \\`result\\` value.\n * (i.e. a \\`rejected\\` of the returned Promise becomes the \\`err\\` callback\n * argument, and a \\`resolved\\` value becomes the \\`result\\`.)\n *\n * Note, due to JavaScript limitations, we can only detect native \\`async\\`\n * functions and not transpilied implementations.\n * Your environment must have \\`async\\`/\\`await\\` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using \\`async\\` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the \\`async function\\` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\nvar index = {\n    apply,\n    applyEach: applyEach$1,\n    applyEachSeries,\n    asyncify,\n    auto,\n    autoInject,\n    cargo,\n    cargoQueue: cargo$1,\n    compose,\n    concat: concat$1,\n    concatLimit: concatLimit$1,\n    concatSeries: concatSeries$1,\n    constant,\n    detect: detect$1,\n    detectLimit: detectLimit$1,\n    detectSeries: detectSeries$1,\n    dir,\n    doUntil,\n    doWhilst: doWhilst$1,\n    each,\n    eachLimit: eachLimit$2,\n    eachOf: eachOf$1,\n    eachOfLimit: eachOfLimit$2,\n    eachOfSeries: eachOfSeries$1,\n    eachSeries: eachSeries$1,\n    ensureAsync,\n    every: every$1,\n    everyLimit: everyLimit$1,\n    everySeries: everySeries$1,\n    filter: filter$1,\n    filterLimit: filterLimit$1,\n    filterSeries: filterSeries$1,\n    forever: forever$1,\n    groupBy,\n    groupByLimit: groupByLimit$1,\n    groupBySeries,\n    log,\n    map: map$1,\n    mapLimit: mapLimit$1,\n    mapSeries: mapSeries$1,\n    mapValues,\n    mapValuesLimit: mapValuesLimit$1,\n    mapValuesSeries,\n    memoize,\n    nextTick: nextTick$1,\n    parallel,\n    parallelLimit,\n    priorityQueue,\n    queue: queue$1$1,\n    race: race$1,\n    reduce: reduce$1,\n    reduceRight,\n    reflect,\n    reflectAll,\n    reject: reject$2,\n    rejectLimit: rejectLimit$1,\n    rejectSeries: rejectSeries$1,\n    retry,\n    retryable,\n    seq,\n    series,\n    setImmediate: setImmediate$1,\n    some: some$1,\n    someLimit: someLimit$1,\n    someSeries: someSeries$1,\n    sortBy: sortBy$1,\n    timeout,\n    times,\n    timesLimit,\n    timesSeries,\n    transform,\n    tryEach: tryEach$1,\n    unmemoize,\n    until,\n    waterfall: waterfall$1,\n    whilst: whilst$1,\n    // aliases\n    all: every$1,\n    allLimit: everyLimit$1,\n    allSeries: everySeries$1,\n    any: some$1,\n    anyLimit: someLimit$1,\n    anySeries: someSeries$1,\n    find: detect$1,\n    findLimit: detectLimit$1,\n    findSeries: detectSeries$1,\n    flatMap: concat$1,\n    flatMapLimit: concatLimit$1,\n    flatMapSeries: concatSeries$1,\n    forEach: each,\n    forEachSeries: eachSeries$1,\n    forEachLimit: eachLimit$2,\n    forEachOf: eachOf$1,\n    forEachOfSeries: eachOfSeries$1,\n    forEachOfLimit: eachOfLimit$2,\n    inject: reduce$1,\n    foldl: reduce$1,\n    foldr: reduceRight,\n    select: filter$1,\n    selectLimit: filterLimit$1,\n    selectSeries: filterSeries$1,\n    wrapSync: asyncify,\n    during: whilst$1,\n    doDuring: doWhilst$1\n};\nexport default index;\nexport { every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, apply, applyEach$1 as applyEach, applyEachSeries, asyncify, auto, autoInject, cargo, cargo$1 as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doWhilst$1 as doDuring, doUntil, doWhilst$1 as doWhilst, whilst$1 as during, each, eachLimit$2 as eachLimit, eachOf$1 as eachOf, eachOfLimit$2 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, reduce$1 as foldl, reduceRight as foldr, each as forEach, eachLimit$2 as forEachLimit, eachOf$1 as forEachOf, eachOfLimit$2 as forEachOfLimit, eachOfSeries$1 as forEachOfSeries, eachSeries$1 as forEachSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, reduce$1 as inject, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick$1 as nextTick, parallel, parallelLimit, priorityQueue, queue$1$1 as queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$2 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, asyncify as wrapSync };\"\n`;\n\nexports[`dep-list-simple matches the snapshot: web_modules/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"async\\\\\": \\\\\"./async.js\\\\\"\n  }\n}\"\n`;\n"
  },
  {
    "path": "test/esinstall/dep-list-simple/dep-list-simple.test.js",
    "content": "const path = require('path');\nconst {\n  existsPackageJson,\n  runTest,\n  testLockFile,\n  testWebModules,\n} = require('../esinstall-test-utils.js');\n\nrequire('jest-specific-snapshot'); // allows to call expect().toMatchSpecificSnapshot(filename, snapshotName)\n\ndescribe('dep-list-simple', () => {\n  it('matches the snapshot', async () => {\n    const cwd = __dirname;\n\n    if (existsPackageJson(cwd) === false) return;\n\n    // Run Test\n    const {output, snapshotFile} = await runTest(['async'], {cwd});\n\n    // Test output\n    expect(output).toMatchSpecificSnapshot(snapshotFile, 'cli output');\n\n    // Test Lockfile (if one exists)\n    await testLockFile(cwd);\n\n    // Cleanup\n    const {testAllSnapshots, testDiffs} = await testWebModules(cwd, snapshotFile);\n\n    // Assert that the snapshots match\n    testAllSnapshots();\n\n    // If any diffs are detected, we'll assert the difference so that we get nice output.\n    testDiffs();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/dep-list-simple/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-dep-list-simple\",\n  \"dependencies\": {\n    \"async\": \"3.1.0\",\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/error-missing-dep/__snapshots__",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`error-missing-dep matches the snapshot: allFiles 1`] = `Array []`;\n\nexports[`error-missing-dep matches the snapshot: cli output 1`] = `\n\"[snowpack] ! installing dependencies...\n[snowpack] Package \\\\\"fake-module\\\\\" not found. Have you installed it?\"\n`;\n"
  },
  {
    "path": "test/esinstall/error-missing-dep/error-missing-dep.test.js",
    "content": "const path = require('path');\nconst {\n  existsPackageJson,\n  runTest,\n  testLockFile,\n  testWebModules,\n} = require('../esinstall-test-utils.js');\n\nrequire('jest-specific-snapshot'); // allows to call expect().toMatchSpecificSnapshot(filename, snapshotName)\n\ndescribe('error-missing-dep', () => {\n  it('matches the snapshot', async () => {\n    const cwd = __dirname;\n\n    if (existsPackageJson(cwd) === false) return;\n\n    // Run Test\n    try {\n      const {output, snapshotFile} = await runTest(['fakemodule'], {cwd});\n      expect(false).toEqual(true); // should not finish\n    } catch (err) {\n      expect(err.message).toEqual('Package \"fakemodule\" not found. Have you installed it? ');\n    }\n  });\n});\n"
  },
  {
    "path": "test/esinstall/error-missing-dep/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-error-missing-dep\",\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/esinstall-test-utils.js",
    "content": "const {readFileSync, existsSync} = require('fs');\nconst fs = require('fs').promises;\nconst glob = require('glob');\nconst snowpack = require('../../snowpack/lib/cjs');\nconst esinstall = require('../../esinstall/lib');\nconst path = require('path');\nconst {\n  stripEverything,\n  stripLockfile,\n  stripWhitespace,\n  stripSvelteComment,\n  stripChunkHash,\n  stripRev,\n} = require('../test-utils.js');\n\nfunction existsPackageJson(cwd) {\n  if (!existsSync(path.join(cwd, 'package.json'))) {\n    const relativePath = cwd.replace(process.cwd() + '/', '');\n\n    console.warn(\n      '%s folder has no package.json file, it is likely a leftover folder from a deleted test. You can remove the folder with `git clean -xdf %s`',\n      relativePath,\n      relativePath,\n    );\n\n    return false;\n  }\n  return true;\n}\nexports.existsPackageJson = existsPackageJson;\n\nasync function runTest(installTargets, options) {\n  const output = [];\n  const logFn = (...msg) => output.push(...msg);\n  const result = await esinstall.install(installTargets, {\n    ...options,\n    logger: {debug: () => {}, info: logFn, warn: logFn, error: logFn},\n  });\n  const actualOutput = stripEverything(output.join('\\n'));\n  const snapshotFile = path.join(options.cwd, '__snapshots__'); // `jest-specific-snapshot` cannot use the .snap extension, since it conflicts with jest\n\n  return {\n    ...result,\n    output: actualOutput,\n    snapshotFile,\n  };\n}\nexports.runTest = runTest;\n\nasync function testLockFile(cwd) {\n  const expectedLockLoc = path.join(cwd, 'expected-lock.json');\n\n  if (existsSync(expectedLockLoc)) {\n    const expectedLock = await fs.readFile(expectedLockLoc, {encoding: 'utf8'});\n\n    const actualLockLoc = path.join(__dirname, LOCKFILE_NAME);\n    const actualLock = await fs.readFile(actualLockLoc, {encoding: 'utf8'});\n\n    expect(stripLockfile(actualLock)).toBe(stripLockfile(expectedLock));\n  }\n}\nexports.testLockFile = testLockFile;\n\nconst defaultWebModulesTestOptions = {throwIfNoWebModules: true};\nasync function testWebModules(\n  cwd,\n  snapshotFile,\n  {throwIfNoWebModules} = defaultWebModulesTestOptions,\n) {\n  const actual = path.join(cwd, 'web_modules');\n  await new Promise((resolve) => setTimeout(resolve, 100));\n  const allFiles = glob.sync(`**/*`, {\n    ignore: ['**/common/**/*'],\n    cwd: actual,\n    nodir: true,\n  });\n\n  if (allFiles.length === 0 && throwIfNoWebModules) {\n    throw new Error('Empty build directory!');\n  }\n\n  return {\n    testAllSnapshots() {\n      expect(allFiles.map((f) => f.replace(/\\\\/g, '/'))).toMatchSpecificSnapshot(\n        snapshotFile,\n        'allFiles',\n      );\n    },\n    testDiffs() {\n      // If any diffs are detected, we'll assert the difference so that we get nice output.\n      for (const entry of allFiles) {\n        // don’t compare CSS or .map files.\n        if (entry.endsWith('.css') || entry.endsWith('.map')) {\n          continue;\n        }\n        const f1 = readFileSync(path.resolve(actual, entry), {encoding: 'utf8'});\n        expect(\n          stripWhitespace(stripSvelteComment(stripChunkHash(stripRev(f1)))),\n        ).toMatchSpecificSnapshot(snapshotFile, `web_modules/${entry.replace(/\\\\/g, '/')}`);\n      }\n    },\n  };\n}\nexports.testWebModules = testWebModules;\n"
  },
  {
    "path": "test/esinstall/exclude-external-packages/__snapshots__",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`exclude-external-packages matches the snapshot: allFiles 1`] = `\nArray [\n  \"import-map.json\",\n  \"react-dom.js\",\n]\n`;\n\nexports[`exclude-external-packages matches the snapshot: cli output 1`] = `\"\"`;\n\nexports[`exclude-external-packages matches the snapshot: web_modules/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"react-dom\\\\\": \\\\\"./react-dom.js\\\\\"\n  }\n}\"\n`;\n\nexports[`exclude-external-packages matches the snapshot: web_modules/react-dom.js 1`] = `\n\"import require$$0 from 'react';\nfunction createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t\tpath: basedir,\n\t\texports: {},\n\t\trequire: function (path, base) {\n\t\t\treturn commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t\t}\n\t}, fn(module, module.exports), module.exports;\n}\nfunction commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\treturn Object(val);\n}\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc');  // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\nvar objectAssign = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn to;\n};\nvar scheduler_development = createCommonjsModule(function (module, exports) {\n{\n  (function() {\nvar enableSchedulerDebugging = false;\nvar enableProfiling = false;\nvar requestHostCallback;\nvar requestHostTimeout;\nvar cancelHostTimeout;\nvar requestPaint;\nvar hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';\nif (hasPerformanceNow) {\n  var localPerformance = performance;\n  exports.unstable_now = function () {\n    return localPerformance.now();\n  };\n} else {\n  var localDate = Date;\n  var initialTime = localDate.now();\n  exports.unstable_now = function () {\n    return localDate.now() - initialTime;\n  };\n}\nif ( // If Scheduler runs in a non-DOM environment, it falls back to a naive\n// implementation using setTimeout.\ntypeof window === 'undefined' || // Check if MessageChannel is supported, too.\ntypeof MessageChannel !== 'function') {\n  // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,\n  // fallback to a naive implementation.\n  var _callback = null;\n  var _timeoutID = null;\n  var _flushCallback = function () {\n    if (_callback !== null) {\n      try {\n        var currentTime = exports.unstable_now();\n        var hasRemainingTime = true;\n        _callback(hasRemainingTime, currentTime);\n        _callback = null;\n      } catch (e) {\n        setTimeout(_flushCallback, 0);\n        throw e;\n      }\n    }\n  };\n  requestHostCallback = function (cb) {\n    if (_callback !== null) {\n      // Protect against re-entrancy.\n      setTimeout(requestHostCallback, 0, cb);\n    } else {\n      _callback = cb;\n      setTimeout(_flushCallback, 0);\n    }\n  };\n  requestHostTimeout = function (cb, ms) {\n    _timeoutID = setTimeout(cb, ms);\n  };\n  cancelHostTimeout = function () {\n    clearTimeout(_timeoutID);\n  };\n  exports.unstable_shouldYield = function () {\n    return false;\n  };\n  requestPaint = exports.unstable_forceFrameRate = function () {};\n} else {\n  // Capture local references to native APIs, in case a polyfill overrides them.\n  var _setTimeout = window.setTimeout;\n  var _clearTimeout = window.clearTimeout;\n  if (typeof console !== 'undefined') {\n    // TODO: Scheduler no longer requires these methods to be polyfilled. But\n    // maybe we want to continue warning if they don't exist, to preserve the\n    // option to rely on it in the future?\n    var requestAnimationFrame = window.requestAnimationFrame;\n    var cancelAnimationFrame = window.cancelAnimationFrame;\n    if (typeof requestAnimationFrame !== 'function') {\n      // Using console['error'] to evade Babel and ESLint\n      console['error'](\\\\\"This browser doesn't support requestAnimationFrame. \\\\\" + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');\n    }\n    if (typeof cancelAnimationFrame !== 'function') {\n      // Using console['error'] to evade Babel and ESLint\n      console['error'](\\\\\"This browser doesn't support cancelAnimationFrame. \\\\\" + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');\n    }\n  }\n  var isMessageLoopRunning = false;\n  var scheduledHostCallback = null;\n  var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n  // thread, like user events. By default, it yields multiple times per frame.\n  // It does not attempt to align with frame boundaries, since most tasks don't\n  // need to be frame aligned; for those that do, use requestAnimationFrame.\n  var yieldInterval = 5;\n  var deadline = 0; // TODO: Make this configurable\n  {\n    // \\`isInputPending\\` is not available. Since we have no way of knowing if\n    // there's pending input, always yield at the end of the frame.\n    exports.unstable_shouldYield = function () {\n      return exports.unstable_now() >= deadline;\n    }; // Since we yield every frame regardless, \\`requestPaint\\` has no effect.\n    requestPaint = function () {};\n  }\n  exports.unstable_forceFrameRate = function (fps) {\n    if (fps < 0 || fps > 125) {\n      // Using console['error'] to evade Babel and ESLint\n      console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');\n      return;\n    }\n    if (fps > 0) {\n      yieldInterval = Math.floor(1000 / fps);\n    } else {\n      // reset the framerate\n      yieldInterval = 5;\n    }\n  };\n  var performWorkUntilDeadline = function () {\n    if (scheduledHostCallback !== null) {\n      var currentTime = exports.unstable_now(); // Yield after \\`yieldInterval\\` ms, regardless of where we are in the vsync\n      // cycle. This means there's always time remaining at the beginning of\n      // the message event.\n      deadline = currentTime + yieldInterval;\n      var hasTimeRemaining = true;\n      try {\n        var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);\n        if (!hasMoreWork) {\n          isMessageLoopRunning = false;\n          scheduledHostCallback = null;\n        } else {\n          // If there's more work, schedule the next message event at the end\n          // of the preceding one.\n          port.postMessage(null);\n        }\n      } catch (error) {\n        // If a scheduler task throws, exit the current browser task so the\n        // error can be observed.\n        port.postMessage(null);\n        throw error;\n      }\n    } else {\n      isMessageLoopRunning = false;\n    } // Yielding to the browser will give it a chance to paint, so we can\n  };\n  var channel = new MessageChannel();\n  var port = channel.port2;\n  channel.port1.onmessage = performWorkUntilDeadline;\n  requestHostCallback = function (callback) {\n    scheduledHostCallback = callback;\n    if (!isMessageLoopRunning) {\n      isMessageLoopRunning = true;\n      port.postMessage(null);\n    }\n  };\n  requestHostTimeout = function (callback, ms) {\n    taskTimeoutID = _setTimeout(function () {\n      callback(exports.unstable_now());\n    }, ms);\n  };\n  cancelHostTimeout = function () {\n    _clearTimeout(taskTimeoutID);\n    taskTimeoutID = -1;\n  };\n}\nfunction push(heap, node) {\n  var index = heap.length;\n  heap.push(node);\n  siftUp(heap, node, index);\n}\nfunction peek(heap) {\n  var first = heap[0];\n  return first === undefined ? null : first;\n}\nfunction pop(heap) {\n  var first = heap[0];\n  if (first !== undefined) {\n    var last = heap.pop();\n    if (last !== first) {\n      heap[0] = last;\n      siftDown(heap, last, 0);\n    }\n    return first;\n  } else {\n    return null;\n  }\n}\nfunction siftUp(heap, node, i) {\n  var index = i;\n  while (true) {\n    var parentIndex = index - 1 >>> 1;\n    var parent = heap[parentIndex];\n    if (parent !== undefined && compare(parent, node) > 0) {\n      // The parent is larger. Swap positions.\n      heap[parentIndex] = node;\n      heap[index] = parent;\n      index = parentIndex;\n    } else {\n      // The parent is smaller. Exit.\n      return;\n    }\n  }\n}\nfunction siftDown(heap, node, i) {\n  var index = i;\n  var length = heap.length;\n  while (index < length) {\n    var leftIndex = (index + 1) * 2 - 1;\n    var left = heap[leftIndex];\n    var rightIndex = leftIndex + 1;\n    var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n    if (left !== undefined && compare(left, node) < 0) {\n      if (right !== undefined && compare(right, left) < 0) {\n        heap[index] = right;\n        heap[rightIndex] = node;\n        index = rightIndex;\n      } else {\n        heap[index] = left;\n        heap[leftIndex] = node;\n        index = leftIndex;\n      }\n    } else if (right !== undefined && compare(right, node) < 0) {\n      heap[index] = right;\n      heap[rightIndex] = node;\n      index = rightIndex;\n    } else {\n      // Neither child is smaller. Exit.\n      return;\n    }\n  }\n}\nfunction compare(a, b) {\n  // Compare sort index first, then task id.\n  var diff = a.sortIndex - b.sortIndex;\n  return diff !== 0 ? diff : a.id - b.id;\n}\n// TODO: Use symbols?\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\nfunction markTaskErrored(task, ms) {\n}\n/* eslint-disable no-var */\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\nvar maxSigned31BitInt = 1073741823; // Times out immediately\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\nvar USER_BLOCKING_PRIORITY_TIMEOUT = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\nvar IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.\nvar isPerformingWork = false;\nvar isHostCallbackScheduled = false;\nvar isHostTimeoutScheduled = false;\nfunction advanceTimers(currentTime) {\n  // Check for tasks that are no longer delayed and add them to the queue.\n  var timer = peek(timerQueue);\n  while (timer !== null) {\n    if (timer.callback === null) {\n      // Timer was cancelled.\n      pop(timerQueue);\n    } else if (timer.startTime <= currentTime) {\n      // Timer fired. Transfer to the task queue.\n      pop(timerQueue);\n      timer.sortIndex = timer.expirationTime;\n      push(taskQueue, timer);\n    } else {\n      // Remaining timers are pending.\n      return;\n    }\n    timer = peek(timerQueue);\n  }\n}\nfunction handleTimeout(currentTime) {\n  isHostTimeoutScheduled = false;\n  advanceTimers(currentTime);\n  if (!isHostCallbackScheduled) {\n    if (peek(taskQueue) !== null) {\n      isHostCallbackScheduled = true;\n      requestHostCallback(flushWork);\n    } else {\n      var firstTimer = peek(timerQueue);\n      if (firstTimer !== null) {\n        requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n      }\n    }\n  }\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n  isHostCallbackScheduled = false;\n  if (isHostTimeoutScheduled) {\n    // We scheduled a timeout but it's no longer needed. Cancel it.\n    isHostTimeoutScheduled = false;\n    cancelHostTimeout();\n  }\n  isPerformingWork = true;\n  var previousPriorityLevel = currentPriorityLevel;\n  try {\n    var currentTime; if (enableProfiling) ; else {\n      // No catch in prod code path.\n      return workLoop(hasTimeRemaining, initialTime);\n    }\n  } finally {\n    currentTask = null;\n    currentPriorityLevel = previousPriorityLevel;\n    isPerformingWork = false;\n  }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n  var currentTime = initialTime;\n  advanceTimers(currentTime);\n  currentTask = peek(taskQueue);\n  while (currentTask !== null && !(enableSchedulerDebugging )) {\n    if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) {\n      // This currentTask hasn't expired, and we've reached the deadline.\n      break;\n    }\n    var callback = currentTask.callback;\n    if (typeof callback === 'function') {\n      currentTask.callback = null;\n      currentPriorityLevel = currentTask.priorityLevel;\n      var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n      var continuationCallback = callback(didUserCallbackTimeout);\n      currentTime = exports.unstable_now();\n      if (typeof continuationCallback === 'function') {\n        currentTask.callback = continuationCallback;\n      } else {\n        if (currentTask === peek(taskQueue)) {\n          pop(taskQueue);\n        }\n      }\n      advanceTimers(currentTime);\n    } else {\n      pop(taskQueue);\n    }\n    currentTask = peek(taskQueue);\n  } // Return whether there's additional work\n  if (currentTask !== null) {\n    return true;\n  } else {\n    var firstTimer = peek(timerQueue);\n    if (firstTimer !== null) {\n      requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n    }\n    return false;\n  }\n}\nfunction unstable_runWithPriority(priorityLevel, eventHandler) {\n  switch (priorityLevel) {\n    case ImmediatePriority:\n    case UserBlockingPriority:\n    case NormalPriority:\n    case LowPriority:\n    case IdlePriority:\n      break;\n    default:\n      priorityLevel = NormalPriority;\n  }\n  var previousPriorityLevel = currentPriorityLevel;\n  currentPriorityLevel = priorityLevel;\n  try {\n    return eventHandler();\n  } finally {\n    currentPriorityLevel = previousPriorityLevel;\n  }\n}\nfunction unstable_next(eventHandler) {\n  var priorityLevel;\n  switch (currentPriorityLevel) {\n    case ImmediatePriority:\n    case UserBlockingPriority:\n    case NormalPriority:\n      // Shift down to normal priority\n      priorityLevel = NormalPriority;\n      break;\n    default:\n      // Anything lower than normal priority should remain at the current level.\n      priorityLevel = currentPriorityLevel;\n      break;\n  }\n  var previousPriorityLevel = currentPriorityLevel;\n  currentPriorityLevel = priorityLevel;\n  try {\n    return eventHandler();\n  } finally {\n    currentPriorityLevel = previousPriorityLevel;\n  }\n}\nfunction unstable_wrapCallback(callback) {\n  var parentPriorityLevel = currentPriorityLevel;\n  return function () {\n    // This is a fork of runWithPriority, inlined for performance.\n    var previousPriorityLevel = currentPriorityLevel;\n    currentPriorityLevel = parentPriorityLevel;\n    try {\n      return callback.apply(this, arguments);\n    } finally {\n      currentPriorityLevel = previousPriorityLevel;\n    }\n  };\n}\nfunction unstable_scheduleCallback(priorityLevel, callback, options) {\n  var currentTime = exports.unstable_now();\n  var startTime;\n  if (typeof options === 'object' && options !== null) {\n    var delay = options.delay;\n    if (typeof delay === 'number' && delay > 0) {\n      startTime = currentTime + delay;\n    } else {\n      startTime = currentTime;\n    }\n  } else {\n    startTime = currentTime;\n  }\n  var timeout;\n  switch (priorityLevel) {\n    case ImmediatePriority:\n      timeout = IMMEDIATE_PRIORITY_TIMEOUT;\n      break;\n    case UserBlockingPriority:\n      timeout = USER_BLOCKING_PRIORITY_TIMEOUT;\n      break;\n    case IdlePriority:\n      timeout = IDLE_PRIORITY_TIMEOUT;\n      break;\n    case LowPriority:\n      timeout = LOW_PRIORITY_TIMEOUT;\n      break;\n    case NormalPriority:\n    default:\n      timeout = NORMAL_PRIORITY_TIMEOUT;\n      break;\n  }\n  var expirationTime = startTime + timeout;\n  var newTask = {\n    id: taskIdCounter++,\n    callback: callback,\n    priorityLevel: priorityLevel,\n    startTime: startTime,\n    expirationTime: expirationTime,\n    sortIndex: -1\n  };\n  if (startTime > currentTime) {\n    // This is a delayed task.\n    newTask.sortIndex = startTime;\n    push(timerQueue, newTask);\n    if (peek(taskQueue) === null && newTask === peek(timerQueue)) {\n      // All tasks are delayed, and this is the task with the earliest delay.\n      if (isHostTimeoutScheduled) {\n        // Cancel an existing timeout.\n        cancelHostTimeout();\n      } else {\n        isHostTimeoutScheduled = true;\n      } // Schedule a timeout.\n      requestHostTimeout(handleTimeout, startTime - currentTime);\n    }\n  } else {\n    newTask.sortIndex = expirationTime;\n    push(taskQueue, newTask);\n    // wait until the next time we yield.\n    if (!isHostCallbackScheduled && !isPerformingWork) {\n      isHostCallbackScheduled = true;\n      requestHostCallback(flushWork);\n    }\n  }\n  return newTask;\n}\nfunction unstable_pauseExecution() {\n}\nfunction unstable_continueExecution() {\n  if (!isHostCallbackScheduled && !isPerformingWork) {\n    isHostCallbackScheduled = true;\n    requestHostCallback(flushWork);\n  }\n}\nfunction unstable_getFirstCallbackNode() {\n  return peek(taskQueue);\n}\nfunction unstable_cancelCallback(task) {\n  // remove from the queue because you can't remove arbitrary nodes from an\n  // array based heap, only the first one.)\n  task.callback = null;\n}\nfunction unstable_getCurrentPriorityLevel() {\n  return currentPriorityLevel;\n}\nvar unstable_requestPaint = requestPaint;\nvar unstable_Profiling =  null;\nexports.unstable_IdlePriority = IdlePriority;\nexports.unstable_ImmediatePriority = ImmediatePriority;\nexports.unstable_LowPriority = LowPriority;\nexports.unstable_NormalPriority = NormalPriority;\nexports.unstable_Profiling = unstable_Profiling;\nexports.unstable_UserBlockingPriority = UserBlockingPriority;\nexports.unstable_cancelCallback = unstable_cancelCallback;\nexports.unstable_continueExecution = unstable_continueExecution;\nexports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;\nexports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;\nexports.unstable_next = unstable_next;\nexports.unstable_pauseExecution = unstable_pauseExecution;\nexports.unstable_requestPaint = unstable_requestPaint;\nexports.unstable_runWithPriority = unstable_runWithPriority;\nexports.unstable_scheduleCallback = unstable_scheduleCallback;\nexports.unstable_wrapCallback = unstable_wrapCallback;\n  })();\n}\n});\nvar scheduler = createCommonjsModule(function (module) {\n{\n  module.exports = scheduler_development;\n}\n});\nvar schedulerTracing_development = createCommonjsModule(function (module, exports) {\n{\n  (function() {\nvar DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.\nvar interactionIDCounter = 0;\nvar threadIDCounter = 0; // Set of currently traced interactions.\n// Interactions \\\\\"stack\\\\\"–\n// Meaning that newly traced interactions are appended to the previously active set.\n// When an interaction goes out of scope, the previous set (if any) is restored.\nexports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.\nexports.__subscriberRef = null;\n{\n  exports.__interactionsRef = {\n    current: new Set()\n  };\n  exports.__subscriberRef = {\n    current: null\n  };\n}\nfunction unstable_clear(callback) {\n  var prevInteractions = exports.__interactionsRef.current;\n  exports.__interactionsRef.current = new Set();\n  try {\n    return callback();\n  } finally {\n    exports.__interactionsRef.current = prevInteractions;\n  }\n}\nfunction unstable_getCurrent() {\n  {\n    return exports.__interactionsRef.current;\n  }\n}\nfunction unstable_getThreadID() {\n  return ++threadIDCounter;\n}\nfunction unstable_trace(name, timestamp, callback) {\n  var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;\n  var interaction = {\n    __count: 1,\n    id: interactionIDCounter++,\n    name: name,\n    timestamp: timestamp\n  };\n  var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.\n  // To do that, clone the current interactions.\n  // The previous set will be restored upon completion.\n  var interactions = new Set(prevInteractions);\n  interactions.add(interaction);\n  exports.__interactionsRef.current = interactions;\n  var subscriber = exports.__subscriberRef.current;\n  var returnValue;\n  try {\n    if (subscriber !== null) {\n      subscriber.onInteractionTraced(interaction);\n    }\n  } finally {\n    try {\n      if (subscriber !== null) {\n        subscriber.onWorkStarted(interactions, threadID);\n      }\n    } finally {\n      try {\n        returnValue = callback();\n      } finally {\n        exports.__interactionsRef.current = prevInteractions;\n        try {\n          if (subscriber !== null) {\n            subscriber.onWorkStopped(interactions, threadID);\n          }\n        } finally {\n          interaction.__count--; // If no async work was scheduled for this interaction,\n          // Notify subscribers that it's completed.\n          if (subscriber !== null && interaction.__count === 0) {\n            subscriber.onInteractionScheduledWorkCompleted(interaction);\n          }\n        }\n      }\n    }\n  }\n  return returnValue;\n}\nfunction unstable_wrap(callback) {\n  var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;\n  var wrappedInteractions = exports.__interactionsRef.current;\n  var subscriber = exports.__subscriberRef.current;\n  if (subscriber !== null) {\n    subscriber.onWorkScheduled(wrappedInteractions, threadID);\n  } // Update the pending async work count for the current interactions.\n  // Update after calling subscribers in case of error.\n  wrappedInteractions.forEach(function (interaction) {\n    interaction.__count++;\n  });\n  var hasRun = false;\n  function wrapped() {\n    var prevInteractions = exports.__interactionsRef.current;\n    exports.__interactionsRef.current = wrappedInteractions;\n    subscriber = exports.__subscriberRef.current;\n    try {\n      var returnValue;\n      try {\n        if (subscriber !== null) {\n          subscriber.onWorkStarted(wrappedInteractions, threadID);\n        }\n      } finally {\n        try {\n          returnValue = callback.apply(undefined, arguments);\n        } finally {\n          exports.__interactionsRef.current = prevInteractions;\n          if (subscriber !== null) {\n            subscriber.onWorkStopped(wrappedInteractions, threadID);\n          }\n        }\n      }\n      return returnValue;\n    } finally {\n      if (!hasRun) {\n        // We only expect a wrapped function to be executed once,\n        // But in the event that it's executed more than once–\n        // Only decrement the outstanding interaction counts once.\n        hasRun = true; // Update pending async counts for all wrapped interactions.\n        // If this was the last scheduled async work for any of them,\n        // Mark them as completed.\n        wrappedInteractions.forEach(function (interaction) {\n          interaction.__count--;\n          if (subscriber !== null && interaction.__count === 0) {\n            subscriber.onInteractionScheduledWorkCompleted(interaction);\n          }\n        });\n      }\n    }\n  }\n  wrapped.cancel = function cancel() {\n    subscriber = exports.__subscriberRef.current;\n    try {\n      if (subscriber !== null) {\n        subscriber.onWorkCanceled(wrappedInteractions, threadID);\n      }\n    } finally {\n      // Update pending async counts for all wrapped interactions.\n      // If this was the last scheduled async work for any of them,\n      // Mark them as completed.\n      wrappedInteractions.forEach(function (interaction) {\n        interaction.__count--;\n        if (subscriber && interaction.__count === 0) {\n          subscriber.onInteractionScheduledWorkCompleted(interaction);\n        }\n      });\n    }\n  };\n  return wrapped;\n}\nvar subscribers = null;\n{\n  subscribers = new Set();\n}\nfunction unstable_subscribe(subscriber) {\n  {\n    subscribers.add(subscriber);\n    if (subscribers.size === 1) {\n      exports.__subscriberRef.current = {\n        onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,\n        onInteractionTraced: onInteractionTraced,\n        onWorkCanceled: onWorkCanceled,\n        onWorkScheduled: onWorkScheduled,\n        onWorkStarted: onWorkStarted,\n        onWorkStopped: onWorkStopped\n      };\n    }\n  }\n}\nfunction unstable_unsubscribe(subscriber) {\n  {\n    subscribers.delete(subscriber);\n    if (subscribers.size === 0) {\n      exports.__subscriberRef.current = null;\n    }\n  }\n}\nfunction onInteractionTraced(interaction) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onInteractionTraced(interaction);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onInteractionScheduledWorkCompleted(interaction) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onInteractionScheduledWorkCompleted(interaction);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkScheduled(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkScheduled(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkStarted(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkStarted(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkStopped(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkStopped(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkCanceled(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkCanceled(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nexports.unstable_clear = unstable_clear;\nexports.unstable_getCurrent = unstable_getCurrent;\nexports.unstable_getThreadID = unstable_getThreadID;\nexports.unstable_subscribe = unstable_subscribe;\nexports.unstable_trace = unstable_trace;\nexports.unstable_unsubscribe = unstable_unsubscribe;\nexports.unstable_wrap = unstable_wrap;\n  })();\n}\n});\nvar tracing = createCommonjsModule(function (module) {\n{\n  module.exports = schedulerTracing_development;\n}\n});\nvar reactDom_development = createCommonjsModule(function (module, exports) {\n{\n  (function() {\nvar React = require$$0;\nvar _assign = objectAssign;\nvar Scheduler = scheduler;\nvar tracing$1 = tracing;\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\nfunction warn(format) {\n  {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n    printWarning('warn', format, args);\n  }\n}\nfunction error(format) {\n  {\n    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n      args[_key2 - 1] = arguments[_key2];\n    }\n    printWarning('error', format, args);\n  }\n}\nfunction printWarning(level, format, args) {\n  // When changing this logic, you might want to also\n  // update consoleWithStackDev.www.js as well.\n  {\n    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n    var stack = ReactDebugCurrentFrame.getStackAddendum();\n    if (stack !== '') {\n      format += '%s';\n      args = args.concat([stack]);\n    }\n    var argsWithFormat = args.map(function (item) {\n      return '' + item;\n    }); // Careful: RN currently depends on this prefix\n    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n    // breaks IE9: https://github.com/facebook/react/issues/13610\n    // eslint-disable-next-line react-internal/no-production-logging\n    Function.prototype.apply.call(console[level], console, argsWithFormat);\n  }\n}\nif (!React) {\n  {\n    throw Error( \\\\\"ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.\\\\\" );\n  }\n}\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar FundamentalComponent = 20;\nvar ScopeComponent = 21;\nvar Block = 22;\nvar OffscreenComponent = 23;\nvar LegacyHiddenComponent = 24;\n// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.\nvar enableProfilerTimer = true; // Record durations for commit and passive effects phases.\nvar enableFundamentalAPI = false; // Experimental Scope support.\nvar enableNewReconciler = false; // Errors that are thrown while unmounting (or after in the case of passive effects)\nvar warnAboutStringRefs = false;\nvar allNativeEvents = new Set();\n/**\n * Mapping from registration name to event name\n */\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\nvar possibleRegistrationNames =  {} ; // Trust the developer to only use possibleRegistrationNames in true\nfunction registerTwoPhaseEvent(registrationName, dependencies) {\n  registerDirectEvent(registrationName, dependencies);\n  registerDirectEvent(registrationName + 'Capture', dependencies);\n}\nfunction registerDirectEvent(registrationName, dependencies) {\n  {\n    if (registrationNameDependencies[registrationName]) {\n      error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, \\`%s\\`.', registrationName);\n    }\n  }\n  registrationNameDependencies[registrationName] = dependencies;\n  {\n    var lowerCasedName = registrationName.toLowerCase();\n    possibleRegistrationNames[lowerCasedName] = registrationName;\n    if (registrationName === 'onDoubleClick') {\n      possibleRegistrationNames.ondblclick = registrationName;\n    }\n  }\n  for (var i = 0; i < dependencies.length; i++) {\n    allNativeEvents.add(dependencies[i]);\n  }\n}\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the filter are presumed to have this type.\nvar STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n// \\\\\"enumerated\\\\\" attributes with \\\\\"true\\\\\" and \\\\\"false\\\\\" as possible values.\n// When true, it should be set to a \\\\\"true\\\\\" string.\n// When false, it should be set to a \\\\\"false\\\\\" string.\nvar BOOLEANISH_STRING = 2; // A real boolean attribute.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\nvar BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n// For any other value, should be present with that value.\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\nvar POSITIVE_NUMERIC = 6;\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \\\\\":A-Z_a-z\\\\\\\\\\\\\\\\u00C0-\\\\\\\\\\\\\\\\u00D6\\\\\\\\\\\\\\\\u00D8-\\\\\\\\\\\\\\\\u00F6\\\\\\\\\\\\\\\\u00F8-\\\\\\\\\\\\\\\\u02FF\\\\\\\\\\\\\\\\u0370-\\\\\\\\\\\\\\\\u037D\\\\\\\\\\\\\\\\u037F-\\\\\\\\\\\\\\\\u1FFF\\\\\\\\\\\\\\\\u200C-\\\\\\\\\\\\\\\\u200D\\\\\\\\\\\\\\\\u2070-\\\\\\\\\\\\\\\\u218F\\\\\\\\\\\\\\\\u2C00-\\\\\\\\\\\\\\\\u2FEF\\\\\\\\\\\\\\\\u3001-\\\\\\\\\\\\\\\\uD7FF\\\\\\\\\\\\\\\\uF900-\\\\\\\\\\\\\\\\uFDCF\\\\\\\\\\\\\\\\uFDF0-\\\\\\\\\\\\\\\\uFFFD\\\\\";\n/* eslint-enable max-len */\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \\\\\"\\\\\\\\\\\\\\\\-.0-9\\\\\\\\\\\\\\\\u00B7\\\\\\\\\\\\\\\\u0300-\\\\\\\\\\\\\\\\u036F\\\\\\\\\\\\\\\\u203F-\\\\\\\\\\\\\\\\u2040\\\\\";\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n    return true;\n  }\n  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n    return false;\n  }\n  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n    validatedAttributeNameCache[attributeName] = true;\n    return true;\n  }\n  illegalAttributeNameCache[attributeName] = true;\n  {\n    error('Invalid attribute name: \\`%s\\`', attributeName);\n  }\n  return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n  if (propertyInfo !== null) {\n    return propertyInfo.type === RESERVED;\n  }\n  if (isCustomComponentTag) {\n    return false;\n  }\n  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n    return true;\n  }\n  return false;\n}\nfunction shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n  if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n    return false;\n  }\n  switch (typeof value) {\n    case 'function': // $FlowIssue symbol is perfectly valid here\n    case 'symbol':\n      // eslint-disable-line\n      return true;\n    case 'boolean':\n      {\n        if (isCustomComponentTag) {\n          return false;\n        }\n        if (propertyInfo !== null) {\n          return !propertyInfo.acceptsBooleans;\n        } else {\n          var prefix = name.toLowerCase().slice(0, 5);\n          return prefix !== 'data-' && prefix !== 'aria-';\n        }\n      }\n    default:\n      return false;\n  }\n}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n  if (value === null || typeof value === 'undefined') {\n    return true;\n  }\n  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n    return true;\n  }\n  if (isCustomComponentTag) {\n    return false;\n  }\n  if (propertyInfo !== null) {\n    switch (propertyInfo.type) {\n      case BOOLEAN:\n        return !value;\n      case OVERLOADED_BOOLEAN:\n        return value === false;\n      case NUMERIC:\n        return isNaN(value);\n      case POSITIVE_NUMERIC:\n        return isNaN(value) || value < 1;\n    }\n  }\n  return false;\n}\nfunction getPropertyInfo(name) {\n  return properties.hasOwnProperty(name) ? properties[name] : null;\n}\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {\n  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n  this.attributeName = attributeName;\n  this.attributeNamespace = attributeNamespace;\n  this.mustUseProperty = mustUseProperty;\n  this.propertyName = name;\n  this.type = type;\n  this.sanitizeURL = sanitizeURL;\n  this.removeEmptyString = removeEmptyString;\n} // When adding attributes to this list, be sure to also add them to\n// the \\`possibleStandardNames\\` module to ensure casing and incorrect\n// name warnings.\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\nvar reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n// elements (not just inputs). Now that ReactDOMInput assigns to the\n// defaultValue property -- do we need this?\n'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\nreservedProps.forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // A few React string attributes have a different name.\n// This is a mapping from React prop names to the attribute names.\n[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n  var name = _ref[0],\n      attributeName = _ref[1];\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are \\\\\"enumerated\\\\\" HTML attributes that accept \\\\\"true\\\\\" and \\\\\"false\\\\\".\n// In React, we let users pass \\`true\\` and \\`false\\` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n  name.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are \\\\\"enumerated\\\\\" SVG attributes that accept \\\\\"true\\\\\" and \\\\\"false\\\\\".\n// In React, we let users pass \\`true\\` and \\`false\\` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n// Since these are SVG attributes, their attribute names are case-sensitive.\n['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are HTML boolean attributes.\n['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n// on the client side because the browsers are inconsistent. Instead we call focus().\n'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n'itemScope'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n  name.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are the few React props that we set as DOM properties\n// rather than attributes. These are all booleans.\n['checked', // Note: \\`option.selected\\` is not updated if \\`select.multiple\\` is\n// disabled with \\`removeAttribute\\`. We have special logic for handling this.\n'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are HTML attributes that are \\\\\"overloaded booleans\\\\\": they behave like\n// booleans, but can also accept a string value.\n['capture', 'download' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are HTML attributes that must be positive numbers.\n['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These are HTML attributes that must be numbers.\n['rowSpan', 'start'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n  name.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n});\nvar CAMELIZE = /[\\\\\\\\-\\\\\\\\:]([a-z])/g;\nvar capitalize = function (token) {\n  return token[1].toUpperCase();\n}; // This is a list of all SVG attributes that need special casing, namespacing,\n// or boolean value assignment. Regular attributes that just accept strings\n// and have the same names are omitted, just like in the HTML attribute filter.\n// Some of these attributes can be hard to find. This list was created by\n// scraping the MDN documentation.\n['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n  var name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // String SVG attributes with the xlink namespace.\n['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n  var name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL\n  false);\n}); // String SVG attributes with the xml namespace.\n['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n  var name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL\n  false);\n}); // These attribute exists both in HTML and SVG.\n// The attribute name is case-sensitive in SVG so we can't just use\n// the React name like we do for attributes that exist only in HTML.\n['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n  attributeName.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false, // sanitizeURL\n  false);\n}); // These attributes accept URLs. These must not allow javascript: URLS.\n// These will also need to accept Trusted Types object in the future.\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL\nfalse);\n['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n  attributeName.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  true, // sanitizeURL\n  true);\n});\n// and any newline or tab are filtered out as if they're not part of the URL.\n// https://url.spec.whatwg.org/#url-parsing\n// Tab or newline are defined as \\\\\\\\t:\n// https://infra.spec.whatwg.org/#ascii-tab-or-newline\n// A C0 control is a code point in the range \\\\\\\\u0000 NULL to \\\\\\\\u001F\n// INFORMATION SEPARATOR ONE, inclusive:\n// https://infra.spec.whatwg.org/#c0-control-or-space\n/* eslint-disable max-len */\nvar isJavaScriptProtocol = /^[\\\\\\\\u0000-\\\\\\\\u001F ]*j[\\\\\\\\t]*a[\\\\\\\\t]*v[\\\\\\\\t]*a[\\\\\\\\t]*s[\\\\\\\\t]*c[\\\\\\\\t]*r[\\\\\\\\t]*i[\\\\\\\\t]*p[\\\\\\\\t]*t[\\\\\\\\t]*\\\\\\\\:/i;\nvar didWarn = false;\nfunction sanitizeURL(url) {\n  {\n    if (!didWarn && isJavaScriptProtocol.test(url)) {\n      didWarn = true;\n      error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n    }\n  }\n}\n/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \\\\\"expected\\\\\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n  {\n    if (propertyInfo.mustUseProperty) {\n      var propertyName = propertyInfo.propertyName;\n      return node[propertyName];\n    } else {\n      if ( propertyInfo.sanitizeURL) {\n        // If we haven't fully disabled javascript: URLs, and if\n        // the hydration is successful of a javascript: URL, we\n        // still want to warn on the client.\n        sanitizeURL('' + expected);\n      }\n      var attributeName = propertyInfo.attributeName;\n      var stringValue = null;\n      if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n        if (node.hasAttribute(attributeName)) {\n          var value = node.getAttribute(attributeName);\n          if (value === '') {\n            return true;\n          }\n          if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n            return value;\n          }\n          if (value === '' + expected) {\n            return expected;\n          }\n          return value;\n        }\n      } else if (node.hasAttribute(attributeName)) {\n        if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n          // We had an attribute but shouldn't have had one, so read it\n          // for the error message.\n          return node.getAttribute(attributeName);\n        }\n        if (propertyInfo.type === BOOLEAN) {\n          // If this was a boolean, it doesn't matter what the value is\n          // the fact that we have it is the same as the expected.\n          return expected;\n        } // Even if this property uses a namespace we use getAttribute\n        // because we assume its namespaced name is the same as our config.\n        // To use getAttributeNS we need the local name which we don't have\n        // in our config atm.\n        stringValue = node.getAttribute(attributeName);\n      }\n      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n        return stringValue === null ? expected : stringValue;\n      } else if (stringValue === '' + expected) {\n        return expected;\n      } else {\n        return stringValue;\n      }\n    }\n  }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\nfunction getValueForAttribute(node, name, expected) {\n  {\n    if (!isAttributeNameSafe(name)) {\n      return;\n    } // If the object is an opaque reference ID, it's expected that\n    // the next prop is different than the server value, so just return\n    // expected\n    if (isOpaqueHydratingObject(expected)) {\n      return expected;\n    }\n    if (!node.hasAttribute(name)) {\n      return expected === undefined ? undefined : null;\n    }\n    var value = node.getAttribute(name);\n    if (value === '' + expected) {\n      return expected;\n    }\n    return value;\n  }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n  var propertyInfo = getPropertyInfo(name);\n  if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n    return;\n  }\n  if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n    value = null;\n  } // If the prop isn't in the special list, treat it as a simple attribute.\n  if (isCustomComponentTag || propertyInfo === null) {\n    if (isAttributeNameSafe(name)) {\n      var _attributeName = name;\n      if (value === null) {\n        node.removeAttribute(_attributeName);\n      } else {\n        node.setAttribute(_attributeName,  '' + value);\n      }\n    }\n    return;\n  }\n  var mustUseProperty = propertyInfo.mustUseProperty;\n  if (mustUseProperty) {\n    var propertyName = propertyInfo.propertyName;\n    if (value === null) {\n      var type = propertyInfo.type;\n      node[propertyName] = type === BOOLEAN ? false : '';\n    } else {\n      // Contrary to \\`setAttribute\\`, object properties are properly\n      // \\`toString\\`ed by IE8/9.\n      node[propertyName] = value;\n    }\n    return;\n  } // The rest are treated as attributes with special cases.\n  var attributeName = propertyInfo.attributeName,\n      attributeNamespace = propertyInfo.attributeNamespace;\n  if (value === null) {\n    node.removeAttribute(attributeName);\n  } else {\n    var _type = propertyInfo.type;\n    var attributeValue;\n    if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n      // If attribute type is boolean, we know for sure it won't be an execution sink\n      // and we won't require Trusted Type here.\n      attributeValue = '';\n    } else {\n      // \\`setAttribute\\` with objects becomes only \\`[object]\\` in IE8/9,\n      // ('' + value) makes it output the correct toString()-value.\n      {\n        attributeValue = '' + value;\n      }\n      if (propertyInfo.sanitizeURL) {\n        sanitizeURL(attributeValue.toString());\n      }\n    }\n    if (attributeNamespace) {\n      node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n    } else {\n      node.setAttribute(attributeName, attributeValue);\n    }\n  }\n}\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nvar REACT_FRAGMENT_TYPE = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\nif (typeof Symbol === 'function' && Symbol.for) {\n  var symbolFor = Symbol.for;\n  REACT_ELEMENT_TYPE = symbolFor('react.element');\n  REACT_PORTAL_TYPE = symbolFor('react.portal');\n  REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n  REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n  REACT_PROFILER_TYPE = symbolFor('react.profiler');\n  REACT_PROVIDER_TYPE = symbolFor('react.provider');\n  REACT_CONTEXT_TYPE = symbolFor('react.context');\n  REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n  REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n  REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n  REACT_MEMO_TYPE = symbolFor('react.memo');\n  REACT_LAZY_TYPE = symbolFor('react.lazy');\n  REACT_BLOCK_TYPE = symbolFor('react.block');\n  symbolFor('react.server.block');\n  symbolFor('react.fundamental');\n  REACT_SCOPE_TYPE = symbolFor('react.scope');\n  REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n  REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n  REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n  REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable !== 'object') {\n    return null;\n  }\n  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n  if (typeof maybeIterator === 'function') {\n    return maybeIterator;\n  }\n  return null;\n}\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\nfunction disabledLog() {}\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n  {\n    if (disabledDepth === 0) {\n      /* eslint-disable react-internal/no-production-logging */\n      prevLog = console.log;\n      prevInfo = console.info;\n      prevWarn = console.warn;\n      prevError = console.error;\n      prevGroup = console.group;\n      prevGroupCollapsed = console.groupCollapsed;\n      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n      var props = {\n        configurable: true,\n        enumerable: true,\n        value: disabledLog,\n        writable: true\n      }; // $FlowFixMe Flow thinks console is immutable.\n      Object.defineProperties(console, {\n        info: props,\n        log: props,\n        warn: props,\n        error: props,\n        group: props,\n        groupCollapsed: props,\n        groupEnd: props\n      });\n      /* eslint-enable react-internal/no-production-logging */\n    }\n    disabledDepth++;\n  }\n}\nfunction reenableLogs() {\n  {\n    disabledDepth--;\n    if (disabledDepth === 0) {\n      /* eslint-disable react-internal/no-production-logging */\n      var props = {\n        configurable: true,\n        enumerable: true,\n        writable: true\n      }; // $FlowFixMe Flow thinks console is immutable.\n      Object.defineProperties(console, {\n        log: _assign({}, props, {\n          value: prevLog\n        }),\n        info: _assign({}, props, {\n          value: prevInfo\n        }),\n        warn: _assign({}, props, {\n          value: prevWarn\n        }),\n        error: _assign({}, props, {\n          value: prevError\n        }),\n        group: _assign({}, props, {\n          value: prevGroup\n        }),\n        groupCollapsed: _assign({}, props, {\n          value: prevGroupCollapsed\n        }),\n        groupEnd: _assign({}, props, {\n          value: prevGroupEnd\n        })\n      });\n      /* eslint-enable react-internal/no-production-logging */\n    }\n    if (disabledDepth < 0) {\n      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n    }\n  }\n}\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n  {\n    if (prefix === undefined) {\n      // Extract the VM specific prefix used by each line.\n      try {\n        throw Error();\n      } catch (x) {\n        var match = x.stack.trim().match(/( *(at )?)/);\n        prefix = match && match[1] || '';\n      }\n    } // We use the prefix to ensure our stacks line up with native stack frames.\n    return '' + prefix + name;\n  }\n}\nvar reentry = false;\nvar componentFrameCache;\n{\n  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n  componentFrameCache = new PossiblyWeakMap();\n}\nfunction describeNativeComponentFrame(fn, construct) {\n  // If something asked for a stack inside a fake render, it should get ignored.\n  if (!fn || reentry) {\n    return '';\n  }\n  {\n    var frame = componentFrameCache.get(fn);\n    if (frame !== undefined) {\n      return frame;\n    }\n  }\n  var control;\n  reentry = true;\n  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n  Error.prepareStackTrace = undefined;\n  var previousDispatcher;\n  {\n    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n    // for warnings.\n    ReactCurrentDispatcher.current = null;\n    disableLogs();\n  }\n  try {\n    // This should throw.\n    if (construct) {\n      // Something should be setting the props in the constructor.\n      var Fake = function () {\n        throw Error();\n      }; // $FlowFixMe\n      Object.defineProperty(Fake.prototype, 'props', {\n        set: function () {\n          // We use a throwing setter instead of frozen or non-writable props\n          // because that won't throw in a non-strict mode function.\n          throw Error();\n        }\n      });\n      if (typeof Reflect === 'object' && Reflect.construct) {\n        // We construct a different control for this case to include any extra\n        // frames added by the construct call.\n        try {\n          Reflect.construct(Fake, []);\n        } catch (x) {\n          control = x;\n        }\n        Reflect.construct(fn, [], Fake);\n      } else {\n        try {\n          Fake.call();\n        } catch (x) {\n          control = x;\n        }\n        fn.call(Fake.prototype);\n      }\n    } else {\n      try {\n        throw Error();\n      } catch (x) {\n        control = x;\n      }\n      fn();\n    }\n  } catch (sample) {\n    // This is inlined manually because closure doesn't do it for us.\n    if (sample && control && typeof sample.stack === 'string') {\n      // This extracts the first frame from the sample that isn't also in the control.\n      // Skipping one frame that we assume is the frame that calls the two.\n      var sampleLines = sample.stack.split('');\n      var controlLines = control.stack.split('');\n      var s = sampleLines.length - 1;\n      var c = controlLines.length - 1;\n      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n        // We expect at least one stack frame to be shared.\n        // Typically this will be the root most one. However, stack frames may be\n        // cut off due to maximum stack limits. In this case, one maybe cut off\n        // earlier than the other. We assume that the sample is longer or the same\n        // and there for cut off earlier. So we should find the root most frame in\n        // the sample somewhere in the control.\n        c--;\n      }\n      for (; s >= 1 && c >= 0; s--, c--) {\n        // Next we find the first one that isn't the same which should be the\n        // frame that called our sample function and the control.\n        if (sampleLines[s] !== controlLines[c]) {\n          // In V8, the first line is describing the message but other VMs don't.\n          // If we're about to return the first line, and the control is also on the same\n          // line, that's a pretty good indicator that our sample threw at same line as\n          // the control. I.e. before we entered the sample frame. So we ignore this result.\n          // This can happen if you passed a class to function component, or non-function.\n          if (s !== 1 || c !== 1) {\n            do {\n              s--;\n              c--; // We may still have similar intermediate frames from the construct call.\n              // The next one that isn't the same should be our match though.\n              if (c < 0 || sampleLines[s] !== controlLines[c]) {\n                // V8 adds a \\\\\"new\\\\\" prefix for native classes. Let's remove it to make it prettier.\n                var _frame = '' + sampleLines[s].replace(' at new ', ' at ');\n                {\n                  if (typeof fn === 'function') {\n                    componentFrameCache.set(fn, _frame);\n                  }\n                } // Return the line we found.\n                return _frame;\n              }\n            } while (s >= 1 && c >= 0);\n          }\n          break;\n        }\n      }\n    }\n  } finally {\n    reentry = false;\n    {\n      ReactCurrentDispatcher.current = previousDispatcher;\n      reenableLogs();\n    }\n    Error.prepareStackTrace = previousPrepareStackTrace;\n  } // Fallback to just using the name if we couldn't make it throw.\n  var name = fn ? fn.displayName || fn.name : '';\n  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n  {\n    if (typeof fn === 'function') {\n      componentFrameCache.set(fn, syntheticFrame);\n    }\n  }\n  return syntheticFrame;\n}\nfunction describeClassComponentFrame(ctor, source, ownerFn) {\n  {\n    return describeNativeComponentFrame(ctor, true);\n  }\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n  {\n    return describeNativeComponentFrame(fn, false);\n  }\n}\nfunction shouldConstruct(Component) {\n  var prototype = Component.prototype;\n  return !!(prototype && prototype.isReactComponent);\n}\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n  if (type == null) {\n    return '';\n  }\n  if (typeof type === 'function') {\n    {\n      return describeNativeComponentFrame(type, shouldConstruct(type));\n    }\n  }\n  if (typeof type === 'string') {\n    return describeBuiltInComponentFrame(type);\n  }\n  switch (type) {\n    case REACT_SUSPENSE_TYPE:\n      return describeBuiltInComponentFrame('Suspense');\n    case REACT_SUSPENSE_LIST_TYPE:\n      return describeBuiltInComponentFrame('SuspenseList');\n  }\n  if (typeof type === 'object') {\n    switch (type.$$typeof) {\n      case REACT_FORWARD_REF_TYPE:\n        return describeFunctionComponentFrame(type.render);\n      case REACT_MEMO_TYPE:\n        // Memo may contain any component type so we recursively resolve it.\n        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n      case REACT_BLOCK_TYPE:\n        return describeFunctionComponentFrame(type._render);\n      case REACT_LAZY_TYPE:\n        {\n          var lazyComponent = type;\n          var payload = lazyComponent._payload;\n          var init = lazyComponent._init;\n          try {\n            // Lazy may contain any component type so we recursively resolve it.\n            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n          } catch (x) {}\n        }\n    }\n  }\n  return '';\n}\nfunction describeFiber(fiber) {\n  var owner =  fiber._debugOwner ? fiber._debugOwner.type : null ;\n  var source =  fiber._debugSource ;\n  switch (fiber.tag) {\n    case HostComponent:\n      return describeBuiltInComponentFrame(fiber.type);\n    case LazyComponent:\n      return describeBuiltInComponentFrame('Lazy');\n    case SuspenseComponent:\n      return describeBuiltInComponentFrame('Suspense');\n    case SuspenseListComponent:\n      return describeBuiltInComponentFrame('SuspenseList');\n    case FunctionComponent:\n    case IndeterminateComponent:\n    case SimpleMemoComponent:\n      return describeFunctionComponentFrame(fiber.type);\n    case ForwardRef:\n      return describeFunctionComponentFrame(fiber.type.render);\n    case Block:\n      return describeFunctionComponentFrame(fiber.type._render);\n    case ClassComponent:\n      return describeClassComponentFrame(fiber.type);\n    default:\n      return '';\n  }\n}\nfunction getStackByFiberInDevAndProd(workInProgress) {\n  try {\n    var info = '';\n    var node = workInProgress;\n    do {\n      info += describeFiber(node);\n      node = node.return;\n    } while (node);\n    return info;\n  } catch (x) {\n    return 'Error generating stack: ' + x.message + '' + x.stack;\n  }\n}\nfunction getWrappedName(outerType, innerType, wrapperName) {\n  var functionName = innerType.displayName || innerType.name || '';\n  return outerType.displayName || (functionName !== '' ? wrapperName + \\\\\"(\\\\\" + functionName + \\\\\")\\\\\" : wrapperName);\n}\nfunction getContextName(type) {\n  return type.displayName || 'Context';\n}\nfunction getComponentName(type) {\n  if (type == null) {\n    // Host root, text node or just invalid type.\n    return null;\n  }\n  {\n    if (typeof type.tag === 'number') {\n      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n    }\n  }\n  if (typeof type === 'function') {\n    return type.displayName || type.name || null;\n  }\n  if (typeof type === 'string') {\n    return type;\n  }\n  switch (type) {\n    case REACT_FRAGMENT_TYPE:\n      return 'Fragment';\n    case REACT_PORTAL_TYPE:\n      return 'Portal';\n    case REACT_PROFILER_TYPE:\n      return 'Profiler';\n    case REACT_STRICT_MODE_TYPE:\n      return 'StrictMode';\n    case REACT_SUSPENSE_TYPE:\n      return 'Suspense';\n    case REACT_SUSPENSE_LIST_TYPE:\n      return 'SuspenseList';\n  }\n  if (typeof type === 'object') {\n    switch (type.$$typeof) {\n      case REACT_CONTEXT_TYPE:\n        var context = type;\n        return getContextName(context) + '.Consumer';\n      case REACT_PROVIDER_TYPE:\n        var provider = type;\n        return getContextName(provider._context) + '.Provider';\n      case REACT_FORWARD_REF_TYPE:\n        return getWrappedName(type, type.render, 'ForwardRef');\n      case REACT_MEMO_TYPE:\n        return getComponentName(type.type);\n      case REACT_BLOCK_TYPE:\n        return getComponentName(type._render);\n      case REACT_LAZY_TYPE:\n        {\n          var lazyComponent = type;\n          var payload = lazyComponent._payload;\n          var init = lazyComponent._init;\n          try {\n            return getComponentName(init(payload));\n          } catch (x) {\n            return null;\n          }\n        }\n    }\n  }\n  return null;\n}\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\nvar current = null;\nvar isRendering = false;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n  {\n    if (current === null) {\n      return null;\n    }\n    var owner = current._debugOwner;\n    if (owner !== null && typeof owner !== 'undefined') {\n      return getComponentName(owner.type);\n    }\n  }\n  return null;\n}\nfunction getCurrentFiberStackInDev() {\n  {\n    if (current === null) {\n      return '';\n    } // Safe because if current fiber exists, we are reconciling,\n    // and it is guaranteed to be the work-in-progress version.\n    return getStackByFiberInDevAndProd(current);\n  }\n}\nfunction resetCurrentFiber() {\n  {\n    ReactDebugCurrentFrame.getCurrentStack = null;\n    current = null;\n    isRendering = false;\n  }\n}\nfunction setCurrentFiber(fiber) {\n  {\n    ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;\n    current = fiber;\n    isRendering = false;\n  }\n}\nfunction setIsRendering(rendering) {\n  {\n    isRendering = rendering;\n  }\n}\nfunction getIsRendering() {\n  {\n    return isRendering;\n  }\n}\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n  return '' + value;\n}\nfunction getToStringValue(value) {\n  switch (typeof value) {\n    case 'boolean':\n    case 'number':\n    case 'object':\n    case 'string':\n    case 'undefined':\n      return value;\n    default:\n      // function, symbol are assigned as empty strings\n      return '';\n  }\n}\nvar hasReadOnlyValue = {\n  button: true,\n  checkbox: true,\n  image: true,\n  hidden: true,\n  radio: true,\n  reset: true,\n  submit: true\n};\nfunction checkControlledValueProps(tagName, props) {\n  {\n    if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {\n      error('You provided a \\`value\\` prop to a form field without an ' + '\\`onChange\\` handler. This will render a read-only field. If ' + 'the field should be mutable use \\`defaultValue\\`. Otherwise, ' + 'set either \\`onChange\\` or \\`readOnly\\`.');\n    }\n    if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {\n      error('You provided a \\`checked\\` prop to a form field without an ' + '\\`onChange\\` handler. This will render a read-only field. If ' + 'the field should be mutable use \\`defaultChecked\\`. Otherwise, ' + 'set either \\`onChange\\` or \\`readOnly\\`.');\n    }\n  }\n}\nfunction isCheckable(elem) {\n  var type = elem.type;\n  var nodeName = elem.nodeName;\n  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\nfunction getTracker(node) {\n  return node._valueTracker;\n}\nfunction detachTracker(node) {\n  node._valueTracker = null;\n}\nfunction getValueFromNode(node) {\n  var value = '';\n  if (!node) {\n    return value;\n  }\n  if (isCheckable(node)) {\n    value = node.checked ? 'true' : 'false';\n  } else {\n    value = node.value;\n  }\n  return value;\n}\nfunction trackValueOnNode(node) {\n  var valueField = isCheckable(node) ? 'checked' : 'value';\n  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n  var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n  // and don't track value will cause over reporting of changes,\n  // but it's better then a hard failure\n  // (needed for certain tests that spyOn input values and Safari)\n  if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n    return;\n  }\n  var get = descriptor.get,\n      set = descriptor.set;\n  Object.defineProperty(node, valueField, {\n    configurable: true,\n    get: function () {\n      return get.call(this);\n    },\n    set: function (value) {\n      currentValue = '' + value;\n      set.call(this, value);\n    }\n  }); // We could've passed this the first time\n  // but it triggers a bug in IE11 and Edge 14/15.\n  // Calling defineProperty() again should be equivalent.\n  // https://github.com/facebook/react/issues/11768\n  Object.defineProperty(node, valueField, {\n    enumerable: descriptor.enumerable\n  });\n  var tracker = {\n    getValue: function () {\n      return currentValue;\n    },\n    setValue: function (value) {\n      currentValue = '' + value;\n    },\n    stopTracking: function () {\n      detachTracker(node);\n      delete node[valueField];\n    }\n  };\n  return tracker;\n}\nfunction track(node) {\n  if (getTracker(node)) {\n    return;\n  } // TODO: Once it's just Fiber we can move this to node._wrapperState\n  node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n  if (!node) {\n    return false;\n  }\n  var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n  // that trying again will succeed\n  if (!tracker) {\n    return true;\n  }\n  var lastValue = tracker.getValue();\n  var nextValue = getValueFromNode(node);\n  if (nextValue !== lastValue) {\n    tracker.setValue(nextValue);\n    return true;\n  }\n  return false;\n}\nfunction getActiveElement(doc) {\n  doc = doc || (typeof document !== 'undefined' ? document : undefined);\n  if (typeof doc === 'undefined') {\n    return null;\n  }\n  try {\n    return doc.activeElement || doc.body;\n  } catch (e) {\n    return doc.body;\n  }\n}\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\nfunction isControlled(props) {\n  var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n  return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an <input> host component that allows setting these optional\n * props: \\`checked\\`, \\`value\\`, \\`defaultChecked\\`, and \\`defaultValue\\`.\n *\n * If \\`checked\\` or \\`value\\` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or \\`defaultChecked\\`)\n * with an empty value (or \\`defaultValue\\`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\nfunction getHostProps(element, props) {\n  var node = element;\n  var checked = props.checked;\n  var hostProps = _assign({}, props, {\n    defaultChecked: undefined,\n    defaultValue: undefined,\n    value: undefined,\n    checked: checked != null ? checked : node._wrapperState.initialChecked\n  });\n  return hostProps;\n}\nfunction initWrapperState(element, props) {\n  {\n    checkControlledValueProps('input', props);\n    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n      error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n      didWarnCheckedDefaultChecked = true;\n    }\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n      error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n      didWarnValueDefaultValue = true;\n    }\n  }\n  var node = element;\n  var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n  node._wrapperState = {\n    initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n    initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n    controlled: isControlled(props)\n  };\n}\nfunction updateChecked(element, props) {\n  var node = element;\n  var checked = props.checked;\n  if (checked != null) {\n    setValueForProperty(node, 'checked', checked, false);\n  }\n}\nfunction updateWrapper(element, props) {\n  var node = element;\n  {\n    var controlled = isControlled(props);\n    if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n      error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');\n      didWarnUncontrolledToControlled = true;\n    }\n    if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n      error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components');\n      didWarnControlledToUncontrolled = true;\n    }\n  }\n  updateChecked(element, props);\n  var value = getToStringValue(props.value);\n  var type = props.type;\n  if (value != null) {\n    if (type === 'number') {\n      if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n      // eslint-disable-next-line\n      node.value != value) {\n        node.value = toString(value);\n      }\n    } else if (node.value !== toString(value)) {\n      node.value = toString(value);\n    }\n  } else if (type === 'submit' || type === 'reset') {\n    // Submit/reset inputs need the attribute removed completely to avoid\n    // blank-text buttons.\n    node.removeAttribute('value');\n    return;\n  }\n  {\n    // When syncing the value attribute, the value comes from a cascade of\n    // properties:\n    //  1. The value React property\n    //  2. The defaultValue React property\n    //  3. Otherwise there should be no change\n    if (props.hasOwnProperty('value')) {\n      setDefaultValue(node, props.type, value);\n    } else if (props.hasOwnProperty('defaultValue')) {\n      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n    }\n  }\n  {\n    // When syncing the checked attribute, it only changes when it needs\n    // to be removed, such as transitioning from a checkbox into a text input\n    if (props.checked == null && props.defaultChecked != null) {\n      node.defaultChecked = !!props.defaultChecked;\n    }\n  }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n  var node = element; // Do not assign value if it is already set. This prevents user text input\n  // from being lost during SSR hydration.\n  if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n    var type = props.type;\n    var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n    // default value provided by the browser. See: #12872\n    if (isButton && (props.value === undefined || props.value === null)) {\n      return;\n    }\n    var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n    // from being lost during SSR hydration.\n    if (!isHydrating) {\n      {\n        // When syncing the value attribute, the value property should use\n        // the wrapperState._initialValue property. This uses:\n        //\n        //   1. The value React property when present\n        //   2. The defaultValue React property when present\n        //   3. An empty string\n        if (initialValue !== node.value) {\n          node.value = initialValue;\n        }\n      }\n    }\n    {\n      // Otherwise, the value attribute is synchronized to the property,\n      // so we assign defaultValue to the same thing as the value property\n      // assignment step above.\n      node.defaultValue = initialValue;\n    }\n  } // Normally, we'd just do \\`node.checked = node.checked\\` upon initial mount, less this bug\n  // this is needed to work around a chrome bug where setting defaultChecked\n  // will sometimes influence the value of checked (even after detachment).\n  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n  // We need to temporarily unset name to avoid disrupting radio button groups.\n  var name = node.name;\n  if (name !== '') {\n    node.name = '';\n  }\n  {\n    // When syncing the checked attribute, both the checked property and\n    // attribute are assigned at the same time using defaultChecked. This uses:\n    //\n    //   1. The checked React property when present\n    //   2. The defaultChecked React property when present\n    //   3. Otherwise, false\n    node.defaultChecked = !node.defaultChecked;\n    node.defaultChecked = !!node._wrapperState.initialChecked;\n  }\n  if (name !== '') {\n    node.name = name;\n  }\n}\nfunction restoreControlledState(element, props) {\n  var node = element;\n  updateWrapper(node, props);\n  updateNamedCousins(node, props);\n}\nfunction updateNamedCousins(rootNode, props) {\n  var name = props.name;\n  if (props.type === 'radio' && name != null) {\n    var queryRoot = rootNode;\n    while (queryRoot.parentNode) {\n      queryRoot = queryRoot.parentNode;\n    } // If \\`rootNode.form\\` was non-null, then we could try \\`form.elements\\`,\n    // but that sometimes behaves strangely in IE8. We could also try using\n    // \\`form.getElementsByName\\`, but that will only return direct children\n    // and won't include inputs that use the HTML5 \\`form=\\` attribute. Since\n    // the input might not even be in a form. It might not even be in the\n    // document. Let's just use the local \\`querySelectorAll\\` to ensure we don't\n    // miss anything.\n    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\\\\\"radio\\\\\"]');\n    for (var i = 0; i < group.length; i++) {\n      var otherNode = group[i];\n      if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n        continue;\n      } // This will throw if radio buttons rendered by different copies of React\n      // and the same name are rendered into the same form (same as #1939).\n      // That's probably okay; we don't support it just as we don't support\n      // mixing React radio buttons with non-React ones.\n      var otherProps = getFiberCurrentPropsFromNode(otherNode);\n      if (!otherProps) {\n        {\n          throw Error( \\\\\"ReactDOMInput: Mixing React and non-React radio inputs with the same \\`name\\` is not supported.\\\\\" );\n        }\n      } // We need update the tracked value on the named cousin since the value\n      // was changed but the input saw no event or value set\n      updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n      // was previously checked to update will cause it to be come re-checked\n      // as appropriate.\n      updateWrapper(otherNode, otherProps);\n    }\n  }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \\\\\"The specified value <x> is not a valid email address\\\\\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\nfunction setDefaultValue(node, type, value) {\n  if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n  type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n    if (value == null) {\n      node.defaultValue = toString(node._wrapperState.initialValue);\n    } else if (node.defaultValue !== toString(value)) {\n      node.defaultValue = toString(value);\n    }\n  }\n}\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\nfunction flattenChildren(children) {\n  var content = ''; // Flatten children. We'll warn if they are invalid\n  // during validateProps() which runs for hydration too.\n  // Note that this would throw on non-element objects.\n  // Elements are stringified (which is normally irrelevant\n  // but matters for <fbt>).\n  React.Children.forEach(children, function (child) {\n    if (child == null) {\n      return;\n    }\n    content += child; // Note: we don't warn about invalid children here.\n    // Instead, this is done separately below so that\n    // it happens during the hydration code path too.\n  });\n  return content;\n}\n/**\n * Implements an <option> host component that warns when \\`selected\\` is set.\n */\nfunction validateProps(element, props) {\n  {\n    // This mirrors the code path above, but runs for hydration too.\n    // Warn about invalid children here so that client and hydration are consistent.\n    // TODO: this seems like it could cause a DEV-only throw for hydration\n    // if children contains a non-element object. We should try to avoid that.\n    if (typeof props.children === 'object' && props.children !== null) {\n      React.Children.forEach(props.children, function (child) {\n        if (child == null) {\n          return;\n        }\n        if (typeof child === 'string' || typeof child === 'number') {\n          return;\n        }\n        if (typeof child.type !== 'string') {\n          return;\n        }\n        if (!didWarnInvalidChild) {\n          didWarnInvalidChild = true;\n          error('Only strings and numbers are supported as <option> children.');\n        }\n      });\n    } // TODO: Remove support for \\`selected\\` in <option>.\n    if (props.selected != null && !didWarnSelectedSetOnOption) {\n      error('Use the \\`defaultValue\\` or \\`value\\` props on <select> instead of ' + 'setting \\`selected\\` on <option>.');\n      didWarnSelectedSetOnOption = true;\n    }\n  }\n}\nfunction postMountWrapper$1(element, props) {\n  // value=\\\\\"\\\\\" should make a value attribute (#6219)\n  if (props.value != null) {\n    element.setAttribute('value', toString(getToStringValue(props.value)));\n  }\n}\nfunction getHostProps$1(element, props) {\n  var hostProps = _assign({\n    children: undefined\n  }, props);\n  var content = flattenChildren(props.children);\n  if (content) {\n    hostProps.children = content;\n  }\n  return hostProps;\n}\nvar didWarnValueDefaultValue$1;\n{\n  didWarnValueDefaultValue$1 = false;\n}\nfunction getDeclarationErrorAddendum() {\n  var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n  if (ownerName) {\n    return 'Check the render method of \\`' + ownerName + '\\`.';\n  }\n  return '';\n}\nvar valuePropNames = ['value', 'defaultValue'];\n/**\n * Validation function for \\`value\\` and \\`defaultValue\\`.\n */\nfunction checkSelectPropTypes(props) {\n  {\n    checkControlledValueProps('select', props);\n    for (var i = 0; i < valuePropNames.length; i++) {\n      var propName = valuePropNames[i];\n      if (props[propName] == null) {\n        continue;\n      }\n      var isArray = Array.isArray(props[propName]);\n      if (props.multiple && !isArray) {\n        error('The \\`%s\\` prop supplied to <select> must be an array if ' + '\\`multiple\\` is true.%s', propName, getDeclarationErrorAddendum());\n      } else if (!props.multiple && isArray) {\n        error('The \\`%s\\` prop supplied to <select> must be a scalar ' + 'value if \\`multiple\\` is false.%s', propName, getDeclarationErrorAddendum());\n      }\n    }\n  }\n}\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n  var options = node.options;\n  if (multiple) {\n    var selectedValues = propValue;\n    var selectedValue = {};\n    for (var i = 0; i < selectedValues.length; i++) {\n      // Prefix to avoid chaos with special keys.\n      selectedValue['$' + selectedValues[i]] = true;\n    }\n    for (var _i = 0; _i < options.length; _i++) {\n      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n      if (options[_i].selected !== selected) {\n        options[_i].selected = selected;\n      }\n      if (selected && setDefaultSelected) {\n        options[_i].defaultSelected = true;\n      }\n    }\n  } else {\n    // Do not set \\`select.value\\` as exact behavior isn't consistent across all\n    // browsers for all cases.\n    var _selectedValue = toString(getToStringValue(propValue));\n    var defaultSelected = null;\n    for (var _i2 = 0; _i2 < options.length; _i2++) {\n      if (options[_i2].value === _selectedValue) {\n        options[_i2].selected = true;\n        if (setDefaultSelected) {\n          options[_i2].defaultSelected = true;\n        }\n        return;\n      }\n      if (defaultSelected === null && !options[_i2].disabled) {\n        defaultSelected = options[_i2];\n      }\n    }\n    if (defaultSelected !== null) {\n      defaultSelected.selected = true;\n    }\n  }\n}\n/**\n * Implements a <select> host component that allows optionally setting the\n * props \\`value\\` and \\`defaultValue\\`. If \\`multiple\\` is false, the prop must be a\n * stringable. If \\`multiple\\` is true, the prop must be an array of stringables.\n *\n * If \\`value\\` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the \\`value\\` prop must change in\n * order for the rendered options to update.\n *\n * If \\`defaultValue\\` is provided, any options with the supplied values will be\n * selected.\n */\nfunction getHostProps$2(element, props) {\n  return _assign({}, props, {\n    value: undefined\n  });\n}\nfunction initWrapperState$1(element, props) {\n  var node = element;\n  {\n    checkSelectPropTypes(props);\n  }\n  node._wrapperState = {\n    wasMultiple: !!props.multiple\n  };\n  {\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n      error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components');\n      didWarnValueDefaultValue$1 = true;\n    }\n  }\n}\nfunction postMountWrapper$2(element, props) {\n  var node = element;\n  node.multiple = !!props.multiple;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  } else if (props.defaultValue != null) {\n    updateOptions(node, !!props.multiple, props.defaultValue, true);\n  }\n}\nfunction postUpdateWrapper(element, props) {\n  var node = element;\n  var wasMultiple = node._wrapperState.wasMultiple;\n  node._wrapperState.wasMultiple = !!props.multiple;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  } else if (wasMultiple !== !!props.multiple) {\n    // For simplicity, reapply \\`defaultValue\\` if \\`multiple\\` is toggled.\n    if (props.defaultValue != null) {\n      updateOptions(node, !!props.multiple, props.defaultValue, true);\n    } else {\n      // Revert the select back to its default unselected state.\n      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n    }\n  }\n}\nfunction restoreControlledState$1(element, props) {\n  var node = element;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  }\n}\nvar didWarnValDefaultVal = false;\n/**\n * Implements a <textarea> host component that allows setting \\`value\\`, and\n * \\`defaultValue\\`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If \\`value\\` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If \\`value\\` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the \\`value\\` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * \\`defaultValue\\` if specified, or the children content (deprecated).\n */\nfunction getHostProps$3(element, props) {\n  var node = element;\n  if (!(props.dangerouslySetInnerHTML == null)) {\n    {\n      throw Error( \\\\\"\\`dangerouslySetInnerHTML\\` does not make sense on <textarea>.\\\\\" );\n    }\n  } // Always set children to the same thing. In IE9, the selection range will\n  // get reset if \\`textContent\\` is mutated.  We could add a check in setTextContent\n  // to only set the value if/when the value differs from the node value (which would\n  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n  // solution. The value can be a boolean or object so that's why it's forced\n  // to be a string.\n  var hostProps = _assign({}, props, {\n    value: undefined,\n    defaultValue: undefined,\n    children: toString(node._wrapperState.initialValue)\n  });\n  return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n  var node = element;\n  {\n    checkControlledValueProps('textarea', props);\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n      error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n      didWarnValDefaultVal = true;\n    }\n  }\n  var initialValue = props.value; // Only bother fetching default value if we're going to use it\n  if (initialValue == null) {\n    var children = props.children,\n        defaultValue = props.defaultValue;\n    if (children != null) {\n      {\n        error('Use the \\`defaultValue\\` or \\`value\\` props instead of setting ' + 'children on <textarea>.');\n      }\n      {\n        if (!(defaultValue == null)) {\n          {\n            throw Error( \\\\\"If you supply \\`defaultValue\\` on a <textarea>, do not pass children.\\\\\" );\n          }\n        }\n        if (Array.isArray(children)) {\n          if (!(children.length <= 1)) {\n            {\n              throw Error( \\\\\"<textarea> can only have at most one child.\\\\\" );\n            }\n          }\n          children = children[0];\n        }\n        defaultValue = children;\n      }\n    }\n    if (defaultValue == null) {\n      defaultValue = '';\n    }\n    initialValue = defaultValue;\n  }\n  node._wrapperState = {\n    initialValue: getToStringValue(initialValue)\n  };\n}\nfunction updateWrapper$1(element, props) {\n  var node = element;\n  var value = getToStringValue(props.value);\n  var defaultValue = getToStringValue(props.defaultValue);\n  if (value != null) {\n    // Cast \\`value\\` to a string to ensure the value is set correctly. While\n    // browsers typically do this as necessary, jsdom doesn't.\n    var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed\n    if (newValue !== node.value) {\n      node.value = newValue;\n    }\n    if (props.defaultValue == null && node.defaultValue !== newValue) {\n      node.defaultValue = newValue;\n    }\n  }\n  if (defaultValue != null) {\n    node.defaultValue = toString(defaultValue);\n  }\n}\nfunction postMountWrapper$3(element, props) {\n  var node = element; // This is in postMount because we need access to the DOM node, which is not\n  // available until after the component has mounted.\n  var textContent = node.textContent; // Only set node.value if textContent is equal to the expected\n  // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n  // will populate textContent as well.\n  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n  if (textContent === node._wrapperState.initialValue) {\n    if (textContent !== '' && textContent !== null) {\n      node.value = textContent;\n    }\n  }\n}\nfunction restoreControlledState$2(element, props) {\n  // DOM component is still mounted; update\n  updateWrapper$1(element, props);\n}\nvar HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nvar Namespaces = {\n  html: HTML_NAMESPACE,\n  mathml: MATH_NAMESPACE,\n  svg: SVG_NAMESPACE\n}; // Assumes there is no parent namespace.\nfunction getIntrinsicNamespace(type) {\n  switch (type) {\n    case 'svg':\n      return SVG_NAMESPACE;\n    case 'math':\n      return MATH_NAMESPACE;\n    default:\n      return HTML_NAMESPACE;\n  }\n}\nfunction getChildNamespace(parentNamespace, type) {\n  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n    // No (or default) parent namespace: potential entry point.\n    return getIntrinsicNamespace(type);\n  }\n  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n    // We're leaving SVG.\n    return HTML_NAMESPACE;\n  } // By default, pass namespace below.\n  return parentNamespace;\n}\n/* globals MSApp */\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n    return function (arg0, arg1, arg2, arg3) {\n      MSApp.execUnsafeLocalFunction(function () {\n        return func(arg0, arg1, arg2, arg3);\n      });\n    };\n  } else {\n    return func;\n  }\n};\nvar reusableSVGContainer;\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n  if (node.namespaceURI === Namespaces.svg) {\n    if (!('innerHTML' in node)) {\n      // IE does not have innerHTML for SVG nodes, so instead we inject the\n      // new markup in a temp node and then move the child nodes across into\n      // the target node\n      reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n      reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';\n      var svgNode = reusableSVGContainer.firstChild;\n      while (node.firstChild) {\n        node.removeChild(node.firstChild);\n      }\n      while (svgNode.firstChild) {\n        node.appendChild(svgNode.firstChild);\n      }\n      return;\n    }\n  }\n  node.innerHTML = html;\n});\n/**\n * HTML nodeType values that represent the type of the node\n */\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n/**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the \\`nodeValue\\` of the Text node directly instead of using\n * \\`.textContent\\` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\nvar setTextContent = function (node, text) {\n  if (text) {\n    var firstChild = node.firstChild;\n    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n      firstChild.nodeValue = text;\n      return;\n    }\n  }\n  node.textContent = text;\n};\n// List derived from Gecko source code:\n// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js\nvar shorthandToLonghand = {\n  animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n  background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n  backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n  border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n  borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n  borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n  borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n  borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n  borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n  borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n  borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n  borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n  borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n  borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n  borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n  borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n  borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n  columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n  columns: ['columnCount', 'columnWidth'],\n  flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n  flexFlow: ['flexDirection', 'flexWrap'],\n  font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n  fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n  gap: ['columnGap', 'rowGap'],\n  grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n  gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n  gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n  gridColumnGap: ['columnGap'],\n  gridGap: ['columnGap', 'rowGap'],\n  gridRow: ['gridRowEnd', 'gridRowStart'],\n  gridRowGap: ['rowGap'],\n  gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n  listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n  margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n  marker: ['markerEnd', 'markerMid', 'markerStart'],\n  mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n  maskPosition: ['maskPositionX', 'maskPositionY'],\n  outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n  overflow: ['overflowX', 'overflowY'],\n  padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n  placeContent: ['alignContent', 'justifyContent'],\n  placeItems: ['alignItems', 'justifyItems'],\n  placeSelf: ['alignSelf', 'justifySelf'],\n  textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n  textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n  transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n  wordWrap: ['overflowWrap']\n};\n/**\n * CSS properties which accept numbers but are not in units of \\\\\"px\\\\\".\n */\nvar isUnitlessNumber = {\n  animationIterationCount: true,\n  borderImageOutset: true,\n  borderImageSlice: true,\n  borderImageWidth: true,\n  boxFlex: true,\n  boxFlexGroup: true,\n  boxOrdinalGroup: true,\n  columnCount: true,\n  columns: true,\n  flex: true,\n  flexGrow: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  flexOrder: true,\n  gridArea: true,\n  gridRow: true,\n  gridRowEnd: true,\n  gridRowSpan: true,\n  gridRowStart: true,\n  gridColumn: true,\n  gridColumnEnd: true,\n  gridColumnSpan: true,\n  gridColumnStart: true,\n  fontWeight: true,\n  lineClamp: true,\n  lineHeight: true,\n  opacity: true,\n  order: true,\n  orphans: true,\n  tabSize: true,\n  widows: true,\n  zIndex: true,\n  zoom: true,\n  // SVG-related properties\n  fillOpacity: true,\n  floodOpacity: true,\n  stopOpacity: true,\n  strokeDasharray: true,\n  strokeDashoffset: true,\n  strokeMiterlimit: true,\n  strokeOpacity: true,\n  strokeWidth: true\n};\n/**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with \\`prefix\\`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\nfunction prefixKey(prefix, key) {\n  return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n  prefixes.forEach(function (prefix) {\n    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n  });\n});\n/**\n * Convert a value into the proper css writable value. The style name \\`name\\`\n * should be logical (no hyphens), as specified\n * in \\`CSSProperty.isUnitlessNumber\\`.\n *\n * @param {string} name CSS property name such as \\`topMargin\\`.\n * @param {*} value CSS property value such as \\`10px\\`.\n * @return {string} Normalized style value with dimensions applied.\n */\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n  // Note that we've removed escapeTextForBrowser() calls here since the\n  // whole string will be escaped when the attribute is injected into\n  // the markup. If you provide unsafe user data here they can inject\n  // arbitrary CSS which may be problematic (I couldn't repro this):\n  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n  // This is not an XSS hole but instead a potential CSS injection issue\n  // which has lead to a greater discussion about how we're going to\n  // trust URLs moving forward. See #2115901\n  var isEmpty = value == null || typeof value === 'boolean' || value === '';\n  if (isEmpty) {\n    return '';\n  }\n  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n  }\n  return ('' + value).trim();\n}\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^ms-/;\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n *   > hyphenateStyleName('backgroundColor')\n *   < \\\\\"background-color\\\\\"\n *   > hyphenateStyleName('MozTransition')\n *   < \\\\\"-moz-transition\\\\\"\n *   > hyphenateStyleName('msTransition')\n *   < \\\\\"-ms-transition\\\\\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an \\`ms\\` prefix\n * is converted to \\`-ms-\\`.\n */\nfunction hyphenateStyleName(name) {\n  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\nvar warnValidStyle = function () {};\n{\n  // 'msTransform' is correct, but the other prefixes should be capitalized\n  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n  var msPattern$1 = /^-ms-/;\n  var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n  var badStyleValueWithSemicolonPattern = /;\\\\\\\\s*$/;\n  var warnedStyleNames = {};\n  var warnedStyleValues = {};\n  var warnedForNaNValue = false;\n  var warnedForInfinityValue = false;\n  var camelize = function (string) {\n    return string.replace(hyphenPattern, function (_, character) {\n      return character.toUpperCase();\n    });\n  };\n  var warnHyphenatedStyleName = function (name) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n    warnedStyleNames[name] = true;\n    error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests\n    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an \\`-ms\\` prefix\n    // is converted to lowercase \\`ms\\`.\n    camelize(name.replace(msPattern$1, 'ms-')));\n  };\n  var warnBadVendoredStyleName = function (name) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n    warnedStyleNames[name] = true;\n    error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n  };\n  var warnStyleValueWithSemicolon = function (name, value) {\n    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n      return;\n    }\n    warnedStyleValues[value] = true;\n    error(\\\\\"Style property values shouldn't contain a semicolon. \\\\\" + 'Try \\\\\"%s: %s\\\\\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n  };\n  var warnStyleValueIsNaN = function (name, value) {\n    if (warnedForNaNValue) {\n      return;\n    }\n    warnedForNaNValue = true;\n    error('\\`NaN\\` is an invalid value for the \\`%s\\` css style property.', name);\n  };\n  var warnStyleValueIsInfinity = function (name, value) {\n    if (warnedForInfinityValue) {\n      return;\n    }\n    warnedForInfinityValue = true;\n    error('\\`Infinity\\` is an invalid value for the \\`%s\\` css style property.', name);\n  };\n  warnValidStyle = function (name, value) {\n    if (name.indexOf('-') > -1) {\n      warnHyphenatedStyleName(name);\n    } else if (badVendoredStyleNamePattern.test(name)) {\n      warnBadVendoredStyleName(name);\n    } else if (badStyleValueWithSemicolonPattern.test(value)) {\n      warnStyleValueWithSemicolon(name, value);\n    }\n    if (typeof value === 'number') {\n      if (isNaN(value)) {\n        warnStyleValueIsNaN(name, value);\n      } else if (!isFinite(value)) {\n        warnStyleValueIsInfinity(name, value);\n      }\n    }\n  };\n}\nvar warnValidStyle$1 = warnValidStyle;\n/**\n * Operations for dealing with CSS properties.\n */\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\nfunction createDangerousStringForStyles(styles) {\n  {\n    var serialized = '';\n    var delimiter = '';\n    for (var styleName in styles) {\n      if (!styles.hasOwnProperty(styleName)) {\n        continue;\n      }\n      var styleValue = styles[styleName];\n      if (styleValue != null) {\n        var isCustomProperty = styleName.indexOf('--') === 0;\n        serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n        delimiter = ';';\n      }\n    }\n    return serialized || null;\n  }\n}\n/**\n * Sets the value for multiple styles on a node.  If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\nfunction setValueForStyles(node, styles) {\n  var style = node.style;\n  for (var styleName in styles) {\n    if (!styles.hasOwnProperty(styleName)) {\n      continue;\n    }\n    var isCustomProperty = styleName.indexOf('--') === 0;\n    {\n      if (!isCustomProperty) {\n        warnValidStyle$1(styleName, styles[styleName]);\n      }\n    }\n    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n    if (styleName === 'float') {\n      styleName = 'cssFloat';\n    }\n    if (isCustomProperty) {\n      style.setProperty(styleName, styleValue);\n    } else {\n      style[styleName] = styleValue;\n    }\n  }\n}\nfunction isValueEmpty(value) {\n  return value == null || typeof value === 'boolean' || value === '';\n}\n/**\n * Given {color: 'red', overflow: 'hidden'} returns {\n *   color: 'color',\n *   overflowX: 'overflow',\n *   overflowY: 'overflow',\n * }. This can be read as \\\\\"the overflowY property was set by the overflow\n * shorthand\\\\\". That is, the values are the property that each was derived from.\n */\nfunction expandShorthandMap(styles) {\n  var expanded = {};\n  for (var key in styles) {\n    var longhands = shorthandToLonghand[key] || [key];\n    for (var i = 0; i < longhands.length; i++) {\n      expanded[longhands[i]] = key;\n    }\n  }\n  return expanded;\n}\n/**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n *   {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}\n *   becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n *   {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}\n *   becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n *   {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}\n *   becomes .style.fontVariant = ''\n */\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n  {\n    if (!nextStyles) {\n      return;\n    }\n    var expandedUpdates = expandShorthandMap(styleUpdates);\n    var expandedStyles = expandShorthandMap(nextStyles);\n    var warnedAbout = {};\n    for (var key in expandedUpdates) {\n      var originalKey = expandedUpdates[key];\n      var correctOriginalKey = expandedStyles[key];\n      if (correctOriginalKey && originalKey !== correctOriginalKey) {\n        var warningKey = originalKey + ',' + correctOriginalKey;\n        if (warnedAbout[warningKey]) {\n          continue;\n        }\n        warnedAbout[warningKey] = true;\n        error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \\\\\"avoid this, don't mix shorthand and non-shorthand properties \\\\\" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n      }\n    }\n  }\n}\n// For HTML, certain tags should omit their close tag. We keep a list for\n// those special-case tags.\nvar omittedCloseTags = {\n  area: true,\n  base: true,\n  br: true,\n  col: true,\n  embed: true,\n  hr: true,\n  img: true,\n  input: true,\n  keygen: true,\n  link: true,\n  meta: true,\n  param: true,\n  source: true,\n  track: true,\n  wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n};\n// \\`omittedCloseTags\\` except that \\`menuitem\\` should still have its closing tag.\nvar voidElementTags = _assign({\n  menuitem: true\n}, omittedCloseTags);\nvar HTML = '__html';\nfunction assertValidProps(tag, props) {\n  if (!props) {\n    return;\n  } // Note the use of \\`==\\` which checks for null or undefined.\n  if (voidElementTags[tag]) {\n    if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n      {\n        throw Error( tag + \\\\\" is a void element tag and must neither have \\`children\\` nor use \\`dangerouslySetInnerHTML\\`.\\\\\" );\n      }\n    }\n  }\n  if (props.dangerouslySetInnerHTML != null) {\n    if (!(props.children == null)) {\n      {\n        throw Error( \\\\\"Can only set one of \\`children\\` or \\`props.dangerouslySetInnerHTML\\`.\\\\\" );\n      }\n    }\n    if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {\n      {\n        throw Error( \\\\\"\\`props.dangerouslySetInnerHTML\\` must be in the form \\`{__html: ...}\\`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.\\\\\" );\n      }\n    }\n  }\n  {\n    if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n      error('A component is \\`contentEditable\\` and contains \\`children\\` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');\n    }\n  }\n  if (!(props.style == null || typeof props.style === 'object')) {\n    {\n      throw Error( \\\\\"The \\`style\\` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\\\\\" );\n    }\n  }\n}\nfunction isCustomComponent(tagName, props) {\n  if (tagName.indexOf('-') === -1) {\n    return typeof props.is === 'string';\n  }\n  switch (tagName) {\n    // These are reserved SVG and MathML elements.\n    // We don't mind this list too much because we expect it to never grow.\n    // The alternative is to track the namespace in a few places which is convoluted.\n    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n    case 'annotation-xml':\n    case 'color-profile':\n    case 'font-face':\n    case 'font-face-src':\n    case 'font-face-uri':\n    case 'font-face-format':\n    case 'font-face-name':\n    case 'missing-glyph':\n      return false;\n    default:\n      return true;\n  }\n}\n// When adding attributes to the HTML or SVG allowed attribute list, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar possibleStandardNames = {\n  // HTML\n  accept: 'accept',\n  acceptcharset: 'acceptCharset',\n  'accept-charset': 'acceptCharset',\n  accesskey: 'accessKey',\n  action: 'action',\n  allowfullscreen: 'allowFullScreen',\n  alt: 'alt',\n  as: 'as',\n  async: 'async',\n  autocapitalize: 'autoCapitalize',\n  autocomplete: 'autoComplete',\n  autocorrect: 'autoCorrect',\n  autofocus: 'autoFocus',\n  autoplay: 'autoPlay',\n  autosave: 'autoSave',\n  capture: 'capture',\n  cellpadding: 'cellPadding',\n  cellspacing: 'cellSpacing',\n  challenge: 'challenge',\n  charset: 'charSet',\n  checked: 'checked',\n  children: 'children',\n  cite: 'cite',\n  class: 'className',\n  classid: 'classID',\n  classname: 'className',\n  cols: 'cols',\n  colspan: 'colSpan',\n  content: 'content',\n  contenteditable: 'contentEditable',\n  contextmenu: 'contextMenu',\n  controls: 'controls',\n  controlslist: 'controlsList',\n  coords: 'coords',\n  crossorigin: 'crossOrigin',\n  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n  data: 'data',\n  datetime: 'dateTime',\n  default: 'default',\n  defaultchecked: 'defaultChecked',\n  defaultvalue: 'defaultValue',\n  defer: 'defer',\n  dir: 'dir',\n  disabled: 'disabled',\n  disablepictureinpicture: 'disablePictureInPicture',\n  disableremoteplayback: 'disableRemotePlayback',\n  download: 'download',\n  draggable: 'draggable',\n  enctype: 'encType',\n  enterkeyhint: 'enterKeyHint',\n  for: 'htmlFor',\n  form: 'form',\n  formmethod: 'formMethod',\n  formaction: 'formAction',\n  formenctype: 'formEncType',\n  formnovalidate: 'formNoValidate',\n  formtarget: 'formTarget',\n  frameborder: 'frameBorder',\n  headers: 'headers',\n  height: 'height',\n  hidden: 'hidden',\n  high: 'high',\n  href: 'href',\n  hreflang: 'hrefLang',\n  htmlfor: 'htmlFor',\n  httpequiv: 'httpEquiv',\n  'http-equiv': 'httpEquiv',\n  icon: 'icon',\n  id: 'id',\n  innerhtml: 'innerHTML',\n  inputmode: 'inputMode',\n  integrity: 'integrity',\n  is: 'is',\n  itemid: 'itemID',\n  itemprop: 'itemProp',\n  itemref: 'itemRef',\n  itemscope: 'itemScope',\n  itemtype: 'itemType',\n  keyparams: 'keyParams',\n  keytype: 'keyType',\n  kind: 'kind',\n  label: 'label',\n  lang: 'lang',\n  list: 'list',\n  loop: 'loop',\n  low: 'low',\n  manifest: 'manifest',\n  marginwidth: 'marginWidth',\n  marginheight: 'marginHeight',\n  max: 'max',\n  maxlength: 'maxLength',\n  media: 'media',\n  mediagroup: 'mediaGroup',\n  method: 'method',\n  min: 'min',\n  minlength: 'minLength',\n  multiple: 'multiple',\n  muted: 'muted',\n  name: 'name',\n  nomodule: 'noModule',\n  nonce: 'nonce',\n  novalidate: 'noValidate',\n  open: 'open',\n  optimum: 'optimum',\n  pattern: 'pattern',\n  placeholder: 'placeholder',\n  playsinline: 'playsInline',\n  poster: 'poster',\n  preload: 'preload',\n  profile: 'profile',\n  radiogroup: 'radioGroup',\n  readonly: 'readOnly',\n  referrerpolicy: 'referrerPolicy',\n  rel: 'rel',\n  required: 'required',\n  reversed: 'reversed',\n  role: 'role',\n  rows: 'rows',\n  rowspan: 'rowSpan',\n  sandbox: 'sandbox',\n  scope: 'scope',\n  scoped: 'scoped',\n  scrolling: 'scrolling',\n  seamless: 'seamless',\n  selected: 'selected',\n  shape: 'shape',\n  size: 'size',\n  sizes: 'sizes',\n  span: 'span',\n  spellcheck: 'spellCheck',\n  src: 'src',\n  srcdoc: 'srcDoc',\n  srclang: 'srcLang',\n  srcset: 'srcSet',\n  start: 'start',\n  step: 'step',\n  style: 'style',\n  summary: 'summary',\n  tabindex: 'tabIndex',\n  target: 'target',\n  title: 'title',\n  type: 'type',\n  usemap: 'useMap',\n  value: 'value',\n  width: 'width',\n  wmode: 'wmode',\n  wrap: 'wrap',\n  // SVG\n  about: 'about',\n  accentheight: 'accentHeight',\n  'accent-height': 'accentHeight',\n  accumulate: 'accumulate',\n  additive: 'additive',\n  alignmentbaseline: 'alignmentBaseline',\n  'alignment-baseline': 'alignmentBaseline',\n  allowreorder: 'allowReorder',\n  alphabetic: 'alphabetic',\n  amplitude: 'amplitude',\n  arabicform: 'arabicForm',\n  'arabic-form': 'arabicForm',\n  ascent: 'ascent',\n  attributename: 'attributeName',\n  attributetype: 'attributeType',\n  autoreverse: 'autoReverse',\n  azimuth: 'azimuth',\n  basefrequency: 'baseFrequency',\n  baselineshift: 'baselineShift',\n  'baseline-shift': 'baselineShift',\n  baseprofile: 'baseProfile',\n  bbox: 'bbox',\n  begin: 'begin',\n  bias: 'bias',\n  by: 'by',\n  calcmode: 'calcMode',\n  capheight: 'capHeight',\n  'cap-height': 'capHeight',\n  clip: 'clip',\n  clippath: 'clipPath',\n  'clip-path': 'clipPath',\n  clippathunits: 'clipPathUnits',\n  cliprule: 'clipRule',\n  'clip-rule': 'clipRule',\n  color: 'color',\n  colorinterpolation: 'colorInterpolation',\n  'color-interpolation': 'colorInterpolation',\n  colorinterpolationfilters: 'colorInterpolationFilters',\n  'color-interpolation-filters': 'colorInterpolationFilters',\n  colorprofile: 'colorProfile',\n  'color-profile': 'colorProfile',\n  colorrendering: 'colorRendering',\n  'color-rendering': 'colorRendering',\n  contentscripttype: 'contentScriptType',\n  contentstyletype: 'contentStyleType',\n  cursor: 'cursor',\n  cx: 'cx',\n  cy: 'cy',\n  d: 'd',\n  datatype: 'datatype',\n  decelerate: 'decelerate',\n  descent: 'descent',\n  diffuseconstant: 'diffuseConstant',\n  direction: 'direction',\n  display: 'display',\n  divisor: 'divisor',\n  dominantbaseline: 'dominantBaseline',\n  'dominant-baseline': 'dominantBaseline',\n  dur: 'dur',\n  dx: 'dx',\n  dy: 'dy',\n  edgemode: 'edgeMode',\n  elevation: 'elevation',\n  enablebackground: 'enableBackground',\n  'enable-background': 'enableBackground',\n  end: 'end',\n  exponent: 'exponent',\n  externalresourcesrequired: 'externalResourcesRequired',\n  fill: 'fill',\n  fillopacity: 'fillOpacity',\n  'fill-opacity': 'fillOpacity',\n  fillrule: 'fillRule',\n  'fill-rule': 'fillRule',\n  filter: 'filter',\n  filterres: 'filterRes',\n  filterunits: 'filterUnits',\n  floodopacity: 'floodOpacity',\n  'flood-opacity': 'floodOpacity',\n  floodcolor: 'floodColor',\n  'flood-color': 'floodColor',\n  focusable: 'focusable',\n  fontfamily: 'fontFamily',\n  'font-family': 'fontFamily',\n  fontsize: 'fontSize',\n  'font-size': 'fontSize',\n  fontsizeadjust: 'fontSizeAdjust',\n  'font-size-adjust': 'fontSizeAdjust',\n  fontstretch: 'fontStretch',\n  'font-stretch': 'fontStretch',\n  fontstyle: 'fontStyle',\n  'font-style': 'fontStyle',\n  fontvariant: 'fontVariant',\n  'font-variant': 'fontVariant',\n  fontweight: 'fontWeight',\n  'font-weight': 'fontWeight',\n  format: 'format',\n  from: 'from',\n  fx: 'fx',\n  fy: 'fy',\n  g1: 'g1',\n  g2: 'g2',\n  glyphname: 'glyphName',\n  'glyph-name': 'glyphName',\n  glyphorientationhorizontal: 'glyphOrientationHorizontal',\n  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n  glyphorientationvertical: 'glyphOrientationVertical',\n  'glyph-orientation-vertical': 'glyphOrientationVertical',\n  glyphref: 'glyphRef',\n  gradienttransform: 'gradientTransform',\n  gradientunits: 'gradientUnits',\n  hanging: 'hanging',\n  horizadvx: 'horizAdvX',\n  'horiz-adv-x': 'horizAdvX',\n  horizoriginx: 'horizOriginX',\n  'horiz-origin-x': 'horizOriginX',\n  ideographic: 'ideographic',\n  imagerendering: 'imageRendering',\n  'image-rendering': 'imageRendering',\n  in2: 'in2',\n  in: 'in',\n  inlist: 'inlist',\n  intercept: 'intercept',\n  k1: 'k1',\n  k2: 'k2',\n  k3: 'k3',\n  k4: 'k4',\n  k: 'k',\n  kernelmatrix: 'kernelMatrix',\n  kernelunitlength: 'kernelUnitLength',\n  kerning: 'kerning',\n  keypoints: 'keyPoints',\n  keysplines: 'keySplines',\n  keytimes: 'keyTimes',\n  lengthadjust: 'lengthAdjust',\n  letterspacing: 'letterSpacing',\n  'letter-spacing': 'letterSpacing',\n  lightingcolor: 'lightingColor',\n  'lighting-color': 'lightingColor',\n  limitingconeangle: 'limitingConeAngle',\n  local: 'local',\n  markerend: 'markerEnd',\n  'marker-end': 'markerEnd',\n  markerheight: 'markerHeight',\n  markermid: 'markerMid',\n  'marker-mid': 'markerMid',\n  markerstart: 'markerStart',\n  'marker-start': 'markerStart',\n  markerunits: 'markerUnits',\n  markerwidth: 'markerWidth',\n  mask: 'mask',\n  maskcontentunits: 'maskContentUnits',\n  maskunits: 'maskUnits',\n  mathematical: 'mathematical',\n  mode: 'mode',\n  numoctaves: 'numOctaves',\n  offset: 'offset',\n  opacity: 'opacity',\n  operator: 'operator',\n  order: 'order',\n  orient: 'orient',\n  orientation: 'orientation',\n  origin: 'origin',\n  overflow: 'overflow',\n  overlineposition: 'overlinePosition',\n  'overline-position': 'overlinePosition',\n  overlinethickness: 'overlineThickness',\n  'overline-thickness': 'overlineThickness',\n  paintorder: 'paintOrder',\n  'paint-order': 'paintOrder',\n  panose1: 'panose1',\n  'panose-1': 'panose1',\n  pathlength: 'pathLength',\n  patterncontentunits: 'patternContentUnits',\n  patterntransform: 'patternTransform',\n  patternunits: 'patternUnits',\n  pointerevents: 'pointerEvents',\n  'pointer-events': 'pointerEvents',\n  points: 'points',\n  pointsatx: 'pointsAtX',\n  pointsaty: 'pointsAtY',\n  pointsatz: 'pointsAtZ',\n  prefix: 'prefix',\n  preservealpha: 'preserveAlpha',\n  preserveaspectratio: 'preserveAspectRatio',\n  primitiveunits: 'primitiveUnits',\n  property: 'property',\n  r: 'r',\n  radius: 'radius',\n  refx: 'refX',\n  refy: 'refY',\n  renderingintent: 'renderingIntent',\n  'rendering-intent': 'renderingIntent',\n  repeatcount: 'repeatCount',\n  repeatdur: 'repeatDur',\n  requiredextensions: 'requiredExtensions',\n  requiredfeatures: 'requiredFeatures',\n  resource: 'resource',\n  restart: 'restart',\n  result: 'result',\n  results: 'results',\n  rotate: 'rotate',\n  rx: 'rx',\n  ry: 'ry',\n  scale: 'scale',\n  security: 'security',\n  seed: 'seed',\n  shaperendering: 'shapeRendering',\n  'shape-rendering': 'shapeRendering',\n  slope: 'slope',\n  spacing: 'spacing',\n  specularconstant: 'specularConstant',\n  specularexponent: 'specularExponent',\n  speed: 'speed',\n  spreadmethod: 'spreadMethod',\n  startoffset: 'startOffset',\n  stddeviation: 'stdDeviation',\n  stemh: 'stemh',\n  stemv: 'stemv',\n  stitchtiles: 'stitchTiles',\n  stopcolor: 'stopColor',\n  'stop-color': 'stopColor',\n  stopopacity: 'stopOpacity',\n  'stop-opacity': 'stopOpacity',\n  strikethroughposition: 'strikethroughPosition',\n  'strikethrough-position': 'strikethroughPosition',\n  strikethroughthickness: 'strikethroughThickness',\n  'strikethrough-thickness': 'strikethroughThickness',\n  string: 'string',\n  stroke: 'stroke',\n  strokedasharray: 'strokeDasharray',\n  'stroke-dasharray': 'strokeDasharray',\n  strokedashoffset: 'strokeDashoffset',\n  'stroke-dashoffset': 'strokeDashoffset',\n  strokelinecap: 'strokeLinecap',\n  'stroke-linecap': 'strokeLinecap',\n  strokelinejoin: 'strokeLinejoin',\n  'stroke-linejoin': 'strokeLinejoin',\n  strokemiterlimit: 'strokeMiterlimit',\n  'stroke-miterlimit': 'strokeMiterlimit',\n  strokewidth: 'strokeWidth',\n  'stroke-width': 'strokeWidth',\n  strokeopacity: 'strokeOpacity',\n  'stroke-opacity': 'strokeOpacity',\n  suppresscontenteditablewarning: 'suppressContentEditableWarning',\n  suppresshydrationwarning: 'suppressHydrationWarning',\n  surfacescale: 'surfaceScale',\n  systemlanguage: 'systemLanguage',\n  tablevalues: 'tableValues',\n  targetx: 'targetX',\n  targety: 'targetY',\n  textanchor: 'textAnchor',\n  'text-anchor': 'textAnchor',\n  textdecoration: 'textDecoration',\n  'text-decoration': 'textDecoration',\n  textlength: 'textLength',\n  textrendering: 'textRendering',\n  'text-rendering': 'textRendering',\n  to: 'to',\n  transform: 'transform',\n  typeof: 'typeof',\n  u1: 'u1',\n  u2: 'u2',\n  underlineposition: 'underlinePosition',\n  'underline-position': 'underlinePosition',\n  underlinethickness: 'underlineThickness',\n  'underline-thickness': 'underlineThickness',\n  unicode: 'unicode',\n  unicodebidi: 'unicodeBidi',\n  'unicode-bidi': 'unicodeBidi',\n  unicoderange: 'unicodeRange',\n  'unicode-range': 'unicodeRange',\n  unitsperem: 'unitsPerEm',\n  'units-per-em': 'unitsPerEm',\n  unselectable: 'unselectable',\n  valphabetic: 'vAlphabetic',\n  'v-alphabetic': 'vAlphabetic',\n  values: 'values',\n  vectoreffect: 'vectorEffect',\n  'vector-effect': 'vectorEffect',\n  version: 'version',\n  vertadvy: 'vertAdvY',\n  'vert-adv-y': 'vertAdvY',\n  vertoriginx: 'vertOriginX',\n  'vert-origin-x': 'vertOriginX',\n  vertoriginy: 'vertOriginY',\n  'vert-origin-y': 'vertOriginY',\n  vhanging: 'vHanging',\n  'v-hanging': 'vHanging',\n  videographic: 'vIdeographic',\n  'v-ideographic': 'vIdeographic',\n  viewbox: 'viewBox',\n  viewtarget: 'viewTarget',\n  visibility: 'visibility',\n  vmathematical: 'vMathematical',\n  'v-mathematical': 'vMathematical',\n  vocab: 'vocab',\n  widths: 'widths',\n  wordspacing: 'wordSpacing',\n  'word-spacing': 'wordSpacing',\n  writingmode: 'writingMode',\n  'writing-mode': 'writingMode',\n  x1: 'x1',\n  x2: 'x2',\n  x: 'x',\n  xchannelselector: 'xChannelSelector',\n  xheight: 'xHeight',\n  'x-height': 'xHeight',\n  xlinkactuate: 'xlinkActuate',\n  'xlink:actuate': 'xlinkActuate',\n  xlinkarcrole: 'xlinkArcrole',\n  'xlink:arcrole': 'xlinkArcrole',\n  xlinkhref: 'xlinkHref',\n  'xlink:href': 'xlinkHref',\n  xlinkrole: 'xlinkRole',\n  'xlink:role': 'xlinkRole',\n  xlinkshow: 'xlinkShow',\n  'xlink:show': 'xlinkShow',\n  xlinktitle: 'xlinkTitle',\n  'xlink:title': 'xlinkTitle',\n  xlinktype: 'xlinkType',\n  'xlink:type': 'xlinkType',\n  xmlbase: 'xmlBase',\n  'xml:base': 'xmlBase',\n  xmllang: 'xmlLang',\n  'xml:lang': 'xmlLang',\n  xmlns: 'xmlns',\n  'xml:space': 'xmlSpace',\n  xmlnsxlink: 'xmlnsXlink',\n  'xmlns:xlink': 'xmlnsXlink',\n  xmlspace: 'xmlSpace',\n  y1: 'y1',\n  y2: 'y2',\n  y: 'y',\n  ychannelselector: 'yChannelSelector',\n  z: 'z',\n  zoomandpan: 'zoomAndPan'\n};\nvar ariaProperties = {\n  'aria-current': 0,\n  // state\n  'aria-details': 0,\n  'aria-disabled': 0,\n  // state\n  'aria-hidden': 0,\n  // state\n  'aria-invalid': 0,\n  // state\n  'aria-keyshortcuts': 0,\n  'aria-label': 0,\n  'aria-roledescription': 0,\n  // Widget Attributes\n  'aria-autocomplete': 0,\n  'aria-checked': 0,\n  'aria-expanded': 0,\n  'aria-haspopup': 0,\n  'aria-level': 0,\n  'aria-modal': 0,\n  'aria-multiline': 0,\n  'aria-multiselectable': 0,\n  'aria-orientation': 0,\n  'aria-placeholder': 0,\n  'aria-pressed': 0,\n  'aria-readonly': 0,\n  'aria-required': 0,\n  'aria-selected': 0,\n  'aria-sort': 0,\n  'aria-valuemax': 0,\n  'aria-valuemin': 0,\n  'aria-valuenow': 0,\n  'aria-valuetext': 0,\n  // Live Region Attributes\n  'aria-atomic': 0,\n  'aria-busy': 0,\n  'aria-live': 0,\n  'aria-relevant': 0,\n  // Drag-and-Drop Attributes\n  'aria-dropeffect': 0,\n  'aria-grabbed': 0,\n  // Relationship Attributes\n  'aria-activedescendant': 0,\n  'aria-colcount': 0,\n  'aria-colindex': 0,\n  'aria-colspan': 0,\n  'aria-controls': 0,\n  'aria-describedby': 0,\n  'aria-errormessage': 0,\n  'aria-flowto': 0,\n  'aria-labelledby': 0,\n  'aria-owns': 0,\n  'aria-posinset': 0,\n  'aria-rowcount': 0,\n  'aria-rowindex': 0,\n  'aria-rowspan': 0,\n  'aria-setsize': 0\n};\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\nfunction validateProperty(tagName, name) {\n  {\n    if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {\n      return true;\n    }\n    if (rARIACamel.test(name)) {\n      var ariaName = 'aria-' + name.slice(4).toLowerCase();\n      var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n      // DOM properties, then it is an invalid aria-* attribute.\n      if (correctName == null) {\n        error('Invalid ARIA attribute \\`%s\\`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n        warnedProperties[name] = true;\n        return true;\n      } // aria-* attributes should be lowercase; suggest the lowercase version.\n      if (name !== correctName) {\n        error('Invalid ARIA attribute \\`%s\\`. Did you mean \\`%s\\`?', name, correctName);\n        warnedProperties[name] = true;\n        return true;\n      }\n    }\n    if (rARIA.test(name)) {\n      var lowerCasedName = name.toLowerCase();\n      var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n      // DOM properties, then it is an invalid aria-* attribute.\n      if (standardName == null) {\n        warnedProperties[name] = true;\n        return false;\n      } // aria-* attributes should be lowercase; suggest the lowercase version.\n      if (name !== standardName) {\n        error('Unknown ARIA attribute \\`%s\\`. Did you mean \\`%s\\`?', name, standardName);\n        warnedProperties[name] = true;\n        return true;\n      }\n    }\n  }\n  return true;\n}\nfunction warnInvalidARIAProps(type, props) {\n  {\n    var invalidProps = [];\n    for (var key in props) {\n      var isValid = validateProperty(type, key);\n      if (!isValid) {\n        invalidProps.push(key);\n      }\n    }\n    var unknownPropString = invalidProps.map(function (prop) {\n      return '\\`' + prop + '\\`';\n    }).join(', ');\n    if (invalidProps.length === 1) {\n      error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n    } else if (invalidProps.length > 1) {\n      error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n    }\n  }\n}\nfunction validateProperties(type, props) {\n  if (isCustomComponent(type, props)) {\n    return;\n  }\n  warnInvalidARIAProps(type, props);\n}\nvar didWarnValueNull = false;\nfunction validateProperties$1(type, props) {\n  {\n    if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n      return;\n    }\n    if (props != null && props.value === null && !didWarnValueNull) {\n      didWarnValueNull = true;\n      if (type === 'select' && props.multiple) {\n        error('\\`value\\` prop on \\`%s\\` should not be null. ' + 'Consider using an empty array when \\`multiple\\` is set to \\`true\\` ' + 'to clear the component or \\`undefined\\` for uncontrolled components.', type);\n      } else {\n        error('\\`value\\` prop on \\`%s\\` should not be null. ' + 'Consider using an empty string to clear the component or \\`undefined\\` ' + 'for uncontrolled components.', type);\n      }\n    }\n  }\n}\nvar validateProperty$1 = function () {};\n{\n  var warnedProperties$1 = {};\n  var _hasOwnProperty = Object.prototype.hasOwnProperty;\n  var EVENT_NAME_REGEX = /^on./;\n  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n  validateProperty$1 = function (tagName, name, value, eventRegistry) {\n    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n      return true;\n    }\n    var lowerCasedName = name.toLowerCase();\n    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n      error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n      warnedProperties$1[name] = true;\n      return true;\n    } // We can't rely on the event system being injected on the server.\n    if (eventRegistry != null) {\n      var registrationNameDependencies = eventRegistry.registrationNameDependencies,\n          possibleRegistrationNames = eventRegistry.possibleRegistrationNames;\n      if (registrationNameDependencies.hasOwnProperty(name)) {\n        return true;\n      }\n      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n      if (registrationName != null) {\n        error('Invalid event handler property \\`%s\\`. Did you mean \\`%s\\`?', name, registrationName);\n        warnedProperties$1[name] = true;\n        return true;\n      }\n      if (EVENT_NAME_REGEX.test(name)) {\n        error('Unknown event handler property \\`%s\\`. It will be ignored.', name);\n        warnedProperties$1[name] = true;\n        return true;\n      }\n    } else if (EVENT_NAME_REGEX.test(name)) {\n      // If no event plugins have been injected, we are in a server environment.\n      // So we can't tell if the event name is correct for sure, but we can filter\n      // out known bad ones like \\`onclick\\`. We can't suggest a specific replacement though.\n      if (INVALID_EVENT_NAME_REGEX.test(name)) {\n        error('Invalid event handler property \\`%s\\`. ' + 'React events use the camelCase naming convention, for example \\`onClick\\`.', name);\n      }\n      warnedProperties$1[name] = true;\n      return true;\n    } // Let the ARIA attribute hook validate ARIA attributes\n    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n      return true;\n    }\n    if (lowerCasedName === 'innerhtml') {\n      error('Directly setting property \\`innerHTML\\` is not permitted. ' + 'For more information, lookup documentation on \\`dangerouslySetInnerHTML\\`.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (lowerCasedName === 'aria') {\n      error('The \\`aria\\` attribute is reserved for future use in React. ' + 'Pass individual \\`aria-\\` attributes instead.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n      error('Received a \\`%s\\` for a string attribute \\`is\\`. If this is expected, cast ' + 'the value to a string.', typeof value);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (typeof value === 'number' && isNaN(value)) {\n      error('Received NaN for the \\`%s\\` attribute. If this is expected, cast ' + 'the value to a string.', name);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    var propertyInfo = getPropertyInfo(name);\n    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n      var standardName = possibleStandardNames[lowerCasedName];\n      if (standardName !== name) {\n        error('Invalid DOM property \\`%s\\`. Did you mean \\`%s\\`?', name, standardName);\n        warnedProperties$1[name] = true;\n        return true;\n      }\n    } else if (!isReserved && name !== lowerCasedName) {\n      // Unknown attributes should have lowercase casing since that's how they\n      // will be cased anyway with server rendering.\n      error('React does not recognize the \\`%s\\` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase \\`%s\\` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n      if (value) {\n        error('Received \\`%s\\` for a non-boolean attribute \\`%s\\`.' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\\\\\"%s\\\\\" or %s={value.toString()}.', value, name, name, value, name);\n      } else {\n        error('Received \\`%s\\` for a non-boolean attribute \\`%s\\`.' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\\\\\"%s\\\\\" or %s={value.toString()}.' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n      }\n      warnedProperties$1[name] = true;\n      return true;\n    } // Now that we've validated casing, do not validate\n    // data types for reserved props\n    if (isReserved) {\n      return true;\n    } // Warn when a known attribute is a bad type\n    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n      warnedProperties$1[name] = true;\n      return false;\n    } // Warn when passing the strings 'false' or 'true' into a boolean prop\n    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n      error('Received the string \\`%s\\` for the boolean attribute \\`%s\\`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \\\\\"false\\\\\".', name, value);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    return true;\n  };\n}\nvar warnUnknownProperties = function (type, props, eventRegistry) {\n  {\n    var unknownProps = [];\n    for (var key in props) {\n      var isValid = validateProperty$1(type, key, props[key], eventRegistry);\n      if (!isValid) {\n        unknownProps.push(key);\n      }\n    }\n    var unknownPropString = unknownProps.map(function (prop) {\n      return '\\`' + prop + '\\`';\n    }).join(', ');\n    if (unknownProps.length === 1) {\n      error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n    } else if (unknownProps.length > 1) {\n      error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n    }\n  }\n};\nfunction validateProperties$2(type, props, eventRegistry) {\n  if (isCustomComponent(type, props)) {\n    return;\n  }\n  warnUnknownProperties(type, props, eventRegistry);\n}\nvar IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;\nvar IS_NON_DELEGATED = 1 << 1;\nvar IS_CAPTURE_PHASE = 1 << 2;\nvar IS_REPLAYED = 1 << 4;\n// set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when\n// we call willDeferLaterForLegacyFBSupport, thus not bailing out\n// will result in endless cycles like an infinite loop.\n// We also don't want to defer during event replaying.\nvar SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\nfunction getEventTarget(nativeEvent) {\n  // Fallback to nativeEvent.srcElement for IE9\n  // https://github.com/facebook/react/issues/12506\n  var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963\n  if (target.correspondingUseElement) {\n    target = target.correspondingUseElement;\n  } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n  // @see http://www.quirksmode.org/js/events_properties.html\n  return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\nfunction restoreStateOfTarget(target) {\n  // We perform this translation at the end of the event loop so that we\n  // always receive the correct fiber here\n  var internalInstance = getInstanceFromNode(target);\n  if (!internalInstance) {\n    // Unmounted\n    return;\n  }\n  if (!(typeof restoreImpl === 'function')) {\n    {\n      throw Error( \\\\\"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.\n  if (stateNode) {\n    var _props = getFiberCurrentPropsFromNode(stateNode);\n    restoreImpl(internalInstance.stateNode, internalInstance.type, _props);\n  }\n}\nfunction setRestoreImplementation(impl) {\n  restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n  if (restoreTarget) {\n    if (restoreQueue) {\n      restoreQueue.push(target);\n    } else {\n      restoreQueue = [target];\n    }\n  } else {\n    restoreTarget = target;\n  }\n}\nfunction needsStateRestore() {\n  return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n  if (!restoreTarget) {\n    return;\n  }\n  var target = restoreTarget;\n  var queuedTargets = restoreQueue;\n  restoreTarget = null;\n  restoreQueue = null;\n  restoreStateOfTarget(target);\n  if (queuedTargets) {\n    for (var i = 0; i < queuedTargets.length; i++) {\n      restoreStateOfTarget(queuedTargets[i]);\n    }\n  }\n}\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n  return fn(bookkeeping);\n};\nvar discreteUpdatesImpl = function (fn, a, b, c, d) {\n  return fn(a, b, c, d);\n};\nvar flushDiscreteUpdatesImpl = function () {};\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\nfunction finishEventHandler() {\n  // Here we wait until all updates have propagated, which is important\n  // when using controlled components within layers:\n  // https://github.com/facebook/react/issues/1698\n  // Then we restore state of any controlled component.\n  var controlledComponentsHavePendingUpdates = needsStateRestore();\n  if (controlledComponentsHavePendingUpdates) {\n    // If a controlled event was fired, we may need to restore the state of\n    // the DOM node back to the controlled value. This is necessary when React\n    // bails out of the update without touching the DOM.\n    flushDiscreteUpdatesImpl();\n    restoreStateIfNeeded();\n  }\n}\nfunction batchedUpdates(fn, bookkeeping) {\n  if (isInsideEventHandler) {\n    // If we are currently inside another batch, we need to wait until it\n    // fully completes before restoring state.\n    return fn(bookkeeping);\n  }\n  isInsideEventHandler = true;\n  try {\n    return batchedUpdatesImpl(fn, bookkeeping);\n  } finally {\n    isInsideEventHandler = false;\n    finishEventHandler();\n  }\n}\nfunction batchedEventUpdates(fn, a, b) {\n  if (isBatchingEventUpdates) {\n    // If we are currently inside another batch, we need to wait until it\n    // fully completes before restoring state.\n    return fn(a, b);\n  }\n  isBatchingEventUpdates = true;\n  try {\n    return batchedEventUpdatesImpl(fn, a, b);\n  } finally {\n    isBatchingEventUpdates = false;\n    finishEventHandler();\n  }\n}\nfunction discreteUpdates(fn, a, b, c, d) {\n  var prevIsInsideEventHandler = isInsideEventHandler;\n  isInsideEventHandler = true;\n  try {\n    return discreteUpdatesImpl(fn, a, b, c, d);\n  } finally {\n    isInsideEventHandler = prevIsInsideEventHandler;\n    if (!isInsideEventHandler) {\n      finishEventHandler();\n    }\n  }\n}\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n  {\n    if (!isInsideEventHandler) {\n      flushDiscreteUpdatesImpl();\n    }\n  }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n  batchedUpdatesImpl = _batchedUpdatesImpl;\n  discreteUpdatesImpl = _discreteUpdatesImpl;\n  flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n  batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\nfunction isInteractive(tag) {\n  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\nfunction shouldPreventMouseEvent(name, type, props) {\n  switch (name) {\n    case 'onClick':\n    case 'onClickCapture':\n    case 'onDoubleClick':\n    case 'onDoubleClickCapture':\n    case 'onMouseDown':\n    case 'onMouseDownCapture':\n    case 'onMouseMove':\n    case 'onMouseMoveCapture':\n    case 'onMouseUp':\n    case 'onMouseUpCapture':\n    case 'onMouseEnter':\n      return !!(props.disabled && isInteractive(type));\n    default:\n      return false;\n  }\n}\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. \\`onClick\\`).\n * @return {?function} The stored callback.\n */\nfunction getListener(inst, registrationName) {\n  var stateNode = inst.stateNode;\n  if (stateNode === null) {\n    // Work in progress (ex: onload events in incremental mode).\n    return null;\n  }\n  var props = getFiberCurrentPropsFromNode(stateNode);\n  if (props === null) {\n    // Work in progress.\n    return null;\n  }\n  var listener = props[registrationName];\n  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n    return null;\n  }\n  if (!(!listener || typeof listener === 'function')) {\n    {\n      throw Error( \\\\\"Expected \\`\\\\\" + registrationName + \\\\\"\\` listener to be a function, instead got a value of \\`\\\\\" + typeof listener + \\\\\"\\` type.\\\\\" );\n    }\n  }\n  return listener;\n}\nvar passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners\n// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\nif (canUseDOM) {\n  try {\n    var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value\n    Object.defineProperty(options, 'passive', {\n      get: function () {\n        passiveBrowserEventsSupported = true;\n      }\n    });\n    window.addEventListener('test', options, options);\n    window.removeEventListener('test', options, options);\n  } catch (e) {\n    passiveBrowserEventsSupported = false;\n  }\n}\nfunction invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {\n  var funcArgs = Array.prototype.slice.call(arguments, 3);\n  try {\n    func.apply(context, funcArgs);\n  } catch (error) {\n    this.onError(error);\n  }\n}\nvar invokeGuardedCallbackImpl = invokeGuardedCallbackProd;\n{\n  // In DEV mode, we swap out invokeGuardedCallback for a special version\n  // that plays more nicely with the browser's DevTools. The idea is to preserve\n  // \\\\\"Pause on exceptions\\\\\" behavior. Because React wraps all user-provided\n  // functions in invokeGuardedCallback, and the production version of\n  // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n  // like caught exceptions, and the DevTools won't pause unless the developer\n  // takes the extra step of enabling pause on caught exceptions. This is\n  // unintuitive, though, because even though React has caught the error, from\n  // the developer's perspective, the error is uncaught.\n  //\n  // To preserve the expected \\\\\"Pause on exceptions\\\\\" behavior, we don't use a\n  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n  // DOM node, and call the user-provided callback from inside an event handler\n  // for that fake event. If the callback throws, the error is \\\\\"captured\\\\\" using\n  // a global event handler. But because the error happens in a different\n  // event loop context, it does not interrupt the normal program flow.\n  // Effectively, this gives us try-catch behavior without actually using\n  // try-catch. Neat!\n  // Check that the browser supports the APIs we need to implement our special\n  // DEV version of invokeGuardedCallback\n  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n    var fakeNode = document.createElement('react');\n    invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {\n      // If document doesn't exist we know for sure we will crash in this method\n      // when we call document.createEvent(). However this can cause confusing\n      // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n      // So we preemptively throw with a better message instead.\n      if (!(typeof document !== 'undefined')) {\n        {\n          throw Error( \\\\\"The \\`document\\` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in \\`componentWillUnmount\\`), or you can change the test itself to be asynchronous.\\\\\" );\n        }\n      }\n      var evt = document.createEvent('Event');\n      var didCall = false; // Keeps track of whether the user-provided callback threw an error. We\n      // set this to true at the beginning, then set it to false right after\n      // calling the function. If the function errors, \\`didError\\` will never be\n      // set to false. This strategy works even if the browser is flaky and\n      // fails to call our global error handler, because it doesn't rely on\n      // the error event at all.\n      var didError = true; // Keeps track of the value of window.event so that we can reset it\n      // during the callback to let user code access window.event in the\n      // browsers that support it.\n      var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n      // dispatching: https://github.com/facebook/react/issues/13688\n      var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');\n      function restoreAfterDispatch() {\n        // We immediately remove the callback from event listeners so that\n        // nested \\`invokeGuardedCallback\\` calls do not clash. Otherwise, a\n        // nested call would trigger the fake event handlers of any call higher\n        // in the stack.\n        fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n        // window.event assignment in both IE <= 10 as they throw an error\n        // \\\\\"Member not found\\\\\" in strict mode, and in Firefox which does not\n        // support window.event.\n        if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n          window.event = windowEvent;\n        }\n      } // Create an event handler for our fake event. We will synchronously\n      // dispatch our fake event using \\`dispatchEvent\\`. Inside the handler, we\n      // call the user-provided callback.\n      var funcArgs = Array.prototype.slice.call(arguments, 3);\n      function callCallback() {\n        didCall = true;\n        restoreAfterDispatch();\n        func.apply(context, funcArgs);\n        didError = false;\n      } // Create a global error event handler. We use this to capture the value\n      // that was thrown. It's possible that this error handler will fire more\n      // than once; for example, if non-React code also calls \\`dispatchEvent\\`\n      // and a handler for that event throws. We should be resilient to most of\n      // those cases. Even if our error event handler fires more than once, the\n      // last error event is always used. If the callback actually does error,\n      // we know that the last error event is the correct one, because it's not\n      // possible for anything else to have happened in between our callback\n      // erroring and the code that follows the \\`dispatchEvent\\` call below. If\n      // the callback doesn't error, but the error event was fired, we know to\n      // ignore it because \\`didError\\` will be false, as described above.\n      var error; // Use this to track whether the error event is ever called.\n      var didSetError = false;\n      var isCrossOriginError = false;\n      function handleWindowError(event) {\n        error = event.error;\n        didSetError = true;\n        if (error === null && event.colno === 0 && event.lineno === 0) {\n          isCrossOriginError = true;\n        }\n        if (event.defaultPrevented) {\n          // Some other error handler has prevented default.\n          // Browsers silence the error report if this happens.\n          // We'll remember this to later decide whether to log it or not.\n          if (error != null && typeof error === 'object') {\n            try {\n              error._suppressLogging = true;\n            } catch (inner) {// Ignore.\n            }\n          }\n        }\n      } // Create a fake event type.\n      var evtType = \\\\\"react-\\\\\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n      window.addEventListener('error', handleWindowError);\n      fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n      // errors, it will trigger our global error handler.\n      evt.initEvent(evtType, false, false);\n      fakeNode.dispatchEvent(evt);\n      if (windowEventDescriptor) {\n        Object.defineProperty(window, 'event', windowEventDescriptor);\n      }\n      if (didCall && didError) {\n        if (!didSetError) {\n          // The callback errored, but the error event never fired.\n          error = new Error('An error was thrown inside one of your components, but React ' + \\\\\"doesn't know what it was. This is likely due to browser \\\\\" + 'flakiness. React does its best to preserve the \\\\\"Pause on ' + 'exceptions\\\\\" behavior of the DevTools, which requires some ' + \\\\\"DEV-mode only tricks. It's possible that these don't work in \\\\\" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n        } else if (isCrossOriginError) {\n          error = new Error(\\\\\"A cross-origin error was thrown. React doesn't have access to \\\\\" + 'the actual error object in development. ' + 'See https://reactjs.org/link/crossorigin-error for more information.');\n        }\n        this.onError(error);\n      } // Remove our event listeners\n      window.removeEventListener('error', handleWindowError);\n      if (!didCall) {\n        // Something went really wrong, and our event was not dispatched.\n        // https://github.com/facebook/react/issues/16734\n        // https://github.com/facebook/react/issues/16585\n        // Fall back to the production implementation.\n        restoreAfterDispatch();\n        return invokeGuardedCallbackProd.apply(this, arguments);\n      }\n    };\n  }\n}\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n  onError: function (error) {\n    hasError = true;\n    caughtError = error;\n  }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n  hasError = false;\n  caughtError = null;\n  invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by \\`rethrowCaughtError\\` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n  invokeGuardedCallback.apply(this, arguments);\n  if (hasError) {\n    var error = clearCaughtError();\n    if (!hasRethrowError) {\n      hasRethrowError = true;\n      rethrowError = error;\n    }\n  }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\nfunction rethrowCaughtError() {\n  if (hasRethrowError) {\n    var error = rethrowError;\n    hasRethrowError = false;\n    rethrowError = null;\n    throw error;\n  }\n}\nfunction hasCaughtError() {\n  return hasError;\n}\nfunction clearCaughtError() {\n  if (hasError) {\n    var error = caughtError;\n    hasError = false;\n    caughtError = null;\n    return error;\n  } else {\n    {\n      {\n        throw Error( \\\\\"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  }\n}\n/**\n * \\`ReactInstanceMap\\` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\nfunction get(key) {\n  return key._reactInternals;\n}\nfunction has(key) {\n  return key._reactInternals !== undefined;\n}\nfunction set(key, value) {\n  key._reactInternals = value;\n}\n// Don't change these two values. They're used by React Dev Tools.\nvar NoFlags =\n/*                      */\n0;\nvar PerformedWork =\n/*                */\n1; // You can change the rest (and add more).\nvar Placement =\n/*                    */\n2;\nvar Update =\n/*                       */\n4;\nvar PlacementAndUpdate =\n/*           */\n6;\nvar Deletion =\n/*                     */\n8;\nvar ContentReset =\n/*                 */\n16;\nvar Callback =\n/*                     */\n32;\nvar DidCapture =\n/*                   */\n64;\nvar Ref =\n/*                          */\n128;\nvar Snapshot =\n/*                     */\n256;\nvar Passive =\n/*                      */\n512; // TODO (effects) Remove this bit once the new reconciler is synced to the old.\nvar PassiveUnmountPendingDev =\n/*     */\n8192;\nvar Hydrating =\n/*                    */\n1024;\nvar HydratingAndUpdate =\n/*           */\n1028; // Passive & Update & Callback & Ref & Snapshot\nvar LifecycleEffectMask =\n/*          */\n932; // Union of all host effects\nvar HostEffectMask =\n/*               */\n2047; // These are not really side effects, but we still reuse this field.\nvar Incomplete =\n/*                   */\n2048;\nvar ShouldCapture =\n/*                */\n4096;\nvar ForceUpdateForLegacySuspense =\n/* */\n16384; // Static tags describe aspects of a fiber that are not specific to a render,\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n  var node = fiber;\n  var nearestMounted = fiber;\n  if (!fiber.alternate) {\n    // If there is no alternate, this might be a new tree that isn't inserted\n    // yet. If it is, then it will have a pending insertion effect on it.\n    var nextNode = node;\n    do {\n      node = nextNode;\n      if ((node.flags & (Placement | Hydrating)) !== NoFlags) {\n        // This is an insertion or in-progress hydration. The nearest possible\n        // mounted fiber is the parent but we need to continue to figure out\n        // if that one is still mounted.\n        nearestMounted = node.return;\n      }\n      nextNode = node.return;\n    } while (nextNode);\n  } else {\n    while (node.return) {\n      node = node.return;\n    }\n  }\n  if (node.tag === HostRoot) {\n    // TODO: Check if this was a nested HostRoot when used with\n    // renderContainerIntoSubtree.\n    return nearestMounted;\n  } // If we didn't hit the root, that means that we're in an disconnected tree\n  // that has been unmounted.\n  return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n  if (fiber.tag === SuspenseComponent) {\n    var suspenseState = fiber.memoizedState;\n    if (suspenseState === null) {\n      var current = fiber.alternate;\n      if (current !== null) {\n        suspenseState = current.memoizedState;\n      }\n    }\n    if (suspenseState !== null) {\n      return suspenseState.dehydrated;\n    }\n  }\n  return null;\n}\nfunction getContainerFromFiber(fiber) {\n  return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n  return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n  {\n    var owner = ReactCurrentOwner.current;\n    if (owner !== null && owner.tag === ClassComponent) {\n      var ownerFiber = owner;\n      var instance = ownerFiber.stateNode;\n      if (!instance._warnedAboutRefsInRender) {\n        error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');\n      }\n      instance._warnedAboutRefsInRender = true;\n    }\n  }\n  var fiber = get(component);\n  if (!fiber) {\n    return false;\n  }\n  return getNearestMountedFiber(fiber) === fiber;\n}\nfunction assertIsMounted(fiber) {\n  if (!(getNearestMountedFiber(fiber) === fiber)) {\n    {\n      throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n    }\n  }\n}\nfunction findCurrentFiberUsingSlowPath(fiber) {\n  var alternate = fiber.alternate;\n  if (!alternate) {\n    // If there is no alternate, then we only need to check if it is mounted.\n    var nearestMounted = getNearestMountedFiber(fiber);\n    if (!(nearestMounted !== null)) {\n      {\n        throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n      }\n    }\n    if (nearestMounted !== fiber) {\n      return null;\n    }\n    return fiber;\n  } // If we have two possible branches, we'll walk backwards up to the root\n  // to see what path the root points to. On the way we may hit one of the\n  // special cases and we'll deal with them.\n  var a = fiber;\n  var b = alternate;\n  while (true) {\n    var parentA = a.return;\n    if (parentA === null) {\n      // We're at the root.\n      break;\n    }\n    var parentB = parentA.alternate;\n    if (parentB === null) {\n      // There is no alternate. This is an unusual case. Currently, it only\n      // happens when a Suspense component is hidden. An extra fragment fiber\n      // is inserted in between the Suspense fiber and its children. Skip\n      // over this extra fragment fiber and proceed to the next parent.\n      var nextParent = parentA.return;\n      if (nextParent !== null) {\n        a = b = nextParent;\n        continue;\n      } // If there's no parent, we're at the root.\n      break;\n    } // If both copies of the parent fiber point to the same child, we can\n    // assume that the child is current. This happens when we bailout on low\n    // priority: the bailed out fiber's child reuses the current child.\n    if (parentA.child === parentB.child) {\n      var child = parentA.child;\n      while (child) {\n        if (child === a) {\n          // We've determined that A is the current branch.\n          assertIsMounted(parentA);\n          return fiber;\n        }\n        if (child === b) {\n          // We've determined that B is the current branch.\n          assertIsMounted(parentA);\n          return alternate;\n        }\n        child = child.sibling;\n      } // We should never have an alternate for any mounting node. So the only\n      // way this could possibly happen is if this was unmounted, if at all.\n      {\n        {\n          throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n        }\n      }\n    }\n    if (a.return !== b.return) {\n      // The return pointer of A and the return pointer of B point to different\n      // fibers. We assume that return pointers never criss-cross, so A must\n      // belong to the child set of A.return, and B must belong to the child\n      // set of B.return.\n      a = parentA;\n      b = parentB;\n    } else {\n      // The return pointers point to the same fiber. We'll have to use the\n      // default, slow path: scan the child sets of each parent alternate to see\n      // which child belongs to which set.\n      //\n      // Search parent A's child set\n      var didFindChild = false;\n      var _child = parentA.child;\n      while (_child) {\n        if (_child === a) {\n          didFindChild = true;\n          a = parentA;\n          b = parentB;\n          break;\n        }\n        if (_child === b) {\n          didFindChild = true;\n          b = parentA;\n          a = parentB;\n          break;\n        }\n        _child = _child.sibling;\n      }\n      if (!didFindChild) {\n        // Search parent B's child set\n        _child = parentB.child;\n        while (_child) {\n          if (_child === a) {\n            didFindChild = true;\n            a = parentB;\n            b = parentA;\n            break;\n          }\n          if (_child === b) {\n            didFindChild = true;\n            b = parentB;\n            a = parentA;\n            break;\n          }\n          _child = _child.sibling;\n        }\n        if (!didFindChild) {\n          {\n            throw Error( \\\\\"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\\\\\" );\n          }\n        }\n      }\n    }\n    if (!(a.alternate === b)) {\n      {\n        throw Error( \\\\\"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  } // If the root is not a host container, we're in a disconnected tree. I.e.\n  // unmounted.\n  if (!(a.tag === HostRoot)) {\n    {\n      throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n    }\n  }\n  if (a.stateNode.current === a) {\n    // We've determined that A is the current branch.\n    return fiber;\n  } // Otherwise B has to be current branch.\n  return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  } // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText) {\n      return node;\n    } else if (node.child) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node.return || node.return === currentParent) {\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  } // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  } // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {\n      return node;\n    } else if (node.child && node.tag !== HostPortal) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node.return || node.return === currentParent) {\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  } // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\nfunction doesFiberContain(parentFiber, childFiber) {\n  var node = childFiber;\n  var parentFiberAlternate = parentFiber.alternate;\n  while (node !== null) {\n    if (node === parentFiber || node === parentFiberAlternate) {\n      return true;\n    }\n    node = node.return;\n  }\n  return false;\n}\nvar attemptUserBlockingHydration;\nfunction setAttemptUserBlockingHydration(fn) {\n  attemptUserBlockingHydration = fn;\n}\nvar attemptContinuousHydration;\nfunction setAttemptContinuousHydration(fn) {\n  attemptContinuousHydration = fn;\n}\nvar attemptHydrationAtCurrentPriority;\nfunction setAttemptHydrationAtCurrentPriority(fn) {\n  attemptHydrationAtCurrentPriority = fn;\n}\nvar attemptHydrationAtPriority;\nfunction setAttemptHydrationAtPriority(fn) {\n  attemptHydrationAtPriority = fn;\n} // TODO: Upgrade this definition once we're on a newer version of Flow that\nvar hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.\nvar queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.\n// if the last target was dehydrated.\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; // For pointer events there can be one latest event per pointerId.\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.\nvar queuedExplicitHydrationTargets = [];\nfunction hasQueuedDiscreteEvents() {\n  return queuedDiscreteEvents.length > 0;\n}\nvar discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', // Intentionally camelCase\n'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit'];\nfunction isReplayableDiscreteEvent(eventType) {\n  return discreteReplayableEvents.indexOf(eventType) > -1;\n}\nfunction createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n  return {\n    blockedOn: blockedOn,\n    domEventName: domEventName,\n    eventSystemFlags: eventSystemFlags | IS_REPLAYED,\n    nativeEvent: nativeEvent,\n    targetContainers: [targetContainer]\n  };\n}\nfunction queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n  var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n  queuedDiscreteEvents.push(queuedEvent);\n} // Resets the replaying for this type of continuous event to no event.\nfunction clearIfContinuousEvent(domEventName, nativeEvent) {\n  switch (domEventName) {\n    case 'focusin':\n    case 'focusout':\n      queuedFocus = null;\n      break;\n    case 'dragenter':\n    case 'dragleave':\n      queuedDrag = null;\n      break;\n    case 'mouseover':\n    case 'mouseout':\n      queuedMouse = null;\n      break;\n    case 'pointerover':\n    case 'pointerout':\n      {\n        var pointerId = nativeEvent.pointerId;\n        queuedPointers.delete(pointerId);\n        break;\n      }\n    case 'gotpointercapture':\n    case 'lostpointercapture':\n      {\n        var _pointerId = nativeEvent.pointerId;\n        queuedPointerCaptures.delete(_pointerId);\n        break;\n      }\n  }\n}\nfunction accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n  if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n    var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n    if (blockedOn !== null) {\n      var _fiber2 = getInstanceFromNode(blockedOn);\n      if (_fiber2 !== null) {\n        // Attempt to increase the priority of this target.\n        attemptContinuousHydration(_fiber2);\n      }\n    }\n    return queuedEvent;\n  } // If we have already queued this exact event, then it's because\n  // the different event systems have different DOM event listeners.\n  // We can accumulate the flags, and the targetContainers, and\n  // store a single event to be replayed.\n  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n  var targetContainers = existingQueuedEvent.targetContainers;\n  if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {\n    targetContainers.push(targetContainer);\n  }\n  return existingQueuedEvent;\n}\nfunction queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n  // These set relatedTarget to null because the replayed event will be treated as if we\n  // moved from outside the window (no target) onto the target once it hydrates.\n  // Instead of mutating we could clone the event.\n  switch (domEventName) {\n    case 'focusin':\n      {\n        var focusEvent = nativeEvent;\n        queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);\n        return true;\n      }\n    case 'dragenter':\n      {\n        var dragEvent = nativeEvent;\n        queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);\n        return true;\n      }\n    case 'mouseover':\n      {\n        var mouseEvent = nativeEvent;\n        queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);\n        return true;\n      }\n    case 'pointerover':\n      {\n        var pointerEvent = nativeEvent;\n        var pointerId = pointerEvent.pointerId;\n        queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));\n        return true;\n      }\n    case 'gotpointercapture':\n      {\n        var _pointerEvent = nativeEvent;\n        var _pointerId2 = _pointerEvent.pointerId;\n        queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));\n        return true;\n      }\n  }\n  return false;\n} // Check if this target is unblocked. Returns true if it's unblocked.\nfunction attemptExplicitHydrationTarget(queuedTarget) {\n  // TODO: This function shares a lot of logic with attemptToDispatchEvent.\n  // Try to unify them. It's a bit tricky since it would require two return\n  // values.\n  var targetInst = getClosestInstanceFromNode(queuedTarget.target);\n  if (targetInst !== null) {\n    var nearestMounted = getNearestMountedFiber(targetInst);\n    if (nearestMounted !== null) {\n      var tag = nearestMounted.tag;\n      if (tag === SuspenseComponent) {\n        var instance = getSuspenseInstanceFromFiber(nearestMounted);\n        if (instance !== null) {\n          // We're blocked on hydrating this boundary.\n          // Increase its priority.\n          queuedTarget.blockedOn = instance;\n          attemptHydrationAtPriority(queuedTarget.lanePriority, function () {\n            Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {\n              attemptHydrationAtCurrentPriority(nearestMounted);\n            });\n          });\n          return;\n        }\n      } else if (tag === HostRoot) {\n        var root = nearestMounted.stateNode;\n        if (root.hydrate) {\n          queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of\n          // a root other than sync.\n          return;\n        }\n      }\n    }\n  }\n  queuedTarget.blockedOn = null;\n}\nfunction attemptReplayContinuousQueuedEvent(queuedEvent) {\n  if (queuedEvent.blockedOn !== null) {\n    return false;\n  }\n  var targetContainers = queuedEvent.targetContainers;\n  while (targetContainers.length > 0) {\n    var targetContainer = targetContainers[0];\n    var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);\n    if (nextBlockedOn !== null) {\n      // We're still blocked. Try again later.\n      var _fiber3 = getInstanceFromNode(nextBlockedOn);\n      if (_fiber3 !== null) {\n        attemptContinuousHydration(_fiber3);\n      }\n      queuedEvent.blockedOn = nextBlockedOn;\n      return false;\n    } // This target container was successfully dispatched. Try the next.\n    targetContainers.shift();\n  }\n  return true;\n}\nfunction attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {\n  if (attemptReplayContinuousQueuedEvent(queuedEvent)) {\n    map.delete(key);\n  }\n}\nfunction replayUnblockedEvents() {\n  hasScheduledReplayAttempt = false; // First replay discrete events.\n  while (queuedDiscreteEvents.length > 0) {\n    var nextDiscreteEvent = queuedDiscreteEvents[0];\n    if (nextDiscreteEvent.blockedOn !== null) {\n      // We're still blocked.\n      // Increase the priority of this boundary to unblock\n      // the next discrete event.\n      var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);\n      if (_fiber4 !== null) {\n        attemptUserBlockingHydration(_fiber4);\n      }\n      break;\n    }\n    var targetContainers = nextDiscreteEvent.targetContainers;\n    while (targetContainers.length > 0) {\n      var targetContainer = targetContainers[0];\n      var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);\n      if (nextBlockedOn !== null) {\n        // We're still blocked. Try again later.\n        nextDiscreteEvent.blockedOn = nextBlockedOn;\n        break;\n      } // This target container was successfully dispatched. Try the next.\n      targetContainers.shift();\n    }\n    if (nextDiscreteEvent.blockedOn === null) {\n      // We've successfully replayed the first event. Let's try the next one.\n      queuedDiscreteEvents.shift();\n    }\n  } // Next replay any continuous events.\n  if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {\n    queuedFocus = null;\n  }\n  if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {\n    queuedDrag = null;\n  }\n  if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {\n    queuedMouse = null;\n  }\n  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);\n  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);\n}\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n  if (queuedEvent.blockedOn === unblocked) {\n    queuedEvent.blockedOn = null;\n    if (!hasScheduledReplayAttempt) {\n      hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are\n      // now unblocked. This first might not actually be unblocked yet.\n      // We could check it early to avoid scheduling an unnecessary callback.\n      Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n    }\n  }\n}\nfunction retryIfBlockedOn(unblocked) {\n  // Mark anything that was blocked on this as no longer blocked\n  // and eligible for a replay.\n  if (queuedDiscreteEvents.length > 0) {\n    scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's\n    // worth it because we expect very few discrete events to queue up and once\n    // we are actually fully unblocked it will be fast to replay them.\n    for (var i = 1; i < queuedDiscreteEvents.length; i++) {\n      var queuedEvent = queuedDiscreteEvents[i];\n      if (queuedEvent.blockedOn === unblocked) {\n        queuedEvent.blockedOn = null;\n      }\n    }\n  }\n  if (queuedFocus !== null) {\n    scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n  }\n  if (queuedDrag !== null) {\n    scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n  }\n  if (queuedMouse !== null) {\n    scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n  }\n  var unblock = function (queuedEvent) {\n    return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n  };\n  queuedPointers.forEach(unblock);\n  queuedPointerCaptures.forEach(unblock);\n  for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {\n    var queuedTarget = queuedExplicitHydrationTargets[_i];\n    if (queuedTarget.blockedOn === unblocked) {\n      queuedTarget.blockedOn = null;\n    }\n  }\n  while (queuedExplicitHydrationTargets.length > 0) {\n    var nextExplicitTarget = queuedExplicitHydrationTargets[0];\n    if (nextExplicitTarget.blockedOn !== null) {\n      // We're still blocked.\n      break;\n    } else {\n      attemptExplicitHydrationTarget(nextExplicitTarget);\n      if (nextExplicitTarget.blockedOn === null) {\n        // We're unblocked.\n        queuedExplicitHydrationTargets.shift();\n      }\n    }\n  }\n}\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\nfunction makePrefixMap(styleProp, eventName) {\n  var prefixes = {};\n  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n  prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n  prefixes['Moz' + styleProp] = 'moz' + eventName;\n  return prefixes;\n}\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\nvar vendorPrefixes = {\n  animationend: makePrefixMap('Animation', 'AnimationEnd'),\n  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n  animationstart: makePrefixMap('Animation', 'AnimationStart'),\n  transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\nvar prefixedEventNames = {};\n/**\n * Element to check for prefixes on.\n */\nvar style = {};\n/**\n * Bootstrap if a DOM exists.\n */\nif (canUseDOM) {\n  style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,\n  // the un-prefixed \\\\\"animation\\\\\" and \\\\\"transition\\\\\" properties are defined on the\n  // style object but the events that fire will still be prefixed, so we need\n  // to check if the un-prefixed events are usable, and if not remove them from the map.\n  if (!('AnimationEvent' in window)) {\n    delete vendorPrefixes.animationend.animation;\n    delete vendorPrefixes.animationiteration.animation;\n    delete vendorPrefixes.animationstart.animation;\n  } // Same as above\n  if (!('TransitionEvent' in window)) {\n    delete vendorPrefixes.transitionend.transition;\n  }\n}\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\nfunction getVendorPrefixedEventName(eventName) {\n  if (prefixedEventNames[eventName]) {\n    return prefixedEventNames[eventName];\n  } else if (!vendorPrefixes[eventName]) {\n    return eventName;\n  }\n  var prefixMap = vendorPrefixes[eventName];\n  for (var styleProp in prefixMap) {\n    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n      return prefixedEventNames[eventName] = prefixMap[styleProp];\n    }\n  }\n  return eventName;\n}\nvar ANIMATION_END = getVendorPrefixedEventName('animationend');\nvar ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration');\nvar ANIMATION_START = getVendorPrefixedEventName('animationstart');\nvar TRANSITION_END = getVendorPrefixedEventName('transitionend');\nvar topLevelEventsToReactNames = new Map();\nvar eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use\n// the code required to apply the same logic for event prioritization and that of the\n// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code\n// duplication (for which there would be quite a bit). For the events that are not needed\n// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an\n// array of top level events.\n// Lastly, we ignore prettier so we can keep the formatting sane.\n// prettier-ignore\nvar discreteEventPairsForSimpleEventPlugin = ['cancel', 'cancel', 'click', 'click', 'close', 'close', 'contextmenu', 'contextMenu', 'copy', 'copy', 'cut', 'cut', 'auxclick', 'auxClick', 'dblclick', 'doubleClick', // Careful!\n'dragend', 'dragEnd', 'dragstart', 'dragStart', 'drop', 'drop', 'focusin', 'focus', // Careful!\n'focusout', 'blur', // Careful!\n'input', 'input', 'invalid', 'invalid', 'keydown', 'keyDown', 'keypress', 'keyPress', 'keyup', 'keyUp', 'mousedown', 'mouseDown', 'mouseup', 'mouseUp', 'paste', 'paste', 'pause', 'pause', 'play', 'play', 'pointercancel', 'pointerCancel', 'pointerdown', 'pointerDown', 'pointerup', 'pointerUp', 'ratechange', 'rateChange', 'reset', 'reset', 'seeked', 'seeked', 'submit', 'submit', 'touchcancel', 'touchCancel', 'touchend', 'touchEnd', 'touchstart', 'touchStart', 'volumechange', 'volumeChange'];\nvar otherDiscreteEvents = ['change', 'selectionchange', 'textInput', 'compositionstart', 'compositionend', 'compositionupdate'];\nvar userBlockingPairsForSimpleEventPlugin = ['drag', 'drag', 'dragenter', 'dragEnter', 'dragexit', 'dragExit', 'dragleave', 'dragLeave', 'dragover', 'dragOver', 'mousemove', 'mouseMove', 'mouseout', 'mouseOut', 'mouseover', 'mouseOver', 'pointermove', 'pointerMove', 'pointerout', 'pointerOut', 'pointerover', 'pointerOver', 'scroll', 'scroll', 'toggle', 'toggle', 'touchmove', 'touchMove', 'wheel', 'wheel']; // prettier-ignore\nvar continuousPairsForSimpleEventPlugin = ['abort', 'abort', ANIMATION_END, 'animationEnd', ANIMATION_ITERATION, 'animationIteration', ANIMATION_START, 'animationStart', 'canplay', 'canPlay', 'canplaythrough', 'canPlayThrough', 'durationchange', 'durationChange', 'emptied', 'emptied', 'encrypted', 'encrypted', 'ended', 'ended', 'error', 'error', 'gotpointercapture', 'gotPointerCapture', 'load', 'load', 'loadeddata', 'loadedData', 'loadedmetadata', 'loadedMetadata', 'loadstart', 'loadStart', 'lostpointercapture', 'lostPointerCapture', 'playing', 'playing', 'progress', 'progress', 'seeking', 'seeking', 'stalled', 'stalled', 'suspend', 'suspend', 'timeupdate', 'timeUpdate', TRANSITION_END, 'transitionEnd', 'waiting', 'waiting'];\n/**\n * Turns\n * ['abort', ...]\n *\n * into\n *\n * topLevelEventsToReactNames = new Map([\n *   ['abort', 'onAbort'],\n * ]);\n *\n * and registers them.\n */\nfunction registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {\n  // As the event types are in pairs of two, we need to iterate\n  // through in twos. The events are in pairs of two to save code\n  // and improve init perf of processing this array, as it will\n  // result in far fewer object allocations and property accesses\n  // if we only use three arrays to process all the categories of\n  // instead of tuples.\n  for (var i = 0; i < eventTypes.length; i += 2) {\n    var topEvent = eventTypes[i];\n    var event = eventTypes[i + 1];\n    var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n    var reactName = 'on' + capitalizedEvent;\n    eventPriorities.set(topEvent, priority);\n    topLevelEventsToReactNames.set(topEvent, reactName);\n    registerTwoPhaseEvent(reactName, [topEvent]);\n  }\n}\nfunction setEventPriorities(eventTypes, priority) {\n  for (var i = 0; i < eventTypes.length; i++) {\n    eventPriorities.set(eventTypes[i], priority);\n  }\n}\nfunction getEventPriorityForPluginSystem(domEventName) {\n  var priority = eventPriorities.get(domEventName); // Default to a ContinuousEvent. Note: we might\n  // want to warn if we can't detect the priority\n  // for the event.\n  return priority === undefined ? ContinuousEvent : priority;\n}\nfunction registerSimpleEvents() {\n  registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);\n  registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);\n  registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);\n  setEventPriorities(otherDiscreteEvents, DiscreteEvent);\n}\nvar Scheduler_now = Scheduler.unstable_now;\n{\n  // Provide explicit error message when production+profiling bundle of e.g.\n  // react-dom is used with production (non-profiling) bundle of\n  // scheduler/tracing\n  if (!(tracing$1.__interactionsRef != null && tracing$1.__interactionsRef.current != null)) {\n    {\n      throw Error( \\\\\"It is not supported to run the profiling version of a renderer (for example, \\`react-dom/profiling\\`) without also replacing the \\`scheduler/tracing\\` module with \\`scheduler/tracing-profiling\\`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling\\\\\" );\n    }\n  }\n}\n// ascending numbers so we can compare them like numbers. They start at 90 to\n// avoid clashing with Scheduler's priorities.\nvar ImmediatePriority = 99;\nvar UserBlockingPriority = 98;\nvar NormalPriority = 97;\nvar LowPriority = 96;\nvar IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.\nvar NoPriority = 90;\nvar initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's \\`now\\` directly.\nvar SyncLanePriority = 15;\nvar SyncBatchedLanePriority = 14;\nvar InputDiscreteHydrationLanePriority = 13;\nvar InputDiscreteLanePriority = 12;\nvar InputContinuousHydrationLanePriority = 11;\nvar InputContinuousLanePriority = 10;\nvar DefaultHydrationLanePriority = 9;\nvar DefaultLanePriority = 8;\nvar TransitionHydrationPriority = 7;\nvar TransitionPriority = 6;\nvar RetryLanePriority = 5;\nvar SelectiveHydrationLanePriority = 4;\nvar IdleHydrationLanePriority = 3;\nvar IdleLanePriority = 2;\nvar OffscreenLanePriority = 1;\nvar NoLanePriority = 0;\nvar TotalLanes = 31;\nvar NoLanes =\n/*                        */\n0;\nvar NoLane =\n/*                          */\n0;\nvar SyncLane =\n/*                        */\n1;\nvar SyncBatchedLane =\n/*                 */\n2;\nvar InputDiscreteHydrationLane =\n/*      */\n4;\nvar InputDiscreteLanes =\n/*                    */\n24;\nvar InputContinuousHydrationLane =\n/*           */\n32;\nvar InputContinuousLanes =\n/*                  */\n192;\nvar DefaultHydrationLane =\n/*            */\n256;\nvar DefaultLanes =\n/*                   */\n3584;\nvar TransitionHydrationLane =\n/*                */\n4096;\nvar TransitionLanes =\n/*                       */\n4186112;\nvar RetryLanes =\n/*                            */\n62914560;\nvar SomeRetryLane =\n/*                  */\n33554432;\nvar SelectiveHydrationLane =\n/*          */\n67108864;\nvar NonIdleLanes =\n/*                                 */\n134217727;\nvar IdleHydrationLane =\n/*               */\n134217728;\nvar IdleLanes =\n/*                             */\n805306368;\nvar OffscreenLane =\n/*                   */\n1073741824;\nvar NoTimestamp = -1;\nfunction setCurrentUpdateLanePriority(newLanePriority) {\n} // \\\\\"Registers\\\\\" used to \\\\\"return\\\\\" multiple values\n// Used by getHighestPriorityLanes and getNextLanes:\nvar return_highestLanePriority = DefaultLanePriority;\nfunction getHighestPriorityLanes(lanes) {\n  if ((SyncLane & lanes) !== NoLanes) {\n    return_highestLanePriority = SyncLanePriority;\n    return SyncLane;\n  }\n  if ((SyncBatchedLane & lanes) !== NoLanes) {\n    return_highestLanePriority = SyncBatchedLanePriority;\n    return SyncBatchedLane;\n  }\n  if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {\n    return_highestLanePriority = InputDiscreteHydrationLanePriority;\n    return InputDiscreteHydrationLane;\n  }\n  var inputDiscreteLanes = InputDiscreteLanes & lanes;\n  if (inputDiscreteLanes !== NoLanes) {\n    return_highestLanePriority = InputDiscreteLanePriority;\n    return inputDiscreteLanes;\n  }\n  if ((lanes & InputContinuousHydrationLane) !== NoLanes) {\n    return_highestLanePriority = InputContinuousHydrationLanePriority;\n    return InputContinuousHydrationLane;\n  }\n  var inputContinuousLanes = InputContinuousLanes & lanes;\n  if (inputContinuousLanes !== NoLanes) {\n    return_highestLanePriority = InputContinuousLanePriority;\n    return inputContinuousLanes;\n  }\n  if ((lanes & DefaultHydrationLane) !== NoLanes) {\n    return_highestLanePriority = DefaultHydrationLanePriority;\n    return DefaultHydrationLane;\n  }\n  var defaultLanes = DefaultLanes & lanes;\n  if (defaultLanes !== NoLanes) {\n    return_highestLanePriority = DefaultLanePriority;\n    return defaultLanes;\n  }\n  if ((lanes & TransitionHydrationLane) !== NoLanes) {\n    return_highestLanePriority = TransitionHydrationPriority;\n    return TransitionHydrationLane;\n  }\n  var transitionLanes = TransitionLanes & lanes;\n  if (transitionLanes !== NoLanes) {\n    return_highestLanePriority = TransitionPriority;\n    return transitionLanes;\n  }\n  var retryLanes = RetryLanes & lanes;\n  if (retryLanes !== NoLanes) {\n    return_highestLanePriority = RetryLanePriority;\n    return retryLanes;\n  }\n  if (lanes & SelectiveHydrationLane) {\n    return_highestLanePriority = SelectiveHydrationLanePriority;\n    return SelectiveHydrationLane;\n  }\n  if ((lanes & IdleHydrationLane) !== NoLanes) {\n    return_highestLanePriority = IdleHydrationLanePriority;\n    return IdleHydrationLane;\n  }\n  var idleLanes = IdleLanes & lanes;\n  if (idleLanes !== NoLanes) {\n    return_highestLanePriority = IdleLanePriority;\n    return idleLanes;\n  }\n  if ((OffscreenLane & lanes) !== NoLanes) {\n    return_highestLanePriority = OffscreenLanePriority;\n    return OffscreenLane;\n  }\n  {\n    error('Should have found matching lanes. This is a bug in React.');\n  } // This shouldn't be reachable, but as a fallback, return the entire bitmask.\n  return_highestLanePriority = DefaultLanePriority;\n  return lanes;\n}\nfunction schedulerPriorityToLanePriority(schedulerPriorityLevel) {\n  switch (schedulerPriorityLevel) {\n    case ImmediatePriority:\n      return SyncLanePriority;\n    case UserBlockingPriority:\n      return InputContinuousLanePriority;\n    case NormalPriority:\n    case LowPriority:\n      // TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration.\n      return DefaultLanePriority;\n    case IdlePriority:\n      return IdleLanePriority;\n    default:\n      return NoLanePriority;\n  }\n}\nfunction lanePriorityToSchedulerPriority(lanePriority) {\n  switch (lanePriority) {\n    case SyncLanePriority:\n    case SyncBatchedLanePriority:\n      return ImmediatePriority;\n    case InputDiscreteHydrationLanePriority:\n    case InputDiscreteLanePriority:\n    case InputContinuousHydrationLanePriority:\n    case InputContinuousLanePriority:\n      return UserBlockingPriority;\n    case DefaultHydrationLanePriority:\n    case DefaultLanePriority:\n    case TransitionHydrationPriority:\n    case TransitionPriority:\n    case SelectiveHydrationLanePriority:\n    case RetryLanePriority:\n      return NormalPriority;\n    case IdleHydrationLanePriority:\n    case IdleLanePriority:\n    case OffscreenLanePriority:\n      return IdlePriority;\n    case NoLanePriority:\n      return NoPriority;\n    default:\n      {\n        {\n          throw Error( \\\\\"Invalid update priority: \\\\\" + lanePriority + \\\\\". This is a bug in React.\\\\\" );\n        }\n      }\n  }\n}\nfunction getNextLanes(root, wipLanes) {\n  // Early bailout if there's no pending work left.\n  var pendingLanes = root.pendingLanes;\n  if (pendingLanes === NoLanes) {\n    return_highestLanePriority = NoLanePriority;\n    return NoLanes;\n  }\n  var nextLanes = NoLanes;\n  var nextLanePriority = NoLanePriority;\n  var expiredLanes = root.expiredLanes;\n  var suspendedLanes = root.suspendedLanes;\n  var pingedLanes = root.pingedLanes; // Check if any work has expired.\n  if (expiredLanes !== NoLanes) {\n    nextLanes = expiredLanes;\n    nextLanePriority = return_highestLanePriority = SyncLanePriority;\n  } else {\n    // Do not work on any idle work until all the non-idle work has finished,\n    // even if the work is suspended.\n    var nonIdlePendingLanes = pendingLanes & NonIdleLanes;\n    if (nonIdlePendingLanes !== NoLanes) {\n      var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;\n      if (nonIdleUnblockedLanes !== NoLanes) {\n        nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);\n        nextLanePriority = return_highestLanePriority;\n      } else {\n        var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;\n        if (nonIdlePingedLanes !== NoLanes) {\n          nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);\n          nextLanePriority = return_highestLanePriority;\n        }\n      }\n    } else {\n      // The only remaining work is Idle.\n      var unblockedLanes = pendingLanes & ~suspendedLanes;\n      if (unblockedLanes !== NoLanes) {\n        nextLanes = getHighestPriorityLanes(unblockedLanes);\n        nextLanePriority = return_highestLanePriority;\n      } else {\n        if (pingedLanes !== NoLanes) {\n          nextLanes = getHighestPriorityLanes(pingedLanes);\n          nextLanePriority = return_highestLanePriority;\n        }\n      }\n    }\n  }\n  if (nextLanes === NoLanes) {\n    // This should only be reachable if we're suspended\n    // TODO: Consider warning in this path if a fallback timer is not scheduled.\n    return NoLanes;\n  } // If there are higher priority lanes, we'll include them even if they\n  // are suspended.\n  nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes); // If we're already in the middle of a render, switching lanes will interrupt\n  // it and we'll lose our progress. We should only do this if the new lanes are\n  // higher priority.\n  if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't\n  // bother waiting until the root is complete.\n  (wipLanes & suspendedLanes) === NoLanes) {\n    getHighestPriorityLanes(wipLanes);\n    var wipLanePriority = return_highestLanePriority;\n    if (nextLanePriority <= wipLanePriority) {\n      return wipLanes;\n    } else {\n      return_highestLanePriority = nextLanePriority;\n    }\n  } // Check for entangled lanes and add them to the batch.\n  //\n  // A lane is said to be entangled with another when it's not allowed to render\n  // in a batch that does not also include the other lane. Typically we do this\n  // when multiple updates have the same source, and we only want to respond to\n  // the most recent event from that source.\n  //\n  // Note that we apply entanglements *after* checking for partial work above.\n  // This means that if a lane is entangled during an interleaved event while\n  // it's already rendering, we won't interrupt it. This is intentional, since\n  // entanglement is usually \\\\\"best effort\\\\\": we'll try our best to render the\n  // lanes in the same batch, but it's not worth throwing out partially\n  // completed work in order to do it.\n  //\n  // For those exceptions where entanglement is semantically important, like\n  // useMutableSource, we should ensure that there is no partial work at the\n  // time we apply the entanglement.\n  var entangledLanes = root.entangledLanes;\n  if (entangledLanes !== NoLanes) {\n    var entanglements = root.entanglements;\n    var lanes = nextLanes & entangledLanes;\n    while (lanes > 0) {\n      var index = pickArbitraryLaneIndex(lanes);\n      var lane = 1 << index;\n      nextLanes |= entanglements[index];\n      lanes &= ~lane;\n    }\n  }\n  return nextLanes;\n}\nfunction getMostRecentEventTime(root, lanes) {\n  var eventTimes = root.eventTimes;\n  var mostRecentEventTime = NoTimestamp;\n  while (lanes > 0) {\n    var index = pickArbitraryLaneIndex(lanes);\n    var lane = 1 << index;\n    var eventTime = eventTimes[index];\n    if (eventTime > mostRecentEventTime) {\n      mostRecentEventTime = eventTime;\n    }\n    lanes &= ~lane;\n  }\n  return mostRecentEventTime;\n}\nfunction computeExpirationTime(lane, currentTime) {\n  // TODO: Expiration heuristic is constant per lane, so could use a map.\n  getHighestPriorityLanes(lane);\n  var priority = return_highestLanePriority;\n  if (priority >= InputContinuousLanePriority) {\n    // User interactions should expire slightly more quickly.\n    //\n    // NOTE: This is set to the corresponding constant as in Scheduler.js. When\n    // we made it larger, a product metric in www regressed, suggesting there's\n    // a user interaction that's being starved by a series of synchronous\n    // updates. If that theory is correct, the proper solution is to fix the\n    // starvation. However, this scenario supports the idea that expiration\n    // times are an important safeguard when starvation does happen.\n    //\n    // Also note that, in the case of user input specifically, this will soon no\n    // longer be an issue because we plan to make user input synchronous by\n    // default (until you enter \\`startTransition\\`, of course.)\n    //\n    // If weren't planning to make these updates synchronous soon anyway, I\n    // would probably make this number a configurable parameter.\n    return currentTime + 250;\n  } else if (priority >= TransitionPriority) {\n    return currentTime + 5000;\n  } else {\n    // Anything idle priority or lower should never expire.\n    return NoTimestamp;\n  }\n}\nfunction markStarvedLanesAsExpired(root, currentTime) {\n  // TODO: This gets called every time we yield. We can optimize by storing\n  // the earliest expiration time on the root. Then use that to quickly bail out\n  // of this function.\n  var pendingLanes = root.pendingLanes;\n  var suspendedLanes = root.suspendedLanes;\n  var pingedLanes = root.pingedLanes;\n  var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their\n  // expiration time. If so, we'll assume the update is being starved and mark\n  // it as expired to force it to finish.\n  var lanes = pendingLanes;\n  while (lanes > 0) {\n    var index = pickArbitraryLaneIndex(lanes);\n    var lane = 1 << index;\n    var expirationTime = expirationTimes[index];\n    if (expirationTime === NoTimestamp) {\n      // Found a pending lane with no expiration time. If it's not suspended, or\n      // if it's pinged, assume it's CPU-bound. Compute a new expiration time\n      // using the current time.\n      if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {\n        // Assumes timestamps are monotonically increasing.\n        expirationTimes[index] = computeExpirationTime(lane, currentTime);\n      }\n    } else if (expirationTime <= currentTime) {\n      // This lane expired\n      root.expiredLanes |= lane;\n    }\n    lanes &= ~lane;\n  }\n} // This returns the highest priority pending lanes regardless of whether they\nfunction getLanesToRetrySynchronouslyOnError(root) {\n  var everythingButOffscreen = root.pendingLanes & ~OffscreenLane;\n  if (everythingButOffscreen !== NoLanes) {\n    return everythingButOffscreen;\n  }\n  if (everythingButOffscreen & OffscreenLane) {\n    return OffscreenLane;\n  }\n  return NoLanes;\n}\nfunction returnNextLanesPriority() {\n  return return_highestLanePriority;\n}\nfunction includesNonIdleWork(lanes) {\n  return (lanes & NonIdleLanes) !== NoLanes;\n}\nfunction includesOnlyRetries(lanes) {\n  return (lanes & RetryLanes) === lanes;\n}\nfunction includesOnlyTransitions(lanes) {\n  return (lanes & TransitionLanes) === lanes;\n} // To ensure consistency across multiple updates in the same event, this should\n// be a pure function, so that it always returns the same lane for given inputs.\nfunction findUpdateLane(lanePriority, wipLanes) {\n  switch (lanePriority) {\n    case NoLanePriority:\n      break;\n    case SyncLanePriority:\n      return SyncLane;\n    case SyncBatchedLanePriority:\n      return SyncBatchedLane;\n    case InputDiscreteLanePriority:\n      {\n        var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);\n        if (_lane === NoLane) {\n          // Shift to the next priority level\n          return findUpdateLane(InputContinuousLanePriority, wipLanes);\n        }\n        return _lane;\n      }\n    case InputContinuousLanePriority:\n      {\n        var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);\n        if (_lane2 === NoLane) {\n          // Shift to the next priority level\n          return findUpdateLane(DefaultLanePriority, wipLanes);\n        }\n        return _lane2;\n      }\n    case DefaultLanePriority:\n      {\n        var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);\n        if (_lane3 === NoLane) {\n          // If all the default lanes are already being worked on, look for a\n          // lane in the transition range.\n          _lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);\n          if (_lane3 === NoLane) {\n            // All the transition lanes are taken, too. This should be very\n            // rare, but as a last resort, pick a default lane. This will have\n            // the effect of interrupting the current work-in-progress render.\n            _lane3 = pickArbitraryLane(DefaultLanes);\n          }\n        }\n        return _lane3;\n      }\n    case TransitionPriority: // Should be handled by findTransitionLane instead\n    case RetryLanePriority:\n      // Should be handled by findRetryLane instead\n      break;\n    case IdleLanePriority:\n      var lane = pickArbitraryLane(IdleLanes & ~wipLanes);\n      if (lane === NoLane) {\n        lane = pickArbitraryLane(IdleLanes);\n      }\n      return lane;\n  }\n  {\n    {\n      throw Error( \\\\\"Invalid update priority: \\\\\" + lanePriority + \\\\\". This is a bug in React.\\\\\" );\n    }\n  }\n} // To ensure consistency across multiple updates in the same event, this should\n// be pure function, so that it always returns the same lane for given inputs.\nfunction findTransitionLane(wipLanes, pendingLanes) {\n  // First look for lanes that are completely unclaimed, i.e. have no\n  // pending work.\n  var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);\n  if (lane === NoLane) {\n    // If all lanes have pending work, look for a lane that isn't currently\n    // being worked on.\n    lane = pickArbitraryLane(TransitionLanes & ~wipLanes);\n    if (lane === NoLane) {\n      // If everything is being worked on, pick any lane. This has the\n      // effect of interrupting the current work-in-progress.\n      lane = pickArbitraryLane(TransitionLanes);\n    }\n  }\n  return lane;\n} // To ensure consistency across multiple updates in the same event, this should\n// be pure function, so that it always returns the same lane for given inputs.\nfunction findRetryLane(wipLanes) {\n  // This is a fork of \\`findUpdateLane\\` designed specifically for Suspense\n  // \\\\\"retries\\\\\" — a special update that attempts to flip a Suspense boundary\n  // from its placeholder state to its primary/resolved state.\n  var lane = pickArbitraryLane(RetryLanes & ~wipLanes);\n  if (lane === NoLane) {\n    lane = pickArbitraryLane(RetryLanes);\n  }\n  return lane;\n}\nfunction getHighestPriorityLane(lanes) {\n  return lanes & -lanes;\n}\nfunction getLowestPriorityLane(lanes) {\n  // This finds the most significant non-zero bit.\n  var index = 31 - clz32(lanes);\n  return index < 0 ? NoLanes : 1 << index;\n}\nfunction getEqualOrHigherPriorityLanes(lanes) {\n  return (getLowestPriorityLane(lanes) << 1) - 1;\n}\nfunction pickArbitraryLane(lanes) {\n  // This wrapper function gets inlined. Only exists so to communicate that it\n  // doesn't matter which bit is selected; you can pick any bit without\n  // affecting the algorithms where its used. Here I'm using\n  // getHighestPriorityLane because it requires the fewest operations.\n  return getHighestPriorityLane(lanes);\n}\nfunction pickArbitraryLaneIndex(lanes) {\n  return 31 - clz32(lanes);\n}\nfunction laneToIndex(lane) {\n  return pickArbitraryLaneIndex(lane);\n}\nfunction includesSomeLane(a, b) {\n  return (a & b) !== NoLanes;\n}\nfunction isSubsetOfLanes(set, subset) {\n  return (set & subset) === subset;\n}\nfunction mergeLanes(a, b) {\n  return a | b;\n}\nfunction removeLanes(set, subset) {\n  return set & ~subset;\n} // Seems redundant, but it changes the type from a single lane (used for\n// updates) to a group of lanes (used for flushing work).\nfunction laneToLanes(lane) {\n  return lane;\n}\nfunction higherPriorityLane(a, b) {\n  // This works because the bit ranges decrease in priority as you go left.\n  return a !== NoLane && a < b ? a : b;\n}\nfunction createLaneMap(initial) {\n  // Intentionally pushing one by one.\n  // https://v8.dev/blog/elements-kinds#avoid-creating-holes\n  var laneMap = [];\n  for (var i = 0; i < TotalLanes; i++) {\n    laneMap.push(initial);\n  }\n  return laneMap;\n}\nfunction markRootUpdated(root, updateLane, eventTime) {\n  root.pendingLanes |= updateLane; // TODO: Theoretically, any update to any lane can unblock any other lane. But\n  // it's not practical to try every single possible combination. We need a\n  // heuristic to decide which lanes to attempt to render, and in which batches.\n  // For now, we use the same heuristic as in the old ExpirationTimes model:\n  // retry any lane at equal or lower priority, but don't try updates at higher\n  // priority without also including the lower priority updates. This works well\n  // when considering updates across different priority levels, but isn't\n  // sufficient for updates within the same priority, since we want to treat\n  // those updates as parallel.\n  // Unsuspend any update at equal or lower priority.\n  var higherPriorityLanes = updateLane - 1; // Turns 0b1000 into 0b0111\n  root.suspendedLanes &= higherPriorityLanes;\n  root.pingedLanes &= higherPriorityLanes;\n  var eventTimes = root.eventTimes;\n  var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most\n  // recent event, and we assume time is monotonically increasing.\n  eventTimes[index] = eventTime;\n}\nfunction markRootSuspended(root, suspendedLanes) {\n  root.suspendedLanes |= suspendedLanes;\n  root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times.\n  var expirationTimes = root.expirationTimes;\n  var lanes = suspendedLanes;\n  while (lanes > 0) {\n    var index = pickArbitraryLaneIndex(lanes);\n    var lane = 1 << index;\n    expirationTimes[index] = NoTimestamp;\n    lanes &= ~lane;\n  }\n}\nfunction markRootPinged(root, pingedLanes, eventTime) {\n  root.pingedLanes |= root.suspendedLanes & pingedLanes;\n}\nfunction markDiscreteUpdatesExpired(root) {\n  root.expiredLanes |= InputDiscreteLanes & root.pendingLanes;\n}\nfunction hasDiscreteLanes(lanes) {\n  return (lanes & InputDiscreteLanes) !== NoLanes;\n}\nfunction markRootMutableRead(root, updateLane) {\n  root.mutableReadLanes |= updateLane & root.pendingLanes;\n}\nfunction markRootFinished(root, remainingLanes) {\n  var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;\n  root.pendingLanes = remainingLanes; // Let's try everything again\n  root.suspendedLanes = 0;\n  root.pingedLanes = 0;\n  root.expiredLanes &= remainingLanes;\n  root.mutableReadLanes &= remainingLanes;\n  root.entangledLanes &= remainingLanes;\n  var entanglements = root.entanglements;\n  var eventTimes = root.eventTimes;\n  var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work\n  var lanes = noLongerPendingLanes;\n  while (lanes > 0) {\n    var index = pickArbitraryLaneIndex(lanes);\n    var lane = 1 << index;\n    entanglements[index] = NoLanes;\n    eventTimes[index] = NoTimestamp;\n    expirationTimes[index] = NoTimestamp;\n    lanes &= ~lane;\n  }\n}\nfunction markRootEntangled(root, entangledLanes) {\n  root.entangledLanes |= entangledLanes;\n  var entanglements = root.entanglements;\n  var lanes = entangledLanes;\n  while (lanes > 0) {\n    var index = pickArbitraryLaneIndex(lanes);\n    var lane = 1 << index;\n    entanglements[index] |= entangledLanes;\n    lanes &= ~lane;\n  }\n}\nvar clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. Only used on lanes, so assume input is an integer.\n// Based on:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32\nvar log = Math.log;\nvar LN2 = Math.LN2;\nfunction clz32Fallback(lanes) {\n  if (lanes === 0) {\n    return 32;\n  }\n  return 31 - (log(lanes) / LN2 | 0) | 0;\n}\n// Intentionally not named imports because Rollup would use dynamic dispatch for\nvar UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority,\n    runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?\nvar _enabled = true; // This is exported in FB builds for use by legacy FB layer infra.\n// We'd like to remove this but it's not clear if this is safe.\nfunction setEnabled(enabled) {\n  _enabled = !!enabled;\n}\nfunction isEnabled() {\n  return _enabled;\n}\nfunction createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {\n  var eventPriority = getEventPriorityForPluginSystem(domEventName);\n  var listenerWrapper;\n  switch (eventPriority) {\n    case DiscreteEvent:\n      listenerWrapper = dispatchDiscreteEvent;\n      break;\n    case UserBlockingEvent:\n      listenerWrapper = dispatchUserBlockingUpdate;\n      break;\n    case ContinuousEvent:\n    default:\n      listenerWrapper = dispatchEvent;\n      break;\n  }\n  return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);\n}\nfunction dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {\n  {\n    flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);\n  }\n  discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);\n}\nfunction dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {\n  {\n    runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));\n  }\n}\nfunction dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n  if (!_enabled) {\n    return;\n  }\n  var allowReplay = true;\n  {\n    // TODO: replaying capture phase events is currently broken\n    // because we used to do it during top-level native bubble handlers\n    // but now we use different bubble and capture handlers.\n    // In eager mode, we attach capture listeners early, so we need\n    // to filter them out until we fix the logic to handle them correctly.\n    // This could've been outside the flag but I put it inside to reduce risk.\n    allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;\n  }\n  if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {\n    // If we already have a queue of discrete events, and this is another discrete\n    // event, then we can't dispatch it regardless of its target, since they\n    // need to dispatch in order.\n    queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.\n    domEventName, eventSystemFlags, targetContainer, nativeEvent);\n    return;\n  }\n  var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);\n  if (blockedOn === null) {\n    // We successfully dispatched this event.\n    if (allowReplay) {\n      clearIfContinuousEvent(domEventName, nativeEvent);\n    }\n    return;\n  }\n  if (allowReplay) {\n    if (isReplayableDiscreteEvent(domEventName)) {\n      // This this to be replayed later once the target is available.\n      queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n      return;\n    }\n    if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {\n      return;\n    } // We need to clear only if we didn't queue because\n    // queueing is accummulative.\n    clearIfContinuousEvent(domEventName, nativeEvent);\n  } // This is not replayable so we'll invoke it but without a target,\n  // in case the event system needs to trace it.\n  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);\n} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.\nfunction attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n  // TODO: Warn if _enabled is false.\n  var nativeEventTarget = getEventTarget(nativeEvent);\n  var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n  if (targetInst !== null) {\n    var nearestMounted = getNearestMountedFiber(targetInst);\n    if (nearestMounted === null) {\n      // This tree has been unmounted already. Dispatch without a target.\n      targetInst = null;\n    } else {\n      var tag = nearestMounted.tag;\n      if (tag === SuspenseComponent) {\n        var instance = getSuspenseInstanceFromFiber(nearestMounted);\n        if (instance !== null) {\n          // Queue the event to be replayed later. Abort dispatching since we\n          // don't want this event dispatched twice through the event system.\n          // TODO: If this is the first discrete event in the queue. Schedule an increased\n          // priority for this boundary.\n          return instance;\n        } // This shouldn't happen, something went wrong but to avoid blocking\n        // the whole system, dispatch the event without a target.\n        // TODO: Warn.\n        targetInst = null;\n      } else if (tag === HostRoot) {\n        var root = nearestMounted.stateNode;\n        if (root.hydrate) {\n          // If this happens during a replay something went wrong and it might block\n          // the whole system.\n          return getContainerFromFiber(nearestMounted);\n        }\n        targetInst = null;\n      } else if (nearestMounted !== targetInst) {\n        // If we get an event (ex: img onload) before committing that\n        // component's mount, ignore it for now (that is, treat it as if it was an\n        // event on a non-React tree). We might also consider queueing events and\n        // dispatching them after the mount.\n        targetInst = null;\n      }\n    }\n  }\n  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer); // We're not blocked on anything.\n  return null;\n}\nfunction addEventBubbleListener(target, eventType, listener) {\n  target.addEventListener(eventType, listener, false);\n  return listener;\n}\nfunction addEventCaptureListener(target, eventType, listener) {\n  target.addEventListener(eventType, listener, true);\n  return listener;\n}\nfunction addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {\n  target.addEventListener(eventType, listener, {\n    capture: true,\n    passive: passive\n  });\n  return listener;\n}\nfunction addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {\n  target.addEventListener(eventType, listener, {\n    passive: passive\n  });\n  return listener;\n}\n/**\n * These variables store information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar root = null;\nvar startText = null;\nvar fallbackText = null;\nfunction initialize(nativeEventTarget) {\n  root = nativeEventTarget;\n  startText = getText();\n  return true;\n}\nfunction reset() {\n  root = null;\n  startText = null;\n  fallbackText = null;\n}\nfunction getData() {\n  if (fallbackText) {\n    return fallbackText;\n  }\n  var start;\n  var startValue = startText;\n  var startLength = startValue.length;\n  var end;\n  var endValue = getText();\n  var endLength = endValue.length;\n  for (start = 0; start < startLength; start++) {\n    if (startValue[start] !== endValue[start]) {\n      break;\n    }\n  }\n  var minEnd = startLength - start;\n  for (end = 1; end <= minEnd; end++) {\n    if (startValue[startLength - end] !== endValue[endLength - end]) {\n      break;\n    }\n  }\n  var sliceTail = end > 1 ? 1 - end : undefined;\n  fallbackText = endValue.slice(start, sliceTail);\n  return fallbackText;\n}\nfunction getText() {\n  if ('value' in root) {\n    return root.value;\n  }\n  return root.textContent;\n}\n/**\n * \\`charCode\\` represents the actual \\\\\"character code\\\\\" and is safe to use with\n * \\`String.fromCharCode\\`. As such, only keys that correspond to printable\n * characters produce a valid \\`charCode\\`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a \\`charCode\\`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized \\`charCode\\` property.\n */\nfunction getEventCharCode(nativeEvent) {\n  var charCode;\n  var keyCode = nativeEvent.keyCode;\n  if ('charCode' in nativeEvent) {\n    charCode = nativeEvent.charCode; // FF does not set \\`charCode\\` for the Enter-key, check against \\`keyCode\\`.\n    if (charCode === 0 && keyCode === 13) {\n      charCode = 13;\n    }\n  } else {\n    // IE8 does not implement \\`charCode\\`, but \\`keyCode\\` has the correct value.\n    charCode = keyCode;\n  } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)\n  // report Enter as charCode 10 when ctrl is pressed.\n  if (charCode === 10) {\n    charCode = 13;\n  } // Some non-printable keys are reported in \\`charCode\\`/\\`keyCode\\`, discard them.\n  // Must not discard the (non-)printable Enter-key.\n  if (charCode >= 32 || charCode === 13) {\n    return charCode;\n  }\n  return 0;\n}\nfunction functionThatReturnsTrue() {\n  return true;\n}\nfunction functionThatReturnsFalse() {\n  return false;\n} // This is intentionally a factory so that we have different returned constructors.\n// If we had a single constructor, it would be megamorphic and engines would deopt.\nfunction createSyntheticEvent(Interface) {\n  /**\n   * Synthetic events are dispatched by event plugins, typically in response to a\n   * top-level event delegation handler.\n   *\n   * These systems should generally use pooling to reduce the frequency of garbage\n   * collection. The system should check \\`isPersistent\\` to determine whether the\n   * event should be released into the pool after being dispatched. Users that\n   * need a persisted event should invoke \\`persist\\`.\n   *\n   * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n   * normalizing browser quirks. Subclasses do not necessarily have to implement a\n   * DOM interface; custom application-specific events can also subclass this.\n   */\n  function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {\n    this._reactName = reactName;\n    this._targetInst = targetInst;\n    this.type = reactEventType;\n    this.nativeEvent = nativeEvent;\n    this.target = nativeEventTarget;\n    this.currentTarget = null;\n    for (var _propName in Interface) {\n      if (!Interface.hasOwnProperty(_propName)) {\n        continue;\n      }\n      var normalize = Interface[_propName];\n      if (normalize) {\n        this[_propName] = normalize(nativeEvent);\n      } else {\n        this[_propName] = nativeEvent[_propName];\n      }\n    }\n    var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n    if (defaultPrevented) {\n      this.isDefaultPrevented = functionThatReturnsTrue;\n    } else {\n      this.isDefaultPrevented = functionThatReturnsFalse;\n    }\n    this.isPropagationStopped = functionThatReturnsFalse;\n    return this;\n  }\n  _assign(SyntheticBaseEvent.prototype, {\n    preventDefault: function () {\n      this.defaultPrevented = true;\n      var event = this.nativeEvent;\n      if (!event) {\n        return;\n      }\n      if (event.preventDefault) {\n        event.preventDefault(); // $FlowFixMe - flow is not aware of \\`unknown\\` in IE\n      } else if (typeof event.returnValue !== 'unknown') {\n        event.returnValue = false;\n      }\n      this.isDefaultPrevented = functionThatReturnsTrue;\n    },\n    stopPropagation: function () {\n      var event = this.nativeEvent;\n      if (!event) {\n        return;\n      }\n      if (event.stopPropagation) {\n        event.stopPropagation(); // $FlowFixMe - flow is not aware of \\`unknown\\` in IE\n      } else if (typeof event.cancelBubble !== 'unknown') {\n        // The ChangeEventPlugin registers a \\\\\"propertychange\\\\\" event for\n        // IE. This event does not support bubbling or cancelling, and\n        // any references to cancelBubble throw \\\\\"Member not found\\\\\".  A\n        // typeof check of \\\\\"unknown\\\\\" circumvents this issue (and is also\n        // IE specific).\n        event.cancelBubble = true;\n      }\n      this.isPropagationStopped = functionThatReturnsTrue;\n    },\n    /**\n     * We release all dispatched \\`SyntheticEvent\\`s after each event loop, adding\n     * them back into the pool. This allows a way to hold onto a reference that\n     * won't be added back into the pool.\n     */\n    persist: function () {// Modern event system doesn't use pooling.\n    },\n    /**\n     * Checks if this event should be released back into the pool.\n     *\n     * @return {boolean} True if this should not be released, false otherwise.\n     */\n    isPersistent: functionThatReturnsTrue\n  });\n  return SyntheticBaseEvent;\n}\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n  eventPhase: 0,\n  bubbles: 0,\n  cancelable: 0,\n  timeStamp: function (event) {\n    return event.timeStamp || Date.now();\n  },\n  defaultPrevented: 0,\n  isTrusted: 0\n};\nvar SyntheticEvent = createSyntheticEvent(EventInterface);\nvar UIEventInterface = _assign({}, EventInterface, {\n  view: 0,\n  detail: 0\n});\nvar SyntheticUIEvent = createSyntheticEvent(UIEventInterface);\nvar lastMovementX;\nvar lastMovementY;\nvar lastMouseEvent;\nfunction updateMouseMovementPolyfillState(event) {\n  if (event !== lastMouseEvent) {\n    if (lastMouseEvent && event.type === 'mousemove') {\n      lastMovementX = event.screenX - lastMouseEvent.screenX;\n      lastMovementY = event.screenY - lastMouseEvent.screenY;\n    } else {\n      lastMovementX = 0;\n      lastMovementY = 0;\n    }\n    lastMouseEvent = event;\n  }\n}\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar MouseEventInterface = _assign({}, UIEventInterface, {\n  screenX: 0,\n  screenY: 0,\n  clientX: 0,\n  clientY: 0,\n  pageX: 0,\n  pageY: 0,\n  ctrlKey: 0,\n  shiftKey: 0,\n  altKey: 0,\n  metaKey: 0,\n  getModifierState: getEventModifierState,\n  button: 0,\n  buttons: 0,\n  relatedTarget: function (event) {\n    if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;\n    return event.relatedTarget;\n  },\n  movementX: function (event) {\n    if ('movementX' in event) {\n      return event.movementX;\n    }\n    updateMouseMovementPolyfillState(event);\n    return lastMovementX;\n  },\n  movementY: function (event) {\n    if ('movementY' in event) {\n      return event.movementY;\n    } // Don't need to call updateMouseMovementPolyfillState() here\n    // because it's guaranteed to have already run when movementX\n    // was copied.\n    return lastMovementY;\n  }\n});\nvar SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar DragEventInterface = _assign({}, MouseEventInterface, {\n  dataTransfer: 0\n});\nvar SyntheticDragEvent = createSyntheticEvent(DragEventInterface);\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar FocusEventInterface = _assign({}, UIEventInterface, {\n  relatedTarget: 0\n});\nvar SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\nvar AnimationEventInterface = _assign({}, EventInterface, {\n  animationName: 0,\n  elapsedTime: 0,\n  pseudoElement: 0\n});\nvar SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\nvar ClipboardEventInterface = _assign({}, EventInterface, {\n  clipboardData: function (event) {\n    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n  }\n});\nvar SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\nvar CompositionEventInterface = _assign({}, EventInterface, {\n  data: 0\n});\nvar SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n *      /#events-inputevents\n */\n// Happens to share the same list for now.\nvar SyntheticInputEvent = SyntheticCompositionEvent;\n/**\n * Normalization of deprecated HTML5 \\`key\\` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\nvar normalizeKey = {\n  Esc: 'Escape',\n  Spacebar: ' ',\n  Left: 'ArrowLeft',\n  Up: 'ArrowUp',\n  Right: 'ArrowRight',\n  Down: 'ArrowDown',\n  Del: 'Delete',\n  Win: 'OS',\n  Menu: 'ContextMenu',\n  Apps: 'ContextMenu',\n  Scroll: 'ScrollLock',\n  MozPrintableKey: 'Unidentified'\n};\n/**\n * Translation from legacy \\`keyCode\\` to HTML5 \\`key\\`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\nvar translateToKey = {\n  '8': 'Backspace',\n  '9': 'Tab',\n  '12': 'Clear',\n  '13': 'Enter',\n  '16': 'Shift',\n  '17': 'Control',\n  '18': 'Alt',\n  '19': 'Pause',\n  '20': 'CapsLock',\n  '27': 'Escape',\n  '32': ' ',\n  '33': 'PageUp',\n  '34': 'PageDown',\n  '35': 'End',\n  '36': 'Home',\n  '37': 'ArrowLeft',\n  '38': 'ArrowUp',\n  '39': 'ArrowRight',\n  '40': 'ArrowDown',\n  '45': 'Insert',\n  '46': 'Delete',\n  '112': 'F1',\n  '113': 'F2',\n  '114': 'F3',\n  '115': 'F4',\n  '116': 'F5',\n  '117': 'F6',\n  '118': 'F7',\n  '119': 'F8',\n  '120': 'F9',\n  '121': 'F10',\n  '122': 'F11',\n  '123': 'F12',\n  '144': 'NumLock',\n  '145': 'ScrollLock',\n  '224': 'Meta'\n};\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized \\`key\\` property.\n */\nfunction getEventKey(nativeEvent) {\n  if (nativeEvent.key) {\n    // Normalize inconsistent values reported by browsers due to\n    // implementations of a working draft specification.\n    // FireFox implements \\`key\\` but returns \\`MozPrintableKey\\` for all\n    // printable characters (normalized to \\`Unidentified\\`), ignore it.\n    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n    if (key !== 'Unidentified') {\n      return key;\n    }\n  } // Browser does not implement \\`key\\`, polyfill as much of it as we can.\n  if (nativeEvent.type === 'keypress') {\n    var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can\n    // thus be captured by \\`keypress\\`, no other non-printable key should.\n    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n  }\n  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n    // While user keyboard layout determines the actual meaning of each\n    // \\`keyCode\\` value, almost all function keys have a universal value.\n    return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n  }\n  return '';\n}\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\nvar modifierKeyToProp = {\n  Alt: 'altKey',\n  Control: 'ctrlKey',\n  Meta: 'metaKey',\n  Shift: 'shiftKey'\n}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support\n// getModifierState. If getModifierState is not supported, we map it to a set of\n// modifier keys exposed by the event. In this case, Lock-keys are not supported.\nfunction modifierStateGetter(keyArg) {\n  var syntheticEvent = this;\n  var nativeEvent = syntheticEvent.nativeEvent;\n  if (nativeEvent.getModifierState) {\n    return nativeEvent.getModifierState(keyArg);\n  }\n  var keyProp = modifierKeyToProp[keyArg];\n  return keyProp ? !!nativeEvent[keyProp] : false;\n}\nfunction getEventModifierState(nativeEvent) {\n  return modifierStateGetter;\n}\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar KeyboardEventInterface = _assign({}, UIEventInterface, {\n  key: getEventKey,\n  code: 0,\n  location: 0,\n  ctrlKey: 0,\n  shiftKey: 0,\n  altKey: 0,\n  metaKey: 0,\n  repeat: 0,\n  locale: 0,\n  getModifierState: getEventModifierState,\n  // Legacy Interface\n  charCode: function (event) {\n    // \\`charCode\\` is the result of a KeyPress event and represents the value of\n    // the actual printable character.\n    // KeyPress is deprecated, but its replacement is not yet final and not\n    // implemented in any major browser. Only KeyPress has charCode.\n    if (event.type === 'keypress') {\n      return getEventCharCode(event);\n    }\n    return 0;\n  },\n  keyCode: function (event) {\n    // \\`keyCode\\` is the result of a KeyDown/Up event and represents the value of\n    // physical keyboard key.\n    // The actual meaning of the value depends on the users' keyboard layout\n    // which cannot be detected. Assuming that it is a US keyboard layout\n    // provides a surprisingly accurate mapping for US and European users.\n    // Due to this, it is left to the user to implement at this time.\n    if (event.type === 'keydown' || event.type === 'keyup') {\n      return event.keyCode;\n    }\n    return 0;\n  },\n  which: function (event) {\n    // \\`which\\` is an alias for either \\`keyCode\\` or \\`charCode\\` depending on the\n    // type of the event.\n    if (event.type === 'keypress') {\n      return getEventCharCode(event);\n    }\n    if (event.type === 'keydown' || event.type === 'keyup') {\n      return event.keyCode;\n    }\n    return 0;\n  }\n});\nvar SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);\n/**\n * @interface PointerEvent\n * @see http://www.w3.org/TR/pointerevents/\n */\nvar PointerEventInterface = _assign({}, MouseEventInterface, {\n  pointerId: 0,\n  width: 0,\n  height: 0,\n  pressure: 0,\n  tangentialPressure: 0,\n  tiltX: 0,\n  tiltY: 0,\n  twist: 0,\n  pointerType: 0,\n  isPrimary: 0\n});\nvar SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\nvar TouchEventInterface = _assign({}, UIEventInterface, {\n  touches: 0,\n  targetTouches: 0,\n  changedTouches: 0,\n  altKey: 0,\n  metaKey: 0,\n  ctrlKey: 0,\n  shiftKey: 0,\n  getModifierState: getEventModifierState\n});\nvar SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\nvar TransitionEventInterface = _assign({}, EventInterface, {\n  propertyName: 0,\n  elapsedTime: 0,\n  pseudoElement: 0\n});\nvar SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar WheelEventInterface = _assign({}, MouseEventInterface, {\n  deltaX: function (event) {\n    return 'deltaX' in event ? event.deltaX : // Fallback to \\`wheelDeltaX\\` for Webkit and normalize (right is positive).\n    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n  },\n  deltaY: function (event) {\n    return 'deltaY' in event ? event.deltaY : // Fallback to \\`wheelDeltaY\\` for Webkit and normalize (down is positive).\n    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to \\`wheelDelta\\` for IE<9 and normalize (down is positive).\n    'wheelDelta' in event ? -event.wheelDelta : 0;\n  },\n  deltaZ: 0,\n  // Browsers without \\\\\"deltaMode\\\\\" is reporting in raw wheel delta where one\n  // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n  deltaMode: 0\n});\nvar SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\nvar documentMode = null;\nif (canUseDOM && 'documentMode' in document) {\n  documentMode = document.documentMode;\n} // Webkit offers a very useful \\`textInput\\` event that can be used to\n// directly represent \\`beforeInput\\`. The IE \\`textinput\\` event is not as\n// useful, so we don't use it.\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\\\\\\\u3000) are not recorded correctly.\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\nfunction registerEvents() {\n  registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']);\n  registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n  registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n  registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n} // Track whether we've ever handled a keypress on the space key.\nvar hasSpaceKeypress = false;\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires \\`keypress\\` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\nfunction isKeypressCommand(nativeEvent) {\n  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n  !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n/**\n * Translate native top level events into event types.\n */\nfunction getCompositionEventType(domEventName) {\n  switch (domEventName) {\n    case 'compositionstart':\n      return 'onCompositionStart';\n    case 'compositionend':\n      return 'onCompositionEnd';\n    case 'compositionupdate':\n      return 'onCompositionUpdate';\n  }\n}\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n */\nfunction isFallbackCompositionStart(domEventName, nativeEvent) {\n  return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}\n/**\n * Does our fallback mode think that this event is the end of composition?\n */\nfunction isFallbackCompositionEnd(domEventName, nativeEvent) {\n  switch (domEventName) {\n    case 'keyup':\n      // Command keys insert or clear IME input.\n      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n    case 'keydown':\n      // Expect IME keyCode on each keydown. If we get any other\n      // code we must have exited earlier.\n      return nativeEvent.keyCode !== START_KEYCODE;\n    case 'keypress':\n    case 'mousedown':\n    case 'focusout':\n      // Events are not possible without cancelling IME.\n      return true;\n    default:\n      return false;\n  }\n}\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the \\`data\\` property populated in the \\`detail\\` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\nfunction getDataFromCustomEvent(nativeEvent) {\n  var detail = nativeEvent.detail;\n  if (typeof detail === 'object' && 'data' in detail) {\n    return detail.data;\n  }\n  return null;\n}\n/**\n * Check if a composition event was triggered by Korean IME.\n * Our fallback mode does not work well with IE's Korean IME,\n * so just use native composition events when Korean IME is used.\n * Although CompositionEvent.locale property is deprecated,\n * it is available in IE, where our fallback mode is enabled.\n *\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isUsingKoreanIME(nativeEvent) {\n  return nativeEvent.locale === 'ko';\n} // Track the current IME composition status, if any.\nvar isComposing = false;\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\nfunction extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {\n  var eventType;\n  var fallbackData;\n  if (canUseCompositionEvent) {\n    eventType = getCompositionEventType(domEventName);\n  } else if (!isComposing) {\n    if (isFallbackCompositionStart(domEventName, nativeEvent)) {\n      eventType = 'onCompositionStart';\n    }\n  } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {\n    eventType = 'onCompositionEnd';\n  }\n  if (!eventType) {\n    return null;\n  }\n  if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\n    // The current composition is stored statically and must not be\n    // overwritten while composition continues.\n    if (!isComposing && eventType === 'onCompositionStart') {\n      isComposing = initialize(nativeEventTarget);\n    } else if (eventType === 'onCompositionEnd') {\n      if (isComposing) {\n        fallbackData = getData();\n      }\n    }\n  }\n  var listeners = accumulateTwoPhaseListeners(targetInst, eventType);\n  if (listeners.length > 0) {\n    var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);\n    dispatchQueue.push({\n      event: event,\n      listeners: listeners\n    });\n    if (fallbackData) {\n      // Inject data generated from fallback path into the synthetic event.\n      // This matches the property of native CompositionEventInterface.\n      event.data = fallbackData;\n    } else {\n      var customData = getDataFromCustomEvent(nativeEvent);\n      if (customData !== null) {\n        event.data = customData;\n      }\n    }\n  }\n}\nfunction getNativeBeforeInputChars(domEventName, nativeEvent) {\n  switch (domEventName) {\n    case 'compositionend':\n      return getDataFromCustomEvent(nativeEvent);\n    case 'keypress':\n      /**\n       * If native \\`textInput\\` events are available, our goal is to make\n       * use of them. However, there is a special case: the spacebar key.\n       * In Webkit, preventing default on a spacebar \\`textInput\\` event\n       * cancels character insertion, but it *also* causes the browser\n       * to fall back to its default spacebar behavior of scrolling the\n       * page.\n       *\n       * Tracking at:\n       * https://code.google.com/p/chromium/issues/detail?id=355103\n       *\n       * To avoid this issue, use the keypress event as if no \\`textInput\\`\n       * event is available.\n       */\n      var which = nativeEvent.which;\n      if (which !== SPACEBAR_CODE) {\n        return null;\n      }\n      hasSpaceKeypress = true;\n      return SPACEBAR_CHAR;\n    case 'textInput':\n      // Record the characters to be added to the DOM.\n      var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled\n      // it at the keypress level and bail immediately. Android Chrome\n      // doesn't give us keycodes, so we need to ignore it.\n      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n        return null;\n      }\n      return chars;\n    default:\n      // For other native event types, do nothing.\n      return null;\n  }\n}\n/**\n * For browsers that do not provide the \\`textInput\\` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n */\nfunction getFallbackBeforeInputChars(domEventName, nativeEvent) {\n  // If we are currently composing (IME) and using a fallback to do so,\n  // try to extract the composed characters from the fallback object.\n  // If composition event is available, we extract a string only at\n  // compositionevent, otherwise extract it at fallback events.\n  if (isComposing) {\n    if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n      var chars = getData();\n      reset();\n      isComposing = false;\n      return chars;\n    }\n    return null;\n  }\n  switch (domEventName) {\n    case 'paste':\n      // If a paste event occurs after a keypress, throw out the input\n      // chars. Paste events should not lead to BeforeInput events.\n      return null;\n    case 'keypress':\n      /**\n       * As of v27, Firefox may fire keypress events even when no character\n       * will be inserted. A few possibilities:\n       *\n       * - \\`which\\` is \\`0\\`. Arrow keys, Esc key, etc.\n       *\n       * - \\`which\\` is the pressed key code, but no char is available.\n       *   Ex: 'AltGr + d\\` in Polish. There is no modified character for\n       *   this key combination and no character is inserted into the\n       *   document, but FF fires the keypress for char code \\`100\\` anyway.\n       *   No \\`input\\` event will occur.\n       *\n       * - \\`which\\` is the pressed key code, but a command combination is\n       *   being used. Ex: \\`Cmd+C\\`. No character is inserted, and no\n       *   \\`input\\` event will occur.\n       */\n      if (!isKeypressCommand(nativeEvent)) {\n        // IE fires the \\`keypress\\` event when a user types an emoji via\n        // Touch keyboard of Windows.  In such a case, the \\`char\\` property\n        // holds an emoji character like \\`\\\\\\\\uD83D\\\\\\\\uDE0A\\`.  Because its length\n        // is 2, the property \\`which\\` does not represent an emoji correctly.\n        // In such a case, we directly return the \\`char\\` property instead of\n        // using \\`which\\`.\n        if (nativeEvent.char && nativeEvent.char.length > 1) {\n          return nativeEvent.char;\n        } else if (nativeEvent.which) {\n          return String.fromCharCode(nativeEvent.which);\n        }\n      }\n      return null;\n    case 'compositionend':\n      return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n    default:\n      return null;\n  }\n}\n/**\n * Extract a SyntheticInputEvent for \\`beforeInput\\`, based on either native\n * \\`textInput\\` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\nfunction extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {\n  var chars;\n  if (canUseTextInputEvent) {\n    chars = getNativeBeforeInputChars(domEventName, nativeEvent);\n  } else {\n    chars = getFallbackBeforeInputChars(domEventName, nativeEvent);\n  } // If no characters are being inserted, no BeforeInput event should\n  // be fired.\n  if (!chars) {\n    return null;\n  }\n  var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');\n  if (listeners.length > 0) {\n    var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget);\n    dispatchQueue.push({\n      event: event,\n      listeners: listeners\n    });\n    event.data = chars;\n  }\n}\n/**\n * Create an \\`onBeforeInput\\` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native \\`textInput\\` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * \\`onKeyPress\\` and \\`onCompositionEnd\\`, but before \\`onInput\\`.\n *\n * \\`beforeInput\\` is spec'd but not implemented in any browsers, and\n * the \\`input\\` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, \\`textInput\\` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting \\`composition\\` events, thus\n * allowing us to share composition fallback code for both \\`beforeInput\\` and\n * \\`composition\\` event types.\n */\nfunction extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n  extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n  extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n}\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n  color: true,\n  date: true,\n  datetime: true,\n  'datetime-local': true,\n  email: true,\n  month: true,\n  number: true,\n  password: true,\n  range: true,\n  search: true,\n  tel: true,\n  text: true,\n  time: true,\n  url: true,\n  week: true\n};\nfunction isTextInputElement(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n  if (nodeName === 'input') {\n    return !!supportedInputTypes[elem.type];\n  }\n  if (nodeName === 'textarea') {\n    return true;\n  }\n  return false;\n}\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as \\`change\\`,\n * \\`reset\\`, \\`load\\`, \\`error\\`, and \\`select\\`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \\\\\"click\\\\\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nfunction isEventSupported(eventNameSuffix) {\n  if (!canUseDOM) {\n    return false;\n  }\n  var eventName = 'on' + eventNameSuffix;\n  var isSupported = (eventName in document);\n  if (!isSupported) {\n    var element = document.createElement('div');\n    element.setAttribute(eventName, 'return;');\n    isSupported = typeof element[eventName] === 'function';\n  }\n  return isSupported;\n}\nfunction registerEvents$1() {\n  registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']);\n}\nfunction createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {\n  // Flag this event loop as needing state restore.\n  enqueueStateRestore(target);\n  var listeners = accumulateTwoPhaseListeners(inst, 'onChange');\n  if (listeners.length > 0) {\n    var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target);\n    dispatchQueue.push({\n      event: event,\n      listeners: listeners\n    });\n  }\n}\n/**\n * For IE shims\n */\nvar activeElement = null;\nvar activeElementInst = null;\n/**\n * SECTION: handle \\`change\\` event\n */\nfunction shouldUseChangeEvent(elem) {\n  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\nfunction manualDispatchChangeEvent(nativeEvent) {\n  var dispatchQueue = [];\n  createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the\n  // other events and have it go through ReactBrowserEventEmitter. Since it\n  // doesn't, we manually listen for the events and so we have to enqueue and\n  // process the abstract event manually.\n  //\n  // Batching is necessary here in order to ensure that all event handlers run\n  // before the next rerender (including event handlers attached to ancestor\n  // elements instead of directly on the input). Without this, controlled\n  // components don't work properly in conjunction with event bubbling because\n  // the component is rerendered and the value reverted before all the event\n  // handlers can run. See https://github.com/facebook/react/issues/708.\n  batchedUpdates(runEventInBatch, dispatchQueue);\n}\nfunction runEventInBatch(dispatchQueue) {\n  processDispatchQueue(dispatchQueue, 0);\n}\nfunction getInstIfValueChanged(targetInst) {\n  var targetNode = getNodeFromInstance(targetInst);\n  if (updateValueIfChanged(targetNode)) {\n    return targetInst;\n  }\n}\nfunction getTargetInstForChangeEvent(domEventName, targetInst) {\n  if (domEventName === 'change') {\n    return targetInst;\n  }\n}\n/**\n * SECTION: handle \\`input\\` event\n */\nvar isInputEventSupported = false;\nif (canUseDOM) {\n  // IE9 claims to support the input event but fails to trigger it when\n  // deleting text, so we ignore its input events.\n  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);\n}\n/**\n * (For IE <=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\nfunction startWatchingForValueChange(target, targetInst) {\n  activeElement = target;\n  activeElementInst = targetInst;\n  activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n/**\n * (For IE <=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\nfunction stopWatchingForValueChange() {\n  if (!activeElement) {\n    return;\n  }\n  activeElement.detachEvent('onpropertychange', handlePropertyChange);\n  activeElement = null;\n  activeElementInst = null;\n}\n/**\n * (For IE <=9) Handles a propertychange event, sending a \\`change\\` event if\n * the value of the active element has changed.\n */\nfunction handlePropertyChange(nativeEvent) {\n  if (nativeEvent.propertyName !== 'value') {\n    return;\n  }\n  if (getInstIfValueChanged(activeElementInst)) {\n    manualDispatchChangeEvent(nativeEvent);\n  }\n}\nfunction handleEventsForInputEventPolyfill(domEventName, target, targetInst) {\n  if (domEventName === 'focusin') {\n    // In IE9, propertychange fires for most input events but is buggy and\n    // doesn't fire when text is deleted, but conveniently, selectionchange\n    // appears to fire in all of the remaining cases so we catch those and\n    // forward the event if the value has changed\n    // In either case, we don't want to call the event handler if the value\n    // is changed from JS so we redefine a setter for \\`.value\\` that updates\n    // our activeElementValue variable, allowing us to ignore those changes\n    //\n    // stopWatching() should be a noop here but we call it just in case we\n    // missed a blur event somehow.\n    stopWatchingForValueChange();\n    startWatchingForValueChange(target, targetInst);\n  } else if (domEventName === 'focusout') {\n    stopWatchingForValueChange();\n  }\n} // For IE8 and IE9.\nfunction getTargetInstForInputEventPolyfill(domEventName, targetInst) {\n  if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') {\n    // On the selectionchange event, the target is just document which isn't\n    // helpful for us so just check activeElement instead.\n    //\n    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n    // propertychange on the first input event after setting \\`value\\` from a\n    // script and fires only keydown, keypress, keyup. Catching keyup usually\n    // gets it and catching keydown lets us fire an event for the first\n    // keystroke if user does a key repeat (it'll be a little delayed: right\n    // before the second keystroke). Other input methods (e.g., paste) seem to\n    // fire selectionchange normally.\n    return getInstIfValueChanged(activeElementInst);\n  }\n}\n/**\n * SECTION: handle \\`click\\` event\n */\nfunction shouldUseClickEvent(elem) {\n  // Use the \\`click\\` event to detect changes to checkbox and radio inputs.\n  // This approach works across all browsers, whereas \\`change\\` does not fire\n  // until \\`blur\\` in IE8.\n  var nodeName = elem.nodeName;\n  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\nfunction getTargetInstForClickEvent(domEventName, targetInst) {\n  if (domEventName === 'click') {\n    return getInstIfValueChanged(targetInst);\n  }\n}\nfunction getTargetInstForInputOrChangeEvent(domEventName, targetInst) {\n  if (domEventName === 'input' || domEventName === 'change') {\n    return getInstIfValueChanged(targetInst);\n  }\n}\nfunction handleControlledInputBlur(node) {\n  var state = node._wrapperState;\n  if (!state || !state.controlled || node.type !== 'number') {\n    return;\n  }\n  {\n    // If controlled, assign the value attribute to the current value on blur\n    setDefaultValue(node, 'number', node.value);\n  }\n}\n/**\n * This plugin creates an \\`onChange\\` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see \\`isTextInputElement\\`)\n * - textarea\n * - select\n */\nfunction extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n  var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n  var getTargetInstFunc, handleEventFunc;\n  if (shouldUseChangeEvent(targetNode)) {\n    getTargetInstFunc = getTargetInstForChangeEvent;\n  } else if (isTextInputElement(targetNode)) {\n    if (isInputEventSupported) {\n      getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n    } else {\n      getTargetInstFunc = getTargetInstForInputEventPolyfill;\n      handleEventFunc = handleEventsForInputEventPolyfill;\n    }\n  } else if (shouldUseClickEvent(targetNode)) {\n    getTargetInstFunc = getTargetInstForClickEvent;\n  }\n  if (getTargetInstFunc) {\n    var inst = getTargetInstFunc(domEventName, targetInst);\n    if (inst) {\n      createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);\n      return;\n    }\n  }\n  if (handleEventFunc) {\n    handleEventFunc(domEventName, targetNode, targetInst);\n  } // When blurring, set the value attribute for number inputs\n  if (domEventName === 'focusout') {\n    handleControlledInputBlur(targetNode);\n  }\n}\nfunction registerEvents$2() {\n  registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);\n  registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);\n  registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);\n  registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);\n}\n/**\n * For almost every interaction we care about, there will be both a top-level\n * \\`mouseover\\` and \\`mouseout\\` event that occurs. Only use \\`mouseout\\` so that\n * we do not extract duplicate events. However, moving the mouse into the\n * browser from outside will not fire a \\`mouseout\\` event. In this case, we use\n * the \\`mouseover\\` top-level event.\n */\nfunction extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n  var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover';\n  var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout';\n  if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {\n    // If this is an over event with a target, we might have already dispatched\n    // the event in the out event of the other target. If this is replayed,\n    // then it's because we couldn't dispatch against this target previously\n    // so we have to do it now instead.\n    var related = nativeEvent.relatedTarget || nativeEvent.fromElement;\n    if (related) {\n      // If the related node is managed by React, we can assume that we have\n      // already dispatched the corresponding events during its mouseout.\n      if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {\n        return;\n      }\n    }\n  }\n  if (!isOutEvent && !isOverEvent) {\n    // Must not be a mouse or pointer in or out - ignoring.\n    return;\n  }\n  var win; // TODO: why is this nullable in the types but we read from it?\n  if (nativeEventTarget.window === nativeEventTarget) {\n    // \\`nativeEventTarget\\` is probably a window object.\n    win = nativeEventTarget;\n  } else {\n    // TODO: Figure out why \\`ownerDocument\\` is sometimes undefined in IE8.\n    var doc = nativeEventTarget.ownerDocument;\n    if (doc) {\n      win = doc.defaultView || doc.parentWindow;\n    } else {\n      win = window;\n    }\n  }\n  var from;\n  var to;\n  if (isOutEvent) {\n    var _related = nativeEvent.relatedTarget || nativeEvent.toElement;\n    from = targetInst;\n    to = _related ? getClosestInstanceFromNode(_related) : null;\n    if (to !== null) {\n      var nearestMounted = getNearestMountedFiber(to);\n      if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {\n        to = null;\n      }\n    }\n  } else {\n    // Moving to a node from outside the window.\n    from = null;\n    to = targetInst;\n  }\n  if (from === to) {\n    // Nothing pertains to our managed components.\n    return;\n  }\n  var SyntheticEventCtor = SyntheticMouseEvent;\n  var leaveEventType = 'onMouseLeave';\n  var enterEventType = 'onMouseEnter';\n  var eventTypePrefix = 'mouse';\n  if (domEventName === 'pointerout' || domEventName === 'pointerover') {\n    SyntheticEventCtor = SyntheticPointerEvent;\n    leaveEventType = 'onPointerLeave';\n    enterEventType = 'onPointerEnter';\n    eventTypePrefix = 'pointer';\n  }\n  var fromNode = from == null ? win : getNodeFromInstance(from);\n  var toNode = to == null ? win : getNodeFromInstance(to);\n  var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget);\n  leave.target = fromNode;\n  leave.relatedTarget = toNode;\n  var enter = null; // We should only process this nativeEvent if we are processing\n  // the first ancestor. Next time, we will ignore the event.\n  var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);\n  if (nativeTargetInst === targetInst) {\n    var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget);\n    enterEvent.target = toNode;\n    enterEvent.relatedTarget = fromNode;\n    enter = enterEvent;\n  }\n  accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);\n}\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n  ;\n}\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\nvar hasOwnProperty$2 = Object.prototype.hasOwnProperty;\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n  if (objectIs(objA, objB)) {\n    return true;\n  }\n  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n    return false;\n  }\n  var keysA = Object.keys(objA);\n  var keysB = Object.keys(objB);\n  if (keysA.length !== keysB.length) {\n    return false;\n  } // Test for A's keys different from B.\n  for (var i = 0; i < keysA.length; i++) {\n    if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n  return true;\n}\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\nfunction getLeafNode(node) {\n  while (node && node.firstChild) {\n    node = node.firstChild;\n  }\n  return node;\n}\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\nfunction getSiblingNode(node) {\n  while (node) {\n    if (node.nextSibling) {\n      return node.nextSibling;\n    }\n    node = node.parentNode;\n  }\n}\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\nfunction getNodeForCharacterOffset(root, offset) {\n  var node = getLeafNode(root);\n  var nodeStart = 0;\n  var nodeEnd = 0;\n  while (node) {\n    if (node.nodeType === TEXT_NODE) {\n      nodeEnd = nodeStart + node.textContent.length;\n      if (nodeStart <= offset && nodeEnd >= offset) {\n        return {\n          node: node,\n          offset: offset - nodeStart\n        };\n      }\n      nodeStart = nodeEnd;\n    }\n    node = getLeafNode(getSiblingNode(node));\n  }\n}\n/**\n * @param {DOMElement} outerNode\n * @return {?object}\n */\nfunction getOffsets(outerNode) {\n  var ownerDocument = outerNode.ownerDocument;\n  var win = ownerDocument && ownerDocument.defaultView || window;\n  var selection = win.getSelection && win.getSelection();\n  if (!selection || selection.rangeCount === 0) {\n    return null;\n  }\n  var anchorNode = selection.anchorNode,\n      anchorOffset = selection.anchorOffset,\n      focusNode = selection.focusNode,\n      focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be \\\\\"anonymous divs\\\\\", e.g. the\n  // up/down buttons on an <input type=\\\\\"number\\\\\">. Anonymous divs do not seem to\n  // expose properties, triggering a \\\\\"Permission denied error\\\\\" if any of its\n  // properties are accessed. The only seemingly possible way to avoid erroring\n  // is to access a property that typically works for non-anonymous divs and\n  // catch any error that may otherwise arise. See\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n  try {\n    /* eslint-disable no-unused-expressions */\n    anchorNode.nodeType;\n    focusNode.nodeType;\n    /* eslint-enable no-unused-expressions */\n  } catch (e) {\n    return null;\n  }\n  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n/**\n * Returns {start, end} where \\`start\\` is the character/codepoint index of\n * (anchorNode, anchorOffset) within the textContent of \\`outerNode\\`, and\n * \\`end\\` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n */\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n  var length = 0;\n  var start = -1;\n  var end = -1;\n  var indexWithinAnchor = 0;\n  var indexWithinFocus = 0;\n  var node = outerNode;\n  var parentNode = null;\n  outer: while (true) {\n    var next = null;\n    while (true) {\n      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n        start = length + anchorOffset;\n      }\n      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n        end = length + focusOffset;\n      }\n      if (node.nodeType === TEXT_NODE) {\n        length += node.nodeValue.length;\n      }\n      if ((next = node.firstChild) === null) {\n        break;\n      } // Moving from \\`node\\` to its first child \\`next\\`.\n      parentNode = node;\n      node = next;\n    }\n    while (true) {\n      if (node === outerNode) {\n        // If \\`outerNode\\` has children, this is always the second time visiting\n        // it. If it has no children, this is still the first loop, and the only\n        // valid selection is anchorNode and focusNode both equal to this node\n        // and both offsets 0, in which case we will have handled above.\n        break outer;\n      }\n      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n        start = length;\n      }\n      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n        end = length;\n      }\n      if ((next = node.nextSibling) !== null) {\n        break;\n      }\n      node = parentNode;\n      parentNode = node.parentNode;\n    } // Moving from \\`node\\` to its next sibling \\`next\\`.\n    node = next;\n  }\n  if (start === -1 || end === -1) {\n    // This should never happen. (Would happen if the anchor/focus nodes aren't\n    // actually inside the passed-in node.)\n    return null;\n  }\n  return {\n    start: start,\n    end: end\n  };\n}\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the \\`extend\\` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\nfunction setOffsets(node, offsets) {\n  var doc = node.ownerDocument || document;\n  var win = doc && doc.defaultView || window; // Edge fails with \\\\\"Object expected\\\\\" in some scenarios.\n  // (For instance: TinyMCE editor used in a list component that supports pasting to add more,\n  // fails when pasting 100+ items)\n  if (!win.getSelection) {\n    return;\n  }\n  var selection = win.getSelection();\n  var length = node.textContent.length;\n  var start = Math.min(offsets.start, length);\n  var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.\n  // Flip backward selections, so we can set with a single range.\n  if (!selection.extend && start > end) {\n    var temp = end;\n    end = start;\n    start = temp;\n  }\n  var startMarker = getNodeForCharacterOffset(node, start);\n  var endMarker = getNodeForCharacterOffset(node, end);\n  if (startMarker && endMarker) {\n    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n      return;\n    }\n    var range = doc.createRange();\n    range.setStart(startMarker.node, startMarker.offset);\n    selection.removeAllRanges();\n    if (start > end) {\n      selection.addRange(range);\n      selection.extend(endMarker.node, endMarker.offset);\n    } else {\n      range.setEnd(endMarker.node, endMarker.offset);\n      selection.addRange(range);\n    }\n  }\n}\nfunction isTextNode(node) {\n  return node && node.nodeType === TEXT_NODE;\n}\nfunction containsNode(outerNode, innerNode) {\n  if (!outerNode || !innerNode) {\n    return false;\n  } else if (outerNode === innerNode) {\n    return true;\n  } else if (isTextNode(outerNode)) {\n    return false;\n  } else if (isTextNode(innerNode)) {\n    return containsNode(outerNode, innerNode.parentNode);\n  } else if ('contains' in outerNode) {\n    return outerNode.contains(innerNode);\n  } else if (outerNode.compareDocumentPosition) {\n    return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n  } else {\n    return false;\n  }\n}\nfunction isInDocument(node) {\n  return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);\n}\nfunction isSameOriginFrame(iframe) {\n  try {\n    // Accessing the contentDocument of a HTMLIframeElement can cause the browser\n    // to throw, e.g. if it has a cross-origin src attribute.\n    // Safari will show an error in the console when the access results in \\\\\"Blocked a frame with origin\\\\\". e.g:\n    // iframe.contentDocument.defaultView;\n    // A safety way is to access one of the cross origin properties: Window or Location\n    // Which might result in \\\\\"SecurityError\\\\\" DOM Exception and it is compatible to Safari.\n    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl\n    return typeof iframe.contentWindow.location.href === 'string';\n  } catch (err) {\n    return false;\n  }\n}\nfunction getActiveElementDeep() {\n  var win = window;\n  var element = getActiveElement();\n  while (element instanceof win.HTMLIFrameElement) {\n    if (isSameOriginFrame(element)) {\n      win = element.contentWindow;\n    } else {\n      return element;\n    }\n    element = getActiveElement(win.document);\n  }\n  return element;\n}\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\n/**\n * @hasSelectionCapabilities: we get the element types that support selection\n * from https://html.spec.whatwg.org/#do-not-apply, looking at \\`selectionStart\\`\n * and \\`selectionEnd\\` rows.\n */\nfunction hasSelectionCapabilities(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\nfunction getSelectionInformation() {\n  var focusedElem = getActiveElementDeep();\n  return {\n    focusedElem: focusedElem,\n    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null\n  };\n}\n/**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\nfunction restoreSelection(priorSelectionInformation) {\n  var curFocusedElem = getActiveElementDeep();\n  var priorFocusedElem = priorSelectionInformation.focusedElem;\n  var priorSelectionRange = priorSelectionInformation.selectionRange;\n  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n    if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {\n      setSelection(priorFocusedElem, priorSelectionRange);\n    } // Focusing a node can change the scroll position, which is undesirable\n    var ancestors = [];\n    var ancestor = priorFocusedElem;\n    while (ancestor = ancestor.parentNode) {\n      if (ancestor.nodeType === ELEMENT_NODE) {\n        ancestors.push({\n          element: ancestor,\n          left: ancestor.scrollLeft,\n          top: ancestor.scrollTop\n        });\n      }\n    }\n    if (typeof priorFocusedElem.focus === 'function') {\n      priorFocusedElem.focus();\n    }\n    for (var i = 0; i < ancestors.length; i++) {\n      var info = ancestors[i];\n      info.element.scrollLeft = info.left;\n      info.element.scrollTop = info.top;\n    }\n  }\n}\n/**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\nfunction getSelection(input) {\n  var selection;\n  if ('selectionStart' in input) {\n    // Modern browser with input or textarea.\n    selection = {\n      start: input.selectionStart,\n      end: input.selectionEnd\n    };\n  } else {\n    // Content editable or old IE textarea.\n    selection = getOffsets(input);\n  }\n  return selection || {\n    start: 0,\n    end: 0\n  };\n}\n/**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input     Set selection bounds of this input or textarea\n * -@offsets   Object of same form that is returned from get*\n */\nfunction setSelection(input, offsets) {\n  var start = offsets.start;\n  var end = offsets.end;\n  if (end === undefined) {\n    end = start;\n  }\n  if ('selectionStart' in input) {\n    input.selectionStart = start;\n    input.selectionEnd = Math.min(end, input.value.length);\n  } else {\n    setOffsets(input, offsets);\n  }\n}\nvar skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;\nfunction registerEvents$3() {\n  registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']);\n}\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n */\nfunction getSelection$1(node) {\n  if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n    return {\n      start: node.selectionStart,\n      end: node.selectionEnd\n    };\n  } else {\n    var win = node.ownerDocument && node.ownerDocument.defaultView || window;\n    var selection = win.getSelection();\n    return {\n      anchorNode: selection.anchorNode,\n      anchorOffset: selection.anchorOffset,\n      focusNode: selection.focusNode,\n      focusOffset: selection.focusOffset\n    };\n  }\n}\n/**\n * Get document associated with the event target.\n */\nfunction getEventTargetDocument(eventTarget) {\n  return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;\n}\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @param {object} nativeEventTarget\n * @return {?SyntheticEvent}\n */\nfunction constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {\n  // Ensure we have the right element, and that the user is not dragging a\n  // selection (this matches native \\`select\\` event behavior). In HTML5, select\n  // fires only on input and textarea thus if there's no focused element we\n  // won't dispatch.\n  var doc = getEventTargetDocument(nativeEventTarget);\n  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {\n    return;\n  } // Only fire when selection has actually changed.\n  var currentSelection = getSelection$1(activeElement$1);\n  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n    lastSelection = currentSelection;\n    var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect');\n    if (listeners.length > 0) {\n      var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget);\n      dispatchQueue.push({\n        event: event,\n        listeners: listeners\n      });\n      event.target = activeElement$1;\n    }\n  }\n}\n/**\n * This plugin creates an \\`onSelect\\` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see \\`isTextInputElement\\`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\nfunction extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n  var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n  switch (domEventName) {\n    // Track the input node that has focus.\n    case 'focusin':\n      if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n        activeElement$1 = targetNode;\n        activeElementInst$1 = targetInst;\n        lastSelection = null;\n      }\n      break;\n    case 'focusout':\n      activeElement$1 = null;\n      activeElementInst$1 = null;\n      lastSelection = null;\n      break;\n    // Don't fire the event while the user is dragging. This matches the\n    // semantics of the native select event.\n    case 'mousedown':\n      mouseDown = true;\n      break;\n    case 'contextmenu':\n    case 'mouseup':\n    case 'dragend':\n      mouseDown = false;\n      constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n      break;\n    // Chrome and IE fire non-standard event when selection is changed (and\n    // sometimes when it hasn't). IE's event fires out of order with respect\n    // to key and input events on deletion, so we discard it.\n    //\n    // Firefox doesn't support selectionchange, so check selection status\n    // after each key entry. The selection changes after keydown and before\n    // keyup, but we check on keydown as well in the case of holding down a\n    // key, when multiple keydown events are fired but only one keyup is.\n    // This is also our approach for IE handling, for the reason above.\n    case 'selectionchange':\n      if (skipSelectionChangeEvent) {\n        break;\n      }\n    // falls through\n    case 'keydown':\n    case 'keyup':\n      constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n  }\n}\nfunction extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n  var reactName = topLevelEventsToReactNames.get(domEventName);\n  if (reactName === undefined) {\n    return;\n  }\n  var SyntheticEventCtor = SyntheticEvent;\n  var reactEventType = domEventName;\n  switch (domEventName) {\n    case 'keypress':\n      // Firefox creates a keypress event for function keys too. This removes\n      // the unwanted keypress events. Enter is however both printable and\n      // non-printable. One would expect Tab to be as well (but it isn't).\n      if (getEventCharCode(nativeEvent) === 0) {\n        return;\n      }\n    /* falls through */\n    case 'keydown':\n    case 'keyup':\n      SyntheticEventCtor = SyntheticKeyboardEvent;\n      break;\n    case 'focusin':\n      reactEventType = 'focus';\n      SyntheticEventCtor = SyntheticFocusEvent;\n      break;\n    case 'focusout':\n      reactEventType = 'blur';\n      SyntheticEventCtor = SyntheticFocusEvent;\n      break;\n    case 'beforeblur':\n    case 'afterblur':\n      SyntheticEventCtor = SyntheticFocusEvent;\n      break;\n    case 'click':\n      // Firefox creates a click event on right mouse clicks. This removes the\n      // unwanted click events.\n      if (nativeEvent.button === 2) {\n        return;\n      }\n    /* falls through */\n    case 'auxclick':\n    case 'dblclick':\n    case 'mousedown':\n    case 'mousemove':\n    case 'mouseup': // TODO: Disabled elements should not respond to mouse events\n    /* falls through */\n    case 'mouseout':\n    case 'mouseover':\n    case 'contextmenu':\n      SyntheticEventCtor = SyntheticMouseEvent;\n      break;\n    case 'drag':\n    case 'dragend':\n    case 'dragenter':\n    case 'dragexit':\n    case 'dragleave':\n    case 'dragover':\n    case 'dragstart':\n    case 'drop':\n      SyntheticEventCtor = SyntheticDragEvent;\n      break;\n    case 'touchcancel':\n    case 'touchend':\n    case 'touchmove':\n    case 'touchstart':\n      SyntheticEventCtor = SyntheticTouchEvent;\n      break;\n    case ANIMATION_END:\n    case ANIMATION_ITERATION:\n    case ANIMATION_START:\n      SyntheticEventCtor = SyntheticAnimationEvent;\n      break;\n    case TRANSITION_END:\n      SyntheticEventCtor = SyntheticTransitionEvent;\n      break;\n    case 'scroll':\n      SyntheticEventCtor = SyntheticUIEvent;\n      break;\n    case 'wheel':\n      SyntheticEventCtor = SyntheticWheelEvent;\n      break;\n    case 'copy':\n    case 'cut':\n    case 'paste':\n      SyntheticEventCtor = SyntheticClipboardEvent;\n      break;\n    case 'gotpointercapture':\n    case 'lostpointercapture':\n    case 'pointercancel':\n    case 'pointerdown':\n    case 'pointermove':\n    case 'pointerout':\n    case 'pointerover':\n    case 'pointerup':\n      SyntheticEventCtor = SyntheticPointerEvent;\n      break;\n  }\n  var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;\n  {\n    // Some events don't bubble in the browser.\n    // In the past, React has always bubbled them, but this can be surprising.\n    // We're going to try aligning closer to the browser behavior by not bubbling\n    // them in React either. We'll start by not bubbling onScroll, and then expand.\n    var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from\n    // nonDelegatedEvents list in DOMPluginEventSystem.\n    // Then we can remove this special list.\n    // This is a breaking change that can wait until React 18.\n    domEventName === 'scroll';\n    var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);\n    if (_listeners.length > 0) {\n      // Intentionally create event lazily.\n      var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);\n      dispatchQueue.push({\n        event: _event,\n        listeners: _listeners\n      });\n    }\n  }\n}\n// TODO: remove top-level side effect.\nregisterSimpleEvents();\nregisterEvents$2();\nregisterEvents$1();\nregisterEvents$3();\nregisterEvents();\nfunction extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n  // TODO: we should remove the concept of a \\\\\"SimpleEventPlugin\\\\\".\n  // This is the basic functionality of the event system. All\n  // the other plugins are essentially polyfills. So the plugin\n  // should probably be inlined somewhere and have its logic\n  // be core the to event system. This would potentially allow\n  // us to ship builds of React without the polyfilled plugins below.\n  extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n  var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; // We don't process these events unless we are in the\n  // event's native \\\\\"bubble\\\\\" phase, which means that we're\n  // not in the capture phase. That's because we emulate\n  // the capture phase here still. This is a trade-off,\n  // because in an ideal world we would not emulate and use\n  // the phases properly, like we do with the SimpleEvent\n  // plugin. However, the plugins below either expect\n  // emulation (EnterLeave) or use state localized to that\n  // plugin (BeforeInput, Change, Select). The state in\n  // these modules complicates things, as you'll essentially\n  // get the case where the capture phase event might change\n  // state, only for the following bubble event to come in\n  // later and not trigger anything as the state now\n  // invalidates the heuristics of the event plugin. We\n  // could alter all these plugins to work in such ways, but\n  // that might cause other unknown side-effects that we\n  // can't forsee right now.\n  if (shouldProcessPolyfillPlugins) {\n    extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n    extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n    extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n    extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n  }\n} // List of events that need to be individually attached to media elements.\nvar mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; // We should not delegate these events to the container, but rather\n// set them on the actual target element itself. This is primarily\n// because these events do not consistently bubble in the DOM.\nvar nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes));\nfunction executeDispatch(event, listener, currentTarget) {\n  var type = event.type || 'unknown-event';\n  event.currentTarget = currentTarget;\n  invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n  event.currentTarget = null;\n}\nfunction processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {\n  var previousInstance;\n  if (inCapturePhase) {\n    for (var i = dispatchListeners.length - 1; i >= 0; i--) {\n      var _dispatchListeners$i = dispatchListeners[i],\n          instance = _dispatchListeners$i.instance,\n          currentTarget = _dispatchListeners$i.currentTarget,\n          listener = _dispatchListeners$i.listener;\n      if (instance !== previousInstance && event.isPropagationStopped()) {\n        return;\n      }\n      executeDispatch(event, listener, currentTarget);\n      previousInstance = instance;\n    }\n  } else {\n    for (var _i = 0; _i < dispatchListeners.length; _i++) {\n      var _dispatchListeners$_i = dispatchListeners[_i],\n          _instance = _dispatchListeners$_i.instance,\n          _currentTarget = _dispatchListeners$_i.currentTarget,\n          _listener = _dispatchListeners$_i.listener;\n      if (_instance !== previousInstance && event.isPropagationStopped()) {\n        return;\n      }\n      executeDispatch(event, _listener, _currentTarget);\n      previousInstance = _instance;\n    }\n  }\n}\nfunction processDispatchQueue(dispatchQueue, eventSystemFlags) {\n  var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;\n  for (var i = 0; i < dispatchQueue.length; i++) {\n    var _dispatchQueue$i = dispatchQueue[i],\n        event = _dispatchQueue$i.event,\n        listeners = _dispatchQueue$i.listeners;\n    processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); //  event system doesn't use pooling.\n  } // This would be a good time to rethrow if any of the event handlers threw.\n  rethrowCaughtError();\n}\nfunction dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {\n  var nativeEventTarget = getEventTarget(nativeEvent);\n  var dispatchQueue = [];\n  extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n  processDispatchQueue(dispatchQueue, eventSystemFlags);\n}\nfunction listenToNonDelegatedEvent(domEventName, targetElement) {\n  var isCapturePhaseListener = false;\n  var listenerSet = getEventListenerSet(targetElement);\n  var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);\n  if (!listenerSet.has(listenerSetKey)) {\n    addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);\n    listenerSet.add(listenerSetKey);\n  }\n}\nvar listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);\nfunction listenToAllSupportedEvents(rootContainerElement) {\n  {\n    if (rootContainerElement[listeningMarker]) {\n      // Performance optimization: don't iterate through events\n      // for the same portal container or root node more than once.\n      // TODO: once we remove the flag, we may be able to also\n      // remove some of the bookkeeping maps used for laziness.\n      return;\n    }\n    rootContainerElement[listeningMarker] = true;\n    allNativeEvents.forEach(function (domEventName) {\n      if (!nonDelegatedEvents.has(domEventName)) {\n        listenToNativeEvent(domEventName, false, rootContainerElement, null);\n      }\n      listenToNativeEvent(domEventName, true, rootContainerElement, null);\n    });\n  }\n}\nfunction listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {\n  var eventSystemFlags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n  var target = rootContainerElement; // selectionchange needs to be attached to the document\n  // otherwise it won't capture incoming events that are only\n  // triggered on the document directly.\n  if (domEventName === 'selectionchange' && rootContainerElement.nodeType !== DOCUMENT_NODE) {\n    target = rootContainerElement.ownerDocument;\n  } // If the event can be delegated (or is capture phase), we can\n  // register it to the root container. Otherwise, we should\n  // register the event to the target element and mark it as\n  // a non-delegated event.\n  if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {\n    // For all non-delegated events, apart from scroll, we attach\n    // their event listeners to the respective elements that their\n    // events fire on. That means we can skip this step, as event\n    // listener has already been added previously. However, we\n    // special case the scroll event because the reality is that any\n    // element can scroll.\n    // TODO: ideally, we'd eventually apply the same logic to all\n    // events from the nonDelegatedEvents list. Then we can remove\n    // this special case and use the same logic for all events.\n    if (domEventName !== 'scroll') {\n      return;\n    }\n    eventSystemFlags |= IS_NON_DELEGATED;\n    target = targetElement;\n  }\n  var listenerSet = getEventListenerSet(target);\n  var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); // If the listener entry is empty or we should upgrade, then\n  // we need to trap an event listener onto the target.\n  if (!listenerSet.has(listenerSetKey)) {\n    if (isCapturePhaseListener) {\n      eventSystemFlags |= IS_CAPTURE_PHASE;\n    }\n    addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);\n    listenerSet.add(listenerSetKey);\n  }\n}\nfunction addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {\n  var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be\n  // active and not passive.\n  var isPassiveListener = undefined;\n  if (passiveBrowserEventsSupported) {\n    // Browsers introduced an intervention, making these events\n    // passive by default on document. React doesn't bind them\n    // to document anymore, but changing this now would undo\n    // the performance wins from the change. So we emulate\n    // the existing behavior manually on the roots now.\n    // https://github.com/facebook/react/issues/19651\n    if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {\n      isPassiveListener = true;\n    }\n  }\n  targetContainer =  targetContainer;\n  if (isCapturePhaseListener) {\n    if (isPassiveListener !== undefined) {\n      addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);\n    } else {\n      addEventCaptureListener(targetContainer, domEventName, listener);\n    }\n  } else {\n    if (isPassiveListener !== undefined) {\n      addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);\n    } else {\n      addEventBubbleListener(targetContainer, domEventName, listener);\n    }\n  }\n}\nfunction isMatchingRootContainer(grandContainer, targetContainer) {\n  return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;\n}\nfunction dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {\n  var ancestorInst = targetInst;\n  if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {\n    var targetContainerNode = targetContainer; // If we are using the legacy FB support flag, we\n    if (targetInst !== null) {\n      // The below logic attempts to work out if we need to change\n      // the target fiber to a different ancestor. We had similar logic\n      // in the legacy event system, except the big difference between\n      // systems is that the modern event system now has an event listener\n      // attached to each React Root and React Portal Root. Together,\n      // the DOM nodes representing these roots are the \\\\\"rootContainer\\\\\".\n      // To figure out which ancestor instance we should use, we traverse\n      // up the fiber tree from the target instance and attempt to find\n      // root boundaries that match that of our current \\\\\"rootContainer\\\\\".\n      // If we find that \\\\\"rootContainer\\\\\", we find the parent fiber\n      // sub-tree for that root and make that our ancestor instance.\n      var node = targetInst;\n      mainLoop: while (true) {\n        if (node === null) {\n          return;\n        }\n        var nodeTag = node.tag;\n        if (nodeTag === HostRoot || nodeTag === HostPortal) {\n          var container = node.stateNode.containerInfo;\n          if (isMatchingRootContainer(container, targetContainerNode)) {\n            break;\n          }\n          if (nodeTag === HostPortal) {\n            // The target is a portal, but it's not the rootContainer we're looking for.\n            // Normally portals handle their own events all the way down to the root.\n            // So we should be able to stop now. However, we don't know if this portal\n            // was part of *our* root.\n            var grandNode = node.return;\n            while (grandNode !== null) {\n              var grandTag = grandNode.tag;\n              if (grandTag === HostRoot || grandTag === HostPortal) {\n                var grandContainer = grandNode.stateNode.containerInfo;\n                if (isMatchingRootContainer(grandContainer, targetContainerNode)) {\n                  // This is the rootContainer we're looking for and we found it as\n                  // a parent of the Portal. That means we can ignore it because the\n                  // Portal will bubble through to us.\n                  return;\n                }\n              }\n              grandNode = grandNode.return;\n            }\n          } // Now we need to find it's corresponding host fiber in the other\n          // tree. To do this we can use getClosestInstanceFromNode, but we\n          // need to validate that the fiber is a host instance, otherwise\n          // we need to traverse up through the DOM till we find the correct\n          // node that is from the other tree.\n          while (container !== null) {\n            var parentNode = getClosestInstanceFromNode(container);\n            if (parentNode === null) {\n              return;\n            }\n            var parentTag = parentNode.tag;\n            if (parentTag === HostComponent || parentTag === HostText) {\n              node = ancestorInst = parentNode;\n              continue mainLoop;\n            }\n            container = container.parentNode;\n          }\n        }\n        node = node.return;\n      }\n    }\n  }\n  batchedEventUpdates(function () {\n    return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);\n  });\n}\nfunction createDispatchListener(instance, listener, currentTarget) {\n  return {\n    instance: instance,\n    listener: listener,\n    currentTarget: currentTarget\n  };\n}\nfunction accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {\n  var captureName = reactName !== null ? reactName + 'Capture' : null;\n  var reactEventName = inCapturePhase ? captureName : reactName;\n  var listeners = [];\n  var instance = targetFiber;\n  var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path.\n  while (instance !== null) {\n    var _instance2 = instance,\n        stateNode = _instance2.stateNode,\n        tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n    if (tag === HostComponent && stateNode !== null) {\n      lastHostComponent = stateNode; // createEventHandle listeners\n      if (reactEventName !== null) {\n        var listener = getListener(instance, reactEventName);\n        if (listener != null) {\n          listeners.push(createDispatchListener(instance, listener, lastHostComponent));\n        }\n      }\n    } // If we are only accumulating events for the target, then we don't\n    // continue to propagate through the React fiber tree to find other\n    // listeners.\n    if (accumulateTargetOnly) {\n      break;\n    }\n    instance = instance.return;\n  }\n  return listeners;\n} // We should only use this function for:\n// - BeforeInputEventPlugin\n// - ChangeEventPlugin\n// - SelectEventPlugin\n// This is because we only process these plugins\n// in the bubble phase, so we need to accumulate two\n// phase event listeners (via emulation).\nfunction accumulateTwoPhaseListeners(targetFiber, reactName) {\n  var captureName = reactName + 'Capture';\n  var listeners = [];\n  var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n  while (instance !== null) {\n    var _instance3 = instance,\n        stateNode = _instance3.stateNode,\n        tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n    if (tag === HostComponent && stateNode !== null) {\n      var currentTarget = stateNode;\n      var captureListener = getListener(instance, captureName);\n      if (captureListener != null) {\n        listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n      }\n      var bubbleListener = getListener(instance, reactName);\n      if (bubbleListener != null) {\n        listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n      }\n    }\n    instance = instance.return;\n  }\n  return listeners;\n}\nfunction getParent(inst) {\n  if (inst === null) {\n    return null;\n  }\n  do {\n    inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.\n    // That is depending on if we want nested subtrees (layers) to bubble\n    // events to their parent. We could also go through parentNode on the\n    // host node but that wouldn't work for React Native and doesn't let us\n    // do the portal feature.\n  } while (inst && inst.tag !== HostComponent);\n  if (inst) {\n    return inst;\n  }\n  return null;\n}\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\nfunction getLowestCommonAncestor(instA, instB) {\n  var nodeA = instA;\n  var nodeB = instB;\n  var depthA = 0;\n  for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {\n    depthA++;\n  }\n  var depthB = 0;\n  for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {\n    depthB++;\n  } // If A is deeper, crawl up.\n  while (depthA - depthB > 0) {\n    nodeA = getParent(nodeA);\n    depthA--;\n  } // If B is deeper, crawl up.\n  while (depthB - depthA > 0) {\n    nodeB = getParent(nodeB);\n    depthB--;\n  } // Walk in lockstep until we find a match.\n  var depth = depthA;\n  while (depth--) {\n    if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {\n      return nodeA;\n    }\n    nodeA = getParent(nodeA);\n    nodeB = getParent(nodeB);\n  }\n  return null;\n}\nfunction accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {\n  var registrationName = event._reactName;\n  var listeners = [];\n  var instance = target;\n  while (instance !== null) {\n    if (instance === common) {\n      break;\n    }\n    var _instance4 = instance,\n        alternate = _instance4.alternate,\n        stateNode = _instance4.stateNode,\n        tag = _instance4.tag;\n    if (alternate !== null && alternate === common) {\n      break;\n    }\n    if (tag === HostComponent && stateNode !== null) {\n      var currentTarget = stateNode;\n      if (inCapturePhase) {\n        var captureListener = getListener(instance, registrationName);\n        if (captureListener != null) {\n          listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n        }\n      } else if (!inCapturePhase) {\n        var bubbleListener = getListener(instance, registrationName);\n        if (bubbleListener != null) {\n          listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n        }\n      }\n    }\n    instance = instance.return;\n  }\n  if (listeners.length !== 0) {\n    dispatchQueue.push({\n      event: event,\n      listeners: listeners\n    });\n  }\n} // We should only use this function for:\n// - EnterLeaveEventPlugin\n// This is because we only process this plugin\n// in the bubble phase, so we need to accumulate two\n// phase event listeners.\nfunction accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {\n  var common = from && to ? getLowestCommonAncestor(from, to) : null;\n  if (from !== null) {\n    accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);\n  }\n  if (to !== null && enterEvent !== null) {\n    accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);\n  }\n}\nfunction getListenerSetKey(domEventName, capture) {\n  return domEventName + \\\\\"__\\\\\" + (capture ? 'capture' : 'bubble');\n}\nvar didWarnInvalidHydration = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML$1 = '__html';\nvar HTML_NAMESPACE$1 = Namespaces.html;\nvar warnedUnknownTags;\nvar suppressHydrationWarning;\nvar validatePropertiesInDevelopment;\nvar warnForTextDifference;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeMarkupForTextOrAttribute;\nvar normalizeHTML;\n{\n  warnedUnknownTags = {\n    // There are working polyfills for <dialog>. Let people use it.\n    dialog: true,\n    // Electron ships a custom <webview> tag to display external web content in\n    // an isolated frame and process.\n    // This tag is not present in non Electron environments such as JSDom which\n    // is often used for testing purposes.\n    // @see https://electronjs.org/docs/api/webview-tag\n    webview: true\n  };\n  validatePropertiesInDevelopment = function (type, props) {\n    validateProperties(type, props);\n    validateProperties$1(type, props);\n    validateProperties$2(type, props, {\n      registrationNameDependencies: registrationNameDependencies,\n      possibleRegistrationNames: possibleRegistrationNames\n    });\n  }; // IE 11 parses & normalizes the style attribute as opposed to other\n  // browsers. It adds spaces and sorts the properties in some\n  // non-alphabetical order. Handling that would require sorting CSS\n  // properties in the client & server versions or applying\n  // \\`expectedStyle\\` to a temporary DOM node to read its \\`style\\` attribute\n  // normalized. Since it only affects IE, we're skipping style warnings\n  // in that browser completely in favor of doing all that work.\n  // See https://github.com/facebook/react/issues/11807\n  canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.\n  // It also can turn \\\\\\\\u0000 into \\\\\\\\uFFFD inside attributes.\n  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n  // If we have a mismatch, it might be caused by that.\n  // We will still patch up in this case but not fire the warning.\n  var NORMALIZE_NEWLINES_REGEX = /?/g;\n  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\\\\\\\u0000|\\\\\\\\uFFFD/g;\n  normalizeMarkupForTextOrAttribute = function (markup) {\n    var markupString = typeof markup === 'string' ? markup : '' + markup;\n    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n  };\n  warnForTextDifference = function (serverText, clientText) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n    if (normalizedServerText === normalizedClientText) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Text content did not match. Server: \\\\\"%s\\\\\" Client: \\\\\"%s\\\\\"', normalizedServerText, normalizedClientText);\n  };\n  warnForPropDifference = function (propName, serverValue, clientValue) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n    if (normalizedServerValue === normalizedClientValue) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Prop \\`%s\\` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n  };\n  warnForExtraAttributes = function (attributeNames) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    var names = [];\n    attributeNames.forEach(function (name) {\n      names.push(name);\n    });\n    error('Extra attributes from the server: %s', names);\n  };\n  warnForInvalidEventListener = function (registrationName, listener) {\n    if (listener === false) {\n      error('Expected \\`%s\\` listener to be a function, instead got \\`false\\`.' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n    } else {\n      error('Expected \\`%s\\` listener to be a function, instead got a value of \\`%s\\` type.', registrationName, typeof listener);\n    }\n  }; // Parse the HTML and read it back to normalize the HTML string so that it\n  // can be used for comparison.\n  normalizeHTML = function (parent, html) {\n    // We could have created a separate document here to avoid\n    // re-initializing custom elements if they exist. But this breaks\n    // how <noscript> is being handled. So we use the same document.\n    // See the discussion in https://github.com/facebook/react/pull/11157.\n    var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n    testElement.innerHTML = html;\n    return testElement.innerHTML;\n  };\n}\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\nfunction noop() {}\nfunction trapClickOnNonInteractiveElement(node) {\n  // Mobile Safari does not fire properly bubble click events on\n  // non-interactive elements, which means delegated click listeners do not\n  // fire. The workaround for this bug involves attaching an empty click\n  // listener on the target node.\n  // https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n  // Just set it using the onclick property so that we don't have to manage any\n  // bookkeeping for it. Not sure if we need to clear it when the listener is\n  // removed.\n  // TODO: Only do this for the relevant Safaris maybe?\n  node.onclick = noop;\n}\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n  for (var propKey in nextProps) {\n    if (!nextProps.hasOwnProperty(propKey)) {\n      continue;\n    }\n    var nextProp = nextProps[propKey];\n    if (propKey === STYLE) {\n      {\n        if (nextProp) {\n          // Freeze the next style object so that we can assume it won't be\n          // mutated. We have already warned for this in the past.\n          Object.freeze(nextProp);\n        }\n      } // Relies on \\`updateStylesByID\\` not mutating \\`styleUpdates\\`.\n      setValueForStyles(domElement, nextProp);\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n      if (nextHtml != null) {\n        setInnerHTML(domElement, nextHtml);\n      }\n    } else if (propKey === CHILDREN) {\n      if (typeof nextProp === 'string') {\n        // Avoid setting initial textContent when the text is empty. In IE11 setting\n        // textContent on a <textarea> will cause the placeholder to not\n        // show within the <textarea> until it has been focused and blurred again.\n        // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n        var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n        if (canSetTextContent) {\n          setTextContent(domElement, nextProp);\n        }\n      } else if (typeof nextProp === 'number') {\n        setTextContent(domElement, '' + nextProp);\n      }\n    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        if ( typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        if (propKey === 'onScroll') {\n          listenToNonDelegatedEvent('scroll', domElement);\n        }\n      }\n    } else if (nextProp != null) {\n      setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n    }\n  }\n}\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n  // TODO: Handle wasCustomComponentTag\n  for (var i = 0; i < updatePayload.length; i += 2) {\n    var propKey = updatePayload[i];\n    var propValue = updatePayload[i + 1];\n    if (propKey === STYLE) {\n      setValueForStyles(domElement, propValue);\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      setInnerHTML(domElement, propValue);\n    } else if (propKey === CHILDREN) {\n      setTextContent(domElement, propValue);\n    } else {\n      setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n    }\n  }\n}\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n  var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML\n  // tags get no namespace.\n  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n  var domElement;\n  var namespaceURI = parentNamespace;\n  if (namespaceURI === HTML_NAMESPACE$1) {\n    namespaceURI = getIntrinsicNamespace(type);\n  }\n  if (namespaceURI === HTML_NAMESPACE$1) {\n    {\n      isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to\n      // allow <SVG> or <mATH>.\n      if (!isCustomComponentTag && type !== type.toLowerCase()) {\n        error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);\n      }\n    }\n    if (type === 'script') {\n      // Create the script via .innerHTML so its \\\\\"parser-inserted\\\\\" flag is\n      // set to true and it does not execute\n      var div = ownerDocument.createElement('div');\n      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line\n      // This is guaranteed to yield a script element.\n      var firstChild = div.firstChild;\n      domElement = div.removeChild(firstChild);\n    } else if (typeof props.is === 'string') {\n      // $FlowIssue \\`createElement\\` should be updated for Web Components\n      domElement = ownerDocument.createElement(type, {\n        is: props.is\n      });\n    } else {\n      // Separate else branch instead of using \\`props.is || undefined\\` above because of a Firefox bug.\n      // See discussion in https://github.com/facebook/react/pull/6896\n      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240\n      domElement = ownerDocument.createElement(type); // Normally attributes are assigned in \\`setInitialDOMProperties\\`, however the \\`multiple\\` and \\`size\\`\n      // attributes on \\`select\\`s needs to be added before \\`option\\`s are inserted.\n      // This prevents:\n      // - a bug where the \\`select\\` does not scroll to the correct option because singular\n      //  \\`select\\` elements automatically pick the first item #13222\n      // - a bug where the \\`select\\` set the first item as selected despite the \\`size\\` attribute #14239\n      // See https://github.com/facebook/react/issues/13222\n      // and https://github.com/facebook/react/issues/14239\n      if (type === 'select') {\n        var node = domElement;\n        if (props.multiple) {\n          node.multiple = true;\n        } else if (props.size) {\n          // Setting a size greater than 1 causes a select to behave like \\`multiple=true\\`, where\n          // it is possible that no option is selected.\n          //\n          // This is only necessary when a select in \\\\\"single selection mode\\\\\".\n          node.size = props.size;\n        }\n      }\n    }\n  } else {\n    domElement = ownerDocument.createElementNS(namespaceURI, type);\n  }\n  {\n    if (namespaceURI === HTML_NAMESPACE$1) {\n      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {\n        warnedUnknownTags[type] = true;\n        error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n      }\n    }\n  }\n  return domElement;\n}\nfunction createTextNode(text, rootContainerElement) {\n  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\nfunction setInitialProperties(domElement, tag, rawProps, rootContainerElement) {\n  var isCustomComponentTag = isCustomComponent(tag, rawProps);\n  {\n    validatePropertiesInDevelopment(tag, rawProps);\n  } // TODO: Make sure that we check isMounted before firing any of these events.\n  var props;\n  switch (tag) {\n    case 'dialog':\n      listenToNonDelegatedEvent('cancel', domElement);\n      listenToNonDelegatedEvent('close', domElement);\n      props = rawProps;\n      break;\n    case 'iframe':\n    case 'object':\n    case 'embed':\n      // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the load event.\n      listenToNonDelegatedEvent('load', domElement);\n      props = rawProps;\n      break;\n    case 'video':\n    case 'audio':\n      // We listen to these events in case to ensure emulated bubble\n      // listeners still fire for all the media events.\n      for (var i = 0; i < mediaEventTypes.length; i++) {\n        listenToNonDelegatedEvent(mediaEventTypes[i], domElement);\n      }\n      props = rawProps;\n      break;\n    case 'source':\n      // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the error event.\n      listenToNonDelegatedEvent('error', domElement);\n      props = rawProps;\n      break;\n    case 'img':\n    case 'image':\n    case 'link':\n      // We listen to these events in case to ensure emulated bubble\n      // listeners still fire for error and load events.\n      listenToNonDelegatedEvent('error', domElement);\n      listenToNonDelegatedEvent('load', domElement);\n      props = rawProps;\n      break;\n    case 'details':\n      // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the toggle event.\n      listenToNonDelegatedEvent('toggle', domElement);\n      props = rawProps;\n      break;\n    case 'input':\n      initWrapperState(domElement, rawProps);\n      props = getHostProps(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the invalid event.\n      listenToNonDelegatedEvent('invalid', domElement);\n      break;\n    case 'option':\n      validateProps(domElement, rawProps);\n      props = getHostProps$1(domElement, rawProps);\n      break;\n    case 'select':\n      initWrapperState$1(domElement, rawProps);\n      props = getHostProps$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the invalid event.\n      listenToNonDelegatedEvent('invalid', domElement);\n      break;\n    case 'textarea':\n      initWrapperState$2(domElement, rawProps);\n      props = getHostProps$3(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the invalid event.\n      listenToNonDelegatedEvent('invalid', domElement);\n      break;\n    default:\n      props = rawProps;\n  }\n  assertValidProps(tag, props);\n  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n  switch (tag) {\n    case 'input':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper(domElement, rawProps, false);\n      break;\n    case 'textarea':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper$3(domElement);\n      break;\n    case 'option':\n      postMountWrapper$1(domElement, rawProps);\n      break;\n    case 'select':\n      postMountWrapper$2(domElement, rawProps);\n      break;\n    default:\n      if (typeof props.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n} // Calculate the diff between the two objects.\nfunction diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n  {\n    validatePropertiesInDevelopment(tag, nextRawProps);\n  }\n  var updatePayload = null;\n  var lastProps;\n  var nextProps;\n  switch (tag) {\n    case 'input':\n      lastProps = getHostProps(domElement, lastRawProps);\n      nextProps = getHostProps(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'option':\n      lastProps = getHostProps$1(domElement, lastRawProps);\n      nextProps = getHostProps$1(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'select':\n      lastProps = getHostProps$2(domElement, lastRawProps);\n      nextProps = getHostProps$2(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'textarea':\n      lastProps = getHostProps$3(domElement, lastRawProps);\n      nextProps = getHostProps$3(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    default:\n      lastProps = lastRawProps;\n      nextProps = nextRawProps;\n      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n  assertValidProps(tag, nextProps);\n  var propKey;\n  var styleName;\n  var styleUpdates = null;\n  for (propKey in lastProps) {\n    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n      continue;\n    }\n    if (propKey === STYLE) {\n      var lastStyle = lastProps[propKey];\n      for (styleName in lastStyle) {\n        if (lastStyle.hasOwnProperty(styleName)) {\n          if (!styleUpdates) {\n            styleUpdates = {};\n          }\n          styleUpdates[styleName] = '';\n        }\n      }\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n      // This is a special case. If any listener updates we need to ensure\n      // that the \\\\\"current\\\\\" fiber pointer gets updated so we need a commit\n      // to update this element.\n      if (!updatePayload) {\n        updatePayload = [];\n      }\n    } else {\n      // For all other deleted properties we add it to the queue. We use\n      // the allowed property list in the commit phase instead.\n      (updatePayload = updatePayload || []).push(propKey, null);\n    }\n  }\n  for (propKey in nextProps) {\n    var nextProp = nextProps[propKey];\n    var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n      continue;\n    }\n    if (propKey === STYLE) {\n      {\n        if (nextProp) {\n          // Freeze the next style object so that we can assume it won't be\n          // mutated. We have already warned for this in the past.\n          Object.freeze(nextProp);\n        }\n      }\n      if (lastProp) {\n        // Unset styles on \\`lastProp\\` but not on \\`nextProp\\`.\n        for (styleName in lastProp) {\n          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n            if (!styleUpdates) {\n              styleUpdates = {};\n            }\n            styleUpdates[styleName] = '';\n          }\n        } // Update styles that changed since \\`lastProp\\`.\n        for (styleName in nextProp) {\n          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n            if (!styleUpdates) {\n              styleUpdates = {};\n            }\n            styleUpdates[styleName] = nextProp[styleName];\n          }\n        }\n      } else {\n        // Relies on \\`updateStylesByID\\` not mutating \\`styleUpdates\\`.\n        if (!styleUpdates) {\n          if (!updatePayload) {\n            updatePayload = [];\n          }\n          updatePayload.push(propKey, styleUpdates);\n        }\n        styleUpdates = nextProp;\n      }\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n      var lastHtml = lastProp ? lastProp[HTML$1] : undefined;\n      if (nextHtml != null) {\n        if (lastHtml !== nextHtml) {\n          (updatePayload = updatePayload || []).push(propKey, nextHtml);\n        }\n      }\n    } else if (propKey === CHILDREN) {\n      if (typeof nextProp === 'string' || typeof nextProp === 'number') {\n        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n      }\n    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        // We eagerly listen to this even though we haven't committed yet.\n        if ( typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        if (propKey === 'onScroll') {\n          listenToNonDelegatedEvent('scroll', domElement);\n        }\n      }\n      if (!updatePayload && lastProp !== nextProp) {\n        // This is a special case. If any listener updates we need to ensure\n        // that the \\\\\"current\\\\\" props pointer gets updated so we need a commit\n        // to update this element.\n        updatePayload = [];\n      }\n    } else if (typeof nextProp === 'object' && nextProp !== null && nextProp.$$typeof === REACT_OPAQUE_ID_TYPE) {\n      // If we encounter useOpaqueReference's opaque object, this means we are hydrating.\n      // In this case, call the opaque object's toString function which generates a new client\n      // ID so client and server IDs match and throws to rerender.\n      nextProp.toString();\n    } else {\n      // For any other property we always add it to the queue and then we\n      // filter it out using the allowed property list during the commit.\n      (updatePayload = updatePayload || []).push(propKey, nextProp);\n    }\n  }\n  if (styleUpdates) {\n    {\n      validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);\n    }\n    (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n  }\n  return updatePayload;\n} // Apply the diff.\nfunction updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n  // Update checked *before* name.\n  // In the middle of an update, it is possible to have multiple checked.\n  // When a checked radio tries to change name, browser makes another radio's checked false.\n  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n    updateChecked(domElement, nextRawProps);\n  }\n  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n  var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.\n  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props\n  // changed.\n  switch (tag) {\n    case 'input':\n      // Update the wrapper around inputs *after* updating props. This has to\n      // happen after \\`updateDOMProperties\\`. Otherwise HTML5 input validations\n      // raise warnings and prevent the new value from being assigned.\n      updateWrapper(domElement, nextRawProps);\n      break;\n    case 'textarea':\n      updateWrapper$1(domElement, nextRawProps);\n      break;\n    case 'select':\n      // <select> value update needs to occur after <option> children\n      // reconciliation\n      postUpdateWrapper(domElement, nextRawProps);\n      break;\n  }\n}\nfunction getPossibleStandardName(propName) {\n  {\n    var lowerCasedName = propName.toLowerCase();\n    if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n      return null;\n    }\n    return possibleStandardNames[lowerCasedName] || null;\n  }\n}\nfunction diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {\n  var isCustomComponentTag;\n  var extraAttributeNames;\n  {\n    suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;\n    isCustomComponentTag = isCustomComponent(tag, rawProps);\n    validatePropertiesInDevelopment(tag, rawProps);\n  } // TODO: Make sure that we check isMounted before firing any of these events.\n  switch (tag) {\n    case 'dialog':\n      listenToNonDelegatedEvent('cancel', domElement);\n      listenToNonDelegatedEvent('close', domElement);\n      break;\n    case 'iframe':\n    case 'object':\n    case 'embed':\n      // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the load event.\n      listenToNonDelegatedEvent('load', domElement);\n      break;\n    case 'video':\n    case 'audio':\n      // We listen to these events in case to ensure emulated bubble\n      // listeners still fire for all the media events.\n      for (var i = 0; i < mediaEventTypes.length; i++) {\n        listenToNonDelegatedEvent(mediaEventTypes[i], domElement);\n      }\n      break;\n    case 'source':\n      // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the error event.\n      listenToNonDelegatedEvent('error', domElement);\n      break;\n    case 'img':\n    case 'image':\n    case 'link':\n      // We listen to these events in case to ensure emulated bubble\n      // listeners still fire for error and load events.\n      listenToNonDelegatedEvent('error', domElement);\n      listenToNonDelegatedEvent('load', domElement);\n      break;\n    case 'details':\n      // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the toggle event.\n      listenToNonDelegatedEvent('toggle', domElement);\n      break;\n    case 'input':\n      initWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the invalid event.\n      listenToNonDelegatedEvent('invalid', domElement);\n      break;\n    case 'option':\n      validateProps(domElement, rawProps);\n      break;\n    case 'select':\n      initWrapperState$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the invalid event.\n      listenToNonDelegatedEvent('invalid', domElement);\n      break;\n    case 'textarea':\n      initWrapperState$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble\n      // listeners still fire for the invalid event.\n      listenToNonDelegatedEvent('invalid', domElement);\n      break;\n  }\n  assertValidProps(tag, rawProps);\n  {\n    extraAttributeNames = new Set();\n    var attributes = domElement.attributes;\n    for (var _i = 0; _i < attributes.length; _i++) {\n      var name = attributes[_i].name.toLowerCase();\n      switch (name) {\n        // Built-in SSR attribute is allowed\n        case 'data-reactroot':\n          break;\n        // Controlled attributes are not validated\n        // TODO: Only ignore them on controlled tags.\n        case 'value':\n          break;\n        case 'checked':\n          break;\n        case 'selected':\n          break;\n        default:\n          // Intentionally use the original name.\n          // See discussion in https://github.com/facebook/react/pull/10676.\n          extraAttributeNames.add(attributes[_i].name);\n      }\n    }\n  }\n  var updatePayload = null;\n  for (var propKey in rawProps) {\n    if (!rawProps.hasOwnProperty(propKey)) {\n      continue;\n    }\n    var nextProp = rawProps[propKey];\n    if (propKey === CHILDREN) {\n      // For text content children we compare against textContent. This\n      // might match additional HTML that is hidden when we read it using\n      // textContent. E.g. \\\\\"foo\\\\\" will match \\\\\"f<span>oo</span>\\\\\" but that still\n      // satisfies our requirement. Our requirement is not to produce perfect\n      // HTML and attributes. Ideally we should preserve structure but it's\n      // ok not to if the visible content is still enough to indicate what\n      // even listeners these nodes might be wired up to.\n      // TODO: Warn if there is more than a single textNode as a child.\n      // TODO: Should we use domElement.firstChild.nodeValue to compare?\n      if (typeof nextProp === 'string') {\n        if (domElement.textContent !== nextProp) {\n          if ( !suppressHydrationWarning) {\n            warnForTextDifference(domElement.textContent, nextProp);\n          }\n          updatePayload = [CHILDREN, nextProp];\n        }\n      } else if (typeof nextProp === 'number') {\n        if (domElement.textContent !== '' + nextProp) {\n          if ( !suppressHydrationWarning) {\n            warnForTextDifference(domElement.textContent, nextProp);\n          }\n          updatePayload = [CHILDREN, '' + nextProp];\n        }\n      }\n    } else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        if ( typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        if (propKey === 'onScroll') {\n          listenToNonDelegatedEvent('scroll', domElement);\n        }\n      }\n    } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)\n    typeof isCustomComponentTag === 'boolean') {\n      // Validate that the properties correspond to their expected values.\n      var serverValue = void 0;\n      var propertyInfo = getPropertyInfo(propKey);\n      if (suppressHydrationWarning) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated\n      // TODO: Only ignore them on controlled tags.\n      propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n        var serverHTML = domElement.innerHTML;\n        var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n        if (nextHtml != null) {\n          var expectedHTML = normalizeHTML(domElement, nextHtml);\n          if (expectedHTML !== serverHTML) {\n            warnForPropDifference(propKey, serverHTML, expectedHTML);\n          }\n        }\n      } else if (propKey === STYLE) {\n        // $FlowFixMe - Should be inferred as not undefined.\n        extraAttributeNames.delete(propKey);\n        if (canDiffStyleForHydrationWarning) {\n          var expectedStyle = createDangerousStringForStyles(nextProp);\n          serverValue = domElement.getAttribute('style');\n          if (expectedStyle !== serverValue) {\n            warnForPropDifference(propKey, serverValue, expectedStyle);\n          }\n        }\n      } else if (isCustomComponentTag) {\n        // $FlowFixMe - Should be inferred as not undefined.\n        extraAttributeNames.delete(propKey.toLowerCase());\n        serverValue = getValueForAttribute(domElement, propKey, nextProp);\n        if (nextProp !== serverValue) {\n          warnForPropDifference(propKey, serverValue, nextProp);\n        }\n      } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {\n        var isMismatchDueToBadCasing = false;\n        if (propertyInfo !== null) {\n          // $FlowFixMe - Should be inferred as not undefined.\n          extraAttributeNames.delete(propertyInfo.attributeName);\n          serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);\n        } else {\n          var ownNamespace = parentNamespace;\n          if (ownNamespace === HTML_NAMESPACE$1) {\n            ownNamespace = getIntrinsicNamespace(tag);\n          }\n          if (ownNamespace === HTML_NAMESPACE$1) {\n            // $FlowFixMe - Should be inferred as not undefined.\n            extraAttributeNames.delete(propKey.toLowerCase());\n          } else {\n            var standardName = getPossibleStandardName(propKey);\n            if (standardName !== null && standardName !== propKey) {\n              // If an SVG prop is supplied with bad casing, it will\n              // be successfully parsed from HTML, but will produce a mismatch\n              // (and would be incorrectly rendered on the client).\n              // However, we already warn about bad casing elsewhere.\n              // So we'll skip the misleading extra mismatch warning in this case.\n              isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.\n              extraAttributeNames.delete(standardName);\n            } // $FlowFixMe - Should be inferred as not undefined.\n            extraAttributeNames.delete(propKey);\n          }\n          serverValue = getValueForAttribute(domElement, propKey, nextProp);\n        }\n        if (nextProp !== serverValue && !isMismatchDueToBadCasing) {\n          warnForPropDifference(propKey, serverValue, nextProp);\n        }\n      }\n    }\n  }\n  {\n    // $FlowFixMe - Should be inferred as not undefined.\n    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {\n      // $FlowFixMe - Should be inferred as not undefined.\n      warnForExtraAttributes(extraAttributeNames);\n    }\n  }\n  switch (tag) {\n    case 'input':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper(domElement, rawProps, true);\n      break;\n    case 'textarea':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper$3(domElement);\n      break;\n    case 'select':\n    case 'option':\n      // For input and textarea we current always set the value property at\n      // post mount to force it to diverge from attributes. However, for\n      // option and select we don't quite do the same thing and select\n      // is not resilient to the DOM state changing so we don't do that here.\n      // TODO: Consider not doing this for input and textarea.\n      break;\n    default:\n      if (typeof rawProps.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n  return updatePayload;\n}\nfunction diffHydratedText(textNode, text) {\n  var isDifferent = textNode.nodeValue !== text;\n  return isDifferent;\n}\nfunction warnForUnmatchedText(textNode, text) {\n  {\n    warnForTextDifference(textNode.nodeValue, text);\n  }\n}\nfunction warnForDeletedHydratableElement(parentNode, child) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n  }\n}\nfunction warnForDeletedHydratableText(parentNode, child) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Did not expect server HTML to contain the text node \\\\\"%s\\\\\" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());\n  }\n}\nfunction warnForInsertedHydratedElement(parentNode, tag, props) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());\n  }\n}\nfunction warnForInsertedHydratedText(parentNode, text) {\n  {\n    if (text === '') {\n      // We expect to insert empty text nodes since they're not represented in\n      // the HTML.\n      // TODO: Remove this special case if we can just avoid inserting empty\n      // text nodes.\n      return;\n    }\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Expected server HTML to contain a matching text node for \\\\\"%s\\\\\" in <%s>.', text, parentNode.nodeName.toLowerCase());\n  }\n}\nfunction restoreControlledState$3(domElement, tag, props) {\n  switch (tag) {\n    case 'input':\n      restoreControlledState(domElement, props);\n      return;\n    case 'textarea':\n      restoreControlledState$2(domElement, props);\n      return;\n    case 'select':\n      restoreControlledState$1(domElement, props);\n      return;\n  }\n}\nvar validateDOMNesting = function () {};\nvar updatedAncestorInfo = function () {};\n{\n  // This validation code was written based on the HTML5 parsing spec:\n  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n  //\n  // Note: this does not catch all invalid nesting, nor does it try to (as it's\n  // not clear what practical benefit doing so provides); instead, we warn only\n  // for cases where the parser will give a parse tree differing from what React\n  // intended. For example, <b><div></div></b> is invalid but we don't warn\n  // because it still parses correctly; we do warn for other cases like nested\n  // <p> tags where the beginning of the second element implicitly closes the\n  // first, causing a confusing mess.\n  // https://html.spec.whatwg.org/multipage/syntax.html#special\n  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point\n  // TODO: Distinguish by namespace here -- for <title>, including it here\n  // errs on the side of fewer warnings\n  'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n  var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n  var emptyAncestorInfo = {\n    current: null,\n    formTag: null,\n    aTagInScope: null,\n    buttonTagInScope: null,\n    nobrTagInScope: null,\n    pTagInButtonScope: null,\n    listItemTagAutoclosing: null,\n    dlItemTagAutoclosing: null\n  };\n  updatedAncestorInfo = function (oldInfo, tag) {\n    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n    var info = {\n      tag: tag\n    };\n    if (inScopeTags.indexOf(tag) !== -1) {\n      ancestorInfo.aTagInScope = null;\n      ancestorInfo.buttonTagInScope = null;\n      ancestorInfo.nobrTagInScope = null;\n    }\n    if (buttonScopeTags.indexOf(tag) !== -1) {\n      ancestorInfo.pTagInButtonScope = null;\n    } // See rules for 'li', 'dd', 'dt' start tags in\n    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n      ancestorInfo.listItemTagAutoclosing = null;\n      ancestorInfo.dlItemTagAutoclosing = null;\n    }\n    ancestorInfo.current = info;\n    if (tag === 'form') {\n      ancestorInfo.formTag = info;\n    }\n    if (tag === 'a') {\n      ancestorInfo.aTagInScope = info;\n    }\n    if (tag === 'button') {\n      ancestorInfo.buttonTagInScope = info;\n    }\n    if (tag === 'nobr') {\n      ancestorInfo.nobrTagInScope = info;\n    }\n    if (tag === 'p') {\n      ancestorInfo.pTagInButtonScope = info;\n    }\n    if (tag === 'li') {\n      ancestorInfo.listItemTagAutoclosing = info;\n    }\n    if (tag === 'dd' || tag === 'dt') {\n      ancestorInfo.dlItemTagAutoclosing = info;\n    }\n    return ancestorInfo;\n  };\n  /**\n   * Returns whether\n   */\n  var isTagValidWithParent = function (tag, parentTag) {\n    // First, let's check if we're in an unusual parsing mode...\n    switch (parentTag) {\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect\n      case 'select':\n        return tag === 'option' || tag === 'optgroup' || tag === '#text';\n      case 'optgroup':\n        return tag === 'option' || tag === '#text';\n      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>\n      // but\n      case 'option':\n        return tag === '#text';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption\n      // No special behavior since these rules fall back to \\\\\"in body\\\\\" mode for\n      // all except special table nodes which cause bad parsing behavior anyway.\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr\n      case 'tr':\n        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody\n      case 'tbody':\n      case 'thead':\n      case 'tfoot':\n        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n      case 'colgroup':\n        return tag === 'col' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable\n      case 'table':\n        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead\n      case 'head':\n        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n      case 'html':\n        return tag === 'head' || tag === 'body' || tag === 'frameset';\n      case 'frameset':\n        return tag === 'frame';\n      case '#document':\n        return tag === 'html';\n    } // Probably in the \\\\\"in body\\\\\" parsing mode, so we outlaw only tag combos\n    // where the parsing rules cause implicit opens or closes to be added.\n    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n    switch (tag) {\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n      case 'rp':\n      case 'rt':\n        return impliedEndTags.indexOf(parentTag) === -1;\n      case 'body':\n      case 'caption':\n      case 'col':\n      case 'colgroup':\n      case 'frameset':\n      case 'frame':\n      case 'head':\n      case 'html':\n      case 'tbody':\n      case 'td':\n      case 'tfoot':\n      case 'th':\n      case 'thead':\n      case 'tr':\n        // These tags are only valid with a few parents that have special child\n        // parsing rules -- if we're down here, then none of those matched and\n        // so we allow it only if we don't know what the parent is, as all other\n        // cases are invalid.\n        return parentTag == null;\n    }\n    return true;\n  };\n  /**\n   * Returns whether\n   */\n  var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n    switch (tag) {\n      case 'address':\n      case 'article':\n      case 'aside':\n      case 'blockquote':\n      case 'center':\n      case 'details':\n      case 'dialog':\n      case 'dir':\n      case 'div':\n      case 'dl':\n      case 'fieldset':\n      case 'figcaption':\n      case 'figure':\n      case 'footer':\n      case 'header':\n      case 'hgroup':\n      case 'main':\n      case 'menu':\n      case 'nav':\n      case 'ol':\n      case 'p':\n      case 'section':\n      case 'summary':\n      case 'ul':\n      case 'pre':\n      case 'listing':\n      case 'table':\n      case 'hr':\n      case 'xmp':\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return ancestorInfo.pTagInButtonScope;\n      case 'form':\n        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n      case 'li':\n        return ancestorInfo.listItemTagAutoclosing;\n      case 'dd':\n      case 'dt':\n        return ancestorInfo.dlItemTagAutoclosing;\n      case 'button':\n        return ancestorInfo.buttonTagInScope;\n      case 'a':\n        // Spec says something about storing a list of markers, but it sounds\n        // equivalent to this check.\n        return ancestorInfo.aTagInScope;\n      case 'nobr':\n        return ancestorInfo.nobrTagInScope;\n    }\n    return null;\n  };\n  var didWarn$1 = {};\n  validateDOMNesting = function (childTag, childText, ancestorInfo) {\n    ancestorInfo = ancestorInfo || emptyAncestorInfo;\n    var parentInfo = ancestorInfo.current;\n    var parentTag = parentInfo && parentInfo.tag;\n    if (childText != null) {\n      if (childTag != null) {\n        error('validateDOMNesting: when childText is passed, childTag should be null');\n      }\n      childTag = '#text';\n    }\n    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n    var invalidParentOrAncestor = invalidParent || invalidAncestor;\n    if (!invalidParentOrAncestor) {\n      return;\n    }\n    var ancestorTag = invalidParentOrAncestor.tag;\n    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag;\n    if (didWarn$1[warnKey]) {\n      return;\n    }\n    didWarn$1[warnKey] = true;\n    var tagDisplayName = childTag;\n    var whitespaceInfo = '';\n    if (childTag === '#text') {\n      if (/\\\\\\\\S/.test(childText)) {\n        tagDisplayName = 'Text nodes';\n      } else {\n        tagDisplayName = 'Whitespace text nodes';\n        whitespaceInfo = \\\\\" Make sure you don't have any extra whitespace between tags on \\\\\" + 'each line of your source code.';\n      }\n    } else {\n      tagDisplayName = '<' + childTag + '>';\n    }\n    if (invalidParent) {\n      var info = '';\n      if (ancestorTag === 'table' && childTag === 'tr') {\n        info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';\n      }\n      error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);\n    } else {\n      error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);\n    }\n  };\n}\nvar SUPPRESS_HYDRATION_WARNING$1;\n{\n  SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\n}\nvar SUSPENSE_START_DATA = '$';\nvar SUSPENSE_END_DATA = '/$';\nvar SUSPENSE_PENDING_START_DATA = '$?';\nvar SUSPENSE_FALLBACK_START_DATA = '$!';\nvar STYLE$1 = 'style';\nvar eventsEnabled = null;\nvar selectionInformation = null;\nfunction shouldAutoFocusHostComponent(type, props) {\n  switch (type) {\n    case 'button':\n    case 'input':\n    case 'select':\n    case 'textarea':\n      return !!props.autoFocus;\n  }\n  return false;\n}\nfunction getRootHostContext(rootContainerInstance) {\n  var type;\n  var namespace;\n  var nodeType = rootContainerInstance.nodeType;\n  switch (nodeType) {\n    case DOCUMENT_NODE:\n    case DOCUMENT_FRAGMENT_NODE:\n      {\n        type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n        var root = rootContainerInstance.documentElement;\n        namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n        break;\n      }\n    default:\n      {\n        var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n        var ownNamespace = container.namespaceURI || null;\n        type = container.tagName;\n        namespace = getChildNamespace(ownNamespace, type);\n        break;\n      }\n  }\n  {\n    var validatedTag = type.toLowerCase();\n    var ancestorInfo = updatedAncestorInfo(null, validatedTag);\n    return {\n      namespace: namespace,\n      ancestorInfo: ancestorInfo\n    };\n  }\n}\nfunction getChildHostContext(parentHostContext, type, rootContainerInstance) {\n  {\n    var parentHostContextDev = parentHostContext;\n    var namespace = getChildNamespace(parentHostContextDev.namespace, type);\n    var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);\n    return {\n      namespace: namespace,\n      ancestorInfo: ancestorInfo\n    };\n  }\n}\nfunction getPublicInstance(instance) {\n  return instance;\n}\nfunction prepareForCommit(containerInfo) {\n  eventsEnabled = isEnabled();\n  selectionInformation = getSelectionInformation();\n  var activeInstance = null;\n  setEnabled(false);\n  return activeInstance;\n}\nfunction resetAfterCommit(containerInfo) {\n  restoreSelection(selectionInformation);\n  setEnabled(eventsEnabled);\n  eventsEnabled = null;\n  selectionInformation = null;\n}\nfunction createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n  var parentNamespace;\n  {\n    // TODO: take namespace into account when validating.\n    var hostContextDev = hostContext;\n    validateDOMNesting(type, null, hostContextDev.ancestorInfo);\n    if (typeof props.children === 'string' || typeof props.children === 'number') {\n      var string = '' + props.children;\n      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n      validateDOMNesting(null, string, ownAncestorInfo);\n    }\n    parentNamespace = hostContextDev.namespace;\n  }\n  var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n  precacheFiberNode(internalInstanceHandle, domElement);\n  updateFiberProps(domElement, props);\n  return domElement;\n}\nfunction appendInitialChild(parentInstance, child) {\n  parentInstance.appendChild(child);\n}\nfunction finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {\n  setInitialProperties(domElement, type, props, rootContainerInstance);\n  return shouldAutoFocusHostComponent(type, props);\n}\nfunction prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n  {\n    var hostContextDev = hostContext;\n    if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n      var string = '' + newProps.children;\n      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n      validateDOMNesting(null, string, ownAncestorInfo);\n    }\n  }\n  return diffProperties(domElement, type, oldProps, newProps);\n}\nfunction shouldSetTextContent(type, props) {\n  return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;\n}\nfunction createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {\n  {\n    var hostContextDev = hostContext;\n    validateDOMNesting(null, text, hostContextDev.ancestorInfo);\n  }\n  var textNode = createTextNode(text, rootContainerInstance);\n  precacheFiberNode(internalInstanceHandle, textNode);\n  return textNode;\n}\n// if a component just imports ReactDOM (e.g. for findDOMNode).\n// Some environments might not have setTimeout or clearTimeout.\nvar scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;\nvar cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;\nvar noTimeout = -1; // -------------------\nfunction commitMount(domElement, type, newProps, internalInstanceHandle) {\n  // Despite the naming that might imply otherwise, this method only\n  // fires if there is an \\`Update\\` effect scheduled during mounting.\n  // This happens if \\`finalizeInitialChildren\\` returns \\`true\\` (which it\n  // does to implement the \\`autoFocus\\` attribute on the client). But\n  // there are also other cases when this might happen (such as patching\n  // up text content during hydration mismatch). So we'll check this again.\n  if (shouldAutoFocusHostComponent(type, newProps)) {\n    domElement.focus();\n  }\n}\nfunction commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n  // Update the props handle so that we know which props are the ones with\n  // with current event handlers.\n  updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.\n  updateProperties(domElement, updatePayload, type, oldProps, newProps);\n}\nfunction resetTextContent(domElement) {\n  setTextContent(domElement, '');\n}\nfunction commitTextUpdate(textInstance, oldText, newText) {\n  textInstance.nodeValue = newText;\n}\nfunction appendChild(parentInstance, child) {\n  parentInstance.appendChild(child);\n}\nfunction appendChildToContainer(container, child) {\n  var parentNode;\n  if (container.nodeType === COMMENT_NODE) {\n    parentNode = container.parentNode;\n    parentNode.insertBefore(child, container);\n  } else {\n    parentNode = container;\n    parentNode.appendChild(child);\n  } // This container might be used for a portal.\n  // If something inside a portal is clicked, that click should bubble\n  // through the React tree. However, on Mobile Safari the click would\n  // never bubble through the *DOM* tree unless an ancestor with onclick\n  // event exists. So we wouldn't see it and dispatch it.\n  // This is why we ensure that non React root containers have inline onclick\n  // defined.\n  // https://github.com/facebook/react/issues/11918\n  var reactRootContainer = container._reactRootContainer;\n  if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {\n    // TODO: This cast may not be sound for SVG, MathML or custom elements.\n    trapClickOnNonInteractiveElement(parentNode);\n  }\n}\nfunction insertBefore(parentInstance, child, beforeChild) {\n  parentInstance.insertBefore(child, beforeChild);\n}\nfunction insertInContainerBefore(container, child, beforeChild) {\n  if (container.nodeType === COMMENT_NODE) {\n    container.parentNode.insertBefore(child, beforeChild);\n  } else {\n    container.insertBefore(child, beforeChild);\n  }\n}\nfunction removeChild(parentInstance, child) {\n  parentInstance.removeChild(child);\n}\nfunction removeChildFromContainer(container, child) {\n  if (container.nodeType === COMMENT_NODE) {\n    container.parentNode.removeChild(child);\n  } else {\n    container.removeChild(child);\n  }\n}\nfunction hideInstance(instance) {\n  // TODO: Does this work for all element types? What about MathML? Should we\n  // pass host context to this method?\n  instance = instance;\n  var style = instance.style;\n  if (typeof style.setProperty === 'function') {\n    style.setProperty('display', 'none', 'important');\n  } else {\n    style.display = 'none';\n  }\n}\nfunction hideTextInstance(textInstance) {\n  textInstance.nodeValue = '';\n}\nfunction unhideInstance(instance, props) {\n  instance = instance;\n  var styleProp = props[STYLE$1];\n  var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;\n  instance.style.display = dangerousStyleValue('display', display);\n}\nfunction unhideTextInstance(textInstance, text) {\n  textInstance.nodeValue = text;\n}\nfunction clearContainer(container) {\n  if (container.nodeType === ELEMENT_NODE) {\n    container.textContent = '';\n  } else if (container.nodeType === DOCUMENT_NODE) {\n    var body = container.body;\n    if (body != null) {\n      body.textContent = '';\n    }\n  }\n} // -------------------\nfunction canHydrateInstance(instance, type, props) {\n  if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n    return null;\n  } // This has now been refined to an element node.\n  return instance;\n}\nfunction canHydrateTextInstance(instance, text) {\n  if (text === '' || instance.nodeType !== TEXT_NODE) {\n    // Empty strings are not parsed by HTML so there won't be a correct match here.\n    return null;\n  } // This has now been refined to a text node.\n  return instance;\n}\nfunction isSuspenseInstancePending(instance) {\n  return instance.data === SUSPENSE_PENDING_START_DATA;\n}\nfunction isSuspenseInstanceFallback(instance) {\n  return instance.data === SUSPENSE_FALLBACK_START_DATA;\n}\nfunction getNextHydratable(node) {\n  // Skip non-hydratable nodes.\n  for (; node != null; node = node.nextSibling) {\n    var nodeType = node.nodeType;\n    if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {\n      break;\n    }\n  }\n  return node;\n}\nfunction getNextHydratableSibling(instance) {\n  return getNextHydratable(instance.nextSibling);\n}\nfunction getFirstHydratableChild(parentInstance) {\n  return getNextHydratable(parentInstance.firstChild);\n}\nfunction hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n  precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events\n  // get attached.\n  updateFiberProps(instance, props);\n  var parentNamespace;\n  {\n    var hostContextDev = hostContext;\n    parentNamespace = hostContextDev.namespace;\n  }\n  return diffHydratedProperties(instance, type, props, parentNamespace);\n}\nfunction hydrateTextInstance(textInstance, text, internalInstanceHandle) {\n  precacheFiberNode(internalInstanceHandle, textInstance);\n  return diffHydratedText(textInstance, text);\n}\nfunction getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {\n  var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.\n  // There might be nested nodes so we need to keep track of how\n  // deep we are and only break out when we're back on top.\n  var depth = 0;\n  while (node) {\n    if (node.nodeType === COMMENT_NODE) {\n      var data = node.data;\n      if (data === SUSPENSE_END_DATA) {\n        if (depth === 0) {\n          return getNextHydratableSibling(node);\n        } else {\n          depth--;\n        }\n      } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n        depth++;\n      }\n    }\n    node = node.nextSibling;\n  } // TODO: Warn, we didn't find the end comment boundary.\n  return null;\n} // Returns the SuspenseInstance if this node is a direct child of a\n// SuspenseInstance. I.e. if its previous sibling is a Comment with\n// SUSPENSE_x_START_DATA. Otherwise, null.\nfunction getParentSuspenseInstance(targetInstance) {\n  var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.\n  // There might be nested nodes so we need to keep track of how\n  // deep we are and only break out when we're back on top.\n  var depth = 0;\n  while (node) {\n    if (node.nodeType === COMMENT_NODE) {\n      var data = node.data;\n      if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n        if (depth === 0) {\n          return node;\n        } else {\n          depth--;\n        }\n      } else if (data === SUSPENSE_END_DATA) {\n        depth++;\n      }\n    }\n    node = node.previousSibling;\n  }\n  return null;\n}\nfunction commitHydratedContainer(container) {\n  // Retry if any event replaying was blocked on this.\n  retryIfBlockedOn(container);\n}\nfunction commitHydratedSuspenseInstance(suspenseInstance) {\n  // Retry if any event replaying was blocked on this.\n  retryIfBlockedOn(suspenseInstance);\n}\nfunction didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {\n  {\n    warnForUnmatchedText(textInstance, text);\n  }\n}\nfunction didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    warnForUnmatchedText(textInstance, text);\n  }\n}\nfunction didNotHydrateContainerInstance(parentContainer, instance) {\n  {\n    if (instance.nodeType === ELEMENT_NODE) {\n      warnForDeletedHydratableElement(parentContainer, instance);\n    } else if (instance.nodeType === COMMENT_NODE) ; else {\n      warnForDeletedHydratableText(parentContainer, instance);\n    }\n  }\n}\nfunction didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    if (instance.nodeType === ELEMENT_NODE) {\n      warnForDeletedHydratableElement(parentInstance, instance);\n    } else if (instance.nodeType === COMMENT_NODE) ; else {\n      warnForDeletedHydratableText(parentInstance, instance);\n    }\n  }\n}\nfunction didNotFindHydratableContainerInstance(parentContainer, type, props) {\n  {\n    warnForInsertedHydratedElement(parentContainer, type);\n  }\n}\nfunction didNotFindHydratableContainerTextInstance(parentContainer, text) {\n  {\n    warnForInsertedHydratedText(parentContainer, text);\n  }\n}\nfunction didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    warnForInsertedHydratedElement(parentInstance, type);\n  }\n}\nfunction didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    warnForInsertedHydratedText(parentInstance, text);\n  }\n}\nfunction didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;\n}\nvar clientId = 0;\nfunction makeClientIdInDEV(warnOnAccessInDEV) {\n  var id = 'r:' + (clientId++).toString(36);\n  return {\n    toString: function () {\n      warnOnAccessInDEV();\n      return id;\n    },\n    valueOf: function () {\n      warnOnAccessInDEV();\n      return id;\n    }\n  };\n}\nfunction isOpaqueHydratingObject(value) {\n  return value !== null && typeof value === 'object' && value.$$typeof === REACT_OPAQUE_ID_TYPE;\n}\nfunction makeOpaqueHydratingObject(attemptToReadValue) {\n  return {\n    $$typeof: REACT_OPAQUE_ID_TYPE,\n    toString: attemptToReadValue,\n    valueOf: attemptToReadValue\n  };\n}\nfunction preparePortalMount(portalInstance) {\n  {\n    listenToAllSupportedEvents(portalInstance);\n  }\n}\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactFiber$' + randomKey;\nvar internalPropsKey = '__reactProps$' + randomKey;\nvar internalContainerInstanceKey = '__reactContainer$' + randomKey;\nvar internalEventHandlersKey = '__reactEvents$' + randomKey;\nfunction precacheFiberNode(hostInst, node) {\n  node[internalInstanceKey] = hostInst;\n}\nfunction markContainerAsRoot(hostRoot, node) {\n  node[internalContainerInstanceKey] = hostRoot;\n}\nfunction unmarkContainerAsRoot(node) {\n  node[internalContainerInstanceKey] = null;\n}\nfunction isContainerMarkedAsRoot(node) {\n  return !!node[internalContainerInstanceKey];\n} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.\n// If the target node is part of a hydrated or not yet rendered subtree, then\n// this may also return a SuspenseComponent or HostRoot to indicate that.\n// Conceptually the HostRoot fiber is a child of the Container node. So if you\n// pass the Container node as the targetNode, you will not actually get the\n// HostRoot back. To get to the HostRoot, you need to pass a child of it.\n// The same thing applies to Suspense boundaries.\nfunction getClosestInstanceFromNode(targetNode) {\n  var targetInst = targetNode[internalInstanceKey];\n  if (targetInst) {\n    // Don't return HostRoot or SuspenseComponent here.\n    return targetInst;\n  } // If the direct event target isn't a React owned DOM node, we need to look\n  // to see if one of its parents is a React owned DOM node.\n  var parentNode = targetNode.parentNode;\n  while (parentNode) {\n    // We'll check if this is a container root that could include\n    // React nodes in the future. We need to check this first because\n    // if we're a child of a dehydrated container, we need to first\n    // find that inner container before moving on to finding the parent\n    // instance. Note that we don't check this field on  the targetNode\n    // itself because the fibers are conceptually between the container\n    // node and the first child. It isn't surrounding the container node.\n    // If it's not a container, we check if it's an instance.\n    targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];\n    if (targetInst) {\n      // Since this wasn't the direct target of the event, we might have\n      // stepped past dehydrated DOM nodes to get here. However they could\n      // also have been non-React nodes. We need to answer which one.\n      // If we the instance doesn't have any children, then there can't be\n      // a nested suspense boundary within it. So we can use this as a fast\n      // bailout. Most of the time, when people add non-React children to\n      // the tree, it is using a ref to a child-less DOM node.\n      // Normally we'd only need to check one of the fibers because if it\n      // has ever gone from having children to deleting them or vice versa\n      // it would have deleted the dehydrated boundary nested inside already.\n      // However, since the HostRoot starts out with an alternate it might\n      // have one on the alternate so we need to check in case this was a\n      // root.\n      var alternate = targetInst.alternate;\n      if (targetInst.child !== null || alternate !== null && alternate.child !== null) {\n        // Next we need to figure out if the node that skipped past is\n        // nested within a dehydrated boundary and if so, which one.\n        var suspenseInstance = getParentSuspenseInstance(targetNode);\n        while (suspenseInstance !== null) {\n          // We found a suspense instance. That means that we haven't\n          // hydrated it yet. Even though we leave the comments in the\n          // DOM after hydrating, and there are boundaries in the DOM\n          // that could already be hydrated, we wouldn't have found them\n          // through this pass since if the target is hydrated it would\n          // have had an internalInstanceKey on it.\n          // Let's get the fiber associated with the SuspenseComponent\n          // as the deepest instance.\n          var targetSuspenseInst = suspenseInstance[internalInstanceKey];\n          if (targetSuspenseInst) {\n            return targetSuspenseInst;\n          } // If we don't find a Fiber on the comment, it might be because\n          // we haven't gotten to hydrate it yet. There might still be a\n          // parent boundary that hasn't above this one so we need to find\n          // the outer most that is known.\n          suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent\n          // host component also hasn't hydrated yet. We can return it\n          // below since it will bail out on the isMounted check later.\n        }\n      }\n      return targetInst;\n    }\n    targetNode = parentNode;\n    parentNode = targetNode.parentNode;\n  }\n  return null;\n}\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\nfunction getInstanceFromNode(node) {\n  var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];\n  if (inst) {\n    if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {\n      return inst;\n    } else {\n      return null;\n    }\n  }\n  return null;\n}\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\nfunction getNodeFromInstance(inst) {\n  if (inst.tag === HostComponent || inst.tag === HostText) {\n    // In Fiber this, is just the state node right now. We assume it will be\n    // a host component or host text.\n    return inst.stateNode;\n  } // Without this first invariant, passing a non-DOM-component triggers the next\n  // invariant for a missing parent, which is super confusing.\n  {\n    {\n      throw Error( \\\\\"getNodeFromInstance: Invalid argument.\\\\\" );\n    }\n  }\n}\nfunction getFiberCurrentPropsFromNode(node) {\n  return node[internalPropsKey] || null;\n}\nfunction updateFiberProps(node, props) {\n  node[internalPropsKey] = props;\n}\nfunction getEventListenerSet(node) {\n  var elementListenerSet = node[internalEventHandlersKey];\n  if (elementListenerSet === undefined) {\n    elementListenerSet = node[internalEventHandlersKey] = new Set();\n  }\n  return elementListenerSet;\n}\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\nfunction setCurrentlyValidatingElement(element) {\n  {\n    if (element) {\n      var owner = element._owner;\n      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n    } else {\n      ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n    }\n  }\n}\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n  {\n    // $FlowFixMe This is okay but Flow doesn't know it.\n    var has = Function.call.bind(Object.prototype.hasOwnProperty);\n    for (var typeSpecName in typeSpecs) {\n      if (has(typeSpecs, typeSpecName)) {\n        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n        // fail the render phase where it didn't fail before. So we log it.\n        // After these have been cleaned up, we'll let them throw.\n        try {\n          // This is intentionally an invariant that gets caught. It's the same\n          // behavior as without this statement except with a better message.\n          if (typeof typeSpecs[typeSpecName] !== 'function') {\n            var err = Error((componentName || 'React class') + ': ' + location + ' type \\`' + typeSpecName + '\\` is invalid; ' + 'it must be a function, usually from the \\`prop-types\\` package, but received \\`' + typeof typeSpecs[typeSpecName] + '\\`.' + 'This often happens because of typos such as \\`PropTypes.function\\` instead of \\`PropTypes.func\\`.');\n            err.name = 'Invariant Violation';\n            throw err;\n          }\n          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n        } catch (ex) {\n          error$1 = ex;\n        }\n        if (error$1 && !(error$1 instanceof Error)) {\n          setCurrentlyValidatingElement(element);\n          error('%s: type specification of %s' + ' \\`%s\\` is invalid; the type checker ' + 'function must return \\`null\\` or an \\`Error\\` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n          setCurrentlyValidatingElement(null);\n        }\n        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n          // Only monitor this failure once because there tends to be a lot of the\n          // same error.\n          loggedTypeFailures[error$1.message] = true;\n          setCurrentlyValidatingElement(element);\n          error('Failed %s type: %s', location, error$1.message);\n          setCurrentlyValidatingElement(null);\n        }\n      }\n    }\n  }\n}\nvar valueStack = [];\nvar fiberStack;\n{\n  fiberStack = [];\n}\nvar index = -1;\nfunction createCursor(defaultValue) {\n  return {\n    current: defaultValue\n  };\n}\nfunction pop(cursor, fiber) {\n  if (index < 0) {\n    {\n      error('Unexpected pop.');\n    }\n    return;\n  }\n  {\n    if (fiber !== fiberStack[index]) {\n      error('Unexpected Fiber popped.');\n    }\n  }\n  cursor.current = valueStack[index];\n  valueStack[index] = null;\n  {\n    fiberStack[index] = null;\n  }\n  index--;\n}\nfunction push(cursor, value, fiber) {\n  index++;\n  valueStack[index] = cursor.current;\n  {\n    fiberStack[index] = fiber;\n  }\n  cursor.current = value;\n}\nvar warnedAboutMissingGetChildContext;\n{\n  warnedAboutMissingGetChildContext = {};\n}\nvar emptyContextObject = {};\n{\n  Object.freeze(emptyContextObject);\n} // A cursor to the current merged context object on the stack.\nvar contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.\nvar didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\nvar previousContext = emptyContextObject;\nfunction getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {\n  {\n    if (didPushOwnContextIfProvider && isContextProvider(Component)) {\n      // If the fiber is a context provider itself, when we read its context\n      // we may have already pushed its own child context on the stack. A context\n      // provider should not \\\\\"see\\\\\" its own child context. Therefore we read the\n      // previous (parent) context instead for a context provider.\n      return previousContext;\n    }\n    return contextStackCursor.current;\n  }\n}\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n  {\n    var instance = workInProgress.stateNode;\n    instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n    instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n  }\n}\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n  {\n    var type = workInProgress.type;\n    var contextTypes = type.contextTypes;\n    if (!contextTypes) {\n      return emptyContextObject;\n    } // Avoid recreating masked context unless unmasked context has changed.\n    // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n    // This may trigger infinite loops if componentWillReceiveProps calls setState.\n    var instance = workInProgress.stateNode;\n    if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n      return instance.__reactInternalMemoizedMaskedChildContext;\n    }\n    var context = {};\n    for (var key in contextTypes) {\n      context[key] = unmaskedContext[key];\n    }\n    {\n      var name = getComponentName(type) || 'Unknown';\n      checkPropTypes(contextTypes, context, 'context', name);\n    } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n    // Context is created before the class component is instantiated so check for instance.\n    if (instance) {\n      cacheContext(workInProgress, unmaskedContext, context);\n    }\n    return context;\n  }\n}\nfunction hasContextChanged() {\n  {\n    return didPerformWorkStackCursor.current;\n  }\n}\nfunction isContextProvider(type) {\n  {\n    var childContextTypes = type.childContextTypes;\n    return childContextTypes !== null && childContextTypes !== undefined;\n  }\n}\nfunction popContext(fiber) {\n  {\n    pop(didPerformWorkStackCursor, fiber);\n    pop(contextStackCursor, fiber);\n  }\n}\nfunction popTopLevelContextObject(fiber) {\n  {\n    pop(didPerformWorkStackCursor, fiber);\n    pop(contextStackCursor, fiber);\n  }\n}\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n  {\n    if (!(contextStackCursor.current === emptyContextObject)) {\n      {\n        throw Error( \\\\\"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    push(contextStackCursor, context, fiber);\n    push(didPerformWorkStackCursor, didChange, fiber);\n  }\n}\nfunction processChildContext(fiber, type, parentContext) {\n  {\n    var instance = fiber.stateNode;\n    var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n    // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n    if (typeof instance.getChildContext !== 'function') {\n      {\n        var componentName = getComponentName(type) || 'Unknown';\n        if (!warnedAboutMissingGetChildContext[componentName]) {\n          warnedAboutMissingGetChildContext[componentName] = true;\n          error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);\n        }\n      }\n      return parentContext;\n    }\n    var childContext = instance.getChildContext();\n    for (var contextKey in childContext) {\n      if (!(contextKey in childContextTypes)) {\n        {\n          throw Error( (getComponentName(type) || 'Unknown') + \\\\\".getChildContext(): key \\\\\\\\\\\\\"\\\\\" + contextKey + \\\\\"\\\\\\\\\\\\\" is not defined in childContextTypes.\\\\\" );\n        }\n      }\n    }\n    {\n      var name = getComponentName(type) || 'Unknown';\n      checkPropTypes(childContextTypes, childContext, 'child context', name);\n    }\n    return _assign({}, parentContext, childContext);\n  }\n}\nfunction pushContextProvider(workInProgress) {\n  {\n    var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.\n    // If the instance does not exist yet, we will push null at first,\n    // and replace it on the stack later when invalidating the context.\n    var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.\n    // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n    previousContext = contextStackCursor.current;\n    push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n    push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n    return true;\n  }\n}\nfunction invalidateContextProvider(workInProgress, type, didChange) {\n  {\n    var instance = workInProgress.stateNode;\n    if (!instance) {\n      {\n        throw Error( \\\\\"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    if (didChange) {\n      // Merge parent and own context.\n      // Skip this if we're not updating due to sCU.\n      // This avoids unnecessarily recomputing memoized values.\n      var mergedContext = processChildContext(workInProgress, type, previousContext);\n      instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.\n      // It is important to unwind the context in the reverse order.\n      pop(didPerformWorkStackCursor, workInProgress);\n      pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.\n      push(contextStackCursor, mergedContext, workInProgress);\n      push(didPerformWorkStackCursor, didChange, workInProgress);\n    } else {\n      pop(didPerformWorkStackCursor, workInProgress);\n      push(didPerformWorkStackCursor, didChange, workInProgress);\n    }\n  }\n}\nfunction findCurrentUnmaskedContext(fiber) {\n  {\n    // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n    // makes sense elsewhere\n    if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {\n      {\n        throw Error( \\\\\"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    var node = fiber;\n    do {\n      switch (node.tag) {\n        case HostRoot:\n          return node.stateNode.context;\n        case ClassComponent:\n          {\n            var Component = node.type;\n            if (isContextProvider(Component)) {\n              return node.stateNode.__reactInternalMemoizedMergedChildContext;\n            }\n            break;\n          }\n      }\n      node = node.return;\n    } while (node !== null);\n    {\n      {\n        throw Error( \\\\\"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  }\n}\nvar LegacyRoot = 0;\nvar BlockingRoot = 1;\nvar ConcurrentRoot = 2;\nvar rendererID = null;\nvar injectedHook = null;\nvar hasLoggedError = false;\nvar isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';\nfunction injectInternals(internals) {\n  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n    // No DevTools\n    return false;\n  }\n  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n  if (hook.isDisabled) {\n    // This isn't a real property on the hook, but it can be set to opt out\n    // of DevTools integration and associated warnings and logs.\n    // https://github.com/facebook/react/issues/3877\n    return true;\n  }\n  if (!hook.supportsFiber) {\n    {\n      error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://reactjs.org/link/react-devtools');\n    } // DevTools exists, even though it doesn't support Fiber.\n    return true;\n  }\n  try {\n    rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.\n    injectedHook = hook;\n  } catch (err) {\n    // Catch all errors because it is unsafe to throw during initialization.\n    {\n      error('React instrumentation encountered an error: %s.', err);\n    }\n  } // DevTools exists\n  return true;\n}\nfunction onScheduleRoot(root, children) {\n  {\n    if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') {\n      try {\n        injectedHook.onScheduleFiberRoot(rendererID, root, children);\n      } catch (err) {\n        if ( !hasLoggedError) {\n          hasLoggedError = true;\n          error('React instrumentation encountered an error: %s', err);\n        }\n      }\n    }\n  }\n}\nfunction onCommitRoot(root, priorityLevel) {\n  if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {\n    try {\n      var didError = (root.current.flags & DidCapture) === DidCapture;\n      if (enableProfilerTimer) {\n        injectedHook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);\n      }\n    } catch (err) {\n      {\n        if (!hasLoggedError) {\n          hasLoggedError = true;\n          error('React instrumentation encountered an error: %s', err);\n        }\n      }\n    }\n  }\n}\nfunction onCommitUnmount(fiber) {\n  if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') {\n    try {\n      injectedHook.onCommitFiberUnmount(rendererID, fiber);\n    } catch (err) {\n      {\n        if (!hasLoggedError) {\n          hasLoggedError = true;\n          error('React instrumentation encountered an error: %s', err);\n        }\n      }\n    }\n  }\n}\nvar Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,\n    Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,\n    Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,\n    Scheduler_shouldYield = Scheduler.unstable_shouldYield,\n    Scheduler_requestPaint = Scheduler.unstable_requestPaint,\n    Scheduler_now$1 = Scheduler.unstable_now,\n    Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n    Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n    Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n    Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,\n    Scheduler_LowPriority = Scheduler.unstable_LowPriority,\n    Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;\n{\n  // Provide explicit error message when production+profiling bundle of e.g.\n  // react-dom is used with production (non-profiling) bundle of\n  // scheduler/tracing\n  if (!(tracing$1.__interactionsRef != null && tracing$1.__interactionsRef.current != null)) {\n    {\n      throw Error( \\\\\"It is not supported to run the profiling version of a renderer (for example, \\`react-dom/profiling\\`) without also replacing the \\`scheduler/tracing\\` module with \\`scheduler/tracing-profiling\\`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling\\\\\" );\n    }\n  }\n}\nvar fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use\n// ascending numbers so we can compare them like numbers. They start at 90 to\n// avoid clashing with Scheduler's priorities.\nvar ImmediatePriority$1 = 99;\nvar UserBlockingPriority$2 = 98;\nvar NormalPriority$1 = 97;\nvar LowPriority$1 = 96;\nvar IdlePriority$1 = 95; // NoPriority is the absence of priority. Also React-only.\nvar NoPriority$1 = 90;\nvar shouldYield = Scheduler_shouldYield;\nvar requestPaint = // Fall back gracefully if we're running an older version of Scheduler.\nScheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};\nvar syncQueue = null;\nvar immediateQueueCallbackNode = null;\nvar isFlushingSyncQueue = false;\nvar initialTimeMs$1 = Scheduler_now$1(); // If the initial timestamp is reasonably small, use Scheduler's \\`now\\` directly.\n// This will be the case for modern browsers that support \\`performance.now\\`. In\n// older browsers, Scheduler falls back to \\`Date.now\\`, which returns a Unix\n// timestamp. In that case, subtract the module initialization time to simulate\n// the behavior of performance.now and keep our times small enough to fit\n// within 32 bits.\n// TODO: Consider lifting this into Scheduler.\nvar now = initialTimeMs$1 < 10000 ? Scheduler_now$1 : function () {\n  return Scheduler_now$1() - initialTimeMs$1;\n};\nfunction getCurrentPriorityLevel() {\n  switch (Scheduler_getCurrentPriorityLevel()) {\n    case Scheduler_ImmediatePriority:\n      return ImmediatePriority$1;\n    case Scheduler_UserBlockingPriority:\n      return UserBlockingPriority$2;\n    case Scheduler_NormalPriority:\n      return NormalPriority$1;\n    case Scheduler_LowPriority:\n      return LowPriority$1;\n    case Scheduler_IdlePriority:\n      return IdlePriority$1;\n    default:\n      {\n        {\n          throw Error( \\\\\"Unknown priority level.\\\\\" );\n        }\n      }\n  }\n}\nfunction reactPriorityToSchedulerPriority(reactPriorityLevel) {\n  switch (reactPriorityLevel) {\n    case ImmediatePriority$1:\n      return Scheduler_ImmediatePriority;\n    case UserBlockingPriority$2:\n      return Scheduler_UserBlockingPriority;\n    case NormalPriority$1:\n      return Scheduler_NormalPriority;\n    case LowPriority$1:\n      return Scheduler_LowPriority;\n    case IdlePriority$1:\n      return Scheduler_IdlePriority;\n    default:\n      {\n        {\n          throw Error( \\\\\"Unknown priority level.\\\\\" );\n        }\n      }\n  }\n}\nfunction runWithPriority$1(reactPriorityLevel, fn) {\n  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n  return Scheduler_runWithPriority(priorityLevel, fn);\n}\nfunction scheduleCallback(reactPriorityLevel, callback, options) {\n  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n  return Scheduler_scheduleCallback(priorityLevel, callback, options);\n}\nfunction scheduleSyncCallback(callback) {\n  // Push this callback into an internal queue. We'll flush these either in\n  // the next tick, or earlier if something calls \\`flushSyncCallbackQueue\\`.\n  if (syncQueue === null) {\n    syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.\n    immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);\n  } else {\n    // Push onto existing queue. Don't need to schedule a callback because\n    // we already scheduled one when we created the queue.\n    syncQueue.push(callback);\n  }\n  return fakeCallbackNode;\n}\nfunction cancelCallback(callbackNode) {\n  if (callbackNode !== fakeCallbackNode) {\n    Scheduler_cancelCallback(callbackNode);\n  }\n}\nfunction flushSyncCallbackQueue() {\n  if (immediateQueueCallbackNode !== null) {\n    var node = immediateQueueCallbackNode;\n    immediateQueueCallbackNode = null;\n    Scheduler_cancelCallback(node);\n  }\n  flushSyncCallbackQueueImpl();\n}\nfunction flushSyncCallbackQueueImpl() {\n  if (!isFlushingSyncQueue && syncQueue !== null) {\n    // Prevent re-entrancy.\n    isFlushingSyncQueue = true;\n    var i = 0;\n    {\n      try {\n        var _isSync2 = true;\n        var _queue = syncQueue;\n        runWithPriority$1(ImmediatePriority$1, function () {\n          for (; i < _queue.length; i++) {\n            var callback = _queue[i];\n            do {\n              callback = callback(_isSync2);\n            } while (callback !== null);\n          }\n        });\n        syncQueue = null;\n      } catch (error) {\n        // If something throws, leave the remaining callbacks on the queue.\n        if (syncQueue !== null) {\n          syncQueue = syncQueue.slice(i + 1);\n        } // Resume flushing in the next tick\n        Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);\n        throw error;\n      } finally {\n        isFlushingSyncQueue = false;\n      }\n    }\n  }\n}\n// TODO: this is special because it gets imported during build.\nvar ReactVersion = '17.0.1';\nvar NoMode = 0;\nvar StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root\n// tag instead\nvar BlockingMode = 2;\nvar ConcurrentMode = 4;\nvar ProfileMode = 8;\nvar DebugTracingMode = 16;\nvar ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;\nvar NoTransition = 0;\nfunction requestCurrentTransition() {\n  return ReactCurrentBatchConfig.transition;\n}\nvar ReactStrictModeWarnings = {\n  recordUnsafeLifecycleWarnings: function (fiber, instance) {},\n  flushPendingUnsafeLifecycleWarnings: function () {},\n  recordLegacyContextWarning: function (fiber, instance) {},\n  flushLegacyContextWarning: function () {},\n  discardPendingWarnings: function () {}\n};\n{\n  var findStrictRoot = function (fiber) {\n    var maybeStrictRoot = null;\n    var node = fiber;\n    while (node !== null) {\n      if (node.mode & StrictMode) {\n        maybeStrictRoot = node;\n      }\n      node = node.return;\n    }\n    return maybeStrictRoot;\n  };\n  var setToSortedString = function (set) {\n    var array = [];\n    set.forEach(function (value) {\n      array.push(value);\n    });\n    return array.sort().join(', ');\n  };\n  var pendingComponentWillMountWarnings = [];\n  var pendingUNSAFE_ComponentWillMountWarnings = [];\n  var pendingComponentWillReceivePropsWarnings = [];\n  var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n  var pendingComponentWillUpdateWarnings = [];\n  var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.\n  var didWarnAboutUnsafeLifecycles = new Set();\n  ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {\n    // Dedup strategy: Warn once per component.\n    if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {\n      return;\n    }\n    if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.\n    instance.componentWillMount.__suppressDeprecationWarning !== true) {\n      pendingComponentWillMountWarnings.push(fiber);\n    }\n    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {\n      pendingUNSAFE_ComponentWillMountWarnings.push(fiber);\n    }\n    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n      pendingComponentWillReceivePropsWarnings.push(fiber);\n    }\n    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n      pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);\n    }\n    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n      pendingComponentWillUpdateWarnings.push(fiber);\n    }\n    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {\n      pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);\n    }\n  };\n  ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {\n    // We do an initial pass to gather component names\n    var componentWillMountUniqueNames = new Set();\n    if (pendingComponentWillMountWarnings.length > 0) {\n      pendingComponentWillMountWarnings.forEach(function (fiber) {\n        componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingComponentWillMountWarnings = [];\n    }\n    var UNSAFE_componentWillMountUniqueNames = new Set();\n    if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {\n      pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {\n        UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingUNSAFE_ComponentWillMountWarnings = [];\n    }\n    var componentWillReceivePropsUniqueNames = new Set();\n    if (pendingComponentWillReceivePropsWarnings.length > 0) {\n      pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {\n        componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingComponentWillReceivePropsWarnings = [];\n    }\n    var UNSAFE_componentWillReceivePropsUniqueNames = new Set();\n    if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {\n      pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {\n        UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n    }\n    var componentWillUpdateUniqueNames = new Set();\n    if (pendingComponentWillUpdateWarnings.length > 0) {\n      pendingComponentWillUpdateWarnings.forEach(function (fiber) {\n        componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingComponentWillUpdateWarnings = [];\n    }\n    var UNSAFE_componentWillUpdateUniqueNames = new Set();\n    if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {\n      pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {\n        UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingUNSAFE_ComponentWillUpdateWarnings = [];\n    } // Finally, we flush all the warnings\n    // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'\n    if (UNSAFE_componentWillMountUniqueNames.size > 0) {\n      var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);\n      error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.' + 'Please update the following components: %s', sortedNames);\n    }\n    if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {\n      var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);\n      error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + \\\\\"* If you're updating state whenever props change, \\\\\" + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state' + 'Please update the following components: %s', _sortedNames);\n    }\n    if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {\n      var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);\n      error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + 'Please update the following components: %s', _sortedNames2);\n    }\n    if (componentWillMountUniqueNames.size > 0) {\n      var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);\n      warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '\\`npx react-codemod rename-unsafe-lifecycles\\` in your project source folder.' + 'Please update the following components: %s', _sortedNames3);\n    }\n    if (componentWillReceivePropsUniqueNames.size > 0) {\n      var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);\n      warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + \\\\\"* If you're updating state whenever props change, refactor your \\\\\" + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '\\`npx react-codemod rename-unsafe-lifecycles\\` in your project source folder.' + 'Please update the following components: %s', _sortedNames4);\n    }\n    if (componentWillUpdateUniqueNames.size > 0) {\n      var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);\n      warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '\\`npx react-codemod rename-unsafe-lifecycles\\` in your project source folder.' + 'Please update the following components: %s', _sortedNames5);\n    }\n  };\n  var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.\n  var didWarnAboutLegacyContext = new Set();\n  ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {\n    var strictRoot = findStrictRoot(fiber);\n    if (strictRoot === null) {\n      error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n      return;\n    } // Dedup strategy: Warn once per component.\n    if (didWarnAboutLegacyContext.has(fiber.type)) {\n      return;\n    }\n    var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);\n    if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {\n      if (warningsForRoot === undefined) {\n        warningsForRoot = [];\n        pendingLegacyContextWarning.set(strictRoot, warningsForRoot);\n      }\n      warningsForRoot.push(fiber);\n    }\n  };\n  ReactStrictModeWarnings.flushLegacyContextWarning = function () {\n    pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {\n      if (fiberArray.length === 0) {\n        return;\n      }\n      var firstFiber = fiberArray[0];\n      var uniqueNames = new Set();\n      fiberArray.forEach(function (fiber) {\n        uniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutLegacyContext.add(fiber.type);\n      });\n      var sortedNames = setToSortedString(uniqueNames);\n      try {\n        setCurrentFiber(firstFiber);\n        error('Legacy context API has been detected within a strict-mode tree.' + 'The old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + 'Please update the following components: %s' + 'Learn more about this warning here: https://reactjs.org/link/legacy-context', sortedNames);\n      } finally {\n        resetCurrentFiber();\n      }\n    });\n  };\n  ReactStrictModeWarnings.discardPendingWarnings = function () {\n    pendingComponentWillMountWarnings = [];\n    pendingUNSAFE_ComponentWillMountWarnings = [];\n    pendingComponentWillReceivePropsWarnings = [];\n    pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n    pendingComponentWillUpdateWarnings = [];\n    pendingUNSAFE_ComponentWillUpdateWarnings = [];\n    pendingLegacyContextWarning = new Map();\n  };\n}\nfunction resolveDefaultProps(Component, baseProps) {\n  if (Component && Component.defaultProps) {\n    // Resolve default props. Taken from ReactElement\n    var props = _assign({}, baseProps);\n    var defaultProps = Component.defaultProps;\n    for (var propName in defaultProps) {\n      if (props[propName] === undefined) {\n        props[propName] = defaultProps[propName];\n      }\n    }\n    return props;\n  }\n  return baseProps;\n}\n// Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\nvar valueCursor = createCursor(null);\nvar rendererSigil;\n{\n  // Use this to detect multiple renderers using the same context\n  rendererSigil = {};\n}\nvar currentlyRenderingFiber = null;\nvar lastContextDependency = null;\nvar lastContextWithAllBitsObserved = null;\nvar isDisallowedContextReadInDEV = false;\nfunction resetContextDependencies() {\n  // This is called right before React yields execution, to ensure \\`readContext\\`\n  // cannot be called outside the render phase.\n  currentlyRenderingFiber = null;\n  lastContextDependency = null;\n  lastContextWithAllBitsObserved = null;\n  {\n    isDisallowedContextReadInDEV = false;\n  }\n}\nfunction enterDisallowedContextReadInDEV() {\n  {\n    isDisallowedContextReadInDEV = true;\n  }\n}\nfunction exitDisallowedContextReadInDEV() {\n  {\n    isDisallowedContextReadInDEV = false;\n  }\n}\nfunction pushProvider(providerFiber, nextValue) {\n  var context = providerFiber.type._context;\n  {\n    push(valueCursor, context._currentValue, providerFiber);\n    context._currentValue = nextValue;\n    {\n      if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {\n        error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n      }\n      context._currentRenderer = rendererSigil;\n    }\n  }\n}\nfunction popProvider(providerFiber) {\n  var currentValue = valueCursor.current;\n  pop(valueCursor, providerFiber);\n  var context = providerFiber.type._context;\n  {\n    context._currentValue = currentValue;\n  }\n}\nfunction calculateChangedBits(context, newValue, oldValue) {\n  if (objectIs(oldValue, newValue)) {\n    // No change\n    return 0;\n  } else {\n    var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n    {\n      if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {\n        error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n      }\n    }\n    return changedBits | 0;\n  }\n}\nfunction scheduleWorkOnParentPath(parent, renderLanes) {\n  // Update the child lanes of all the ancestors, including the alternates.\n  var node = parent;\n  while (node !== null) {\n    var alternate = node.alternate;\n    if (!isSubsetOfLanes(node.childLanes, renderLanes)) {\n      node.childLanes = mergeLanes(node.childLanes, renderLanes);\n      if (alternate !== null) {\n        alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);\n      }\n    } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) {\n      alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);\n    } else {\n      // Neither alternate was updated, which means the rest of the\n      // ancestor path already has sufficient priority.\n      break;\n    }\n    node = node.return;\n  }\n}\nfunction propagateContextChange(workInProgress, context, changedBits, renderLanes) {\n  var fiber = workInProgress.child;\n  if (fiber !== null) {\n    // Set the return pointer of the child to the work-in-progress fiber.\n    fiber.return = workInProgress;\n  }\n  while (fiber !== null) {\n    var nextFiber = void 0; // Visit this fiber.\n    var list = fiber.dependencies;\n    if (list !== null) {\n      nextFiber = fiber.child;\n      var dependency = list.firstContext;\n      while (dependency !== null) {\n        // Check if the context matches.\n        if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {\n          // Match! Schedule an update on this fiber.\n          if (fiber.tag === ClassComponent) {\n            // Schedule a force update on the work-in-progress.\n            var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes));\n            update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the\n            // update to the current fiber, too, which means it will persist even if\n            // this render is thrown away. Since it's a race condition, not sure it's\n            // worth fixing.\n            enqueueUpdate(fiber, update);\n          }\n          fiber.lanes = mergeLanes(fiber.lanes, renderLanes);\n          var alternate = fiber.alternate;\n          if (alternate !== null) {\n            alternate.lanes = mergeLanes(alternate.lanes, renderLanes);\n          }\n          scheduleWorkOnParentPath(fiber.return, renderLanes); // Mark the updated lanes on the list, too.\n          list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the\n          // dependency list.\n          break;\n        }\n        dependency = dependency.next;\n      }\n    } else if (fiber.tag === ContextProvider) {\n      // Don't scan deeper if this is a matching provider\n      nextFiber = fiber.type === workInProgress.type ? null : fiber.child;\n    } else {\n      // Traverse down.\n      nextFiber = fiber.child;\n    }\n    if (nextFiber !== null) {\n      // Set the return pointer of the child to the work-in-progress fiber.\n      nextFiber.return = fiber;\n    } else {\n      // No child. Traverse to next sibling.\n      nextFiber = fiber;\n      while (nextFiber !== null) {\n        if (nextFiber === workInProgress) {\n          // We're back to the root of this subtree. Exit.\n          nextFiber = null;\n          break;\n        }\n        var sibling = nextFiber.sibling;\n        if (sibling !== null) {\n          // Set the return pointer of the sibling to the work-in-progress fiber.\n          sibling.return = nextFiber.return;\n          nextFiber = sibling;\n          break;\n        } // No more siblings. Traverse up.\n        nextFiber = nextFiber.return;\n      }\n    }\n    fiber = nextFiber;\n  }\n}\nfunction prepareToReadContext(workInProgress, renderLanes) {\n  currentlyRenderingFiber = workInProgress;\n  lastContextDependency = null;\n  lastContextWithAllBitsObserved = null;\n  var dependencies = workInProgress.dependencies;\n  if (dependencies !== null) {\n    var firstContext = dependencies.firstContext;\n    if (firstContext !== null) {\n      if (includesSomeLane(dependencies.lanes, renderLanes)) {\n        // Context list has a pending update. Mark that this fiber performed work.\n        markWorkInProgressReceivedUpdate();\n      } // Reset the work-in-progress list\n      dependencies.firstContext = null;\n    }\n  }\n}\nfunction readContext(context, observedBits) {\n  {\n    // This warning would fire if you read context inside a Hook like useMemo.\n    // Unlike the class check below, it's not enforced in production for perf.\n    if (isDisallowedContextReadInDEV) {\n      error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n    }\n  }\n  if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {\n    var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.\n    if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {\n      // Observe all updates.\n      lastContextWithAllBitsObserved = context;\n      resolvedObservedBits = MAX_SIGNED_31_BIT_INT;\n    } else {\n      resolvedObservedBits = observedBits;\n    }\n    var contextItem = {\n      context: context,\n      observedBits: resolvedObservedBits,\n      next: null\n    };\n    if (lastContextDependency === null) {\n      if (!(currentlyRenderingFiber !== null)) {\n        {\n          throw Error( \\\\\"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().\\\\\" );\n        }\n      } // This is the first dependency for this component. Create a new list.\n      lastContextDependency = contextItem;\n      currentlyRenderingFiber.dependencies = {\n        lanes: NoLanes,\n        firstContext: contextItem,\n        responders: null\n      };\n    } else {\n      // Append a new context item.\n      lastContextDependency = lastContextDependency.next = contextItem;\n    }\n  }\n  return  context._currentValue ;\n}\nvar UpdateState = 0;\nvar ReplaceState = 1;\nvar ForceUpdate = 2;\nvar CaptureUpdate = 3; // Global state that is reset at the beginning of calling \\`processUpdateQueue\\`.\n// It should only be read right after calling \\`processUpdateQueue\\`, via\n// \\`checkHasForceUpdateAfterProcessing\\`.\nvar hasForceUpdate = false;\nvar didWarnUpdateInsideUpdate;\nvar currentlyProcessingQueue;\n{\n  didWarnUpdateInsideUpdate = false;\n  currentlyProcessingQueue = null;\n}\nfunction initializeUpdateQueue(fiber) {\n  var queue = {\n    baseState: fiber.memoizedState,\n    firstBaseUpdate: null,\n    lastBaseUpdate: null,\n    shared: {\n      pending: null\n    },\n    effects: null\n  };\n  fiber.updateQueue = queue;\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n  // Clone the update queue from current. Unless it's already a clone.\n  var queue = workInProgress.updateQueue;\n  var currentQueue = current.updateQueue;\n  if (queue === currentQueue) {\n    var clone = {\n      baseState: currentQueue.baseState,\n      firstBaseUpdate: currentQueue.firstBaseUpdate,\n      lastBaseUpdate: currentQueue.lastBaseUpdate,\n      shared: currentQueue.shared,\n      effects: currentQueue.effects\n    };\n    workInProgress.updateQueue = clone;\n  }\n}\nfunction createUpdate(eventTime, lane) {\n  var update = {\n    eventTime: eventTime,\n    lane: lane,\n    tag: UpdateState,\n    payload: null,\n    callback: null,\n    next: null\n  };\n  return update;\n}\nfunction enqueueUpdate(fiber, update) {\n  var updateQueue = fiber.updateQueue;\n  if (updateQueue === null) {\n    // Only occurs if the fiber has been unmounted.\n    return;\n  }\n  var sharedQueue = updateQueue.shared;\n  var pending = sharedQueue.pending;\n  if (pending === null) {\n    // This is the first update. Create a circular list.\n    update.next = update;\n  } else {\n    update.next = pending.next;\n    pending.next = update;\n  }\n  sharedQueue.pending = update;\n  {\n    if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {\n      error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');\n      didWarnUpdateInsideUpdate = true;\n    }\n  }\n}\nfunction enqueueCapturedUpdate(workInProgress, capturedUpdate) {\n  // Captured updates are updates that are thrown by a child during the render\n  // phase. They should be discarded if the render is aborted. Therefore,\n  // we should only put them on the work-in-progress queue, not the current one.\n  var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone.\n  var current = workInProgress.alternate;\n  if (current !== null) {\n    var currentQueue = current.updateQueue;\n    if (queue === currentQueue) {\n      // The work-in-progress queue is the same as current. This happens when\n      // we bail out on a parent fiber that then captures an error thrown by\n      // a child. Since we want to append the update only to the work-in\n      // -progress queue, we need to clone the updates. We usually clone during\n      // processUpdateQueue, but that didn't happen in this case because we\n      // skipped over the parent when we bailed out.\n      var newFirst = null;\n      var newLast = null;\n      var firstBaseUpdate = queue.firstBaseUpdate;\n      if (firstBaseUpdate !== null) {\n        // Loop through the updates and clone them.\n        var update = firstBaseUpdate;\n        do {\n          var clone = {\n            eventTime: update.eventTime,\n            lane: update.lane,\n            tag: update.tag,\n            payload: update.payload,\n            callback: update.callback,\n            next: null\n          };\n          if (newLast === null) {\n            newFirst = newLast = clone;\n          } else {\n            newLast.next = clone;\n            newLast = clone;\n          }\n          update = update.next;\n        } while (update !== null); // Append the captured update the end of the cloned list.\n        if (newLast === null) {\n          newFirst = newLast = capturedUpdate;\n        } else {\n          newLast.next = capturedUpdate;\n          newLast = capturedUpdate;\n        }\n      } else {\n        // There are no base updates.\n        newFirst = newLast = capturedUpdate;\n      }\n      queue = {\n        baseState: currentQueue.baseState,\n        firstBaseUpdate: newFirst,\n        lastBaseUpdate: newLast,\n        shared: currentQueue.shared,\n        effects: currentQueue.effects\n      };\n      workInProgress.updateQueue = queue;\n      return;\n    }\n  } // Append the update to the end of the list.\n  var lastBaseUpdate = queue.lastBaseUpdate;\n  if (lastBaseUpdate === null) {\n    queue.firstBaseUpdate = capturedUpdate;\n  } else {\n    lastBaseUpdate.next = capturedUpdate;\n  }\n  queue.lastBaseUpdate = capturedUpdate;\n}\nfunction getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {\n  switch (update.tag) {\n    case ReplaceState:\n      {\n        var payload = update.payload;\n        if (typeof payload === 'function') {\n          // Updater function\n          {\n            enterDisallowedContextReadInDEV();\n          }\n          var nextState = payload.call(instance, prevState, nextProps);\n          {\n            if ( workInProgress.mode & StrictMode) {\n              disableLogs();\n              try {\n                payload.call(instance, prevState, nextProps);\n              } finally {\n                reenableLogs();\n              }\n            }\n            exitDisallowedContextReadInDEV();\n          }\n          return nextState;\n        } // State object\n        return payload;\n      }\n    case CaptureUpdate:\n      {\n        workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;\n      }\n    // Intentional fallthrough\n    case UpdateState:\n      {\n        var _payload = update.payload;\n        var partialState;\n        if (typeof _payload === 'function') {\n          // Updater function\n          {\n            enterDisallowedContextReadInDEV();\n          }\n          partialState = _payload.call(instance, prevState, nextProps);\n          {\n            if ( workInProgress.mode & StrictMode) {\n              disableLogs();\n              try {\n                _payload.call(instance, prevState, nextProps);\n              } finally {\n                reenableLogs();\n              }\n            }\n            exitDisallowedContextReadInDEV();\n          }\n        } else {\n          // Partial state object\n          partialState = _payload;\n        }\n        if (partialState === null || partialState === undefined) {\n          // Null and undefined are treated as no-ops.\n          return prevState;\n        } // Merge the partial state and the previous state.\n        return _assign({}, prevState, partialState);\n      }\n    case ForceUpdate:\n      {\n        hasForceUpdate = true;\n        return prevState;\n      }\n  }\n  return prevState;\n}\nfunction processUpdateQueue(workInProgress, props, instance, renderLanes) {\n  // This is always non-null on a ClassComponent or HostRoot\n  var queue = workInProgress.updateQueue;\n  hasForceUpdate = false;\n  {\n    currentlyProcessingQueue = queue.shared;\n  }\n  var firstBaseUpdate = queue.firstBaseUpdate;\n  var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue.\n  var pendingQueue = queue.shared.pending;\n  if (pendingQueue !== null) {\n    queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first\n    // and last so that it's non-circular.\n    var lastPendingUpdate = pendingQueue;\n    var firstPendingUpdate = lastPendingUpdate.next;\n    lastPendingUpdate.next = null; // Append pending updates to base queue\n    if (lastBaseUpdate === null) {\n      firstBaseUpdate = firstPendingUpdate;\n    } else {\n      lastBaseUpdate.next = firstPendingUpdate;\n    }\n    lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then\n    // we need to transfer the updates to that queue, too. Because the base\n    // queue is a singly-linked list with no cycles, we can append to both\n    // lists and take advantage of structural sharing.\n    // TODO: Pass \\`current\\` as argument\n    var current = workInProgress.alternate;\n    if (current !== null) {\n      // This is always non-null on a ClassComponent or HostRoot\n      var currentQueue = current.updateQueue;\n      var currentLastBaseUpdate = currentQueue.lastBaseUpdate;\n      if (currentLastBaseUpdate !== lastBaseUpdate) {\n        if (currentLastBaseUpdate === null) {\n          currentQueue.firstBaseUpdate = firstPendingUpdate;\n        } else {\n          currentLastBaseUpdate.next = firstPendingUpdate;\n        }\n        currentQueue.lastBaseUpdate = lastPendingUpdate;\n      }\n    }\n  } // These values may change as we process the queue.\n  if (firstBaseUpdate !== null) {\n    // Iterate through the list of updates to compute the result.\n    var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes\n    // from the original lanes.\n    var newLanes = NoLanes;\n    var newBaseState = null;\n    var newFirstBaseUpdate = null;\n    var newLastBaseUpdate = null;\n    var update = firstBaseUpdate;\n    do {\n      var updateLane = update.lane;\n      var updateEventTime = update.eventTime;\n      if (!isSubsetOfLanes(renderLanes, updateLane)) {\n        // Priority is insufficient. Skip this update. If this is the first\n        // skipped update, the previous update/state is the new base\n        // update/state.\n        var clone = {\n          eventTime: updateEventTime,\n          lane: updateLane,\n          tag: update.tag,\n          payload: update.payload,\n          callback: update.callback,\n          next: null\n        };\n        if (newLastBaseUpdate === null) {\n          newFirstBaseUpdate = newLastBaseUpdate = clone;\n          newBaseState = newState;\n        } else {\n          newLastBaseUpdate = newLastBaseUpdate.next = clone;\n        } // Update the remaining priority in the queue.\n        newLanes = mergeLanes(newLanes, updateLane);\n      } else {\n        // This update does have sufficient priority.\n        if (newLastBaseUpdate !== null) {\n          var _clone = {\n            eventTime: updateEventTime,\n            // This update is going to be committed so we never want uncommit\n            // it. Using NoLane works because 0 is a subset of all bitmasks, so\n            // this will never be skipped by the check above.\n            lane: NoLane,\n            tag: update.tag,\n            payload: update.payload,\n            callback: update.callback,\n            next: null\n          };\n          newLastBaseUpdate = newLastBaseUpdate.next = _clone;\n        } // Process this update.\n        newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);\n        var callback = update.callback;\n        if (callback !== null) {\n          workInProgress.flags |= Callback;\n          var effects = queue.effects;\n          if (effects === null) {\n            queue.effects = [update];\n          } else {\n            effects.push(update);\n          }\n        }\n      }\n      update = update.next;\n      if (update === null) {\n        pendingQueue = queue.shared.pending;\n        if (pendingQueue === null) {\n          break;\n        } else {\n          // An update was scheduled from inside a reducer. Add the new\n          // pending updates to the end of the list and keep processing.\n          var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we\n          // unravel them when transferring them to the base queue.\n          var _firstPendingUpdate = _lastPendingUpdate.next;\n          _lastPendingUpdate.next = null;\n          update = _firstPendingUpdate;\n          queue.lastBaseUpdate = _lastPendingUpdate;\n          queue.shared.pending = null;\n        }\n      }\n    } while (true);\n    if (newLastBaseUpdate === null) {\n      newBaseState = newState;\n    }\n    queue.baseState = newBaseState;\n    queue.firstBaseUpdate = newFirstBaseUpdate;\n    queue.lastBaseUpdate = newLastBaseUpdate; // Set the remaining expiration time to be whatever is remaining in the queue.\n    // This should be fine because the only two other things that contribute to\n    // expiration time are props and context. We're already in the middle of the\n    // begin phase by the time we start processing the queue, so we've already\n    // dealt with the props. Context in components that specify\n    // shouldComponentUpdate is tricky; but we'll have to account for\n    // that regardless.\n    markSkippedUpdateLanes(newLanes);\n    workInProgress.lanes = newLanes;\n    workInProgress.memoizedState = newState;\n  }\n  {\n    currentlyProcessingQueue = null;\n  }\n}\nfunction callCallback(callback, context) {\n  if (!(typeof callback === 'function')) {\n    {\n      throw Error( \\\\\"Invalid argument passed as callback. Expected a function. Instead received: \\\\\" + callback );\n    }\n  }\n  callback.call(context);\n}\nfunction resetHasForceUpdateBeforeProcessing() {\n  hasForceUpdate = false;\n}\nfunction checkHasForceUpdateAfterProcessing() {\n  return hasForceUpdate;\n}\nfunction commitUpdateQueue(finishedWork, finishedQueue, instance) {\n  // Commit the effects\n  var effects = finishedQueue.effects;\n  finishedQueue.effects = null;\n  if (effects !== null) {\n    for (var i = 0; i < effects.length; i++) {\n      var effect = effects[i];\n      var callback = effect.callback;\n      if (callback !== null) {\n        effect.callback = null;\n        callCallback(callback, instance);\n      }\n    }\n  }\n}\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray; // React.Component uses a shared frozen object by default.\n// We'll use it to determine whether we need to initialize legacy refs.\nvar emptyRefsObject = new React.Component().refs;\nvar didWarnAboutStateAssignmentForComponent;\nvar didWarnAboutUninitializedState;\nvar didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\nvar didWarnAboutLegacyLifecyclesAndDerivedState;\nvar didWarnAboutUndefinedDerivedState;\nvar warnOnUndefinedDerivedState;\nvar warnOnInvalidCallback;\nvar didWarnAboutDirectlyAssigningPropsToState;\nvar didWarnAboutContextTypeAndContextTypes;\nvar didWarnAboutInvalidateContextType;\n{\n  didWarnAboutStateAssignmentForComponent = new Set();\n  didWarnAboutUninitializedState = new Set();\n  didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();\n  didWarnAboutLegacyLifecyclesAndDerivedState = new Set();\n  didWarnAboutDirectlyAssigningPropsToState = new Set();\n  didWarnAboutUndefinedDerivedState = new Set();\n  didWarnAboutContextTypeAndContextTypes = new Set();\n  didWarnAboutInvalidateContextType = new Set();\n  var didWarnOnInvalidCallback = new Set();\n  warnOnInvalidCallback = function (callback, callerName) {\n    if (callback === null || typeof callback === 'function') {\n      return;\n    }\n    var key = callerName + '_' + callback;\n    if (!didWarnOnInvalidCallback.has(key)) {\n      didWarnOnInvalidCallback.add(key);\n      error('%s(...): Expected the last optional \\`callback\\` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n    }\n  };\n  warnOnUndefinedDerivedState = function (type, partialState) {\n    if (partialState === undefined) {\n      var componentName = getComponentName(type) || 'Component';\n      if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n        didWarnAboutUndefinedDerivedState.add(componentName);\n        error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n      }\n    }\n  }; // This is so gross but it's at least non-critical and can be removed if\n  // it causes problems. This is meant to give a nicer error message for\n  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n  // ...)) which otherwise throws a \\\\\"_processChildContext is not a function\\\\\"\n  // exception.\n  Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n    enumerable: false,\n    value: function () {\n      {\n        {\n          throw Error( \\\\\"_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).\\\\\" );\n        }\n      }\n    }\n  });\n  Object.freeze(fakeInternalInstance);\n}\nfunction applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {\n  var prevState = workInProgress.memoizedState;\n  {\n    if ( workInProgress.mode & StrictMode) {\n      disableLogs();\n      try {\n        // Invoke the function an extra time to help detect side-effects.\n        getDerivedStateFromProps(nextProps, prevState);\n      } finally {\n        reenableLogs();\n      }\n    }\n  }\n  var partialState = getDerivedStateFromProps(nextProps, prevState);\n  {\n    warnOnUndefinedDerivedState(ctor, partialState);\n  } // Merge the partial state and the previous state.\n  var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);\n  workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the\n  // base state.\n  if (workInProgress.lanes === NoLanes) {\n    // Queue is always non-null for classes\n    var updateQueue = workInProgress.updateQueue;\n    updateQueue.baseState = memoizedState;\n  }\n}\nvar classComponentUpdater = {\n  isMounted: isMounted,\n  enqueueSetState: function (inst, payload, callback) {\n    var fiber = get(inst);\n    var eventTime = requestEventTime();\n    var lane = requestUpdateLane(fiber);\n    var update = createUpdate(eventTime, lane);\n    update.payload = payload;\n    if (callback !== undefined && callback !== null) {\n      {\n        warnOnInvalidCallback(callback, 'setState');\n      }\n      update.callback = callback;\n    }\n    enqueueUpdate(fiber, update);\n    scheduleUpdateOnFiber(fiber, lane, eventTime);\n  },\n  enqueueReplaceState: function (inst, payload, callback) {\n    var fiber = get(inst);\n    var eventTime = requestEventTime();\n    var lane = requestUpdateLane(fiber);\n    var update = createUpdate(eventTime, lane);\n    update.tag = ReplaceState;\n    update.payload = payload;\n    if (callback !== undefined && callback !== null) {\n      {\n        warnOnInvalidCallback(callback, 'replaceState');\n      }\n      update.callback = callback;\n    }\n    enqueueUpdate(fiber, update);\n    scheduleUpdateOnFiber(fiber, lane, eventTime);\n  },\n  enqueueForceUpdate: function (inst, callback) {\n    var fiber = get(inst);\n    var eventTime = requestEventTime();\n    var lane = requestUpdateLane(fiber);\n    var update = createUpdate(eventTime, lane);\n    update.tag = ForceUpdate;\n    if (callback !== undefined && callback !== null) {\n      {\n        warnOnInvalidCallback(callback, 'forceUpdate');\n      }\n      update.callback = callback;\n    }\n    enqueueUpdate(fiber, update);\n    scheduleUpdateOnFiber(fiber, lane, eventTime);\n  }\n};\nfunction checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {\n  var instance = workInProgress.stateNode;\n  if (typeof instance.shouldComponentUpdate === 'function') {\n    {\n      if ( workInProgress.mode & StrictMode) {\n        disableLogs();\n        try {\n          // Invoke the function an extra time to help detect side-effects.\n          instance.shouldComponentUpdate(newProps, newState, nextContext);\n        } finally {\n          reenableLogs();\n        }\n      }\n    }\n    var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n    {\n      if (shouldUpdate === undefined) {\n        error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');\n      }\n    }\n    return shouldUpdate;\n  }\n  if (ctor.prototype && ctor.prototype.isPureReactComponent) {\n    return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);\n  }\n  return true;\n}\nfunction checkClassInstance(workInProgress, ctor, newProps) {\n  var instance = workInProgress.stateNode;\n  {\n    var name = getComponentName(ctor) || 'Component';\n    var renderPresent = instance.render;\n    if (!renderPresent) {\n      if (ctor.prototype && typeof ctor.prototype.render === 'function') {\n        error('%s(...): No \\`render\\` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n      } else {\n        error('%s(...): No \\`render\\` method found on the returned component ' + 'instance: you may have forgotten to define \\`render\\`.', name);\n      }\n    }\n    if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {\n      error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);\n    }\n    if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {\n      error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);\n    }\n    if (instance.propTypes) {\n      error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n    }\n    if (instance.contextType) {\n      error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);\n    }\n    {\n      if (instance.contextTypes) {\n        error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n      }\n      if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {\n        didWarnAboutContextTypeAndContextTypes.add(ctor);\n        error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);\n      }\n    }\n    if (typeof instance.componentShouldUpdate === 'function') {\n      error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);\n    }\n    if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n      error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');\n    }\n    if (typeof instance.componentDidUnmount === 'function') {\n      error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n    }\n    if (typeof instance.componentDidReceiveProps === 'function') {\n      error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n    }\n    if (typeof instance.componentWillRecieveProps === 'function') {\n      error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n    }\n    if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {\n      error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);\n    }\n    var hasMutatedProps = instance.props !== newProps;\n    if (instance.props !== undefined && hasMutatedProps) {\n      error('%s(...): When calling super() in \\`%s\\`, make sure to pass ' + \\\\\"up the same props that your component's constructor was passed.\\\\\", name, name);\n    }\n    if (instance.defaultProps) {\n      error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {\n      didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);\n      error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));\n    }\n    if (typeof instance.getDerivedStateFromProps === 'function') {\n      error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n    }\n    if (typeof instance.getDerivedStateFromError === 'function') {\n      error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n    }\n    if (typeof ctor.getSnapshotBeforeUpdate === 'function') {\n      error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);\n    }\n    var _state = instance.state;\n    if (_state && (typeof _state !== 'object' || isArray(_state))) {\n      error('%s.state: must be set to an object or null', name);\n    }\n    if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {\n      error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);\n    }\n  }\n}\nfunction adoptClassInstance(workInProgress, instance) {\n  instance.updater = classComponentUpdater;\n  workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates\n  set(instance, workInProgress);\n  {\n    instance._reactInternalInstance = fakeInternalInstance;\n  }\n}\nfunction constructClassInstance(workInProgress, ctor, props) {\n  var isLegacyContextConsumer = false;\n  var unmaskedContext = emptyContextObject;\n  var context = emptyContextObject;\n  var contextType = ctor.contextType;\n  {\n    if ('contextType' in ctor) {\n      var isValid = // Allow null for conditional declaration\n      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>\n      if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {\n        didWarnAboutInvalidateContextType.add(ctor);\n        var addendum = '';\n        if (contextType === undefined) {\n          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n        } else if (typeof contextType !== 'object') {\n          addendum = ' However, it is set to a ' + typeof contextType + '.';\n        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {\n          addendum = ' Did you accidentally pass the Context.Provider instead?';\n        } else if (contextType._context !== undefined) {\n          // <Context.Consumer>\n          addendum = ' Did you accidentally pass the Context.Consumer instead?';\n        } else {\n          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n        }\n        error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);\n      }\n    }\n  }\n  if (typeof contextType === 'object' && contextType !== null) {\n    context = readContext(contextType);\n  } else {\n    unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    var contextTypes = ctor.contextTypes;\n    isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;\n    context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;\n  } // Instantiate twice to help detect side-effects.\n  {\n    if ( workInProgress.mode & StrictMode) {\n      disableLogs();\n      try {\n        new ctor(props, context); // eslint-disable-line no-new\n      } finally {\n        reenableLogs();\n      }\n    }\n  }\n  var instance = new ctor(props, context);\n  var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;\n  adoptClassInstance(workInProgress, instance);\n  {\n    if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {\n      var componentName = getComponentName(ctor) || 'Component';\n      if (!didWarnAboutUninitializedState.has(componentName)) {\n        didWarnAboutUninitializedState.add(componentName);\n        error('\\`%s\\` uses \\`getDerivedStateFromProps\\` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to \\`this.state\\` in the constructor of \\`%s\\`. ' + 'This ensures that \\`getDerivedStateFromProps\\` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);\n      }\n    } // If new component APIs are defined, \\\\\"unsafe\\\\\" lifecycles won't be called.\n    // Warn about these lifecycles if they are present.\n    // Don't warn about react-lifecycles-compat polyfilled methods though.\n    if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {\n      var foundWillMountName = null;\n      var foundWillReceivePropsName = null;\n      var foundWillUpdateName = null;\n      if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {\n        foundWillMountName = 'componentWillMount';\n      } else if (typeof instance.UNSAFE_componentWillMount === 'function') {\n        foundWillMountName = 'UNSAFE_componentWillMount';\n      }\n      if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n        foundWillReceivePropsName = 'componentWillReceiveProps';\n      } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n        foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n      }\n      if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n        foundWillUpdateName = 'componentWillUpdate';\n      } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n        foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n      }\n      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n        var _componentName = getComponentName(ctor) || 'Component';\n        var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n        if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n          didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n          error('Unsafe legacy lifecycles will not be called for components using new component APIs.' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s' + 'The above lifecycles should be removed. Learn more about this warning here:' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \\\\\"  \\\\\" + foundWillMountName : '', foundWillReceivePropsName !== null ? \\\\\"  \\\\\" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \\\\\"  \\\\\" + foundWillUpdateName : '');\n        }\n      }\n    }\n  } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n  // ReactFiberContext usually updates this cache but can't for newly-created instances.\n  if (isLegacyContextConsumer) {\n    cacheContext(workInProgress, unmaskedContext, context);\n  }\n  return instance;\n}\nfunction callComponentWillMount(workInProgress, instance) {\n  var oldState = instance.state;\n  if (typeof instance.componentWillMount === 'function') {\n    instance.componentWillMount();\n  }\n  if (typeof instance.UNSAFE_componentWillMount === 'function') {\n    instance.UNSAFE_componentWillMount();\n  }\n  if (oldState !== instance.state) {\n    {\n      error('%s.componentWillMount(): Assigning directly to this.state is ' + \\\\\"deprecated (except inside a component's \\\\\" + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');\n    }\n    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n  }\n}\nfunction callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {\n  var oldState = instance.state;\n  if (typeof instance.componentWillReceiveProps === 'function') {\n    instance.componentWillReceiveProps(newProps, nextContext);\n  }\n  if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n  }\n  if (instance.state !== oldState) {\n    {\n      var componentName = getComponentName(workInProgress.type) || 'Component';\n      if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {\n        didWarnAboutStateAssignmentForComponent.add(componentName);\n        error('%s.componentWillReceiveProps(): Assigning directly to ' + \\\\\"this.state is deprecated (except inside a component's \\\\\" + 'constructor). Use setState instead.', componentName);\n      }\n    }\n    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n  }\n} // Invokes the mount life-cycles on a previously never rendered instance.\nfunction mountClassInstance(workInProgress, ctor, newProps, renderLanes) {\n  {\n    checkClassInstance(workInProgress, ctor, newProps);\n  }\n  var instance = workInProgress.stateNode;\n  instance.props = newProps;\n  instance.state = workInProgress.memoizedState;\n  instance.refs = emptyRefsObject;\n  initializeUpdateQueue(workInProgress);\n  var contextType = ctor.contextType;\n  if (typeof contextType === 'object' && contextType !== null) {\n    instance.context = readContext(contextType);\n  } else {\n    var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    instance.context = getMaskedContext(workInProgress, unmaskedContext);\n  }\n  {\n    if (instance.state === newProps) {\n      var componentName = getComponentName(ctor) || 'Component';\n      if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n        didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n        error('%s: It is not recommended to assign props directly to state ' + \\\\\"because updates to props won't be reflected in state. \\\\\" + 'In most cases, it is better to use props directly.', componentName);\n      }\n    }\n    if (workInProgress.mode & StrictMode) {\n      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);\n    }\n    {\n      ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);\n    }\n  }\n  processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n  instance.state = workInProgress.memoizedState;\n  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n  if (typeof getDerivedStateFromProps === 'function') {\n    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n    instance.state = workInProgress.memoizedState;\n  } // In order to support react-lifecycles-compat polyfilled components,\n  // Unsafe lifecycles should not be invoked for components using the new APIs.\n  if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n    callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's\n    // process them now.\n    processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n    instance.state = workInProgress.memoizedState;\n  }\n  if (typeof instance.componentDidMount === 'function') {\n    workInProgress.flags |= Update;\n  }\n}\nfunction resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {\n  var instance = workInProgress.stateNode;\n  var oldProps = workInProgress.memoizedProps;\n  instance.props = oldProps;\n  var oldContext = instance.context;\n  var contextType = ctor.contextType;\n  var nextContext = emptyContextObject;\n  if (typeof contextType === 'object' && contextType !== null) {\n    nextContext = readContext(contextType);\n  } else {\n    var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);\n  }\n  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n  // ever the previously attempted to render - not the \\\\\"current\\\\\". However,\n  // during componentDidUpdate we pass the \\\\\"current\\\\\" props.\n  // In order to support react-lifecycles-compat polyfilled components,\n  // Unsafe lifecycles should not be invoked for components using the new APIs.\n  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n    if (oldProps !== newProps || oldContext !== nextContext) {\n      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n    }\n  }\n  resetHasForceUpdateBeforeProcessing();\n  var oldState = workInProgress.memoizedState;\n  var newState = instance.state = oldState;\n  processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n  newState = workInProgress.memoizedState;\n  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.flags |= Update;\n    }\n    return false;\n  }\n  if (typeof getDerivedStateFromProps === 'function') {\n    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n    newState = workInProgress.memoizedState;\n  }\n  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n  if (shouldUpdate) {\n    // In order to support react-lifecycles-compat polyfilled components,\n    // Unsafe lifecycles should not be invoked for components using the new APIs.\n    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n      if (typeof instance.componentWillMount === 'function') {\n        instance.componentWillMount();\n      }\n      if (typeof instance.UNSAFE_componentWillMount === 'function') {\n        instance.UNSAFE_componentWillMount();\n      }\n    }\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.flags |= Update;\n    }\n  } else {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.flags |= Update;\n    } // If shouldComponentUpdate returned false, we should still update the\n    // memoized state to indicate that this work can be reused.\n    workInProgress.memoizedProps = newProps;\n    workInProgress.memoizedState = newState;\n  } // Update the existing instance's state, props, and context pointers even\n  // if shouldComponentUpdate returns false.\n  instance.props = newProps;\n  instance.state = newState;\n  instance.context = nextContext;\n  return shouldUpdate;\n} // Invokes the update life-cycles and returns false if it shouldn't rerender.\nfunction updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) {\n  var instance = workInProgress.stateNode;\n  cloneUpdateQueue(current, workInProgress);\n  var unresolvedOldProps = workInProgress.memoizedProps;\n  var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps);\n  instance.props = oldProps;\n  var unresolvedNewProps = workInProgress.pendingProps;\n  var oldContext = instance.context;\n  var contextType = ctor.contextType;\n  var nextContext = emptyContextObject;\n  if (typeof contextType === 'object' && contextType !== null) {\n    nextContext = readContext(contextType);\n  } else {\n    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);\n  }\n  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n  // ever the previously attempted to render - not the \\\\\"current\\\\\". However,\n  // during componentDidUpdate we pass the \\\\\"current\\\\\" props.\n  // In order to support react-lifecycles-compat polyfilled components,\n  // Unsafe lifecycles should not be invoked for components using the new APIs.\n  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n    if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {\n      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n    }\n  }\n  resetHasForceUpdateBeforeProcessing();\n  var oldState = workInProgress.memoizedState;\n  var newState = instance.state = oldState;\n  processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n  newState = workInProgress.memoizedState;\n  if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidUpdate === 'function') {\n      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.flags |= Update;\n      }\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.flags |= Snapshot;\n      }\n    }\n    return false;\n  }\n  if (typeof getDerivedStateFromProps === 'function') {\n    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n    newState = workInProgress.memoizedState;\n  }\n  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n  if (shouldUpdate) {\n    // In order to support react-lifecycles-compat polyfilled components,\n    // Unsafe lifecycles should not be invoked for components using the new APIs.\n    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {\n      if (typeof instance.componentWillUpdate === 'function') {\n        instance.componentWillUpdate(newProps, newState, nextContext);\n      }\n      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);\n      }\n    }\n    if (typeof instance.componentDidUpdate === 'function') {\n      workInProgress.flags |= Update;\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n      workInProgress.flags |= Snapshot;\n    }\n  } else {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidUpdate === 'function') {\n      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.flags |= Update;\n      }\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n      if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.flags |= Snapshot;\n      }\n    } // If shouldComponentUpdate returned false, we should still update the\n    // memoized props/state to indicate that this work can be reused.\n    workInProgress.memoizedProps = newProps;\n    workInProgress.memoizedState = newState;\n  } // Update the existing instance's state, props, and context pointers even\n  // if shouldComponentUpdate returns false.\n  instance.props = newProps;\n  instance.state = newState;\n  instance.context = nextContext;\n  return shouldUpdate;\n}\nvar didWarnAboutMaps;\nvar didWarnAboutGenerators;\nvar didWarnAboutStringRefs;\nvar ownerHasKeyUseWarning;\nvar ownerHasFunctionTypeWarning;\nvar warnForMissingKey = function (child, returnFiber) {};\n{\n  didWarnAboutMaps = false;\n  didWarnAboutGenerators = false;\n  didWarnAboutStringRefs = {};\n  /**\n   * Warn if there's no key explicitly set on dynamic arrays of children or\n   * object keys are not valid. This allows us to keep track of children between\n   * updates.\n   */\n  ownerHasKeyUseWarning = {};\n  ownerHasFunctionTypeWarning = {};\n  warnForMissingKey = function (child, returnFiber) {\n    if (child === null || typeof child !== 'object') {\n      return;\n    }\n    if (!child._store || child._store.validated || child.key != null) {\n      return;\n    }\n    if (!(typeof child._store === 'object')) {\n      {\n        throw Error( \\\\\"React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    child._store.validated = true;\n    var componentName = getComponentName(returnFiber.type) || 'Component';\n    if (ownerHasKeyUseWarning[componentName]) {\n      return;\n    }\n    ownerHasKeyUseWarning[componentName] = true;\n    error('Each child in a list should have a unique ' + '\\\\\"key\\\\\" prop. See https://reactjs.org/link/warning-keys for ' + 'more information.');\n  };\n}\nvar isArray$1 = Array.isArray;\nfunction coerceRef(returnFiber, current, element) {\n  var mixedRef = element.ref;\n  if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {\n    {\n      // TODO: Clean this up once we turn on the string ref warning for\n      // everyone, because the strict mode case will no longer be relevant\n      if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs\n      // because these cannot be automatically converted to an arrow function\n      // using a codemod. Therefore, we don't have to warn about string refs again.\n      !(element._owner && element._self && element._owner.stateNode !== element._self)) {\n        var componentName = getComponentName(returnFiber.type) || 'Component';\n        if (!didWarnAboutStringRefs[componentName]) {\n          {\n            error('A string ref, \\\\\"%s\\\\\", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', mixedRef);\n          }\n          didWarnAboutStringRefs[componentName] = true;\n        }\n      }\n    }\n    if (element._owner) {\n      var owner = element._owner;\n      var inst;\n      if (owner) {\n        var ownerFiber = owner;\n        if (!(ownerFiber.tag === ClassComponent)) {\n          {\n            throw Error( \\\\\"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\\\\\" );\n          }\n        }\n        inst = ownerFiber.stateNode;\n      }\n      if (!inst) {\n        {\n          throw Error( \\\\\"Missing owner for string ref \\\\\" + mixedRef + \\\\\". This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n        }\n      }\n      var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref\n      if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {\n        return current.ref;\n      }\n      var ref = function (value) {\n        var refs = inst.refs;\n        if (refs === emptyRefsObject) {\n          // This is a lazy pooled frozen object, so we need to initialize.\n          refs = inst.refs = {};\n        }\n        if (value === null) {\n          delete refs[stringRef];\n        } else {\n          refs[stringRef] = value;\n        }\n      };\n      ref._stringRef = stringRef;\n      return ref;\n    } else {\n      if (!(typeof mixedRef === 'string')) {\n        {\n          throw Error( \\\\\"Expected ref to be a function, a string, an object returned by React.createRef(), or null.\\\\\" );\n        }\n      }\n      if (!element._owner) {\n        {\n          throw Error( \\\\\"Element ref was specified as a string (\\\\\" + mixedRef + \\\\\") but no owner was set. This could happen for one of the following reasons:1. You may be adding a ref to a function component2. You may be adding a ref to a component that was not created inside a component's render method3. You have multiple copies of React loadedSee https://reactjs.org/link/refs-must-have-owner for more information.\\\\\" );\n        }\n      }\n    }\n  }\n  return mixedRef;\n}\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n  if (returnFiber.type !== 'textarea') {\n    {\n      {\n        throw Error( \\\\\"Objects are not valid as a React child (found: \\\\\" + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + \\\\\"). If you meant to render a collection of children, use an array instead.\\\\\" );\n      }\n    }\n  }\n}\nfunction warnOnFunctionType(returnFiber) {\n  {\n    var componentName = getComponentName(returnFiber.type) || 'Component';\n    if (ownerHasFunctionTypeWarning[componentName]) {\n      return;\n    }\n    ownerHasFunctionTypeWarning[componentName] = true;\n    error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');\n  }\n} // We avoid inlining this to avoid potential deopts from using try/catch.\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\nfunction ChildReconciler(shouldTrackSideEffects) {\n  function deleteChild(returnFiber, childToDelete) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return;\n    } // Deletions are added in reversed order so we add it to the front.\n    // At this point, the return fiber's effect list is empty except for\n    // deletions, so we can just append the deletion to the list. The remaining\n    // effects aren't added until the complete phase. Once we implement\n    // resuming, this may not be true.\n    var last = returnFiber.lastEffect;\n    if (last !== null) {\n      last.nextEffect = childToDelete;\n      returnFiber.lastEffect = childToDelete;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n    }\n    childToDelete.nextEffect = null;\n    childToDelete.flags = Deletion;\n  }\n  function deleteRemainingChildren(returnFiber, currentFirstChild) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return null;\n    } // TODO: For the shouldClone case, this could be micro-optimized a bit by\n    // assuming that after the first child we've already added everything.\n    var childToDelete = currentFirstChild;\n    while (childToDelete !== null) {\n      deleteChild(returnFiber, childToDelete);\n      childToDelete = childToDelete.sibling;\n    }\n    return null;\n  }\n  function mapRemainingChildren(returnFiber, currentFirstChild) {\n    // Add the remaining children to a temporary map so that we can find them by\n    // keys quickly. Implicit (null) keys get added to this set with their index\n    // instead.\n    var existingChildren = new Map();\n    var existingChild = currentFirstChild;\n    while (existingChild !== null) {\n      if (existingChild.key !== null) {\n        existingChildren.set(existingChild.key, existingChild);\n      } else {\n        existingChildren.set(existingChild.index, existingChild);\n      }\n      existingChild = existingChild.sibling;\n    }\n    return existingChildren;\n  }\n  function useFiber(fiber, pendingProps) {\n    // We currently set sibling to null and index to 0 here because it is easy\n    // to forget to do before returning it. E.g. for the single child case.\n    var clone = createWorkInProgress(fiber, pendingProps);\n    clone.index = 0;\n    clone.sibling = null;\n    return clone;\n  }\n  function placeChild(newFiber, lastPlacedIndex, newIndex) {\n    newFiber.index = newIndex;\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return lastPlacedIndex;\n    }\n    var current = newFiber.alternate;\n    if (current !== null) {\n      var oldIndex = current.index;\n      if (oldIndex < lastPlacedIndex) {\n        // This is a move.\n        newFiber.flags = Placement;\n        return lastPlacedIndex;\n      } else {\n        // This item can stay in place.\n        return oldIndex;\n      }\n    } else {\n      // This is an insertion.\n      newFiber.flags = Placement;\n      return lastPlacedIndex;\n    }\n  }\n  function placeSingleChild(newFiber) {\n    // This is simpler for the single child case. We only need to do a\n    // placement for inserting new children.\n    if (shouldTrackSideEffects && newFiber.alternate === null) {\n      newFiber.flags = Placement;\n    }\n    return newFiber;\n  }\n  function updateTextNode(returnFiber, current, textContent, lanes) {\n    if (current === null || current.tag !== HostText) {\n      // Insert\n      var created = createFiberFromText(textContent, returnFiber.mode, lanes);\n      created.return = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, textContent);\n      existing.return = returnFiber;\n      return existing;\n    }\n  }\n  function updateElement(returnFiber, current, element, lanes) {\n    if (current !== null) {\n      if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n       isCompatibleFamilyForHotReloading(current, element) )) {\n        // Move based on index\n        var existing = useFiber(current, element.props);\n        existing.ref = coerceRef(returnFiber, current, element);\n        existing.return = returnFiber;\n        {\n          existing._debugSource = element._source;\n          existing._debugOwner = element._owner;\n        }\n        return existing;\n      }\n    } // Insert\n    var created = createFiberFromElement(element, returnFiber.mode, lanes);\n    created.ref = coerceRef(returnFiber, current, element);\n    created.return = returnFiber;\n    return created;\n  }\n  function updatePortal(returnFiber, current, portal, lanes) {\n    if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n      // Insert\n      var created = createFiberFromPortal(portal, returnFiber.mode, lanes);\n      created.return = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, portal.children || []);\n      existing.return = returnFiber;\n      return existing;\n    }\n  }\n  function updateFragment(returnFiber, current, fragment, lanes, key) {\n    if (current === null || current.tag !== Fragment) {\n      // Insert\n      var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);\n      created.return = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, fragment);\n      existing.return = returnFiber;\n      return existing;\n    }\n  }\n  function createChild(returnFiber, newChild, lanes) {\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      var created = createFiberFromText('' + newChild, returnFiber.mode, lanes);\n      created.return = returnFiber;\n      return created;\n    }\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);\n            _created.ref = coerceRef(returnFiber, null, newChild);\n            _created.return = returnFiber;\n            return _created;\n          }\n        case REACT_PORTAL_TYPE:\n          {\n            var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);\n            _created2.return = returnFiber;\n            return _created2;\n          }\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);\n        _created3.return = returnFiber;\n        return _created3;\n      }\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType(returnFiber);\n      }\n    }\n    return null;\n  }\n  function updateSlot(returnFiber, oldFiber, newChild, lanes) {\n    // Update the fiber if the keys match, otherwise return null.\n    var key = oldFiber !== null ? oldFiber.key : null;\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      if (key !== null) {\n        return null;\n      }\n      return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes);\n    }\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            if (newChild.key === key) {\n              if (newChild.type === REACT_FRAGMENT_TYPE) {\n                return updateFragment(returnFiber, oldFiber, newChild.props.children, lanes, key);\n              }\n              return updateElement(returnFiber, oldFiber, newChild, lanes);\n            } else {\n              return null;\n            }\n          }\n        case REACT_PORTAL_TYPE:\n          {\n            if (newChild.key === key) {\n              return updatePortal(returnFiber, oldFiber, newChild, lanes);\n            } else {\n              return null;\n            }\n          }\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        if (key !== null) {\n          return null;\n        }\n        return updateFragment(returnFiber, oldFiber, newChild, lanes, null);\n      }\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType(returnFiber);\n      }\n    }\n    return null;\n  }\n  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys, so we neither have to check the old nor\n      // new node for the key. If both are text nodes, they match.\n      var matchedFiber = existingChildren.get(newIdx) || null;\n      return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes);\n    }\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            if (newChild.type === REACT_FRAGMENT_TYPE) {\n              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);\n            }\n            return updateElement(returnFiber, _matchedFiber, newChild, lanes);\n          }\n        case REACT_PORTAL_TYPE:\n          {\n            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);\n          }\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _matchedFiber3 = existingChildren.get(newIdx) || null;\n        return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null);\n      }\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType(returnFiber);\n      }\n    }\n    return null;\n  }\n  /**\n   * Warns if there is a duplicate or missing key\n   */\n  function warnOnInvalidKey(child, knownKeys, returnFiber) {\n    {\n      if (typeof child !== 'object' || child === null) {\n        return knownKeys;\n      }\n      switch (child.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n        case REACT_PORTAL_TYPE:\n          warnForMissingKey(child, returnFiber);\n          var key = child.key;\n          if (typeof key !== 'string') {\n            break;\n          }\n          if (knownKeys === null) {\n            knownKeys = new Set();\n            knownKeys.add(key);\n            break;\n          }\n          if (!knownKeys.has(key)) {\n            knownKeys.add(key);\n            break;\n          }\n          error('Encountered two children with the same key, \\`%s\\`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n          break;\n      }\n    }\n    return knownKeys;\n  }\n  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {\n    // This algorithm can't optimize by searching from both ends since we\n    // don't have backpointers on fibers. I'm trying to see how far we can get\n    // with that model. If it ends up not being worth the tradeoffs, we can\n    // add it later.\n    // Even with a two ended optimization, we'd want to optimize for the case\n    // where there are few changes and brute force the comparison instead of\n    // going for the Map. It'd like to explore hitting that path first in\n    // forward-only mode and only go for the Map once we notice that we need\n    // lots of look ahead. This doesn't handle reversal as well as two ended\n    // search but that's unusual. Besides, for the two ended optimization to\n    // work on Iterables, we'd need to copy the whole set.\n    // In this first iteration, we'll just live with hitting the bad case\n    // (adding everything to a Map) in for every insert/move.\n    // If you change this code, also update reconcileChildrenIterator() which\n    // uses the same algorithm.\n    {\n      // First, validate keys.\n      var knownKeys = null;\n      for (var i = 0; i < newChildren.length; i++) {\n        var child = newChildren[i];\n        knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);\n      }\n    }\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (oldFiber === null) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n    if (newIdx === newChildren.length) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; newIdx < newChildren.length; newIdx++) {\n        var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);\n        if (_newFiber === null) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber;\n        } else {\n          previousNewFiber.sibling = _newFiber;\n        }\n        previousNewFiber = _newFiber;\n      }\n      return resultingFirstChild;\n    } // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n    for (; newIdx < newChildren.length; newIdx++) {\n      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);\n      if (_newFiber2 !== null) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber2.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber2;\n        } else {\n          previousNewFiber.sibling = _newFiber2;\n        }\n        previousNewFiber = _newFiber2;\n      }\n    }\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function (child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n    return resultingFirstChild;\n  }\n  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {\n    // This is the same implementation as reconcileChildrenArray(),\n    // but using the iterator instead.\n    var iteratorFn = getIteratorFn(newChildrenIterable);\n    if (!(typeof iteratorFn === 'function')) {\n      {\n        throw Error( \\\\\"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    {\n      // We don't support rendering Generators because it's a mutation.\n      // See https://github.com/facebook/react/issues/12995\n      if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag\n      newChildrenIterable[Symbol.toStringTag] === 'Generator') {\n        if (!didWarnAboutGenerators) {\n          error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with \\`Array.from()\\` or the ' + '\\`[...spread]\\` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');\n        }\n        didWarnAboutGenerators = true;\n      } // Warn about using Maps as children\n      if (newChildrenIterable.entries === iteratorFn) {\n        if (!didWarnAboutMaps) {\n          error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n        }\n        didWarnAboutMaps = true;\n      } // First, validate keys.\n      // We'll get a different iterator later for the main pass.\n      var _newChildren = iteratorFn.call(newChildrenIterable);\n      if (_newChildren) {\n        var knownKeys = null;\n        var _step = _newChildren.next();\n        for (; !_step.done; _step = _newChildren.next()) {\n          var child = _step.value;\n          knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);\n        }\n      }\n    }\n    var newChildren = iteratorFn.call(newChildrenIterable);\n    if (!(newChildren != null)) {\n      {\n        throw Error( \\\\\"An iterable object provided no iterator.\\\\\" );\n      }\n    }\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n    var step = newChildren.next();\n    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (oldFiber === null) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n    if (step.done) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; !step.done; newIdx++, step = newChildren.next()) {\n        var _newFiber3 = createChild(returnFiber, step.value, lanes);\n        if (_newFiber3 === null) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber3;\n        } else {\n          previousNewFiber.sibling = _newFiber3;\n        }\n        previousNewFiber = _newFiber3;\n      }\n      return resultingFirstChild;\n    } // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n    for (; !step.done; newIdx++, step = newChildren.next()) {\n      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);\n      if (_newFiber4 !== null) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber4.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber4;\n        } else {\n          previousNewFiber.sibling = _newFiber4;\n        }\n        previousNewFiber = _newFiber4;\n      }\n    }\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function (child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n    return resultingFirstChild;\n  }\n  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {\n    // There's no need to check for keys on text nodes since we don't have a\n    // way to define them.\n    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n      // We already have an existing node so let's just update it and delete\n      // the rest.\n      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n      var existing = useFiber(currentFirstChild, textContent);\n      existing.return = returnFiber;\n      return existing;\n    } // The existing first child is not a text node so we need to create one\n    // and delete the existing ones.\n    deleteRemainingChildren(returnFiber, currentFirstChild);\n    var created = createFiberFromText(textContent, returnFiber.mode, lanes);\n    created.return = returnFiber;\n    return created;\n  }\n  function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {\n    var key = element.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        switch (child.tag) {\n          case Fragment:\n            {\n              if (element.type === REACT_FRAGMENT_TYPE) {\n                deleteRemainingChildren(returnFiber, child.sibling);\n                var existing = useFiber(child, element.props.children);\n                existing.return = returnFiber;\n                {\n                  existing._debugSource = element._source;\n                  existing._debugOwner = element._owner;\n                }\n                return existing;\n              }\n              break;\n            }\n          case Block:\n          // We intentionally fallthrough here if enableBlocksAPI is not on.\n          // eslint-disable-next-lined no-fallthrough\n          default:\n            {\n              if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n               isCompatibleFamilyForHotReloading(child, element) )) {\n                deleteRemainingChildren(returnFiber, child.sibling);\n                var _existing3 = useFiber(child, element.props);\n                _existing3.ref = coerceRef(returnFiber, child, element);\n                _existing3.return = returnFiber;\n                {\n                  _existing3._debugSource = element._source;\n                  _existing3._debugOwner = element._owner;\n                }\n                return _existing3;\n              }\n              break;\n            }\n        } // Didn't match.\n        deleteRemainingChildren(returnFiber, child);\n        break;\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n    if (element.type === REACT_FRAGMENT_TYPE) {\n      var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);\n      created.return = returnFiber;\n      return created;\n    } else {\n      var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);\n      _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n      _created4.return = returnFiber;\n      return _created4;\n    }\n  }\n  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {\n    var key = portal.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, portal.children || []);\n          existing.return = returnFiber;\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n    var created = createFiberFromPortal(portal, returnFiber.mode, lanes);\n    created.return = returnFiber;\n    return created;\n  } // This API will tag the children with the side-effect of the reconciliation\n  // itself. They will be added to the side-effect list as we pass through the\n  // children and the parent.\n  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) {\n    // This function is not recursive.\n    // If the top level item is an array, we treat it as a set of children,\n    // not as a fragment. Nested arrays on the other hand will be treated as\n    // fragment nodes. Recursion happens at the normal flow.\n    // Handle top level unkeyed fragments as if they were arrays.\n    // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n    // We treat the ambiguous cases above the same.\n    var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n    if (isUnkeyedTopLevelFragment) {\n      newChild = newChild.props.children;\n    } // Handle object types\n    var isObject = typeof newChild === 'object' && newChild !== null;\n    if (isObject) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));\n        case REACT_PORTAL_TYPE:\n          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));\n      }\n    }\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes));\n    }\n    if (isArray$1(newChild)) {\n      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);\n    }\n    if (getIteratorFn(newChild)) {\n      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);\n    }\n    if (isObject) {\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType(returnFiber);\n      }\n    }\n    if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n      // If the new child is undefined, and the return fiber is a composite\n      // component, throw an error. If Fiber return types are disabled,\n      // we already threw above.\n      switch (returnFiber.tag) {\n        case ClassComponent:\n          {\n            {\n              var instance = returnFiber.stateNode;\n              if (instance.render._isMockFunction) {\n                // We allow auto-mocks to proceed as if they're returning null.\n                break;\n              }\n            }\n          }\n        // Intentionally fall through to the next case, which handles both\n        // functions and classes\n        // eslint-disable-next-lined no-fallthrough\n        case Block:\n        case FunctionComponent:\n        case ForwardRef:\n        case SimpleMemoComponent:\n          {\n            {\n              {\n                throw Error( (getComponentName(returnFiber.type) || 'Component') + \\\\\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\\\\\" );\n              }\n            }\n          }\n      }\n    } // Remaining cases are all treated as empty.\n    return deleteRemainingChildren(returnFiber, currentFirstChild);\n  }\n  return reconcileChildFibers;\n}\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\nfunction cloneChildFibers(current, workInProgress) {\n  if (!(current === null || workInProgress.child === current.child)) {\n    {\n      throw Error( \\\\\"Resuming work not yet implemented.\\\\\" );\n    }\n  }\n  if (workInProgress.child === null) {\n    return;\n  }\n  var currentChild = workInProgress.child;\n  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);\n  workInProgress.child = newChild;\n  newChild.return = workInProgress;\n  while (currentChild.sibling !== null) {\n    currentChild = currentChild.sibling;\n    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);\n    newChild.return = workInProgress;\n  }\n  newChild.sibling = null;\n} // Reset a workInProgress child set to prepare it for a second pass.\nfunction resetChildFibers(workInProgress, lanes) {\n  var child = workInProgress.child;\n  while (child !== null) {\n    resetWorkInProgress(child, lanes);\n    child = child.sibling;\n  }\n}\nvar NO_CONTEXT = {};\nvar contextStackCursor$1 = createCursor(NO_CONTEXT);\nvar contextFiberStackCursor = createCursor(NO_CONTEXT);\nvar rootInstanceStackCursor = createCursor(NO_CONTEXT);\nfunction requiredContext(c) {\n  if (!(c !== NO_CONTEXT)) {\n    {\n      throw Error( \\\\\"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  return c;\n}\nfunction getRootHostContainer() {\n  var rootInstance = requiredContext(rootInstanceStackCursor.current);\n  return rootInstance;\n}\nfunction pushHostContainer(fiber, nextRootInstance) {\n  // Push current root instance onto the stack;\n  // This allows us to reset root when portals are popped.\n  push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.\n  // This enables us to pop only Fibers that provide unique contexts.\n  push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.\n  // However, we can't just call getRootHostContext() and push it because\n  // we'd have a different number of entries on the stack depending on\n  // whether getRootHostContext() throws somewhere in renderer code or not.\n  // So we push an empty value first. This lets us safely unwind on errors.\n  push(contextStackCursor$1, NO_CONTEXT, fiber);\n  var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.\n  pop(contextStackCursor$1, fiber);\n  push(contextStackCursor$1, nextRootContext, fiber);\n}\nfunction popHostContainer(fiber) {\n  pop(contextStackCursor$1, fiber);\n  pop(contextFiberStackCursor, fiber);\n  pop(rootInstanceStackCursor, fiber);\n}\nfunction getHostContext() {\n  var context = requiredContext(contextStackCursor$1.current);\n  return context;\n}\nfunction pushHostContext(fiber) {\n  var rootInstance = requiredContext(rootInstanceStackCursor.current);\n  var context = requiredContext(contextStackCursor$1.current);\n  var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.\n  if (context === nextContext) {\n    return;\n  } // Track the context and the Fiber that provided it.\n  // This enables us to pop only Fibers that provide unique contexts.\n  push(contextFiberStackCursor, fiber, fiber);\n  push(contextStackCursor$1, nextContext, fiber);\n}\nfunction popHostContext(fiber) {\n  // Do not pop unless this Fiber provided the current context.\n  // pushHostContext() only pushes Fibers that provide unique contexts.\n  if (contextFiberStackCursor.current !== fiber) {\n    return;\n  }\n  pop(contextStackCursor$1, fiber);\n  pop(contextFiberStackCursor, fiber);\n}\nvar DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is\n// inherited deeply down the subtree. The upper bits only affect\n// this immediate suspense boundary and gets reset each new\n// boundary or suspense list.\nvar SubtreeSuspenseContextMask = 1; // Subtree Flags:\n// InvisibleParentSuspenseContext indicates that one of our parent Suspense\n// boundaries is not currently showing visible main content.\n// Either because it is already showing a fallback or is not mounted at all.\n// We can use this to determine if it is desirable to trigger a fallback at\n// the parent. If not, then we might need to trigger undesirable boundaries\n// and/or suspend the commit to avoid hiding the parent content.\nvar InvisibleParentSuspenseContext = 1; // Shallow Flags:\n// ForceSuspenseFallback can be used by SuspenseList to force newly added\n// items into their fallback state during one of the render passes.\nvar ForceSuspenseFallback = 2;\nvar suspenseStackCursor = createCursor(DefaultSuspenseContext);\nfunction hasSuspenseContext(parentContext, flag) {\n  return (parentContext & flag) !== 0;\n}\nfunction setDefaultShallowSuspenseContext(parentContext) {\n  return parentContext & SubtreeSuspenseContextMask;\n}\nfunction setShallowSuspenseContext(parentContext, shallowContext) {\n  return parentContext & SubtreeSuspenseContextMask | shallowContext;\n}\nfunction addSubtreeSuspenseContext(parentContext, subtreeContext) {\n  return parentContext | subtreeContext;\n}\nfunction pushSuspenseContext(fiber, newContext) {\n  push(suspenseStackCursor, newContext, fiber);\n}\nfunction popSuspenseContext(fiber) {\n  pop(suspenseStackCursor, fiber);\n}\nfunction shouldCaptureSuspense(workInProgress, hasInvisibleParent) {\n  // If it was the primary children that just suspended, capture and render the\n  // fallback. Otherwise, don't capture and bubble to the next boundary.\n  var nextState = workInProgress.memoizedState;\n  if (nextState !== null) {\n    if (nextState.dehydrated !== null) {\n      // A dehydrated boundary always captures.\n      return true;\n    }\n    return false;\n  }\n  var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.\n  if (props.fallback === undefined) {\n    return false;\n  } // Regular boundaries always capture.\n  if (props.unstable_avoidThisFallback !== true) {\n    return true;\n  } // If it's a boundary we should avoid, then we prefer to bubble up to the\n  // parent boundary if it is currently invisible.\n  if (hasInvisibleParent) {\n    return false;\n  } // If the parent is not able to handle it, we must handle it.\n  return true;\n}\nfunction findFirstSuspended(row) {\n  var node = row;\n  while (node !== null) {\n    if (node.tag === SuspenseComponent) {\n      var state = node.memoizedState;\n      if (state !== null) {\n        var dehydrated = state.dehydrated;\n        if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {\n          return node;\n        }\n      }\n    } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't\n    // keep track of whether it suspended or not.\n    node.memoizedProps.revealOrder !== undefined) {\n      var didSuspend = (node.flags & DidCapture) !== NoFlags;\n      if (didSuspend) {\n        return node;\n      }\n    } else if (node.child !== null) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === row) {\n      return null;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === row) {\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n  return null;\n}\nvar NoFlags$1 =\n/*  */\n0; // Represents whether effect should fire.\nvar HasEffect =\n/* */\n1; // Represents the phase in which the effect (not the clean-up) fires.\nvar Layout =\n/*    */\n2;\nvar Passive$1 =\n/*   */\n4;\n// This may have been an insertion or a hydration.\nvar hydrationParentFiber = null;\nvar nextHydratableInstance = null;\nvar isHydrating = false;\nfunction enterHydrationState(fiber) {\n  var parentInstance = fiber.stateNode.containerInfo;\n  nextHydratableInstance = getFirstHydratableChild(parentInstance);\n  hydrationParentFiber = fiber;\n  isHydrating = true;\n  return true;\n}\nfunction deleteHydratableInstance(returnFiber, instance) {\n  {\n    switch (returnFiber.tag) {\n      case HostRoot:\n        didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);\n        break;\n      case HostComponent:\n        didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);\n        break;\n    }\n  }\n  var childToDelete = createFiberFromHostInstanceForDeletion();\n  childToDelete.stateNode = instance;\n  childToDelete.return = returnFiber;\n  childToDelete.flags = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,\n  // these children are not part of the reconciliation list of children.\n  // Even if we abort and rereconcile the children, that will try to hydrate\n  // again and the nodes are still in the host tree so these will be\n  // recreated.\n  if (returnFiber.lastEffect !== null) {\n    returnFiber.lastEffect.nextEffect = childToDelete;\n    returnFiber.lastEffect = childToDelete;\n  } else {\n    returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n  }\n}\nfunction insertNonHydratedInstance(returnFiber, fiber) {\n  fiber.flags = fiber.flags & ~Hydrating | Placement;\n  {\n    switch (returnFiber.tag) {\n      case HostRoot:\n        {\n          var parentContainer = returnFiber.stateNode.containerInfo;\n          switch (fiber.tag) {\n            case HostComponent:\n              var type = fiber.type;\n              var props = fiber.pendingProps;\n              didNotFindHydratableContainerInstance(parentContainer, type);\n              break;\n            case HostText:\n              var text = fiber.pendingProps;\n              didNotFindHydratableContainerTextInstance(parentContainer, text);\n              break;\n          }\n          break;\n        }\n      case HostComponent:\n        {\n          var parentType = returnFiber.type;\n          var parentProps = returnFiber.memoizedProps;\n          var parentInstance = returnFiber.stateNode;\n          switch (fiber.tag) {\n            case HostComponent:\n              var _type = fiber.type;\n              var _props = fiber.pendingProps;\n              didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);\n              break;\n            case HostText:\n              var _text = fiber.pendingProps;\n              didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);\n              break;\n            case SuspenseComponent:\n              didNotFindHydratableSuspenseInstance(parentType, parentProps);\n              break;\n          }\n          break;\n        }\n      default:\n        return;\n    }\n  }\n}\nfunction tryHydrate(fiber, nextInstance) {\n  switch (fiber.tag) {\n    case HostComponent:\n      {\n        var type = fiber.type;\n        var props = fiber.pendingProps;\n        var instance = canHydrateInstance(nextInstance, type);\n        if (instance !== null) {\n          fiber.stateNode = instance;\n          return true;\n        }\n        return false;\n      }\n    case HostText:\n      {\n        var text = fiber.pendingProps;\n        var textInstance = canHydrateTextInstance(nextInstance, text);\n        if (textInstance !== null) {\n          fiber.stateNode = textInstance;\n          return true;\n        }\n        return false;\n      }\n    case SuspenseComponent:\n      {\n        return false;\n      }\n    default:\n      return false;\n  }\n}\nfunction tryToClaimNextHydratableInstance(fiber) {\n  if (!isHydrating) {\n    return;\n  }\n  var nextInstance = nextHydratableInstance;\n  if (!nextInstance) {\n    // Nothing to hydrate. Make it an insertion.\n    insertNonHydratedInstance(hydrationParentFiber, fiber);\n    isHydrating = false;\n    hydrationParentFiber = fiber;\n    return;\n  }\n  var firstAttemptedInstance = nextInstance;\n  if (!tryHydrate(fiber, nextInstance)) {\n    // If we can't hydrate this instance let's try the next one.\n    // We use this as a heuristic. It's based on intuition and not data so it\n    // might be flawed or unnecessary.\n    nextInstance = getNextHydratableSibling(firstAttemptedInstance);\n    if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n      // Nothing to hydrate. Make it an insertion.\n      insertNonHydratedInstance(hydrationParentFiber, fiber);\n      isHydrating = false;\n      hydrationParentFiber = fiber;\n      return;\n    } // We matched the next one, we'll now assume that the first one was\n    // superfluous and we'll delete it. Since we can't eagerly delete it\n    // we'll have to schedule a deletion. To do that, this node needs a dummy\n    // fiber associated with it.\n    deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);\n  }\n  hydrationParentFiber = fiber;\n  nextHydratableInstance = getFirstHydratableChild(nextInstance);\n}\nfunction prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n  var instance = fiber.stateNode;\n  var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.\n  fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n  // is a new ref we mark this as an update.\n  if (updatePayload !== null) {\n    return true;\n  }\n  return false;\n}\nfunction prepareToHydrateHostTextInstance(fiber) {\n  var textInstance = fiber.stateNode;\n  var textContent = fiber.memoizedProps;\n  var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n  {\n    if (shouldUpdate) {\n      // We assume that prepareToHydrateHostTextInstance is called in a context where the\n      // hydration parent is the parent host component of this host text.\n      var returnFiber = hydrationParentFiber;\n      if (returnFiber !== null) {\n        switch (returnFiber.tag) {\n          case HostRoot:\n            {\n              var parentContainer = returnFiber.stateNode.containerInfo;\n              didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);\n              break;\n            }\n          case HostComponent:\n            {\n              var parentType = returnFiber.type;\n              var parentProps = returnFiber.memoizedProps;\n              var parentInstance = returnFiber.stateNode;\n              didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);\n              break;\n            }\n        }\n      }\n    }\n  }\n  return shouldUpdate;\n}\nfunction skipPastDehydratedSuspenseInstance(fiber) {\n  var suspenseState = fiber.memoizedState;\n  var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n  if (!suspenseInstance) {\n    {\n      throw Error( \\\\\"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);\n}\nfunction popToNextHostParent(fiber) {\n  var parent = fiber.return;\n  while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {\n    parent = parent.return;\n  }\n  hydrationParentFiber = parent;\n}\nfunction popHydrationState(fiber) {\n  if (fiber !== hydrationParentFiber) {\n    // We're deeper than the current hydration context, inside an inserted\n    // tree.\n    return false;\n  }\n  if (!isHydrating) {\n    // If we're not currently hydrating but we're in a hydration context, then\n    // we were an insertion and now need to pop up reenter hydration of our\n    // siblings.\n    popToNextHostParent(fiber);\n    isHydrating = true;\n    return false;\n  }\n  var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.\n  // We only do this deeper than head and body since they tend to have random\n  // other nodes in them. We also ignore components with pure text content in\n  // side of them.\n  // TODO: Better heuristic.\n  if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {\n    var nextInstance = nextHydratableInstance;\n    while (nextInstance) {\n      deleteHydratableInstance(fiber, nextInstance);\n      nextInstance = getNextHydratableSibling(nextInstance);\n    }\n  }\n  popToNextHostParent(fiber);\n  if (fiber.tag === SuspenseComponent) {\n    nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);\n  } else {\n    nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n  }\n  return true;\n}\nfunction resetHydrationState() {\n  hydrationParentFiber = null;\n  nextHydratableInstance = null;\n  isHydrating = false;\n}\nfunction getIsHydrating() {\n  return isHydrating;\n}\n// and should be reset before starting a new render.\n// This tracks which mutable sources need to be reset after a render.\nvar workInProgressSources = [];\nvar rendererSigil$1;\n{\n  // Used to detect multiple renderers using the same mutable source.\n  rendererSigil$1 = {};\n}\nfunction markSourceAsDirty(mutableSource) {\n  workInProgressSources.push(mutableSource);\n}\nfunction resetWorkInProgressVersions() {\n  for (var i = 0; i < workInProgressSources.length; i++) {\n    var mutableSource = workInProgressSources[i];\n    {\n      mutableSource._workInProgressVersionPrimary = null;\n    }\n  }\n  workInProgressSources.length = 0;\n}\nfunction getWorkInProgressVersion(mutableSource) {\n  {\n    return mutableSource._workInProgressVersionPrimary;\n  }\n}\nfunction setWorkInProgressVersion(mutableSource, version) {\n  {\n    mutableSource._workInProgressVersionPrimary = version;\n  }\n  workInProgressSources.push(mutableSource);\n}\nfunction warnAboutMultipleRenderersDEV(mutableSource) {\n  {\n    {\n      if (mutableSource._currentPrimaryRenderer == null) {\n        mutableSource._currentPrimaryRenderer = rendererSigil$1;\n      } else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {\n        error('Detected multiple renderers concurrently rendering the ' + 'same mutable source. This is currently unsupported.');\n      }\n    }\n  }\n} // Eager reads the version of a mutable source and stores it on the root.\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,\n    ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar didWarnAboutMismatchedHooksForComponent;\nvar didWarnAboutUseOpaqueIdentifier;\n{\n  didWarnAboutUseOpaqueIdentifier = {};\n  didWarnAboutMismatchedHooksForComponent = new Set();\n}\n// These are set right before calling the component.\nvar renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from\n// the work-in-progress hook.\nvar currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The\n// current hook list is the list that belongs to the current fiber. The\n// work-in-progress hook list is a new list that will be added to the\n// work-in-progress fiber.\nvar currentHook = null;\nvar workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This\n// does not get reset if we do another render pass; only when we're completely\n// finished evaluating this component. This is an optimization so we know\n// whether we need to clear render phase updates after a throw.\nvar didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This\n// gets reset after each attempt.\n// TODO: Maybe there's some way to consolidate this with\n// \\`didScheduleRenderPhaseUpdate\\`. Or with \\`numberOfReRenders\\`.\nvar didScheduleRenderPhaseUpdateDuringThisPass = false;\nvar RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook\nvar currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.\n// The list stores the order of hooks used during the initial render (mount).\n// Subsequent renders (updates) reference this list.\nvar hookTypesDev = null;\nvar hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore\n// the dependencies for Hooks that need them (e.g. useEffect or useMemo).\n// When true, such Hooks will always be \\\\\"remounted\\\\\". Only used during hot reload.\nvar ignorePreviousDependencies = false;\nfunction mountHookTypesDev() {\n  {\n    var hookName = currentHookNameInDev;\n    if (hookTypesDev === null) {\n      hookTypesDev = [hookName];\n    } else {\n      hookTypesDev.push(hookName);\n    }\n  }\n}\nfunction updateHookTypesDev() {\n  {\n    var hookName = currentHookNameInDev;\n    if (hookTypesDev !== null) {\n      hookTypesUpdateIndexDev++;\n      if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {\n        warnOnHookMismatchInDev(hookName);\n      }\n    }\n  }\n}\nfunction checkDepsAreArrayDev(deps) {\n  {\n    if (deps !== undefined && deps !== null && !Array.isArray(deps)) {\n      // Verify deps, but only on mount to avoid extra checks.\n      // It's unlikely their type would change as usually you define them inline.\n      error('%s received a final argument that is not an array (instead, received \\`%s\\`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);\n    }\n  }\n}\nfunction warnOnHookMismatchInDev(currentHookName) {\n  {\n    var componentName = getComponentName(currentlyRenderingFiber$1.type);\n    if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {\n      didWarnAboutMismatchedHooksForComponent.add(componentName);\n      if (hookTypesDev !== null) {\n        var table = '';\n        var secondColumnStart = 30;\n        for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {\n          var oldHookName = hookTypesDev[i];\n          var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;\n          var row = i + 1 + \\\\\". \\\\\" + oldHookName; // Extra space so second column lines up\n          // lol @ IE not supporting String#repeat\n          while (row.length < secondColumnStart) {\n            row += ' ';\n          }\n          row += newHookName + '';\n          table += row;\n        }\n        error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks' + '   Previous render            Next render' + '   ------------------------------------------------------' + '%s' + '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', componentName, table);\n      }\n    }\n  }\n}\nfunction throwInvalidHookError() {\n  {\n    {\n      throw Error( \\\\\"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:1. You might have mismatching versions of React and the renderer (such as React DOM)2. You might be breaking the Rules of Hooks3. You might have more than one copy of React in the same appSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.\\\\\" );\n    }\n  }\n}\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n  {\n    if (ignorePreviousDependencies) {\n      // Only true when this component is being hot reloaded.\n      return false;\n    }\n  }\n  if (prevDeps === null) {\n    {\n      error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n    }\n    return false;\n  }\n  {\n    // Don't bother comparing lengths in prod because these arrays should be\n    // passed inline.\n    if (nextDeps.length !== prevDeps.length) {\n      error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.' + 'Previous: %s' + 'Incoming: %s', currentHookNameInDev, \\\\\"[\\\\\" + prevDeps.join(', ') + \\\\\"]\\\\\", \\\\\"[\\\\\" + nextDeps.join(', ') + \\\\\"]\\\\\");\n    }\n  }\n  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {\n    if (objectIs(nextDeps[i], prevDeps[i])) {\n      continue;\n    }\n    return false;\n  }\n  return true;\n}\nfunction renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) {\n  renderLanes = nextRenderLanes;\n  currentlyRenderingFiber$1 = workInProgress;\n  {\n    hookTypesDev = current !== null ? current._debugHookTypes : null;\n    hookTypesUpdateIndexDev = -1; // Used for hot reloading:\n    ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;\n  }\n  workInProgress.memoizedState = null;\n  workInProgress.updateQueue = null;\n  workInProgress.lanes = NoLanes; // The following should have already been reset\n  // currentHook = null;\n  // workInProgressHook = null;\n  // didScheduleRenderPhaseUpdate = false;\n  // TODO Warn if no hooks are used at all during mount, then some are used during update.\n  // Currently we will identify the update render as a mount because memoizedState === null.\n  // This is tricky because it's valid for certain types of components (e.g. React.lazy)\n  // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.\n  // Non-stateful hooks (e.g. context) don't get added to memoizedState,\n  // so memoizedState would be null during updates and mounts.\n  {\n    if (current !== null && current.memoizedState !== null) {\n      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;\n    } else if (hookTypesDev !== null) {\n      // This dispatcher handles an edge case where a component is updating,\n      // but no stateful hooks have been used.\n      // We want to match the production code behavior (which will use HooksDispatcherOnMount),\n      // but with the extra DEV validation to ensure hooks ordering hasn't changed.\n      // This dispatcher does that.\n      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;\n    } else {\n      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;\n    }\n  }\n  var children = Component(props, secondArg); // Check if there was a render phase update\n  if (didScheduleRenderPhaseUpdateDuringThisPass) {\n    // Keep rendering in a loop for as long as render phase updates continue to\n    // be scheduled. Use a counter to prevent infinite loops.\n    var numberOfReRenders = 0;\n    do {\n      didScheduleRenderPhaseUpdateDuringThisPass = false;\n      if (!(numberOfReRenders < RE_RENDER_LIMIT)) {\n        {\n          throw Error( \\\\\"Too many re-renders. React limits the number of renders to prevent an infinite loop.\\\\\" );\n        }\n      }\n      numberOfReRenders += 1;\n      {\n        // Even when hot reloading, allow dependencies to stabilize\n        // after first render to prevent infinite render phase updates.\n        ignorePreviousDependencies = false;\n      } // Start over from the beginning of the list\n      currentHook = null;\n      workInProgressHook = null;\n      workInProgress.updateQueue = null;\n      {\n        // Also validate hook order for cascading updates.\n        hookTypesUpdateIndexDev = -1;\n      }\n      ReactCurrentDispatcher$1.current =  HooksDispatcherOnRerenderInDEV ;\n      children = Component(props, secondArg);\n    } while (didScheduleRenderPhaseUpdateDuringThisPass);\n  } // We can assume the previous dispatcher is always this one, since we set it\n  // at the beginning of the render phase and there's no re-entrancy.\n  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n  {\n    workInProgress._debugHookTypes = hookTypesDev;\n  } // This check uses currentHook so that it works the same in DEV and prod bundles.\n  // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.\n  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;\n  renderLanes = NoLanes;\n  currentlyRenderingFiber$1 = null;\n  currentHook = null;\n  workInProgressHook = null;\n  {\n    currentHookNameInDev = null;\n    hookTypesDev = null;\n    hookTypesUpdateIndexDev = -1;\n  }\n  didScheduleRenderPhaseUpdate = false;\n  if (!!didRenderTooFewHooks) {\n    {\n      throw Error( \\\\\"Rendered fewer hooks than expected. This may be caused by an accidental early return statement.\\\\\" );\n    }\n  }\n  return children;\n}\nfunction bailoutHooks(current, workInProgress, lanes) {\n  workInProgress.updateQueue = current.updateQueue;\n  workInProgress.flags &= ~(Passive | Update);\n  current.lanes = removeLanes(current.lanes, lanes);\n}\nfunction resetHooksAfterThrow() {\n  // We can assume the previous dispatcher is always this one, since we set it\n  // at the beginning of the render phase and there's no re-entrancy.\n  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n  if (didScheduleRenderPhaseUpdate) {\n    // There were render phase updates. These are only valid for this render\n    // phase, which we are now aborting. Remove the updates from the queues so\n    // they do not persist to the next render. Do not remove updates from hooks\n    // that weren't processed.\n    //\n    // Only reset the updates from the queue if it has a clone. If it does\n    // not have a clone, that means it wasn't processed, and the updates were\n    // scheduled before we entered the render phase.\n    var hook = currentlyRenderingFiber$1.memoizedState;\n    while (hook !== null) {\n      var queue = hook.queue;\n      if (queue !== null) {\n        queue.pending = null;\n      }\n      hook = hook.next;\n    }\n    didScheduleRenderPhaseUpdate = false;\n  }\n  renderLanes = NoLanes;\n  currentlyRenderingFiber$1 = null;\n  currentHook = null;\n  workInProgressHook = null;\n  {\n    hookTypesDev = null;\n    hookTypesUpdateIndexDev = -1;\n    currentHookNameInDev = null;\n    isUpdatingOpaqueValueInRenderPhase = false;\n  }\n  didScheduleRenderPhaseUpdateDuringThisPass = false;\n}\nfunction mountWorkInProgressHook() {\n  var hook = {\n    memoizedState: null,\n    baseState: null,\n    baseQueue: null,\n    queue: null,\n    next: null\n  };\n  if (workInProgressHook === null) {\n    // This is the first hook in the list\n    currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;\n  } else {\n    // Append to the end of the list\n    workInProgressHook = workInProgressHook.next = hook;\n  }\n  return workInProgressHook;\n}\nfunction updateWorkInProgressHook() {\n  // This function is used both for updates and for re-renders triggered by a\n  // render phase update. It assumes there is either a current hook we can\n  // clone, or a work-in-progress hook from a previous render pass that we can\n  // use as a base. When we reach the end of the base list, we must switch to\n  // the dispatcher used for mounts.\n  var nextCurrentHook;\n  if (currentHook === null) {\n    var current = currentlyRenderingFiber$1.alternate;\n    if (current !== null) {\n      nextCurrentHook = current.memoizedState;\n    } else {\n      nextCurrentHook = null;\n    }\n  } else {\n    nextCurrentHook = currentHook.next;\n  }\n  var nextWorkInProgressHook;\n  if (workInProgressHook === null) {\n    nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;\n  } else {\n    nextWorkInProgressHook = workInProgressHook.next;\n  }\n  if (nextWorkInProgressHook !== null) {\n    // There's already a work-in-progress. Reuse it.\n    workInProgressHook = nextWorkInProgressHook;\n    nextWorkInProgressHook = workInProgressHook.next;\n    currentHook = nextCurrentHook;\n  } else {\n    // Clone from the current hook.\n    if (!(nextCurrentHook !== null)) {\n      {\n        throw Error( \\\\\"Rendered more hooks than during the previous render.\\\\\" );\n      }\n    }\n    currentHook = nextCurrentHook;\n    var newHook = {\n      memoizedState: currentHook.memoizedState,\n      baseState: currentHook.baseState,\n      baseQueue: currentHook.baseQueue,\n      queue: currentHook.queue,\n      next: null\n    };\n    if (workInProgressHook === null) {\n      // This is the first hook in the list.\n      currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;\n    } else {\n      // Append to the end of the list.\n      workInProgressHook = workInProgressHook.next = newHook;\n    }\n  }\n  return workInProgressHook;\n}\nfunction createFunctionComponentUpdateQueue() {\n  return {\n    lastEffect: null\n  };\n}\nfunction basicStateReducer(state, action) {\n  // $FlowFixMe: Flow doesn't like mixed types\n  return typeof action === 'function' ? action(state) : action;\n}\nfunction mountReducer(reducer, initialArg, init) {\n  var hook = mountWorkInProgressHook();\n  var initialState;\n  if (init !== undefined) {\n    initialState = init(initialArg);\n  } else {\n    initialState = initialArg;\n  }\n  hook.memoizedState = hook.baseState = initialState;\n  var queue = hook.queue = {\n    pending: null,\n    dispatch: null,\n    lastRenderedReducer: reducer,\n    lastRenderedState: initialState\n  };\n  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n  return [hook.memoizedState, dispatch];\n}\nfunction updateReducer(reducer, initialArg, init) {\n  var hook = updateWorkInProgressHook();\n  var queue = hook.queue;\n  if (!(queue !== null)) {\n    {\n      throw Error( \\\\\"Should have a queue. This is likely a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  queue.lastRenderedReducer = reducer;\n  var current = currentHook; // The last rebase update that is NOT part of the base state.\n  var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.\n  var pendingQueue = queue.pending;\n  if (pendingQueue !== null) {\n    // We have new updates that haven't been processed yet.\n    // We'll add them to the base queue.\n    if (baseQueue !== null) {\n      // Merge the pending queue and the base queue.\n      var baseFirst = baseQueue.next;\n      var pendingFirst = pendingQueue.next;\n      baseQueue.next = pendingFirst;\n      pendingQueue.next = baseFirst;\n    }\n    {\n      if (current.baseQueue !== baseQueue) {\n        // Internal invariant that should never happen, but feasibly could in\n        // the future if we implement resuming, or some form of that.\n        error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.');\n      }\n    }\n    current.baseQueue = baseQueue = pendingQueue;\n    queue.pending = null;\n  }\n  if (baseQueue !== null) {\n    // We have a queue to process.\n    var first = baseQueue.next;\n    var newState = current.baseState;\n    var newBaseState = null;\n    var newBaseQueueFirst = null;\n    var newBaseQueueLast = null;\n    var update = first;\n    do {\n      var updateLane = update.lane;\n      if (!isSubsetOfLanes(renderLanes, updateLane)) {\n        // Priority is insufficient. Skip this update. If this is the first\n        // skipped update, the previous update/state is the new base\n        // update/state.\n        var clone = {\n          lane: updateLane,\n          action: update.action,\n          eagerReducer: update.eagerReducer,\n          eagerState: update.eagerState,\n          next: null\n        };\n        if (newBaseQueueLast === null) {\n          newBaseQueueFirst = newBaseQueueLast = clone;\n          newBaseState = newState;\n        } else {\n          newBaseQueueLast = newBaseQueueLast.next = clone;\n        } // Update the remaining priority in the queue.\n        // TODO: Don't need to accumulate this. Instead, we can remove\n        // renderLanes from the original lanes.\n        currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);\n        markSkippedUpdateLanes(updateLane);\n      } else {\n        // This update does have sufficient priority.\n        if (newBaseQueueLast !== null) {\n          var _clone = {\n            // This update is going to be committed so we never want uncommit\n            // it. Using NoLane works because 0 is a subset of all bitmasks, so\n            // this will never be skipped by the check above.\n            lane: NoLane,\n            action: update.action,\n            eagerReducer: update.eagerReducer,\n            eagerState: update.eagerState,\n            next: null\n          };\n          newBaseQueueLast = newBaseQueueLast.next = _clone;\n        } // Process this update.\n        if (update.eagerReducer === reducer) {\n          // If this update was processed eagerly, and its reducer matches the\n          // current reducer, we can use the eagerly computed state.\n          newState = update.eagerState;\n        } else {\n          var action = update.action;\n          newState = reducer(newState, action);\n        }\n      }\n      update = update.next;\n    } while (update !== null && update !== first);\n    if (newBaseQueueLast === null) {\n      newBaseState = newState;\n    } else {\n      newBaseQueueLast.next = newBaseQueueFirst;\n    } // Mark that the fiber performed work, but only if the new state is\n    // different from the current state.\n    if (!objectIs(newState, hook.memoizedState)) {\n      markWorkInProgressReceivedUpdate();\n    }\n    hook.memoizedState = newState;\n    hook.baseState = newBaseState;\n    hook.baseQueue = newBaseQueueLast;\n    queue.lastRenderedState = newState;\n  }\n  var dispatch = queue.dispatch;\n  return [hook.memoizedState, dispatch];\n}\nfunction rerenderReducer(reducer, initialArg, init) {\n  var hook = updateWorkInProgressHook();\n  var queue = hook.queue;\n  if (!(queue !== null)) {\n    {\n      throw Error( \\\\\"Should have a queue. This is likely a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous\n  // work-in-progress hook.\n  var dispatch = queue.dispatch;\n  var lastRenderPhaseUpdate = queue.pending;\n  var newState = hook.memoizedState;\n  if (lastRenderPhaseUpdate !== null) {\n    // The queue doesn't persist past this render pass.\n    queue.pending = null;\n    var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n    var update = firstRenderPhaseUpdate;\n    do {\n      // Process this render phase update. We don't have to check the\n      // priority because it will always be the same as the current\n      // render's.\n      var action = update.action;\n      newState = reducer(newState, action);\n      update = update.next;\n    } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is\n    // different from the current state.\n    if (!objectIs(newState, hook.memoizedState)) {\n      markWorkInProgressReceivedUpdate();\n    }\n    hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to\n    // the base state unless the queue is empty.\n    // TODO: Not sure if this is the desired semantics, but it's what we\n    // do for gDSFP. I can't remember why.\n    if (hook.baseQueue === null) {\n      hook.baseState = newState;\n    }\n    queue.lastRenderedState = newState;\n  }\n  return [newState, dispatch];\n}\nfunction readFromUnsubcribedMutableSource(root, source, getSnapshot) {\n  {\n    warnAboutMultipleRenderersDEV(source);\n  }\n  var getVersion = source._getVersion;\n  var version = getVersion(source._source); // Is it safe for this component to read from this source during the current render?\n  var isSafeToReadFromSource = false; // Check the version first.\n  // If this render has already been started with a specific version,\n  // we can use it alone to determine if we can safely read from the source.\n  var currentRenderVersion = getWorkInProgressVersion(source);\n  if (currentRenderVersion !== null) {\n    // It's safe to read if the store hasn't been mutated since the last time\n    // we read something.\n    isSafeToReadFromSource = currentRenderVersion === version;\n  } else {\n    // If there's no version, then this is the first time we've read from the\n    // source during the current render pass, so we need to do a bit more work.\n    // What we need to determine is if there are any hooks that already\n    // subscribed to the source, and if so, whether there are any pending\n    // mutations that haven't been synchronized yet.\n    //\n    // If there are no pending mutations, then \\`root.mutableReadLanes\\` will be\n    // empty, and we know we can safely read.\n    //\n    // If there *are* pending mutations, we may still be able to safely read\n    // if the currently rendering lanes are inclusive of the pending mutation\n    // lanes, since that guarantees that the value we're about to read from\n    // the source is consistent with the values that we read during the most\n    // recent mutation.\n    isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root.mutableReadLanes);\n    if (isSafeToReadFromSource) {\n      // If it's safe to read from this source during the current render,\n      // store the version in case other components read from it.\n      // A changed version number will let those components know to throw and restart the render.\n      setWorkInProgressVersion(source, version);\n    }\n  }\n  if (isSafeToReadFromSource) {\n    var snapshot = getSnapshot(source._source);\n    {\n      if (typeof snapshot === 'function') {\n        error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');\n      }\n    }\n    return snapshot;\n  } else {\n    // This handles the special case of a mutable source being shared between renderers.\n    // In that case, if the source is mutated between the first and second renderer,\n    // The second renderer don't know that it needs to reset the WIP version during unwind,\n    // (because the hook only marks sources as dirty if it's written to their WIP version).\n    // That would cause this tear check to throw again and eventually be visible to the user.\n    // We can avoid this infinite loop by explicitly marking the source as dirty.\n    //\n    // This can lead to tearing in the first renderer when it resumes,\n    // but there's nothing we can do about that (short of throwing here and refusing to continue the render).\n    markSourceAsDirty(source);\n    {\n      {\n        throw Error( \\\\\"Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  }\n}\nfunction useMutableSource(hook, source, getSnapshot, subscribe) {\n  var root = getWorkInProgressRoot();\n  if (!(root !== null)) {\n    {\n      throw Error( \\\\\"Expected a work-in-progress root. This is a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  var getVersion = source._getVersion;\n  var version = getVersion(source._source);\n  var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const\n  var _dispatcher$useState = dispatcher.useState(function () {\n    return readFromUnsubcribedMutableSource(root, source, getSnapshot);\n  }),\n      currentSnapshot = _dispatcher$useState[0],\n      setSnapshot = _dispatcher$useState[1];\n  var snapshot = currentSnapshot; // Grab a handle to the state hook as well.\n  // We use it to clear the pending update queue if we have a new source.\n  var stateHook = workInProgressHook;\n  var memoizedState = hook.memoizedState;\n  var refs = memoizedState.refs;\n  var prevGetSnapshot = refs.getSnapshot;\n  var prevSource = memoizedState.source;\n  var prevSubscribe = memoizedState.subscribe;\n  var fiber = currentlyRenderingFiber$1;\n  hook.memoizedState = {\n    refs: refs,\n    source: source,\n    subscribe: subscribe\n  }; // Sync the values needed by our subscription handler after each commit.\n  dispatcher.useEffect(function () {\n    refs.getSnapshot = getSnapshot; // Normally the dispatch function for a state hook never changes,\n    // but this hook recreates the queue in certain cases  to avoid updates from stale sources.\n    // handleChange() below needs to reference the dispatch function without re-subscribing,\n    // so we use a ref to ensure that it always has the latest version.\n    refs.setSnapshot = setSnapshot; // Check for a possible change between when we last rendered now.\n    var maybeNewVersion = getVersion(source._source);\n    if (!objectIs(version, maybeNewVersion)) {\n      var maybeNewSnapshot = getSnapshot(source._source);\n      {\n        if (typeof maybeNewSnapshot === 'function') {\n          error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');\n        }\n      }\n      if (!objectIs(snapshot, maybeNewSnapshot)) {\n        setSnapshot(maybeNewSnapshot);\n        var lane = requestUpdateLane(fiber);\n        markRootMutableRead(root, lane);\n      } // If the source mutated between render and now,\n      // there may be state updates already scheduled from the old source.\n      // Entangle the updates so that they render in the same batch.\n      markRootEntangled(root, root.mutableReadLanes);\n    }\n  }, [getSnapshot, source, subscribe]); // If we got a new source or subscribe function, re-subscribe in a passive effect.\n  dispatcher.useEffect(function () {\n    var handleChange = function () {\n      var latestGetSnapshot = refs.getSnapshot;\n      var latestSetSnapshot = refs.setSnapshot;\n      try {\n        latestSetSnapshot(latestGetSnapshot(source._source)); // Record a pending mutable source update with the same expiration time.\n        var lane = requestUpdateLane(fiber);\n        markRootMutableRead(root, lane);\n      } catch (error) {\n        // A selector might throw after a source mutation.\n        // e.g. it might try to read from a part of the store that no longer exists.\n        // In this case we should still schedule an update with React.\n        // Worst case the selector will throw again and then an error boundary will handle it.\n        latestSetSnapshot(function () {\n          throw error;\n        });\n      }\n    };\n    var unsubscribe = subscribe(source._source, handleChange);\n    {\n      if (typeof unsubscribe !== 'function') {\n        error('Mutable source subscribe function must return an unsubscribe function.');\n      }\n    }\n    return unsubscribe;\n  }, [source, subscribe]); // If any of the inputs to useMutableSource change, reading is potentially unsafe.\n  //\n  // If either the source or the subscription have changed we can't can't trust the update queue.\n  // Maybe the source changed in a way that the old subscription ignored but the new one depends on.\n  //\n  // If the getSnapshot function changed, we also shouldn't rely on the update queue.\n  // It's possible that the underlying source was mutated between the when the last \\\\\"change\\\\\" event fired,\n  // and when the current render (with the new getSnapshot function) is processed.\n  //\n  // In both cases, we need to throw away pending updates (since they are no longer relevant)\n  // and treat reading from the source as we do in the mount case.\n  if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {\n    // Create a new queue and setState method,\n    // So if there are interleaved updates, they get pushed to the older queue.\n    // When this becomes current, the previous queue and dispatch method will be discarded,\n    // including any interleaving updates that occur.\n    var newQueue = {\n      pending: null,\n      dispatch: null,\n      lastRenderedReducer: basicStateReducer,\n      lastRenderedState: snapshot\n    };\n    newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);\n    stateHook.queue = newQueue;\n    stateHook.baseQueue = null;\n    snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);\n    stateHook.memoizedState = stateHook.baseState = snapshot;\n  }\n  return snapshot;\n}\nfunction mountMutableSource(source, getSnapshot, subscribe) {\n  var hook = mountWorkInProgressHook();\n  hook.memoizedState = {\n    refs: {\n      getSnapshot: getSnapshot,\n      setSnapshot: null\n    },\n    source: source,\n    subscribe: subscribe\n  };\n  return useMutableSource(hook, source, getSnapshot, subscribe);\n}\nfunction updateMutableSource(source, getSnapshot, subscribe) {\n  var hook = updateWorkInProgressHook();\n  return useMutableSource(hook, source, getSnapshot, subscribe);\n}\nfunction mountState(initialState) {\n  var hook = mountWorkInProgressHook();\n  if (typeof initialState === 'function') {\n    // $FlowFixMe: Flow doesn't like mixed types\n    initialState = initialState();\n  }\n  hook.memoizedState = hook.baseState = initialState;\n  var queue = hook.queue = {\n    pending: null,\n    dispatch: null,\n    lastRenderedReducer: basicStateReducer,\n    lastRenderedState: initialState\n  };\n  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n  return [hook.memoizedState, dispatch];\n}\nfunction updateState(initialState) {\n  return updateReducer(basicStateReducer);\n}\nfunction rerenderState(initialState) {\n  return rerenderReducer(basicStateReducer);\n}\nfunction pushEffect(tag, create, destroy, deps) {\n  var effect = {\n    tag: tag,\n    create: create,\n    destroy: destroy,\n    deps: deps,\n    // Circular\n    next: null\n  };\n  var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n  if (componentUpdateQueue === null) {\n    componentUpdateQueue = createFunctionComponentUpdateQueue();\n    currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n    componentUpdateQueue.lastEffect = effect.next = effect;\n  } else {\n    var lastEffect = componentUpdateQueue.lastEffect;\n    if (lastEffect === null) {\n      componentUpdateQueue.lastEffect = effect.next = effect;\n    } else {\n      var firstEffect = lastEffect.next;\n      lastEffect.next = effect;\n      effect.next = firstEffect;\n      componentUpdateQueue.lastEffect = effect;\n    }\n  }\n  return effect;\n}\nfunction mountRef(initialValue) {\n  var hook = mountWorkInProgressHook();\n  var ref = {\n    current: initialValue\n  };\n  {\n    Object.seal(ref);\n  }\n  hook.memoizedState = ref;\n  return ref;\n}\nfunction updateRef(initialValue) {\n  var hook = updateWorkInProgressHook();\n  return hook.memoizedState;\n}\nfunction mountEffectImpl(fiberFlags, hookFlags, create, deps) {\n  var hook = mountWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  currentlyRenderingFiber$1.flags |= fiberFlags;\n  hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);\n}\nfunction updateEffectImpl(fiberFlags, hookFlags, create, deps) {\n  var hook = updateWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var destroy = undefined;\n  if (currentHook !== null) {\n    var prevEffect = currentHook.memoizedState;\n    destroy = prevEffect.destroy;\n    if (nextDeps !== null) {\n      var prevDeps = prevEffect.deps;\n      if (areHookInputsEqual(nextDeps, prevDeps)) {\n        pushEffect(hookFlags, create, destroy, nextDeps);\n        return;\n      }\n    }\n  }\n  currentlyRenderingFiber$1.flags |= fiberFlags;\n  hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);\n}\nfunction mountEffect(create, deps) {\n  {\n    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n    if ('undefined' !== typeof jest) {\n      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n    }\n  }\n  return mountEffectImpl(Update | Passive, Passive$1, create, deps);\n}\nfunction updateEffect(create, deps) {\n  {\n    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n    if ('undefined' !== typeof jest) {\n      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n    }\n  }\n  return updateEffectImpl(Update | Passive, Passive$1, create, deps);\n}\nfunction mountLayoutEffect(create, deps) {\n  return mountEffectImpl(Update, Layout, create, deps);\n}\nfunction updateLayoutEffect(create, deps) {\n  return updateEffectImpl(Update, Layout, create, deps);\n}\nfunction imperativeHandleEffect(create, ref) {\n  if (typeof ref === 'function') {\n    var refCallback = ref;\n    var _inst = create();\n    refCallback(_inst);\n    return function () {\n      refCallback(null);\n    };\n  } else if (ref !== null && ref !== undefined) {\n    var refObject = ref;\n    {\n      if (!refObject.hasOwnProperty('current')) {\n        error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');\n      }\n    }\n    var _inst2 = create();\n    refObject.current = _inst2;\n    return function () {\n      refObject.current = null;\n    };\n  }\n}\nfunction mountImperativeHandle(ref, create, deps) {\n  {\n    if (typeof create !== 'function') {\n      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n    }\n  } // TODO: If deps are provided, should we skip comparing the ref itself?\n  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n  return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\nfunction updateImperativeHandle(ref, create, deps) {\n  {\n    if (typeof create !== 'function') {\n      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n    }\n  } // TODO: If deps are provided, should we skip comparing the ref itself?\n  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n  return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\nfunction mountDebugValue(value, formatterFn) {// This hook is normally a no-op.\n  // The react-debug-hooks package injects its own implementation\n  // so that e.g. DevTools can display custom hook values.\n}\nvar updateDebugValue = mountDebugValue;\nfunction mountCallback(callback, deps) {\n  var hook = mountWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  hook.memoizedState = [callback, nextDeps];\n  return callback;\n}\nfunction updateCallback(callback, deps) {\n  var hook = updateWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var prevState = hook.memoizedState;\n  if (prevState !== null) {\n    if (nextDeps !== null) {\n      var prevDeps = prevState[1];\n      if (areHookInputsEqual(nextDeps, prevDeps)) {\n        return prevState[0];\n      }\n    }\n  }\n  hook.memoizedState = [callback, nextDeps];\n  return callback;\n}\nfunction mountMemo(nextCreate, deps) {\n  var hook = mountWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var nextValue = nextCreate();\n  hook.memoizedState = [nextValue, nextDeps];\n  return nextValue;\n}\nfunction updateMemo(nextCreate, deps) {\n  var hook = updateWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var prevState = hook.memoizedState;\n  if (prevState !== null) {\n    // Assume these are defined. If they're not, areHookInputsEqual will warn.\n    if (nextDeps !== null) {\n      var prevDeps = prevState[1];\n      if (areHookInputsEqual(nextDeps, prevDeps)) {\n        return prevState[0];\n      }\n    }\n  }\n  var nextValue = nextCreate();\n  hook.memoizedState = [nextValue, nextDeps];\n  return nextValue;\n}\nfunction mountDeferredValue(value) {\n  var _mountState = mountState(value),\n      prevValue = _mountState[0],\n      setValue = _mountState[1];\n  mountEffect(function () {\n    var prevTransition = ReactCurrentBatchConfig$1.transition;\n    ReactCurrentBatchConfig$1.transition = 1;\n    try {\n      setValue(value);\n    } finally {\n      ReactCurrentBatchConfig$1.transition = prevTransition;\n    }\n  }, [value]);\n  return prevValue;\n}\nfunction updateDeferredValue(value) {\n  var _updateState = updateState(),\n      prevValue = _updateState[0],\n      setValue = _updateState[1];\n  updateEffect(function () {\n    var prevTransition = ReactCurrentBatchConfig$1.transition;\n    ReactCurrentBatchConfig$1.transition = 1;\n    try {\n      setValue(value);\n    } finally {\n      ReactCurrentBatchConfig$1.transition = prevTransition;\n    }\n  }, [value]);\n  return prevValue;\n}\nfunction rerenderDeferredValue(value) {\n  var _rerenderState = rerenderState(),\n      prevValue = _rerenderState[0],\n      setValue = _rerenderState[1];\n  updateEffect(function () {\n    var prevTransition = ReactCurrentBatchConfig$1.transition;\n    ReactCurrentBatchConfig$1.transition = 1;\n    try {\n      setValue(value);\n    } finally {\n      ReactCurrentBatchConfig$1.transition = prevTransition;\n    }\n  }, [value]);\n  return prevValue;\n}\nfunction startTransition(setPending, callback) {\n  var priorityLevel = getCurrentPriorityLevel();\n  {\n    runWithPriority$1(priorityLevel < UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function () {\n      setPending(true);\n    });\n    runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function () {\n      var prevTransition = ReactCurrentBatchConfig$1.transition;\n      ReactCurrentBatchConfig$1.transition = 1;\n      try {\n        setPending(false);\n        callback();\n      } finally {\n        ReactCurrentBatchConfig$1.transition = prevTransition;\n      }\n    });\n  }\n}\nfunction mountTransition() {\n  var _mountState2 = mountState(false),\n      isPending = _mountState2[0],\n      setPending = _mountState2[1]; // The \\`start\\` method can be stored on a ref, since \\`setPending\\`\n  // never changes.\n  var start = startTransition.bind(null, setPending);\n  mountRef(start);\n  return [start, isPending];\n}\nfunction updateTransition() {\n  var _updateState2 = updateState(),\n      isPending = _updateState2[0];\n  var startRef = updateRef();\n  var start = startRef.current;\n  return [start, isPending];\n}\nfunction rerenderTransition() {\n  var _rerenderState2 = rerenderState(),\n      isPending = _rerenderState2[0];\n  var startRef = updateRef();\n  var start = startRef.current;\n  return [start, isPending];\n}\nvar isUpdatingOpaqueValueInRenderPhase = false;\nfunction getIsUpdatingOpaqueValueInRenderPhaseInDEV() {\n  {\n    return isUpdatingOpaqueValueInRenderPhase;\n  }\n}\nfunction warnOnOpaqueIdentifierAccessInDEV(fiber) {\n  {\n    // TODO: Should warn in effects and callbacks, too\n    var name = getComponentName(fiber.type) || 'Unknown';\n    if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name]) {\n      error('The object passed back from useOpaqueIdentifier is meant to be ' + 'passed through to attributes only. Do not read the ' + 'value directly.');\n      didWarnAboutUseOpaqueIdentifier[name] = true;\n    }\n  }\n}\nfunction mountOpaqueIdentifier() {\n  var makeId =  makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1)) ;\n  if (getIsHydrating()) {\n    var didUpgrade = false;\n    var fiber = currentlyRenderingFiber$1;\n    var readValue = function () {\n      if (!didUpgrade) {\n        // Only upgrade once. This works even inside the render phase because\n        // the update is added to a shared queue, which outlasts the\n        // in-progress render.\n        didUpgrade = true;\n        {\n          isUpdatingOpaqueValueInRenderPhase = true;\n          setId(makeId());\n          isUpdatingOpaqueValueInRenderPhase = false;\n          warnOnOpaqueIdentifierAccessInDEV(fiber);\n        }\n      }\n      {\n        {\n          throw Error( \\\\\"The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.\\\\\" );\n        }\n      }\n    };\n    var id = makeOpaqueHydratingObject(readValue);\n    var setId = mountState(id)[1];\n    if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {\n      currentlyRenderingFiber$1.flags |= Update | Passive;\n      pushEffect(HasEffect | Passive$1, function () {\n        setId(makeId());\n      }, undefined, null);\n    }\n    return id;\n  } else {\n    var _id = makeId();\n    mountState(_id);\n    return _id;\n  }\n}\nfunction updateOpaqueIdentifier() {\n  var id = updateState()[0];\n  return id;\n}\nfunction rerenderOpaqueIdentifier() {\n  var id = rerenderState()[0];\n  return id;\n}\nfunction dispatchAction(fiber, queue, action) {\n  {\n    if (typeof arguments[3] === 'function') {\n      error(\\\\\"State updates from the useState() and useReducer() Hooks don't support the \\\\\" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n    }\n  }\n  var eventTime = requestEventTime();\n  var lane = requestUpdateLane(fiber);\n  var update = {\n    lane: lane,\n    action: action,\n    eagerReducer: null,\n    eagerState: null,\n    next: null\n  }; // Append the update to the end of the list.\n  var pending = queue.pending;\n  if (pending === null) {\n    // This is the first update. Create a circular list.\n    update.next = update;\n  } else {\n    update.next = pending.next;\n    pending.next = update;\n  }\n  queue.pending = update;\n  var alternate = fiber.alternate;\n  if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {\n    // This is a render phase update. Stash it in a lazily-created map of\n    // queue -> linked list of updates. After this render pass, we'll restart\n    // and apply the stashed updates on top of the work-in-progress hook.\n    didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;\n  } else {\n    if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {\n      // The queue is currently empty, which means we can eagerly compute the\n      // next state before entering the render phase. If the new state is the\n      // same as the current state, we may be able to bail out entirely.\n      var lastRenderedReducer = queue.lastRenderedReducer;\n      if (lastRenderedReducer !== null) {\n        var prevDispatcher;\n        {\n          prevDispatcher = ReactCurrentDispatcher$1.current;\n          ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n        }\n        try {\n          var currentState = queue.lastRenderedState;\n          var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute\n          // it, on the update object. If the reducer hasn't changed by the\n          // time we enter the render phase, then the eager state can be used\n          // without calling the reducer again.\n          update.eagerReducer = lastRenderedReducer;\n          update.eagerState = eagerState;\n          if (objectIs(eagerState, currentState)) {\n            // Fast path. We can bail out without scheduling React to re-render.\n            // It's still possible that we'll need to rebase this update later,\n            // if the component re-renders for a different reason and by that\n            // time the reducer has changed.\n            return;\n          }\n        } catch (error) {// Suppress the error. It will throw again in the render phase.\n        } finally {\n          {\n            ReactCurrentDispatcher$1.current = prevDispatcher;\n          }\n        }\n      }\n    }\n    {\n      // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n      if ('undefined' !== typeof jest) {\n        warnIfNotScopedWithMatchingAct(fiber);\n        warnIfNotCurrentlyActingUpdatesInDev(fiber);\n      }\n    }\n    scheduleUpdateOnFiber(fiber, lane, eventTime);\n  }\n}\nvar ContextOnlyDispatcher = {\n  readContext: readContext,\n  useCallback: throwInvalidHookError,\n  useContext: throwInvalidHookError,\n  useEffect: throwInvalidHookError,\n  useImperativeHandle: throwInvalidHookError,\n  useLayoutEffect: throwInvalidHookError,\n  useMemo: throwInvalidHookError,\n  useReducer: throwInvalidHookError,\n  useRef: throwInvalidHookError,\n  useState: throwInvalidHookError,\n  useDebugValue: throwInvalidHookError,\n  useDeferredValue: throwInvalidHookError,\n  useTransition: throwInvalidHookError,\n  useMutableSource: throwInvalidHookError,\n  useOpaqueIdentifier: throwInvalidHookError,\n  unstable_isNewReconciler: enableNewReconciler\n};\nvar HooksDispatcherOnMountInDEV = null;\nvar HooksDispatcherOnMountWithHookTypesInDEV = null;\nvar HooksDispatcherOnUpdateInDEV = null;\nvar HooksDispatcherOnRerenderInDEV = null;\nvar InvalidNestedHooksDispatcherOnMountInDEV = null;\nvar InvalidNestedHooksDispatcherOnUpdateInDEV = null;\nvar InvalidNestedHooksDispatcherOnRerenderInDEV = null;\n{\n  var warnInvalidContextAccess = function () {\n    error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n  };\n  var warnInvalidHookAccess = function () {\n    error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');\n  };\n  HooksDispatcherOnMountInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      mountHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      mountHookTypesDev();\n      return mountRef(initialValue);\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      mountHookTypesDev();\n      return mountDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      mountHookTypesDev();\n      return mountDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      mountHookTypesDev();\n      return mountTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      mountHookTypesDev();\n      return mountMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      mountHookTypesDev();\n      return mountOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n  HooksDispatcherOnMountWithHookTypesInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      updateHookTypesDev();\n      return mountCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      updateHookTypesDev();\n      return mountEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      updateHookTypesDev();\n      return mountImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      updateHookTypesDev();\n      return mountLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      updateHookTypesDev();\n      return mountRef(initialValue);\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      updateHookTypesDev();\n      return mountDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      updateHookTypesDev();\n      return mountDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      updateHookTypesDev();\n      return mountTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      updateHookTypesDev();\n      return mountMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      updateHookTypesDev();\n      return mountOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n  HooksDispatcherOnUpdateInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      updateHookTypesDev();\n      return updateDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      updateHookTypesDev();\n      return updateTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      updateHookTypesDev();\n      return updateMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      updateHookTypesDev();\n      return updateOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n  HooksDispatcherOnRerenderInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n      try {\n        return rerenderReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n      try {\n        return rerenderState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      updateHookTypesDev();\n      return rerenderDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      updateHookTypesDev();\n      return rerenderTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      updateHookTypesDev();\n      return updateMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      updateHookTypesDev();\n      return rerenderOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n  InvalidNestedHooksDispatcherOnMountInDEV = {\n    readContext: function (context, observedBits) {\n      warnInvalidContextAccess();\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountRef(initialValue);\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n  InvalidNestedHooksDispatcherOnUpdateInDEV = {\n    readContext: function (context, observedBits) {\n      warnInvalidContextAccess();\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n  InvalidNestedHooksDispatcherOnRerenderInDEV = {\n    readContext: function (context, observedBits) {\n      warnInvalidContextAccess();\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return rerenderReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher$1.current;\n      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return rerenderState(initialState);\n      } finally {\n        ReactCurrentDispatcher$1.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useDeferredValue: function (value) {\n      currentHookNameInDev = 'useDeferredValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return rerenderDeferredValue(value);\n    },\n    useTransition: function () {\n      currentHookNameInDev = 'useTransition';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return rerenderTransition();\n    },\n    useMutableSource: function (source, getSnapshot, subscribe) {\n      currentHookNameInDev = 'useMutableSource';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateMutableSource(source, getSnapshot, subscribe);\n    },\n    useOpaqueIdentifier: function () {\n      currentHookNameInDev = 'useOpaqueIdentifier';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return rerenderOpaqueIdentifier();\n    },\n    unstable_isNewReconciler: enableNewReconciler\n  };\n}\nvar now$1 = Scheduler.unstable_now;\nvar commitTime = 0;\nvar profilerStartTime = -1;\nfunction getCommitTime() {\n  return commitTime;\n}\nfunction recordCommitTime() {\n  commitTime = now$1();\n}\nfunction startProfilerTimer(fiber) {\n  profilerStartTime = now$1();\n  if (fiber.actualStartTime < 0) {\n    fiber.actualStartTime = now$1();\n  }\n}\nfunction stopProfilerTimerIfRunning(fiber) {\n  profilerStartTime = -1;\n}\nfunction stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {\n  if (profilerStartTime >= 0) {\n    var elapsedTime = now$1() - profilerStartTime;\n    fiber.actualDuration += elapsedTime;\n    if (overrideBaseTime) {\n      fiber.selfBaseDuration = elapsedTime;\n    }\n    profilerStartTime = -1;\n  }\n}\nfunction transferActualDuration(fiber) {\n  // Transfer time spent rendering these children so we don't lose it\n  // after we rerender. This is used as a helper in special cases\n  // where we should count the work of multiple passes.\n  var child = fiber.child;\n  while (child) {\n    fiber.actualDuration += child.actualDuration;\n    child = child.sibling;\n  }\n}\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar didReceiveUpdate = false;\nvar didWarnAboutBadClass;\nvar didWarnAboutModulePatternComponent;\nvar didWarnAboutContextTypeOnFunctionComponent;\nvar didWarnAboutGetDerivedStateOnFunctionComponent;\nvar didWarnAboutFunctionRefs;\nvar didWarnAboutReassigningProps;\nvar didWarnAboutRevealOrder;\nvar didWarnAboutTailOptions;\n{\n  didWarnAboutBadClass = {};\n  didWarnAboutModulePatternComponent = {};\n  didWarnAboutContextTypeOnFunctionComponent = {};\n  didWarnAboutGetDerivedStateOnFunctionComponent = {};\n  didWarnAboutFunctionRefs = {};\n  didWarnAboutReassigningProps = false;\n  didWarnAboutRevealOrder = {};\n  didWarnAboutTailOptions = {};\n}\nfunction reconcileChildren(current, workInProgress, nextChildren, renderLanes) {\n  if (current === null) {\n    // If this is a fresh new component that hasn't been rendered yet, we\n    // won't update its child set by applying minimal side-effects. Instead,\n    // we will add them all to the child before it gets rendered. That means\n    // we can optimize this reconciliation pass by not tracking side-effects.\n    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);\n  } else {\n    // If the current child is the same as the work in progress, it means that\n    // we haven't yet started any work on these children. Therefore, we use\n    // the clone algorithm to create a copy of all the current children.\n    // If we had any progressed work already, that is invalid at this point so\n    // let's throw it out.\n    workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes);\n  }\n}\nfunction forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) {\n  // This function is fork of reconcileChildren. It's used in cases where we\n  // want to reconcile without matching against the existing set. This has the\n  // effect of all current children being unmounted; even if the type and key\n  // are the same, the old child is unmounted and a new child is created.\n  //\n  // To do this, we're going to go through the reconcile algorithm twice. In\n  // the first pass, we schedule a deletion for all the current children by\n  // passing null.\n  workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we\n  // pass null in place of where we usually pass the current child set. This has\n  // the effect of remounting all children regardless of whether their\n  // identities match.\n  workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);\n}\nfunction updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) {\n  // TODO: current can be non-null here even if the component\n  // hasn't yet mounted. This happens after the first render suspends.\n  // We'll need to figure out if this is fine or can cause issues.\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var innerPropTypes = Component.propTypes;\n      if (innerPropTypes) {\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(Component));\n      }\n    }\n  }\n  var render = Component.render;\n  var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent\n  var nextChildren;\n  prepareToReadContext(workInProgress, renderLanes);\n  {\n    ReactCurrentOwner$1.current = workInProgress;\n    setIsRendering(true);\n    nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);\n    if ( workInProgress.mode & StrictMode) {\n      disableLogs();\n      try {\n        nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);\n      } finally {\n        reenableLogs();\n      }\n    }\n    setIsRendering(false);\n  }\n  if (current !== null && !didReceiveUpdate) {\n    bailoutHooks(current, workInProgress, renderLanes);\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n  } // React DevTools reads this flag.\n  workInProgress.flags |= PerformedWork;\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction updateMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {\n  if (current === null) {\n    var type = Component.type;\n    if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.\n    Component.defaultProps === undefined) {\n      var resolvedType = type;\n      {\n        resolvedType = resolveFunctionForHotReloading(type);\n      } // If this is a plain function component without default props,\n      // and with only the default shallow comparison, we upgrade it\n      // to a SimpleMemoComponent to allow fast path updates.\n      workInProgress.tag = SimpleMemoComponent;\n      workInProgress.type = resolvedType;\n      {\n        validateFunctionComponentInDev(workInProgress, type);\n      }\n      return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateLanes, renderLanes);\n    }\n    {\n      var innerPropTypes = type.propTypes;\n      if (innerPropTypes) {\n        // Inner memo component props aren't currently validated in createElement.\n        // We could move it there, but we'd still need this for lazy code path.\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(type));\n      }\n    }\n    var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes);\n    child.ref = workInProgress.ref;\n    child.return = workInProgress;\n    workInProgress.child = child;\n    return child;\n  }\n  {\n    var _type = Component.type;\n    var _innerPropTypes = _type.propTypes;\n    if (_innerPropTypes) {\n      // Inner memo component props aren't currently validated in createElement.\n      // We could move it there, but we'd still need this for lazy code path.\n      checkPropTypes(_innerPropTypes, nextProps, // Resolved props\n      'prop', getComponentName(_type));\n    }\n  }\n  var currentChild = current.child; // This is always exactly one child\n  if (!includesSomeLane(updateLanes, renderLanes)) {\n    // This will be the props with resolved defaultProps,\n    // unlike current.memoizedProps which will be the unresolved ones.\n    var prevProps = currentChild.memoizedProps; // Default to shallow comparison\n    var compare = Component.compare;\n    compare = compare !== null ? compare : shallowEqual;\n    if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n    }\n  } // React DevTools reads this flag.\n  workInProgress.flags |= PerformedWork;\n  var newChild = createWorkInProgress(currentChild, nextProps);\n  newChild.ref = workInProgress.ref;\n  newChild.return = workInProgress;\n  workInProgress.child = newChild;\n  return newChild;\n}\nfunction updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {\n  // TODO: current can be non-null here even if the component\n  // hasn't yet mounted. This happens when the inner render suspends.\n  // We'll need to figure out if this is fine or can cause issues.\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var outerMemoType = workInProgress.elementType;\n      if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {\n        // We warn when you define propTypes on lazy()\n        // so let's just skip over it to find memo() outer wrapper.\n        // Inner props for memo are validated later.\n        var lazyComponent = outerMemoType;\n        var payload = lazyComponent._payload;\n        var init = lazyComponent._init;\n        try {\n          outerMemoType = init(payload);\n        } catch (x) {\n          outerMemoType = null;\n        } // Inner propTypes will be validated in the function component path.\n        var outerPropTypes = outerMemoType && outerMemoType.propTypes;\n        if (outerPropTypes) {\n          checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)\n          'prop', getComponentName(outerMemoType));\n        }\n      }\n    }\n  }\n  if (current !== null) {\n    var prevProps = current.memoizedProps;\n    if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.\n     workInProgress.type === current.type )) {\n      didReceiveUpdate = false;\n      if (!includesSomeLane(renderLanes, updateLanes)) {\n        // The pending lanes were cleared at the beginning of beginWork. We're\n        // about to bail out, but there might be other lanes that weren't\n        // included in the current render. Usually, the priority level of the\n        // remaining updates is accumlated during the evaluation of the\n        // component (i.e. when processing the update queue). But since since\n        // we're bailing out early *without* evaluating the component, we need\n        // to account for it here, too. Reset to the value of the current fiber.\n        // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,\n        // because a MemoComponent fiber does not have hooks or an update queue;\n        // rather, it wraps around an inner component, which may or may not\n        // contains hooks.\n        // TODO: Move the reset at in beginWork out of the common path so that\n        // this is no longer necessary.\n        workInProgress.lanes = current.lanes;\n        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n      } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {\n        // This is a special case that only exists for legacy mode.\n        // See https://github.com/facebook/react/pull/19216.\n        didReceiveUpdate = true;\n      }\n    }\n  }\n  return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes);\n}\nfunction updateOffscreenComponent(current, workInProgress, renderLanes) {\n  var nextProps = workInProgress.pendingProps;\n  var nextChildren = nextProps.children;\n  var prevState = current !== null ? current.memoizedState : null;\n  if (nextProps.mode === 'hidden' || nextProps.mode === 'unstable-defer-without-hiding') {\n    if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n      // In legacy sync mode, don't defer the subtree. Render it now.\n      // TODO: Figure out what we should do in Blocking mode.\n      var nextState = {\n        baseLanes: NoLanes\n      };\n      workInProgress.memoizedState = nextState;\n      pushRenderLanes(workInProgress, renderLanes);\n    } else if (!includesSomeLane(renderLanes, OffscreenLane)) {\n      var nextBaseLanes;\n      if (prevState !== null) {\n        var prevBaseLanes = prevState.baseLanes;\n        nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes);\n      } else {\n        nextBaseLanes = renderLanes;\n      } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n      {\n        markSpawnedWork(OffscreenLane);\n      }\n      workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane);\n      var _nextState = {\n        baseLanes: nextBaseLanes\n      };\n      workInProgress.memoizedState = _nextState; // We're about to bail out, but we need to push this to the stack anyway\n      // to avoid a push/pop misalignment.\n      pushRenderLanes(workInProgress, nextBaseLanes);\n      return null;\n    } else {\n      // Rendering at offscreen, so we can clear the base lanes.\n      var _nextState2 = {\n        baseLanes: NoLanes\n      };\n      workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out.\n      var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes;\n      pushRenderLanes(workInProgress, subtreeRenderLanes);\n    }\n  } else {\n    var _subtreeRenderLanes;\n    if (prevState !== null) {\n      _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); // Since we're not hidden anymore, reset the state\n      workInProgress.memoizedState = null;\n    } else {\n      // We weren't previously hidden, and we still aren't, so there's nothing\n      // special to do. Need to push to the stack regardless, though, to avoid\n      // a push/pop misalignment.\n      _subtreeRenderLanes = renderLanes;\n    }\n    pushRenderLanes(workInProgress, _subtreeRenderLanes);\n  }\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n} // Note: These happen to have identical begin phases, for now. We shouldn't hold\n// ourselves to this constraint, though. If the behavior diverges, we should\n// fork the function.\nvar updateLegacyHiddenComponent = updateOffscreenComponent;\nfunction updateFragment(current, workInProgress, renderLanes) {\n  var nextChildren = workInProgress.pendingProps;\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction updateMode(current, workInProgress, renderLanes) {\n  var nextChildren = workInProgress.pendingProps.children;\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction updateProfiler(current, workInProgress, renderLanes) {\n  {\n    workInProgress.flags |= Update; // Reset effect durations for the next eventual effect phase.\n    // These are reset during render to allow the DevTools commit hook a chance to read them,\n    var stateNode = workInProgress.stateNode;\n    stateNode.effectDuration = 0;\n    stateNode.passiveEffectDuration = 0;\n  }\n  var nextProps = workInProgress.pendingProps;\n  var nextChildren = nextProps.children;\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction markRef(current, workInProgress) {\n  var ref = workInProgress.ref;\n  if (current === null && ref !== null || current !== null && current.ref !== ref) {\n    // Schedule a Ref effect\n    workInProgress.flags |= Ref;\n  }\n}\nfunction updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) {\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var innerPropTypes = Component.propTypes;\n      if (innerPropTypes) {\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(Component));\n      }\n    }\n  }\n  var context;\n  {\n    var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);\n    context = getMaskedContext(workInProgress, unmaskedContext);\n  }\n  var nextChildren;\n  prepareToReadContext(workInProgress, renderLanes);\n  {\n    ReactCurrentOwner$1.current = workInProgress;\n    setIsRendering(true);\n    nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);\n    if ( workInProgress.mode & StrictMode) {\n      disableLogs();\n      try {\n        nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);\n      } finally {\n        reenableLogs();\n      }\n    }\n    setIsRendering(false);\n  }\n  if (current !== null && !didReceiveUpdate) {\n    bailoutHooks(current, workInProgress, renderLanes);\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n  } // React DevTools reads this flag.\n  workInProgress.flags |= PerformedWork;\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) {\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var innerPropTypes = Component.propTypes;\n      if (innerPropTypes) {\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(Component));\n      }\n    }\n  } // Push context providers early to prevent context stack mismatches.\n  // During mounting we don't know the child context yet as the instance doesn't exist.\n  // We will invalidate the child context in finishClassComponent() right after rendering.\n  var hasContext;\n  if (isContextProvider(Component)) {\n    hasContext = true;\n    pushContextProvider(workInProgress);\n  } else {\n    hasContext = false;\n  }\n  prepareToReadContext(workInProgress, renderLanes);\n  var instance = workInProgress.stateNode;\n  var shouldUpdate;\n  if (instance === null) {\n    if (current !== null) {\n      // A class component without an instance only mounts if it suspended\n      // inside a non-concurrent tree, in an inconsistent state. We want to\n      // treat it like a new mount, even though an empty version of it already\n      // committed. Disconnect the alternate pointers.\n      current.alternate = null;\n      workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n      workInProgress.flags |= Placement;\n    } // In the initial pass we might need to construct the instance.\n    constructClassInstance(workInProgress, Component, nextProps);\n    mountClassInstance(workInProgress, Component, nextProps, renderLanes);\n    shouldUpdate = true;\n  } else if (current === null) {\n    // In a resume, we'll already have an instance we can reuse.\n    shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes);\n  } else {\n    shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes);\n  }\n  var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes);\n  {\n    var inst = workInProgress.stateNode;\n    if (shouldUpdate && inst.props !== nextProps) {\n      if (!didWarnAboutReassigningProps) {\n        error('It looks like %s is reassigning its own \\`this.props\\` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');\n      }\n      didWarnAboutReassigningProps = true;\n    }\n  }\n  return nextUnitOfWork;\n}\nfunction finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {\n  // Refs should update even if shouldComponentUpdate returns false\n  markRef(current, workInProgress);\n  var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;\n  if (!shouldUpdate && !didCaptureError) {\n    // Context providers should defer to sCU for rendering\n    if (hasContext) {\n      invalidateContextProvider(workInProgress, Component, false);\n    }\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n  }\n  var instance = workInProgress.stateNode; // Rerender\n  ReactCurrentOwner$1.current = workInProgress;\n  var nextChildren;\n  if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {\n    // If we captured an error, but getDerivedStateFromError is not defined,\n    // unmount all the children. componentDidCatch will schedule an update to\n    // re-render a fallback. This is temporary until we migrate everyone to\n    // the new API.\n    // TODO: Warn in a future release.\n    nextChildren = null;\n    {\n      stopProfilerTimerIfRunning();\n    }\n  } else {\n    {\n      setIsRendering(true);\n      nextChildren = instance.render();\n      if ( workInProgress.mode & StrictMode) {\n        disableLogs();\n        try {\n          instance.render();\n        } finally {\n          reenableLogs();\n        }\n      }\n      setIsRendering(false);\n    }\n  } // React DevTools reads this flag.\n  workInProgress.flags |= PerformedWork;\n  if (current !== null && didCaptureError) {\n    // If we're recovering from an error, reconcile without reusing any of\n    // the existing children. Conceptually, the normal children and the children\n    // that are shown on error are two different sets, so we shouldn't reuse\n    // normal children even if their identities match.\n    forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes);\n  } else {\n    reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  } // Memoize state using the values we just used to render.\n  // TODO: Restructure so we never read values from the instance.\n  workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.\n  if (hasContext) {\n    invalidateContextProvider(workInProgress, Component, true);\n  }\n  return workInProgress.child;\n}\nfunction pushHostRootContext(workInProgress) {\n  var root = workInProgress.stateNode;\n  if (root.pendingContext) {\n    pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n  } else if (root.context) {\n    // Should always be set\n    pushTopLevelContextObject(workInProgress, root.context, false);\n  }\n  pushHostContainer(workInProgress, root.containerInfo);\n}\nfunction updateHostRoot(current, workInProgress, renderLanes) {\n  pushHostRootContext(workInProgress);\n  var updateQueue = workInProgress.updateQueue;\n  if (!(current !== null && updateQueue !== null)) {\n    {\n      throw Error( \\\\\"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  var nextProps = workInProgress.pendingProps;\n  var prevState = workInProgress.memoizedState;\n  var prevChildren = prevState !== null ? prevState.element : null;\n  cloneUpdateQueue(current, workInProgress);\n  processUpdateQueue(workInProgress, nextProps, null, renderLanes);\n  var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property\n  // being called \\\\\"element\\\\\".\n  var nextChildren = nextState.element;\n  if (nextChildren === prevChildren) {\n    resetHydrationState();\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n  }\n  var root = workInProgress.stateNode;\n  if (root.hydrate && enterHydrationState(workInProgress)) {\n    // If we don't have any current children this might be the first pass.\n    // We always try to hydrate. If this isn't a hydration pass there won't\n    // be any children to hydrate which is effectively the same thing as\n    // not hydrating.\n    {\n      var mutableSourceEagerHydrationData = root.mutableSourceEagerHydrationData;\n      if (mutableSourceEagerHydrationData != null) {\n        for (var i = 0; i < mutableSourceEagerHydrationData.length; i += 2) {\n          var mutableSource = mutableSourceEagerHydrationData[i];\n          var version = mutableSourceEagerHydrationData[i + 1];\n          setWorkInProgressVersion(mutableSource, version);\n        }\n      }\n    }\n    var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);\n    workInProgress.child = child;\n    var node = child;\n    while (node) {\n      // Mark each child as hydrating. This is a fast path to know whether this\n      // tree is part of a hydrating tree. This is used to determine if a child\n      // node has fully mounted yet, and for scheduling event replaying.\n      // Conceptually this is similar to Placement in that a new subtree is\n      // inserted into the React tree here. It just happens to not need DOM\n      // mutations because it already exists.\n      node.flags = node.flags & ~Placement | Hydrating;\n      node = node.sibling;\n    }\n  } else {\n    // Otherwise reset hydration state in case we aborted and resumed another\n    // root.\n    reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n    resetHydrationState();\n  }\n  return workInProgress.child;\n}\nfunction updateHostComponent(current, workInProgress, renderLanes) {\n  pushHostContext(workInProgress);\n  if (current === null) {\n    tryToClaimNextHydratableInstance(workInProgress);\n  }\n  var type = workInProgress.type;\n  var nextProps = workInProgress.pendingProps;\n  var prevProps = current !== null ? current.memoizedProps : null;\n  var nextChildren = nextProps.children;\n  var isDirectTextChild = shouldSetTextContent(type, nextProps);\n  if (isDirectTextChild) {\n    // We special case a direct text child of a host node. This is a common\n    // case. We won't handle it as a reified child. We will instead handle\n    // this in the host environment that also has access to this prop. That\n    // avoids allocating another HostText fiber and traversing it.\n    nextChildren = null;\n  } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {\n    // If we're switching from a direct text child to a normal child, or to\n    // empty, we need to schedule the text content to be reset.\n    workInProgress.flags |= ContentReset;\n  }\n  markRef(current, workInProgress);\n  reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction updateHostText(current, workInProgress) {\n  if (current === null) {\n    tryToClaimNextHydratableInstance(workInProgress);\n  } // Nothing to do here. This is terminal. We'll do the completion step\n  // immediately after.\n  return null;\n}\nfunction mountLazyComponent(_current, workInProgress, elementType, updateLanes, renderLanes) {\n  if (_current !== null) {\n    // A lazy component only mounts if it suspended inside a non-\n    // concurrent tree, in an inconsistent state. We want to treat it like\n    // a new mount, even though an empty version of it already committed.\n    // Disconnect the alternate pointers.\n    _current.alternate = null;\n    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n    workInProgress.flags |= Placement;\n  }\n  var props = workInProgress.pendingProps;\n  var lazyComponent = elementType;\n  var payload = lazyComponent._payload;\n  var init = lazyComponent._init;\n  var Component = init(payload); // Store the unwrapped component in the type.\n  workInProgress.type = Component;\n  var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);\n  var resolvedProps = resolveDefaultProps(Component, props);\n  var child;\n  switch (resolvedTag) {\n    case FunctionComponent:\n      {\n        {\n          validateFunctionComponentInDev(workInProgress, Component);\n          workInProgress.type = Component = resolveFunctionForHotReloading(Component);\n        }\n        child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes);\n        return child;\n      }\n    case ClassComponent:\n      {\n        {\n          workInProgress.type = Component = resolveClassForHotReloading(Component);\n        }\n        child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes);\n        return child;\n      }\n    case ForwardRef:\n      {\n        {\n          workInProgress.type = Component = resolveForwardRefForHotReloading(Component);\n        }\n        child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes);\n        return child;\n      }\n    case MemoComponent:\n      {\n        {\n          if (workInProgress.type !== workInProgress.elementType) {\n            var outerPropTypes = Component.propTypes;\n            if (outerPropTypes) {\n              checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only\n              'prop', getComponentName(Component));\n            }\n          }\n        }\n        child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too\n        updateLanes, renderLanes);\n        return child;\n      }\n  }\n  var hint = '';\n  {\n    if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {\n      hint = ' Did you wrap a component in React.lazy() more than once?';\n    }\n  } // This message intentionally doesn't mention ForwardRef or MemoComponent\n  // because the fact that it's a separate type of work is an\n  // implementation detail.\n  {\n    {\n      throw Error( \\\\\"Element type is invalid. Received a promise that resolves to: \\\\\" + Component + \\\\\". Lazy element type must resolve to a class or function.\\\\\" + hint );\n    }\n  }\n}\nfunction mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) {\n  if (_current !== null) {\n    // An incomplete component only mounts if it suspended inside a non-\n    // concurrent tree, in an inconsistent state. We want to treat it like\n    // a new mount, even though an empty version of it already committed.\n    // Disconnect the alternate pointers.\n    _current.alternate = null;\n    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n    workInProgress.flags |= Placement;\n  } // Promote the fiber to a class and try rendering again.\n  workInProgress.tag = ClassComponent; // The rest of this function is a fork of \\`updateClassComponent\\`\n  // Push context providers early to prevent context stack mismatches.\n  // During mounting we don't know the child context yet as the instance doesn't exist.\n  // We will invalidate the child context in finishClassComponent() right after rendering.\n  var hasContext;\n  if (isContextProvider(Component)) {\n    hasContext = true;\n    pushContextProvider(workInProgress);\n  } else {\n    hasContext = false;\n  }\n  prepareToReadContext(workInProgress, renderLanes);\n  constructClassInstance(workInProgress, Component, nextProps);\n  mountClassInstance(workInProgress, Component, nextProps, renderLanes);\n  return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);\n}\nfunction mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {\n  if (_current !== null) {\n    // An indeterminate component only mounts if it suspended inside a non-\n    // concurrent tree, in an inconsistent state. We want to treat it like\n    // a new mount, even though an empty version of it already committed.\n    // Disconnect the alternate pointers.\n    _current.alternate = null;\n    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n    workInProgress.flags |= Placement;\n  }\n  var props = workInProgress.pendingProps;\n  var context;\n  {\n    var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);\n    context = getMaskedContext(workInProgress, unmaskedContext);\n  }\n  prepareToReadContext(workInProgress, renderLanes);\n  var value;\n  {\n    if (Component.prototype && typeof Component.prototype.render === 'function') {\n      var componentName = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutBadClass[componentName]) {\n        error(\\\\\"The <%s /> component appears to have a render method, but doesn't extend React.Component. \\\\\" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n        didWarnAboutBadClass[componentName] = true;\n      }\n    }\n    if (workInProgress.mode & StrictMode) {\n      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);\n    }\n    setIsRendering(true);\n    ReactCurrentOwner$1.current = workInProgress;\n    value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);\n    setIsRendering(false);\n  } // React DevTools reads this flag.\n  workInProgress.flags |= PerformedWork;\n  {\n    // Support for module components is deprecated and is removed behind a flag.\n    // Whether or not it would crash later, we want to show a good message in DEV first.\n    if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n      var _componentName = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutModulePatternComponent[_componentName]) {\n        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \\\\\"If you can't use a class try assigning the prototype on the function as a workaround. \\\\\" + \\\\\"\\`%s.prototype = React.Component.prototype\\`. Don't use an arrow function since it \\\\\" + 'cannot be called with \\`new\\` by React.', _componentName, _componentName, _componentName);\n        didWarnAboutModulePatternComponent[_componentName] = true;\n      }\n    }\n  }\n  if ( // Run these checks in production only if the flag is off.\n  // Eventually we'll delete this branch altogether.\n   typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n    {\n      var _componentName2 = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutModulePatternComponent[_componentName2]) {\n        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \\\\\"If you can't use a class try assigning the prototype on the function as a workaround. \\\\\" + \\\\\"\\`%s.prototype = React.Component.prototype\\`. Don't use an arrow function since it \\\\\" + 'cannot be called with \\`new\\` by React.', _componentName2, _componentName2, _componentName2);\n        didWarnAboutModulePatternComponent[_componentName2] = true;\n      }\n    } // Proceed under the assumption that this is a class instance\n    workInProgress.tag = ClassComponent; // Throw out any hooks that were used.\n    workInProgress.memoizedState = null;\n    workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.\n    // During mounting we don't know the child context yet as the instance doesn't exist.\n    // We will invalidate the child context in finishClassComponent() right after rendering.\n    var hasContext = false;\n    if (isContextProvider(Component)) {\n      hasContext = true;\n      pushContextProvider(workInProgress);\n    } else {\n      hasContext = false;\n    }\n    workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;\n    initializeUpdateQueue(workInProgress);\n    var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n    if (typeof getDerivedStateFromProps === 'function') {\n      applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);\n    }\n    adoptClassInstance(workInProgress, value);\n    mountClassInstance(workInProgress, Component, props, renderLanes);\n    return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);\n  } else {\n    // Proceed under the assumption that this is a function component\n    workInProgress.tag = FunctionComponent;\n    {\n      if ( workInProgress.mode & StrictMode) {\n        disableLogs();\n        try {\n          value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);\n        } finally {\n          reenableLogs();\n        }\n      }\n    }\n    reconcileChildren(null, workInProgress, value, renderLanes);\n    {\n      validateFunctionComponentInDev(workInProgress, Component);\n    }\n    return workInProgress.child;\n  }\n}\nfunction validateFunctionComponentInDev(workInProgress, Component) {\n  {\n    if (Component) {\n      if (Component.childContextTypes) {\n        error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');\n      }\n    }\n    if (workInProgress.ref !== null) {\n      var info = '';\n      var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n      if (ownerName) {\n        info += 'Check the render method of \\`' + ownerName + '\\`.';\n      }\n      var warningKey = ownerName || workInProgress._debugID || '';\n      var debugSource = workInProgress._debugSource;\n      if (debugSource) {\n        warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n      }\n      if (!didWarnAboutFunctionRefs[warningKey]) {\n        didWarnAboutFunctionRefs[warningKey] = true;\n        error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);\n      }\n    }\n    if (typeof Component.getDerivedStateFromProps === 'function') {\n      var _componentName3 = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {\n        error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);\n        didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;\n      }\n    }\n    if (typeof Component.contextType === 'object' && Component.contextType !== null) {\n      var _componentName4 = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {\n        error('%s: Function components do not support contextType.', _componentName4);\n        didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;\n      }\n    }\n  }\n}\nvar SUSPENDED_MARKER = {\n  dehydrated: null,\n  retryLane: NoLane\n};\nfunction mountSuspenseOffscreenState(renderLanes) {\n  return {\n    baseLanes: renderLanes\n  };\n}\nfunction updateSuspenseOffscreenState(prevOffscreenState, renderLanes) {\n  return {\n    baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes)\n  };\n} // TODO: Probably should inline this back\nfunction shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) {\n  // If we're already showing a fallback, there are cases where we need to\n  // remain on that fallback regardless of whether the content has resolved.\n  // For example, SuspenseList coordinates when nested content appears.\n  if (current !== null) {\n    var suspenseState = current.memoizedState;\n    if (suspenseState === null) {\n      // Currently showing content. Don't hide it, even if ForceSuspenseFallack\n      // is true. More precise name might be \\\\\"ForceRemainSuspenseFallback\\\\\".\n      // Note: This is a factoring smell. Can't remain on a fallback if there's\n      // no fallback to remain on.\n      return false;\n    }\n  } // Not currently showing content. Consult the Suspense context.\n  return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n}\nfunction getRemainingWorkInPrimaryTree(current, renderLanes) {\n  // TODO: Should not remove render lanes that were pinged during this render\n  return removeLanes(current.childLanes, renderLanes);\n}\nfunction updateSuspenseComponent(current, workInProgress, renderLanes) {\n  var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.\n  {\n    if (shouldSuspend(workInProgress)) {\n      workInProgress.flags |= DidCapture;\n    }\n  }\n  var suspenseContext = suspenseStackCursor.current;\n  var showFallback = false;\n  var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags;\n  if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {\n    // Something in this boundary's subtree already suspended. Switch to\n    // rendering the fallback children.\n    showFallback = true;\n    workInProgress.flags &= ~DidCapture;\n  } else {\n    // Attempting the main content\n    if (current === null || current.memoizedState !== null) {\n      // This is a new mount or this boundary is already showing a fallback state.\n      // Mark this subtree context as having at least one invisible parent that could\n      // handle the fallback state.\n      // Boundaries without fallbacks or should be avoided are not considered since\n      // they cannot handle preferred fallback states.\n      if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {\n        suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);\n      }\n    }\n  }\n  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n  pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense\n  // boundary's children. This involves some custom reconcilation logic. Two\n  // main reasons this is so complicated.\n  //\n  // First, Legacy Mode has different semantics for backwards compatibility. The\n  // primary tree will commit in an inconsistent state, so when we do the\n  // second pass to render the fallback, we do some exceedingly, uh, clever\n  // hacks to make that not totally break. Like transferring effects and\n  // deletions from hidden tree. In Concurrent Mode, it's much simpler,\n  // because we bailout on the primary tree completely and leave it in its old\n  // state, no effects. Same as what we do for Offscreen (except that\n  // Offscreen doesn't have the first render pass).\n  //\n  // Second is hydration. During hydration, the Suspense fiber has a slightly\n  // different layout, where the child points to a dehydrated fragment, which\n  // contains the DOM rendered by the server.\n  //\n  // Third, even if you set all that aside, Suspense is like error boundaries in\n  // that we first we try to render one tree, and if that fails, we render again\n  // and switch to a different tree. Like a try/catch block. So we have to track\n  // which branch we're currently rendering. Ideally we would model this using\n  // a stack.\n  if (current === null) {\n    // Initial mount\n    // If we're currently hydrating, try to hydrate this boundary.\n    // But only if this has a fallback.\n    if (nextProps.fallback !== undefined) {\n      tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.\n    }\n    var nextPrimaryChildren = nextProps.children;\n    var nextFallbackChildren = nextProps.fallback;\n    if (showFallback) {\n      var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);\n      var primaryChildFragment = workInProgress.child;\n      primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);\n      workInProgress.memoizedState = SUSPENDED_MARKER;\n      return fallbackFragment;\n    } else if (typeof nextProps.unstable_expectedLoadTime === 'number') {\n      // This is a CPU-bound tree. Skip this tree and show a placeholder to\n      // unblock the surrounding content. Then immediately retry after the\n      // initial commit.\n      var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);\n      var _primaryChildFragment = workInProgress.child;\n      _primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);\n      workInProgress.memoizedState = SUSPENDED_MARKER; // Since nothing actually suspended, there will nothing to ping this to\n      // get it started back up to attempt the next item. While in terms of\n      // priority this work has the same priority as this current render, it's\n      // not part of the same transition once the transition has committed. If\n      // it's sync, we still want to yield so that it can be painted.\n      // Conceptually, this is really the same as pinging. We can use any\n      // RetryLane even if it's the one currently rendering since we're leaving\n      // it behind on this node.\n      workInProgress.lanes = SomeRetryLane;\n      {\n        markSpawnedWork(SomeRetryLane);\n      }\n      return _fallbackFragment;\n    } else {\n      return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren, renderLanes);\n    }\n  } else {\n    // This is an update.\n    // If the current fiber has a SuspenseState, that means it's already showing\n    // a fallback.\n    var prevState = current.memoizedState;\n    if (prevState !== null) {\n      if (showFallback) {\n        var _nextFallbackChildren2 = nextProps.fallback;\n        var _nextPrimaryChildren2 = nextProps.children;\n        var _fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes);\n        var _primaryChildFragment3 = workInProgress.child;\n        var prevOffscreenState = current.child.memoizedState;\n        _primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes);\n        _primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes);\n        workInProgress.memoizedState = SUSPENDED_MARKER;\n        return _fallbackChildFragment;\n      } else {\n        var _nextPrimaryChildren3 = nextProps.children;\n        var _primaryChildFragment4 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren3, renderLanes);\n        workInProgress.memoizedState = null;\n        return _primaryChildFragment4;\n      }\n    } else {\n      // The current tree is not already showing a fallback.\n      if (showFallback) {\n        // Timed out.\n        var _nextFallbackChildren3 = nextProps.fallback;\n        var _nextPrimaryChildren4 = nextProps.children;\n        var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes);\n        var _primaryChildFragment5 = workInProgress.child;\n        var _prevOffscreenState = current.child.memoizedState;\n        _primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes);\n        _primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); // Skip the primary children, and continue working on the\n        // fallback children.\n        workInProgress.memoizedState = SUSPENDED_MARKER;\n        return _fallbackChildFragment2;\n      } else {\n        // Still haven't timed out. Continue rendering the children, like we\n        // normally do.\n        var _nextPrimaryChildren5 = nextProps.children;\n        var _primaryChildFragment6 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren5, renderLanes);\n        workInProgress.memoizedState = null;\n        return _primaryChildFragment6;\n      }\n    }\n  }\n}\nfunction mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) {\n  var mode = workInProgress.mode;\n  var primaryChildProps = {\n    mode: 'visible',\n    children: primaryChildren\n  };\n  var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes, null);\n  primaryChildFragment.return = workInProgress;\n  workInProgress.child = primaryChildFragment;\n  return primaryChildFragment;\n}\nfunction mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n  var mode = workInProgress.mode;\n  var progressedPrimaryFragment = workInProgress.child;\n  var primaryChildProps = {\n    mode: 'hidden',\n    children: primaryChildren\n  };\n  var primaryChildFragment;\n  var fallbackChildFragment;\n  if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {\n    // In legacy mode, we commit the primary tree as if it successfully\n    // completed, even though it's in an inconsistent state.\n    primaryChildFragment = progressedPrimaryFragment;\n    primaryChildFragment.childLanes = NoLanes;\n    primaryChildFragment.pendingProps = primaryChildProps;\n    if ( workInProgress.mode & ProfileMode) {\n      // Reset the durations from the first pass so they aren't included in the\n      // final amounts. This seems counterintuitive, since we're intentionally\n      // not measuring part of the render phase, but this makes it match what we\n      // do in Concurrent Mode.\n      primaryChildFragment.actualDuration = 0;\n      primaryChildFragment.actualStartTime = -1;\n      primaryChildFragment.selfBaseDuration = 0;\n      primaryChildFragment.treeBaseDuration = 0;\n    }\n    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);\n  } else {\n    primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);\n    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);\n  }\n  primaryChildFragment.return = workInProgress;\n  fallbackChildFragment.return = workInProgress;\n  primaryChildFragment.sibling = fallbackChildFragment;\n  workInProgress.child = primaryChildFragment;\n  return fallbackChildFragment;\n}\nfunction createWorkInProgressOffscreenFiber(current, offscreenProps) {\n  // The props argument to \\`createWorkInProgress\\` is \\`any\\` typed, so we use this\n  // wrapper function to constrain it.\n  return createWorkInProgress(current, offscreenProps);\n}\nfunction updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) {\n  var currentPrimaryChildFragment = current.child;\n  var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n  var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {\n    mode: 'visible',\n    children: primaryChildren\n  });\n  if ((workInProgress.mode & BlockingMode) === NoMode) {\n    primaryChildFragment.lanes = renderLanes;\n  }\n  primaryChildFragment.return = workInProgress;\n  primaryChildFragment.sibling = null;\n  if (currentFallbackChildFragment !== null) {\n    // Delete the fallback child fragment\n    currentFallbackChildFragment.nextEffect = null;\n    currentFallbackChildFragment.flags = Deletion;\n    workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChildFragment;\n  }\n  workInProgress.child = primaryChildFragment;\n  return primaryChildFragment;\n}\nfunction updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n  var mode = workInProgress.mode;\n  var currentPrimaryChildFragment = current.child;\n  var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n  var primaryChildProps = {\n    mode: 'hidden',\n    children: primaryChildren\n  };\n  var primaryChildFragment;\n  if ( // In legacy mode, we commit the primary tree as if it successfully\n  // completed, even though it's in an inconsistent state.\n  (mode & BlockingMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was\n  // already cloned. In legacy mode, the only case where this isn't true is\n  // when DevTools forces us to display a fallback; we skip the first render\n  // pass entirely and go straight to rendering the fallback. (In Concurrent\n  // Mode, SuspenseList can also trigger this scenario, but this is a legacy-\n  // only codepath.)\n  workInProgress.child !== currentPrimaryChildFragment) {\n    var progressedPrimaryFragment = workInProgress.child;\n    primaryChildFragment = progressedPrimaryFragment;\n    primaryChildFragment.childLanes = NoLanes;\n    primaryChildFragment.pendingProps = primaryChildProps;\n    if ( workInProgress.mode & ProfileMode) {\n      // Reset the durations from the first pass so they aren't included in the\n      // final amounts. This seems counterintuitive, since we're intentionally\n      // not measuring part of the render phase, but this makes it match what we\n      // do in Concurrent Mode.\n      primaryChildFragment.actualDuration = 0;\n      primaryChildFragment.actualStartTime = -1;\n      primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;\n      primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;\n    } // The fallback fiber was added as a deletion effect during the first pass.\n    // However, since we're going to remain on the fallback, we no longer want\n    // to delete it. So we need to remove it from the list. Deletions are stored\n    // on the same list as effects. We want to keep the effects from the primary\n    // tree. So we copy the primary child fragment's effect list, which does not\n    // include the fallback deletion effect.\n    var progressedLastEffect = primaryChildFragment.lastEffect;\n    if (progressedLastEffect !== null) {\n      workInProgress.firstEffect = primaryChildFragment.firstEffect;\n      workInProgress.lastEffect = progressedLastEffect;\n      progressedLastEffect.nextEffect = null;\n    } else {\n      // TODO: Reset this somewhere else? Lol legacy mode is so weird.\n      workInProgress.firstEffect = workInProgress.lastEffect = null;\n    }\n  } else {\n    primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);\n  }\n  var fallbackChildFragment;\n  if (currentFallbackChildFragment !== null) {\n    fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);\n  } else {\n    fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already\n    // mounted but this is a new fiber.\n    fallbackChildFragment.flags |= Placement;\n  }\n  fallbackChildFragment.return = workInProgress;\n  primaryChildFragment.return = workInProgress;\n  primaryChildFragment.sibling = fallbackChildFragment;\n  workInProgress.child = primaryChildFragment;\n  return fallbackChildFragment;\n}\nfunction scheduleWorkOnFiber(fiber, renderLanes) {\n  fiber.lanes = mergeLanes(fiber.lanes, renderLanes);\n  var alternate = fiber.alternate;\n  if (alternate !== null) {\n    alternate.lanes = mergeLanes(alternate.lanes, renderLanes);\n  }\n  scheduleWorkOnParentPath(fiber.return, renderLanes);\n}\nfunction propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) {\n  // Mark any Suspense boundaries with fallbacks as having work to do.\n  // If they were previously forced into fallbacks, they may now be able\n  // to unblock.\n  var node = firstChild;\n  while (node !== null) {\n    if (node.tag === SuspenseComponent) {\n      var state = node.memoizedState;\n      if (state !== null) {\n        scheduleWorkOnFiber(node, renderLanes);\n      }\n    } else if (node.tag === SuspenseListComponent) {\n      // If the tail is hidden there might not be an Suspense boundaries\n      // to schedule work on. In this case we have to schedule it on the\n      // list itself.\n      // We don't have to traverse to the children of the list since\n      // the list will propagate the change when it rerenders.\n      scheduleWorkOnFiber(node, renderLanes);\n    } else if (node.child !== null) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === workInProgress) {\n      return;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === workInProgress) {\n        return;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n}\nfunction findLastContentRow(firstChild) {\n  // This is going to find the last row among these children that is already\n  // showing content on the screen, as opposed to being in fallback state or\n  // new. If a row has multiple Suspense boundaries, any of them being in the\n  // fallback state, counts as the whole row being in a fallback state.\n  // Note that the \\\\\"rows\\\\\" will be workInProgress, but any nested children\n  // will still be current since we haven't rendered them yet. The mounted\n  // order may not be the same as the new order. We use the new order.\n  var row = firstChild;\n  var lastContentRow = null;\n  while (row !== null) {\n    var currentRow = row.alternate; // New rows can't be content rows.\n    if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n      lastContentRow = row;\n    }\n    row = row.sibling;\n  }\n  return lastContentRow;\n}\nfunction validateRevealOrder(revealOrder) {\n  {\n    if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {\n      didWarnAboutRevealOrder[revealOrder] = true;\n      if (typeof revealOrder === 'string') {\n        switch (revealOrder.toLowerCase()) {\n          case 'together':\n          case 'forwards':\n          case 'backwards':\n            {\n              error('\\\\\"%s\\\\\" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase \\\\\"%s\\\\\" instead.', revealOrder, revealOrder.toLowerCase());\n              break;\n            }\n          case 'forward':\n          case 'backward':\n            {\n              error('\\\\\"%s\\\\\" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use \\\\\"%ss\\\\\" instead.', revealOrder, revealOrder.toLowerCase());\n              break;\n            }\n          default:\n            error('\\\\\"%s\\\\\" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean \\\\\"together\\\\\", \\\\\"forwards\\\\\" or \\\\\"backwards\\\\\"?', revealOrder);\n            break;\n        }\n      } else {\n        error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean \\\\\"together\\\\\", \\\\\"forwards\\\\\" or \\\\\"backwards\\\\\"?', revealOrder);\n      }\n    }\n  }\n}\nfunction validateTailOptions(tailMode, revealOrder) {\n  {\n    if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {\n      if (tailMode !== 'collapsed' && tailMode !== 'hidden') {\n        didWarnAboutTailOptions[tailMode] = true;\n        error('\\\\\"%s\\\\\" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean \\\\\"collapsed\\\\\" or \\\\\"hidden\\\\\"?', tailMode);\n      } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {\n        didWarnAboutTailOptions[tailMode] = true;\n        error('<SuspenseList tail=\\\\\"%s\\\\\" /> is only valid if revealOrder is ' + '\\\\\"forwards\\\\\" or \\\\\"backwards\\\\\". ' + 'Did you mean to specify revealOrder=\\\\\"forwards\\\\\"?', tailMode);\n      }\n    }\n  }\n}\nfunction validateSuspenseListNestedChild(childSlot, index) {\n  {\n    var isArray = Array.isArray(childSlot);\n    var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';\n    if (isArray || isIterable) {\n      var type = isArray ? 'array' : 'iterable';\n      error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);\n      return false;\n    }\n  }\n  return true;\n}\nfunction validateSuspenseListChildren(children, revealOrder) {\n  {\n    if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {\n      if (Array.isArray(children)) {\n        for (var i = 0; i < children.length; i++) {\n          if (!validateSuspenseListNestedChild(children[i], i)) {\n            return;\n          }\n        }\n      } else {\n        var iteratorFn = getIteratorFn(children);\n        if (typeof iteratorFn === 'function') {\n          var childrenIterator = iteratorFn.call(children);\n          if (childrenIterator) {\n            var step = childrenIterator.next();\n            var _i = 0;\n            for (; !step.done; step = childrenIterator.next()) {\n              if (!validateSuspenseListNestedChild(step.value, _i)) {\n                return;\n              }\n              _i++;\n            }\n          }\n        } else {\n          error('A single row was passed to a <SuspenseList revealOrder=\\\\\"%s\\\\\" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);\n        }\n      }\n    }\n  }\n}\nfunction initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {\n  var renderState = workInProgress.memoizedState;\n  if (renderState === null) {\n    workInProgress.memoizedState = {\n      isBackwards: isBackwards,\n      rendering: null,\n      renderingStartTime: 0,\n      last: lastContentRow,\n      tail: tail,\n      tailMode: tailMode,\n      lastEffect: lastEffectBeforeRendering\n    };\n  } else {\n    // We can reuse the existing object from previous renders.\n    renderState.isBackwards = isBackwards;\n    renderState.rendering = null;\n    renderState.renderingStartTime = 0;\n    renderState.last = lastContentRow;\n    renderState.tail = tail;\n    renderState.tailMode = tailMode;\n    renderState.lastEffect = lastEffectBeforeRendering;\n  }\n} // This can end up rendering this component multiple passes.\n// The first pass splits the children fibers into two sets. A head and tail.\n// We first render the head. If anything is in fallback state, we do another\n// pass through beginWork to rerender all children (including the tail) with\n// the force suspend context. If the first render didn't have anything in\n// in fallback state. Then we render each row in the tail one-by-one.\n// That happens in the completeWork phase without going back to beginWork.\nfunction updateSuspenseListComponent(current, workInProgress, renderLanes) {\n  var nextProps = workInProgress.pendingProps;\n  var revealOrder = nextProps.revealOrder;\n  var tailMode = nextProps.tail;\n  var newChildren = nextProps.children;\n  validateRevealOrder(revealOrder);\n  validateTailOptions(tailMode, revealOrder);\n  validateSuspenseListChildren(newChildren, revealOrder);\n  reconcileChildren(current, workInProgress, newChildren, renderLanes);\n  var suspenseContext = suspenseStackCursor.current;\n  var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n  if (shouldForceFallback) {\n    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n    workInProgress.flags |= DidCapture;\n  } else {\n    var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags;\n    if (didSuspendBefore) {\n      // If we previously forced a fallback, we need to schedule work\n      // on any nested boundaries to let them know to try to render\n      // again. This is the same as context updating.\n      propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes);\n    }\n    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n  }\n  pushSuspenseContext(workInProgress, suspenseContext);\n  if ((workInProgress.mode & BlockingMode) === NoMode) {\n    // In legacy mode, SuspenseList doesn't work so we just\n    // use make it a noop by treating it as the default revealOrder.\n    workInProgress.memoizedState = null;\n  } else {\n    switch (revealOrder) {\n      case 'forwards':\n        {\n          var lastContentRow = findLastContentRow(workInProgress.child);\n          var tail;\n          if (lastContentRow === null) {\n            // The whole list is part of the tail.\n            // TODO: We could fast path by just rendering the tail now.\n            tail = workInProgress.child;\n            workInProgress.child = null;\n          } else {\n            // Disconnect the tail rows after the content row.\n            // We're going to render them separately later.\n            tail = lastContentRow.sibling;\n            lastContentRow.sibling = null;\n          }\n          initSuspenseListRenderState(workInProgress, false, // isBackwards\n          tail, lastContentRow, tailMode, workInProgress.lastEffect);\n          break;\n        }\n      case 'backwards':\n        {\n          // We're going to find the first row that has existing content.\n          // At the same time we're going to reverse the list of everything\n          // we pass in the meantime. That's going to be our tail in reverse\n          // order.\n          var _tail = null;\n          var row = workInProgress.child;\n          workInProgress.child = null;\n          while (row !== null) {\n            var currentRow = row.alternate; // New rows can't be content rows.\n            if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n              // This is the beginning of the main content.\n              workInProgress.child = row;\n              break;\n            }\n            var nextRow = row.sibling;\n            row.sibling = _tail;\n            _tail = row;\n            row = nextRow;\n          } // TODO: If workInProgress.child is null, we can continue on the tail immediately.\n          initSuspenseListRenderState(workInProgress, true, // isBackwards\n          _tail, null, // last\n          tailMode, workInProgress.lastEffect);\n          break;\n        }\n      case 'together':\n        {\n          initSuspenseListRenderState(workInProgress, false, // isBackwards\n          null, // tail\n          null, // last\n          undefined, workInProgress.lastEffect);\n          break;\n        }\n      default:\n        {\n          // The default reveal order is the same as not having\n          // a boundary.\n          workInProgress.memoizedState = null;\n        }\n    }\n  }\n  return workInProgress.child;\n}\nfunction updatePortalComponent(current, workInProgress, renderLanes) {\n  pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n  var nextChildren = workInProgress.pendingProps;\n  if (current === null) {\n    // Portals are special because we don't append the children during mount\n    // but at commit. Therefore we need to track insertions which the normal\n    // flow doesn't do during mount. This doesn't happen at the root because\n    // the root always starts with a \\\\\"current\\\\\" with a null child.\n    // TODO: Consider unifying this with how the root works.\n    workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);\n  } else {\n    reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n  }\n  return workInProgress.child;\n}\nvar hasWarnedAboutUsingNoValuePropOnContextProvider = false;\nfunction updateContextProvider(current, workInProgress, renderLanes) {\n  var providerType = workInProgress.type;\n  var context = providerType._context;\n  var newProps = workInProgress.pendingProps;\n  var oldProps = workInProgress.memoizedProps;\n  var newValue = newProps.value;\n  {\n    if (!('value' in newProps)) {\n      if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {\n        hasWarnedAboutUsingNoValuePropOnContextProvider = true;\n        error('The \\`value\\` prop is required for the \\`<Context.Provider>\\`. Did you misspell it or forget to pass it?');\n      }\n    }\n    var providerPropTypes = workInProgress.type.propTypes;\n    if (providerPropTypes) {\n      checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider');\n    }\n  }\n  pushProvider(workInProgress, newValue);\n  if (oldProps !== null) {\n    var oldValue = oldProps.value;\n    var changedBits = calculateChangedBits(context, newValue, oldValue);\n    if (changedBits === 0) {\n      // No change. Bailout early if children are the same.\n      if (oldProps.children === newProps.children && !hasContextChanged()) {\n        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n      }\n    } else {\n      // The context value changed. Search for matching consumers and schedule\n      // them to update.\n      propagateContextChange(workInProgress, context, changedBits, renderLanes);\n    }\n  }\n  var newChildren = newProps.children;\n  reconcileChildren(current, workInProgress, newChildren, renderLanes);\n  return workInProgress.child;\n}\nvar hasWarnedAboutUsingContextAsConsumer = false;\nfunction updateContextConsumer(current, workInProgress, renderLanes) {\n  var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In\n  // DEV mode, we create a separate object for Context.Consumer that acts\n  // like a proxy to Context. This proxy object adds unnecessary code in PROD\n  // so we use the old behaviour (Context.Consumer references Context) to\n  // reduce size and overhead. The separate object references context via\n  // a property called \\\\\"_context\\\\\", which also gives us the ability to check\n  // in DEV mode if this property exists or not and warn if it does not.\n  {\n    if (context._context === undefined) {\n      // This may be because it's a Context (rather than a Consumer).\n      // Or it may be because it's older React where they're the same thing.\n      // We only want to warn if we're sure it's a new React.\n      if (context !== context.Consumer) {\n        if (!hasWarnedAboutUsingContextAsConsumer) {\n          hasWarnedAboutUsingContextAsConsumer = true;\n          error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n        }\n      }\n    } else {\n      context = context._context;\n    }\n  }\n  var newProps = workInProgress.pendingProps;\n  var render = newProps.children;\n  {\n    if (typeof render !== 'function') {\n      error('A context consumer was rendered with multiple children, or a child ' + \\\\\"that isn't a function. A context consumer expects a single child \\\\\" + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');\n    }\n  }\n  prepareToReadContext(workInProgress, renderLanes);\n  var newValue = readContext(context, newProps.unstable_observedBits);\n  var newChildren;\n  {\n    ReactCurrentOwner$1.current = workInProgress;\n    setIsRendering(true);\n    newChildren = render(newValue);\n    setIsRendering(false);\n  } // React DevTools reads this flag.\n  workInProgress.flags |= PerformedWork;\n  reconcileChildren(current, workInProgress, newChildren, renderLanes);\n  return workInProgress.child;\n}\nfunction markWorkInProgressReceivedUpdate() {\n  didReceiveUpdate = true;\n}\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {\n  if (current !== null) {\n    // Reuse previous dependencies\n    workInProgress.dependencies = current.dependencies;\n  }\n  {\n    // Don't update \\\\\"base\\\\\" render times for bailouts.\n    stopProfilerTimerIfRunning();\n  }\n  markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work.\n  if (!includesSomeLane(renderLanes, workInProgress.childLanes)) {\n    // The children don't have any work either. We can skip them.\n    // TODO: Once we add back resuming, we should check if the children are\n    // a work-in-progress set. If so, we need to transfer their effects.\n    return null;\n  } else {\n    // This fiber doesn't have work, but its subtree does. Clone the child\n    // fibers and continue.\n    cloneChildFibers(current, workInProgress);\n    return workInProgress.child;\n  }\n}\nfunction remountFiber(current, oldWorkInProgress, newWorkInProgress) {\n  {\n    var returnFiber = oldWorkInProgress.return;\n    if (returnFiber === null) {\n      throw new Error('Cannot swap the root fiber.');\n    } // Disconnect from the old current.\n    // It will get deleted.\n    current.alternate = null;\n    oldWorkInProgress.alternate = null; // Connect to the new tree.\n    newWorkInProgress.index = oldWorkInProgress.index;\n    newWorkInProgress.sibling = oldWorkInProgress.sibling;\n    newWorkInProgress.return = oldWorkInProgress.return;\n    newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.\n    if (oldWorkInProgress === returnFiber.child) {\n      returnFiber.child = newWorkInProgress;\n    } else {\n      var prevSibling = returnFiber.child;\n      if (prevSibling === null) {\n        throw new Error('Expected parent to have a child.');\n      }\n      while (prevSibling.sibling !== oldWorkInProgress) {\n        prevSibling = prevSibling.sibling;\n        if (prevSibling === null) {\n          throw new Error('Expected to find the previous sibling.');\n        }\n      }\n      prevSibling.sibling = newWorkInProgress;\n    } // Delete the old fiber and place the new one.\n    // Since the old fiber is disconnected, we have to schedule it manually.\n    var last = returnFiber.lastEffect;\n    if (last !== null) {\n      last.nextEffect = current;\n      returnFiber.lastEffect = current;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = current;\n    }\n    current.nextEffect = null;\n    current.flags = Deletion;\n    newWorkInProgress.flags |= Placement; // Restart work from the new fiber.\n    return newWorkInProgress;\n  }\n}\nfunction beginWork(current, workInProgress, renderLanes) {\n  var updateLanes = workInProgress.lanes;\n  {\n    if (workInProgress._debugNeedsRemount && current !== null) {\n      // This will restart the begin phase with a new fiber.\n      return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes));\n    }\n  }\n  if (current !== null) {\n    var oldProps = current.memoizedProps;\n    var newProps = workInProgress.pendingProps;\n    if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:\n     workInProgress.type !== current.type )) {\n      // If props or context changed, mark the fiber as having performed work.\n      // This may be unset if the props are determined to be equal later (memo).\n      didReceiveUpdate = true;\n    } else if (!includesSomeLane(renderLanes, updateLanes)) {\n      didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering\n      // the begin phase. There's still some bookkeeping we that needs to be done\n      // in this optimized path, mostly pushing stuff onto the stack.\n      switch (workInProgress.tag) {\n        case HostRoot:\n          pushHostRootContext(workInProgress);\n          resetHydrationState();\n          break;\n        case HostComponent:\n          pushHostContext(workInProgress);\n          break;\n        case ClassComponent:\n          {\n            var Component = workInProgress.type;\n            if (isContextProvider(Component)) {\n              pushContextProvider(workInProgress);\n            }\n            break;\n          }\n        case HostPortal:\n          pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n          break;\n        case ContextProvider:\n          {\n            var newValue = workInProgress.memoizedProps.value;\n            pushProvider(workInProgress, newValue);\n            break;\n          }\n        case Profiler:\n          {\n            // Profiler should only call onRender when one of its descendants actually rendered.\n            var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);\n            if (hasChildWork) {\n              workInProgress.flags |= Update;\n            } // Reset effect durations for the next eventual effect phase.\n            // These are reset during render to allow the DevTools commit hook a chance to read them,\n            var stateNode = workInProgress.stateNode;\n            stateNode.effectDuration = 0;\n            stateNode.passiveEffectDuration = 0;\n          }\n          break;\n        case SuspenseComponent:\n          {\n            var state = workInProgress.memoizedState;\n            if (state !== null) {\n              // whether to retry the primary children, or to skip over it and\n              // go straight to the fallback. Check the priority of the primary\n              // child fragment.\n              var primaryChildFragment = workInProgress.child;\n              var primaryChildLanes = primaryChildFragment.childLanes;\n              if (includesSomeLane(renderLanes, primaryChildLanes)) {\n                // The primary children have pending work. Use the normal path\n                // to attempt to render the primary children again.\n                return updateSuspenseComponent(current, workInProgress, renderLanes);\n              } else {\n                // The primary child fragment does not have pending work marked\n                // on it\n                pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient\n                // priority. Bailout.\n                var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n                if (child !== null) {\n                  // The fallback children have pending work. Skip over the\n                  // primary children and work on the fallback.\n                  return child.sibling;\n                } else {\n                  return null;\n                }\n              }\n            } else {\n              pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));\n            }\n            break;\n          }\n        case SuspenseListComponent:\n          {\n            var didSuspendBefore = (current.flags & DidCapture) !== NoFlags;\n            var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);\n            if (didSuspendBefore) {\n              if (_hasChildWork) {\n                // If something was in fallback state last time, and we have all the\n                // same children then we're still in progressive loading state.\n                // Something might get unblocked by state updates or retries in the\n                // tree which will affect the tail. So we need to use the normal\n                // path to compute the correct tail.\n                return updateSuspenseListComponent(current, workInProgress, renderLanes);\n              } // If none of the children had any work, that means that none of\n              // them got retried so they'll still be blocked in the same way\n              // as before. We can fast bail out.\n              workInProgress.flags |= DidCapture;\n            } // If nothing suspended before and we're rendering the same children,\n            // then the tail doesn't matter. Anything new that suspends will work\n            // in the \\\\\"together\\\\\" mode, so we can continue from the state we had.\n            var renderState = workInProgress.memoizedState;\n            if (renderState !== null) {\n              // Reset to the \\\\\"together\\\\\" mode in case we've started a different\n              // update in the past but didn't complete it.\n              renderState.rendering = null;\n              renderState.tail = null;\n              renderState.lastEffect = null;\n            }\n            pushSuspenseContext(workInProgress, suspenseStackCursor.current);\n            if (_hasChildWork) {\n              break;\n            } else {\n              // If none of the children had any work, that means that none of\n              // them got retried so they'll still be blocked in the same way\n              // as before. We can fast bail out.\n              return null;\n            }\n          }\n        case OffscreenComponent:\n        case LegacyHiddenComponent:\n          {\n            // Need to check if the tree still needs to be deferred. This is\n            // almost identical to the logic used in the normal update path,\n            // so we'll just enter that. The only difference is we'll bail out\n            // at the next level instead of this one, because the child props\n            // have not changed. Which is fine.\n            // TODO: Probably should refactor \\`beginWork\\` to split the bailout\n            // path from the normal path. I'm tempted to do a labeled break here\n            // but I won't :)\n            workInProgress.lanes = NoLanes;\n            return updateOffscreenComponent(current, workInProgress, renderLanes);\n          }\n      }\n      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n    } else {\n      if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {\n        // This is a special case that only exists for legacy mode.\n        // See https://github.com/facebook/react/pull/19216.\n        didReceiveUpdate = true;\n      } else {\n        // An update was scheduled on this fiber, but there are no new props\n        // nor legacy context. Set this to false. If an update queue or context\n        // consumer produces a changed value, it will set this to true. Otherwise,\n        // the component will assume the children have not changed and bail out.\n        didReceiveUpdate = false;\n      }\n    }\n  } else {\n    didReceiveUpdate = false;\n  } // Before entering the begin phase, clear pending update priority.\n  // TODO: This assumes that we're about to evaluate the component and process\n  // the update queue. However, there's an exception: SimpleMemoComponent\n  // sometimes bails out later in the begin phase. This indicates that we should\n  // move this assignment out of the common path and into each branch.\n  workInProgress.lanes = NoLanes;\n  switch (workInProgress.tag) {\n    case IndeterminateComponent:\n      {\n        return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes);\n      }\n    case LazyComponent:\n      {\n        var elementType = workInProgress.elementType;\n        return mountLazyComponent(current, workInProgress, elementType, updateLanes, renderLanes);\n      }\n    case FunctionComponent:\n      {\n        var _Component = workInProgress.type;\n        var unresolvedProps = workInProgress.pendingProps;\n        var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);\n        return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderLanes);\n      }\n    case ClassComponent:\n      {\n        var _Component2 = workInProgress.type;\n        var _unresolvedProps = workInProgress.pendingProps;\n        var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);\n        return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderLanes);\n      }\n    case HostRoot:\n      return updateHostRoot(current, workInProgress, renderLanes);\n    case HostComponent:\n      return updateHostComponent(current, workInProgress, renderLanes);\n    case HostText:\n      return updateHostText(current, workInProgress);\n    case SuspenseComponent:\n      return updateSuspenseComponent(current, workInProgress, renderLanes);\n    case HostPortal:\n      return updatePortalComponent(current, workInProgress, renderLanes);\n    case ForwardRef:\n      {\n        var type = workInProgress.type;\n        var _unresolvedProps2 = workInProgress.pendingProps;\n        var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);\n        return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes);\n      }\n    case Fragment:\n      return updateFragment(current, workInProgress, renderLanes);\n    case Mode:\n      return updateMode(current, workInProgress, renderLanes);\n    case Profiler:\n      return updateProfiler(current, workInProgress, renderLanes);\n    case ContextProvider:\n      return updateContextProvider(current, workInProgress, renderLanes);\n    case ContextConsumer:\n      return updateContextConsumer(current, workInProgress, renderLanes);\n    case MemoComponent:\n      {\n        var _type2 = workInProgress.type;\n        var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.\n        var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);\n        {\n          if (workInProgress.type !== workInProgress.elementType) {\n            var outerPropTypes = _type2.propTypes;\n            if (outerPropTypes) {\n              checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only\n              'prop', getComponentName(_type2));\n            }\n          }\n        }\n        _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);\n        return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateLanes, renderLanes);\n      }\n    case SimpleMemoComponent:\n      {\n        return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateLanes, renderLanes);\n      }\n    case IncompleteClassComponent:\n      {\n        var _Component3 = workInProgress.type;\n        var _unresolvedProps4 = workInProgress.pendingProps;\n        var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);\n        return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderLanes);\n      }\n    case SuspenseListComponent:\n      {\n        return updateSuspenseListComponent(current, workInProgress, renderLanes);\n      }\n    case FundamentalComponent:\n      {\n        break;\n      }\n    case ScopeComponent:\n      {\n        break;\n      }\n    case Block:\n      {\n        break;\n      }\n    case OffscreenComponent:\n      {\n        return updateOffscreenComponent(current, workInProgress, renderLanes);\n      }\n    case LegacyHiddenComponent:\n      {\n        return updateLegacyHiddenComponent(current, workInProgress, renderLanes);\n      }\n  }\n  {\n    {\n      throw Error( \\\\\"Unknown unit of work tag (\\\\\" + workInProgress.tag + \\\\\"). This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction markUpdate(workInProgress) {\n  // Tag the fiber with an update effect. This turns a Placement into\n  // a PlacementAndUpdate.\n  workInProgress.flags |= Update;\n}\nfunction markRef$1(workInProgress) {\n  workInProgress.flags |= Ref;\n}\nvar appendAllChildren;\nvar updateHostContainer;\nvar updateHostComponent$1;\nvar updateHostText$1;\n{\n  // Mutation mode\n  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {\n    // We only have the top Fiber that was created but we need recurse down its\n    // children to find all the terminal nodes.\n    var node = workInProgress.child;\n    while (node !== null) {\n      if (node.tag === HostComponent || node.tag === HostText) {\n        appendInitialChild(parent, node.stateNode);\n      } else if (node.tag === HostPortal) ; else if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n      if (node === workInProgress) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node.return === null || node.return === workInProgress) {\n          return;\n        }\n        node = node.return;\n      }\n      node.sibling.return = node.return;\n      node = node.sibling;\n    }\n  };\n  updateHostContainer = function (workInProgress) {// Noop\n  };\n  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {\n    // If we have an alternate, that means this is an update and we need to\n    // schedule a side-effect to do the updates.\n    var oldProps = current.memoizedProps;\n    if (oldProps === newProps) {\n      // In mutation mode, this is sufficient for a bailout because\n      // we won't touch this node even if children changed.\n      return;\n    } // If we get updated because one of our children updated, we don't\n    // have newProps so we'll have to reuse them.\n    // TODO: Split the update API as separate for the props vs. children.\n    // Even better would be if children weren't special cased at all tho.\n    var instance = workInProgress.stateNode;\n    var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host\n    // component is hitting the resume path. Figure out why. Possibly\n    // related to \\`hidden\\`.\n    var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.\n    workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n    // is a new ref we mark this as an update. All the work is done in commitWork.\n    if (updatePayload) {\n      markUpdate(workInProgress);\n    }\n  };\n  updateHostText$1 = function (current, workInProgress, oldText, newText) {\n    // If the text differs, mark it as an update. All the work in done in commitWork.\n    if (oldText !== newText) {\n      markUpdate(workInProgress);\n    }\n  };\n}\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n  if (getIsHydrating()) {\n    // If we're hydrating, we should consume as many items as we can\n    // so we don't leave any behind.\n    return;\n  }\n  switch (renderState.tailMode) {\n    case 'hidden':\n      {\n        // Any insertions at the end of the tail list after this point\n        // should be invisible. If there are already mounted boundaries\n        // anything before them are not considered for collapsing.\n        // Therefore we need to go through the whole tail to find if\n        // there are any.\n        var tailNode = renderState.tail;\n        var lastTailNode = null;\n        while (tailNode !== null) {\n          if (tailNode.alternate !== null) {\n            lastTailNode = tailNode;\n          }\n          tailNode = tailNode.sibling;\n        } // Next we're simply going to delete all insertions after the\n        // last rendered item.\n        if (lastTailNode === null) {\n          // All remaining items in the tail are insertions.\n          renderState.tail = null;\n        } else {\n          // Detach the insertion after the last node that was already\n          // inserted.\n          lastTailNode.sibling = null;\n        }\n        break;\n      }\n    case 'collapsed':\n      {\n        // Any insertions at the end of the tail list after this point\n        // should be invisible. If there are already mounted boundaries\n        // anything before them are not considered for collapsing.\n        // Therefore we need to go through the whole tail to find if\n        // there are any.\n        var _tailNode = renderState.tail;\n        var _lastTailNode = null;\n        while (_tailNode !== null) {\n          if (_tailNode.alternate !== null) {\n            _lastTailNode = _tailNode;\n          }\n          _tailNode = _tailNode.sibling;\n        } // Next we're simply going to delete all insertions after the\n        // last rendered item.\n        if (_lastTailNode === null) {\n          // All remaining items in the tail are insertions.\n          if (!hasRenderedATailFallback && renderState.tail !== null) {\n            // We suspended during the head. We want to show at least one\n            // row at the tail. So we'll keep on and cut off the rest.\n            renderState.tail.sibling = null;\n          } else {\n            renderState.tail = null;\n          }\n        } else {\n          // Detach the insertion after the last node that was already\n          // inserted.\n          _lastTailNode.sibling = null;\n        }\n        break;\n      }\n  }\n}\nfunction completeWork(current, workInProgress, renderLanes) {\n  var newProps = workInProgress.pendingProps;\n  switch (workInProgress.tag) {\n    case IndeterminateComponent:\n    case LazyComponent:\n    case SimpleMemoComponent:\n    case FunctionComponent:\n    case ForwardRef:\n    case Fragment:\n    case Mode:\n    case Profiler:\n    case ContextConsumer:\n    case MemoComponent:\n      return null;\n    case ClassComponent:\n      {\n        var Component = workInProgress.type;\n        if (isContextProvider(Component)) {\n          popContext(workInProgress);\n        }\n        return null;\n      }\n    case HostRoot:\n      {\n        popHostContainer(workInProgress);\n        popTopLevelContextObject(workInProgress);\n        resetWorkInProgressVersions();\n        var fiberRoot = workInProgress.stateNode;\n        if (fiberRoot.pendingContext) {\n          fiberRoot.context = fiberRoot.pendingContext;\n          fiberRoot.pendingContext = null;\n        }\n        if (current === null || current.child === null) {\n          // If we hydrated, pop so that we can delete any remaining children\n          // that weren't hydrated.\n          var wasHydrated = popHydrationState(workInProgress);\n          if (wasHydrated) {\n            // If we hydrated, then we'll need to schedule an update for\n            // the commit side-effects on the root.\n            markUpdate(workInProgress);\n          } else if (!fiberRoot.hydrate) {\n            // Schedule an effect to clear this container at the start of the next commit.\n            // This handles the case of React rendering into a container with previous children.\n            // It's also safe to do for updates too, because current.child would only be null\n            // if the previous render was null (so the the container would already be empty).\n            workInProgress.flags |= Snapshot;\n          }\n        }\n        updateHostContainer(workInProgress);\n        return null;\n      }\n    case HostComponent:\n      {\n        popHostContext(workInProgress);\n        var rootContainerInstance = getRootHostContainer();\n        var type = workInProgress.type;\n        if (current !== null && workInProgress.stateNode != null) {\n          updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);\n          if (current.ref !== workInProgress.ref) {\n            markRef$1(workInProgress);\n          }\n        } else {\n          if (!newProps) {\n            if (!(workInProgress.stateNode !== null)) {\n              {\n                throw Error( \\\\\"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n              }\n            } // This can happen when we abort work.\n            return null;\n          }\n          var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context\n          // \\\\\"stack\\\\\" as the parent. Then append children as we go in beginWork\n          // or completeWork depending on whether we want to add them top->down or\n          // bottom->up. Top->down is faster in IE11.\n          var _wasHydrated = popHydrationState(workInProgress);\n          if (_wasHydrated) {\n            // TODO: Move this and createInstance step into the beginPhase\n            // to consolidate.\n            if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {\n              // If changes to the hydrated node need to be applied at the\n              // commit-phase we mark this as such.\n              markUpdate(workInProgress);\n            }\n          } else {\n            var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);\n            appendAllChildren(instance, workInProgress, false, false);\n            workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount.\n            // (eg DOM renderer supports auto-focus for certain elements).\n            // Make sure such renderers get scheduled for later work.\n            if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {\n              markUpdate(workInProgress);\n            }\n          }\n          if (workInProgress.ref !== null) {\n            // If there is a ref on a host node we need to schedule a callback\n            markRef$1(workInProgress);\n          }\n        }\n        return null;\n      }\n    case HostText:\n      {\n        var newText = newProps;\n        if (current && workInProgress.stateNode != null) {\n          var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need\n          // to schedule a side-effect to do the updates.\n          updateHostText$1(current, workInProgress, oldText, newText);\n        } else {\n          if (typeof newText !== 'string') {\n            if (!(workInProgress.stateNode !== null)) {\n              {\n                throw Error( \\\\\"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n              }\n            } // This can happen when we abort work.\n          }\n          var _rootContainerInstance = getRootHostContainer();\n          var _currentHostContext = getHostContext();\n          var _wasHydrated2 = popHydrationState(workInProgress);\n          if (_wasHydrated2) {\n            if (prepareToHydrateHostTextInstance(workInProgress)) {\n              markUpdate(workInProgress);\n            }\n          } else {\n            workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);\n          }\n        }\n        return null;\n      }\n    case SuspenseComponent:\n      {\n        popSuspenseContext(workInProgress);\n        var nextState = workInProgress.memoizedState;\n        if ((workInProgress.flags & DidCapture) !== NoFlags) {\n          // Something suspended. Re-render with the fallback children.\n          workInProgress.lanes = renderLanes; // Do not reset the effect list.\n          if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n            transferActualDuration(workInProgress);\n          }\n          return workInProgress;\n        }\n        var nextDidTimeout = nextState !== null;\n        var prevDidTimeout = false;\n        if (current === null) {\n          if (workInProgress.memoizedProps.fallback !== undefined) {\n            popHydrationState(workInProgress);\n          }\n        } else {\n          var prevState = current.memoizedState;\n          prevDidTimeout = prevState !== null;\n        }\n        if (nextDidTimeout && !prevDidTimeout) {\n          // If this subtreee is running in blocking mode we can suspend,\n          // otherwise we won't suspend.\n          // TODO: This will still suspend a synchronous tree if anything\n          // in the concurrent tree already suspended during this render.\n          // This is a known bug.\n          if ((workInProgress.mode & BlockingMode) !== NoMode) {\n            // TODO: Move this back to throwException because this is too late\n            // if this is a large tree which is common for initial loads. We\n            // don't know if we should restart a render or not until we get\n            // this marker, and this is too late.\n            // If this render already had a ping or lower pri updates,\n            // and this is the first time we know we're going to suspend we\n            // should be able to immediately restart from within throwException.\n            var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;\n            if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {\n              // If this was in an invisible tree or a new render, then showing\n              // this boundary is ok.\n              renderDidSuspend();\n            } else {\n              // Otherwise, we're going to have to hide content so we should\n              // suspend for longer if possible.\n              renderDidSuspendDelayIfPossible();\n            }\n          }\n        }\n        {\n          // TODO: Only schedule updates if these values are non equal, i.e. it changed.\n          if (nextDidTimeout || prevDidTimeout) {\n            // If this boundary just timed out, schedule an effect to attach a\n            // retry listener to the promise. This flag is also used to hide the\n            // primary children. In mutation mode, we also need the flag to\n            // *unhide* children that were previously hidden, so check if this\n            // is currently timed out, too.\n            workInProgress.flags |= Update;\n          }\n        }\n        return null;\n      }\n    case HostPortal:\n      popHostContainer(workInProgress);\n      updateHostContainer(workInProgress);\n      if (current === null) {\n        preparePortalMount(workInProgress.stateNode.containerInfo);\n      }\n      return null;\n    case ContextProvider:\n      // Pop provider fiber\n      popProvider(workInProgress);\n      return null;\n    case IncompleteClassComponent:\n      {\n        // Same as class component case. I put it down here so that the tags are\n        // sequential to ensure this switch is compiled to a jump table.\n        var _Component = workInProgress.type;\n        if (isContextProvider(_Component)) {\n          popContext(workInProgress);\n        }\n        return null;\n      }\n    case SuspenseListComponent:\n      {\n        popSuspenseContext(workInProgress);\n        var renderState = workInProgress.memoizedState;\n        if (renderState === null) {\n          // We're running in the default, \\\\\"independent\\\\\" mode.\n          // We don't do anything in this mode.\n          return null;\n        }\n        var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags;\n        var renderedTail = renderState.rendering;\n        if (renderedTail === null) {\n          // We just rendered the head.\n          if (!didSuspendAlready) {\n            // This is the first pass. We need to figure out if anything is still\n            // suspended in the rendered set.\n            // If new content unsuspended, but there's still some content that\n            // didn't. Then we need to do a second pass that forces everything\n            // to keep showing their fallbacks.\n            // We might be suspended if something in this render pass suspended, or\n            // something in the previous committed pass suspended. Otherwise,\n            // there's no chance so we can skip the expensive call to\n            // findFirstSuspended.\n            var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags);\n            if (!cannotBeSuspended) {\n              var row = workInProgress.child;\n              while (row !== null) {\n                var suspended = findFirstSuspended(row);\n                if (suspended !== null) {\n                  didSuspendAlready = true;\n                  workInProgress.flags |= DidCapture;\n                  cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as\n                  // part of the second pass. In that case nothing will subscribe to\n                  // its thennables. Instead, we'll transfer its thennables to the\n                  // SuspenseList so that it can retry if they resolve.\n                  // There might be multiple of these in the list but since we're\n                  // going to wait for all of them anyway, it doesn't really matter\n                  // which ones gets to ping. In theory we could get clever and keep\n                  // track of how many dependencies remain but it gets tricky because\n                  // in the meantime, we can add/remove/change items and dependencies.\n                  // We might bail out of the loop before finding any but that\n                  // doesn't matter since that means that the other boundaries that\n                  // we did find already has their listeners attached.\n                  var newThennables = suspended.updateQueue;\n                  if (newThennables !== null) {\n                    workInProgress.updateQueue = newThennables;\n                    workInProgress.flags |= Update;\n                  } // Rerender the whole list, but this time, we'll force fallbacks\n                  // to stay in place.\n                  // Reset the effect list before doing the second pass since that's now invalid.\n                  if (renderState.lastEffect === null) {\n                    workInProgress.firstEffect = null;\n                  }\n                  workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.\n                  resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately\n                  // rerender the children.\n                  pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));\n                  return workInProgress.child;\n                }\n                row = row.sibling;\n              }\n            }\n            if (renderState.tail !== null && now() > getRenderTargetTime()) {\n              // We have already passed our CPU deadline but we still have rows\n              // left in the tail. We'll just give up further attempts to render\n              // the main content and only render fallbacks.\n              workInProgress.flags |= DidCapture;\n              didSuspendAlready = true;\n              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n              // to get it started back up to attempt the next item. While in terms\n              // of priority this work has the same priority as this current render,\n              // it's not part of the same transition once the transition has\n              // committed. If it's sync, we still want to yield so that it can be\n              // painted. Conceptually, this is really the same as pinging.\n              // We can use any RetryLane even if it's the one currently rendering\n              // since we're leaving it behind on this node.\n              workInProgress.lanes = SomeRetryLane;\n              {\n                markSpawnedWork(SomeRetryLane);\n              }\n            }\n          } else {\n            cutOffTailIfNeeded(renderState, false);\n          } // Next we're going to render the tail.\n        } else {\n          // Append the rendered row to the child list.\n          if (!didSuspendAlready) {\n            var _suspended = findFirstSuspended(renderedTail);\n            if (_suspended !== null) {\n              workInProgress.flags |= DidCapture;\n              didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't\n              // get lost if this row ends up dropped during a second pass.\n              var _newThennables = _suspended.updateQueue;\n              if (_newThennables !== null) {\n                workInProgress.updateQueue = _newThennables;\n                workInProgress.flags |= Update;\n              }\n              cutOffTailIfNeeded(renderState, true); // This might have been modified.\n              if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating.\n              ) {\n                  // We need to delete the row we just rendered.\n                  // Reset the effect list to what it was before we rendered this\n                  // child. The nested children have already appended themselves.\n                  var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.\n                  if (lastEffect !== null) {\n                    lastEffect.nextEffect = null;\n                  } // We're done.\n                  return null;\n                }\n            } else if ( // The time it took to render last row is greater than the remaining\n            // time we have to render. So rendering one more row would likely\n            // exceed it.\n            now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) {\n              // We have now passed our CPU deadline and we'll just give up further\n              // attempts to render the main content and only render fallbacks.\n              // The assumption is that this is usually faster.\n              workInProgress.flags |= DidCapture;\n              didSuspendAlready = true;\n              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n              // to get it started back up to attempt the next item. While in terms\n              // of priority this work has the same priority as this current render,\n              // it's not part of the same transition once the transition has\n              // committed. If it's sync, we still want to yield so that it can be\n              // painted. Conceptually, this is really the same as pinging.\n              // We can use any RetryLane even if it's the one currently rendering\n              // since we're leaving it behind on this node.\n              workInProgress.lanes = SomeRetryLane;\n              {\n                markSpawnedWork(SomeRetryLane);\n              }\n            }\n          }\n          if (renderState.isBackwards) {\n            // The effect list of the backwards tail will have been added\n            // to the end. This breaks the guarantee that life-cycles fire in\n            // sibling order but that isn't a strong guarantee promised by React.\n            // Especially since these might also just pop in during future commits.\n            // Append to the beginning of the list.\n            renderedTail.sibling = workInProgress.child;\n            workInProgress.child = renderedTail;\n          } else {\n            var previousSibling = renderState.last;\n            if (previousSibling !== null) {\n              previousSibling.sibling = renderedTail;\n            } else {\n              workInProgress.child = renderedTail;\n            }\n            renderState.last = renderedTail;\n          }\n        }\n        if (renderState.tail !== null) {\n          // We still have tail rows to render.\n          // Pop a row.\n          var next = renderState.tail;\n          renderState.rendering = next;\n          renderState.tail = next.sibling;\n          renderState.lastEffect = workInProgress.lastEffect;\n          renderState.renderingStartTime = now();\n          next.sibling = null; // Restore the context.\n          // TODO: We can probably just avoid popping it instead and only\n          // setting it the first time we go from not suspended to suspended.\n          var suspenseContext = suspenseStackCursor.current;\n          if (didSuspendAlready) {\n            suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n          } else {\n            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n          }\n          pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.\n          return next;\n        }\n        return null;\n      }\n    case FundamentalComponent:\n      {\n        break;\n      }\n    case ScopeComponent:\n      {\n        break;\n      }\n    case Block:\n      break;\n    case OffscreenComponent:\n    case LegacyHiddenComponent:\n      {\n        popRenderLanes(workInProgress);\n        if (current !== null) {\n          var _nextState = workInProgress.memoizedState;\n          var _prevState = current.memoizedState;\n          var prevIsHidden = _prevState !== null;\n          var nextIsHidden = _nextState !== null;\n          if (prevIsHidden !== nextIsHidden && newProps.mode !== 'unstable-defer-without-hiding') {\n            workInProgress.flags |= Update;\n          }\n        }\n        return null;\n      }\n  }\n  {\n    {\n      throw Error( \\\\\"Unknown unit of work tag (\\\\\" + workInProgress.tag + \\\\\"). This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction unwindWork(workInProgress, renderLanes) {\n  switch (workInProgress.tag) {\n    case ClassComponent:\n      {\n        var Component = workInProgress.type;\n        if (isContextProvider(Component)) {\n          popContext(workInProgress);\n        }\n        var flags = workInProgress.flags;\n        if (flags & ShouldCapture) {\n          workInProgress.flags = flags & ~ShouldCapture | DidCapture;\n          if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n            transferActualDuration(workInProgress);\n          }\n          return workInProgress;\n        }\n        return null;\n      }\n    case HostRoot:\n      {\n        popHostContainer(workInProgress);\n        popTopLevelContextObject(workInProgress);\n        resetWorkInProgressVersions();\n        var _flags = workInProgress.flags;\n        if (!((_flags & DidCapture) === NoFlags)) {\n          {\n            throw Error( \\\\\"The root failed to unmount after an error. This is likely a bug in React. Please file an issue.\\\\\" );\n          }\n        }\n        workInProgress.flags = _flags & ~ShouldCapture | DidCapture;\n        return workInProgress;\n      }\n    case HostComponent:\n      {\n        // TODO: popHydrationState\n        popHostContext(workInProgress);\n        return null;\n      }\n    case SuspenseComponent:\n      {\n        popSuspenseContext(workInProgress);\n        var _flags2 = workInProgress.flags;\n        if (_flags2 & ShouldCapture) {\n          workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.\n          if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n            transferActualDuration(workInProgress);\n          }\n          return workInProgress;\n        }\n        return null;\n      }\n    case SuspenseListComponent:\n      {\n        popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been\n        // caught by a nested boundary. If not, it should bubble through.\n        return null;\n      }\n    case HostPortal:\n      popHostContainer(workInProgress);\n      return null;\n    case ContextProvider:\n      popProvider(workInProgress);\n      return null;\n    case OffscreenComponent:\n    case LegacyHiddenComponent:\n      popRenderLanes(workInProgress);\n      return null;\n    default:\n      return null;\n  }\n}\nfunction unwindInterruptedWork(interruptedWork) {\n  switch (interruptedWork.tag) {\n    case ClassComponent:\n      {\n        var childContextTypes = interruptedWork.type.childContextTypes;\n        if (childContextTypes !== null && childContextTypes !== undefined) {\n          popContext(interruptedWork);\n        }\n        break;\n      }\n    case HostRoot:\n      {\n        popHostContainer(interruptedWork);\n        popTopLevelContextObject(interruptedWork);\n        resetWorkInProgressVersions();\n        break;\n      }\n    case HostComponent:\n      {\n        popHostContext(interruptedWork);\n        break;\n      }\n    case HostPortal:\n      popHostContainer(interruptedWork);\n      break;\n    case SuspenseComponent:\n      popSuspenseContext(interruptedWork);\n      break;\n    case SuspenseListComponent:\n      popSuspenseContext(interruptedWork);\n      break;\n    case ContextProvider:\n      popProvider(interruptedWork);\n      break;\n    case OffscreenComponent:\n    case LegacyHiddenComponent:\n      popRenderLanes(interruptedWork);\n      break;\n  }\n}\nfunction createCapturedValue(value, source) {\n  // If the value is an error, call this function immediately after it is thrown\n  // so the stack is accurate.\n  return {\n    value: value,\n    source: source,\n    stack: getStackByFiberInDevAndProd(source)\n  };\n}\n// This module is forked in different environments.\n// By default, return \\`true\\` to log errors to the console.\n// Forks can return \\`false\\` if this isn't desirable.\nfunction showErrorDialog(boundary, errorInfo) {\n  return true;\n}\nfunction logCapturedError(boundary, errorInfo) {\n  try {\n    var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging.\n    // This enables renderers like ReactNative to better manage redbox behavior.\n    if (logError === false) {\n      return;\n    }\n    var error = errorInfo.value;\n    if (true) {\n      var source = errorInfo.source;\n      var stack = errorInfo.stack;\n      var componentStack = stack !== null ? stack : ''; // Browsers support silencing uncaught errors by calling\n      // \\`preventDefault()\\` in window \\`error\\` handler.\n      // We record this information as an expando on the error.\n      if (error != null && error._suppressLogging) {\n        if (boundary.tag === ClassComponent) {\n          // The error is recoverable and was silenced.\n          // Ignore it and don't print the stack addendum.\n          // This is handy for testing error boundaries without noise.\n          return;\n        } // The error is fatal. Since the silencing might have\n        // been accidental, we'll surface it anyway.\n        // However, the browser would have silenced the original error\n        // so we'll print it first, and then print the stack addendum.\n        console['error'](error); // Don't transform to our wrapper\n        // For a more detailed description of this block, see:\n        // https://github.com/facebook/react/pull/13384\n      }\n      var componentName = source ? getComponentName(source.type) : null;\n      var componentNameMessage = componentName ? \\\\\"The above error occurred in the <\\\\\" + componentName + \\\\\"> component:\\\\\" : 'The above error occurred in one of your React components:';\n      var errorBoundaryMessage;\n      var errorBoundaryName = getComponentName(boundary.type);\n      if (errorBoundaryName) {\n        errorBoundaryMessage = \\\\\"React will try to recreate this component tree from scratch \\\\\" + (\\\\\"using the error boundary you provided, \\\\\" + errorBoundaryName + \\\\\".\\\\\");\n      } else {\n        errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.' + 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.';\n      }\n      var combinedMessage = componentNameMessage + \\\\\"\\\\\" + componentStack + \\\\\"\\\\\" + (\\\\\"\\\\\" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.\n      // We don't include the original error message and JS stack because the browser\n      // has already printed it. Even if the application swallows the error, it is still\n      // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n      console['error'](combinedMessage); // Don't transform to our wrapper\n    }\n  } catch (e) {\n    // This method must not throw, or React internal state will get messed up.\n    // If console.error is overridden, or logCapturedError() shows a dialog that throws,\n    // we want to report this error outside of the normal stack as a last resort.\n    // https://github.com/facebook/react/issues/13188\n    setTimeout(function () {\n      throw e;\n    });\n  }\n}\nvar PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;\nfunction createRootErrorUpdate(fiber, errorInfo, lane) {\n  var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null.\n  update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property\n  // being called \\\\\"element\\\\\".\n  update.payload = {\n    element: null\n  };\n  var error = errorInfo.value;\n  update.callback = function () {\n    onUncaughtError(error);\n    logCapturedError(fiber, errorInfo);\n  };\n  return update;\n}\nfunction createClassErrorUpdate(fiber, errorInfo, lane) {\n  var update = createUpdate(NoTimestamp, lane);\n  update.tag = CaptureUpdate;\n  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n  if (typeof getDerivedStateFromError === 'function') {\n    var error$1 = errorInfo.value;\n    update.payload = function () {\n      logCapturedError(fiber, errorInfo);\n      return getDerivedStateFromError(error$1);\n    };\n  }\n  var inst = fiber.stateNode;\n  if (inst !== null && typeof inst.componentDidCatch === 'function') {\n    update.callback = function callback() {\n      {\n        markFailedErrorBoundaryForHotReloading(fiber);\n      }\n      if (typeof getDerivedStateFromError !== 'function') {\n        // To preserve the preexisting retry behavior of error boundaries,\n        // we keep track of which ones already failed during this batch.\n        // This gets reset before we yield back to the browser.\n        // TODO: Warn in strict mode if getDerivedStateFromError is\n        // not defined.\n        markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined\n        logCapturedError(fiber, errorInfo);\n      }\n      var error$1 = errorInfo.value;\n      var stack = errorInfo.stack;\n      this.componentDidCatch(error$1, {\n        componentStack: stack !== null ? stack : ''\n      });\n      {\n        if (typeof getDerivedStateFromError !== 'function') {\n          // If componentDidCatch is the only error boundary method defined,\n          // then it needs to call setState to recover from errors.\n          // If no state update is scheduled then the boundary will swallow the error.\n          if (!includesSomeLane(fiber.lanes, SyncLane)) {\n            error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');\n          }\n        }\n      }\n    };\n  } else {\n    update.callback = function () {\n      markFailedErrorBoundaryForHotReloading(fiber);\n    };\n  }\n  return update;\n}\nfunction attachPingListener(root, wakeable, lanes) {\n  // Attach a listener to the promise to \\\\\"ping\\\\\" the root and retry. But only if\n  // one does not already exist for the lanes we're currently rendering (which\n  // acts like a \\\\\"thread ID\\\\\" here).\n  var pingCache = root.pingCache;\n  var threadIDs;\n  if (pingCache === null) {\n    pingCache = root.pingCache = new PossiblyWeakMap$1();\n    threadIDs = new Set();\n    pingCache.set(wakeable, threadIDs);\n  } else {\n    threadIDs = pingCache.get(wakeable);\n    if (threadIDs === undefined) {\n      threadIDs = new Set();\n      pingCache.set(wakeable, threadIDs);\n    }\n  }\n  if (!threadIDs.has(lanes)) {\n    // Memoize using the thread ID to prevent redundant listeners.\n    threadIDs.add(lanes);\n    var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);\n    wakeable.then(ping, ping);\n  }\n}\nfunction throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {\n  // The source fiber did not complete.\n  sourceFiber.flags |= Incomplete; // Its effect list is no longer valid.\n  sourceFiber.firstEffect = sourceFiber.lastEffect = null;\n  if (value !== null && typeof value === 'object' && typeof value.then === 'function') {\n    // This is a wakeable.\n    var wakeable = value;\n    if ((sourceFiber.mode & BlockingMode) === NoMode) {\n      // Reset the memoizedState to what it was before we attempted\n      // to render it.\n      var currentSource = sourceFiber.alternate;\n      if (currentSource) {\n        sourceFiber.updateQueue = currentSource.updateQueue;\n        sourceFiber.memoizedState = currentSource.memoizedState;\n        sourceFiber.lanes = currentSource.lanes;\n      } else {\n        sourceFiber.updateQueue = null;\n        sourceFiber.memoizedState = null;\n      }\n    }\n    var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.\n    var _workInProgress = returnFiber;\n    do {\n      if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {\n        // Found the nearest boundary.\n        // Stash the promise on the boundary fiber. If the boundary times out, we'll\n        // attach another listener to flip the boundary back to its normal state.\n        var wakeables = _workInProgress.updateQueue;\n        if (wakeables === null) {\n          var updateQueue = new Set();\n          updateQueue.add(wakeable);\n          _workInProgress.updateQueue = updateQueue;\n        } else {\n          wakeables.add(wakeable);\n        } // If the boundary is outside of blocking mode, we should *not*\n        // suspend the commit. Pretend as if the suspended component rendered\n        // null and keep rendering. In the commit phase, we'll schedule a\n        // subsequent synchronous update to re-render the Suspense.\n        //\n        // Note: It doesn't matter whether the component that suspended was\n        // inside a blocking mode tree. If the Suspense is outside of it, we\n        // should *not* suspend the commit.\n        if ((_workInProgress.mode & BlockingMode) === NoMode) {\n          _workInProgress.flags |= DidCapture;\n          sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.\n          // But we shouldn't call any lifecycle methods or callbacks. Remove\n          // all lifecycle effect tags.\n          sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);\n          if (sourceFiber.tag === ClassComponent) {\n            var currentSourceFiber = sourceFiber.alternate;\n            if (currentSourceFiber === null) {\n              // This is a new mount. Change the tag so it's not mistaken for a\n              // completed class component. For example, we should not call\n              // componentWillUnmount if it is deleted.\n              sourceFiber.tag = IncompleteClassComponent;\n            } else {\n              // When we try rendering again, we should not reuse the current fiber,\n              // since it's known to be in an inconsistent state. Use a force update to\n              // prevent a bail out.\n              var update = createUpdate(NoTimestamp, SyncLane);\n              update.tag = ForceUpdate;\n              enqueueUpdate(sourceFiber, update);\n            }\n          } // The source fiber did not complete. Mark it with Sync priority to\n          // indicate that it still has pending work.\n          sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); // Exit without suspending.\n          return;\n        } // Confirmed that the boundary is in a concurrent mode tree. Continue\n        // with the normal suspend path.\n        //\n        // After this we'll use a set of heuristics to determine whether this\n        // render pass will run to completion or restart or \\\\\"suspend\\\\\" the commit.\n        // The actual logic for this is spread out in different places.\n        //\n        // This first principle is that if we're going to suspend when we complete\n        // a root, then we should also restart if we get an update or ping that\n        // might unsuspend it, and vice versa. The only reason to suspend is\n        // because you think you might want to restart before committing. However,\n        // it doesn't make sense to restart only while in the period we're suspended.\n        //\n        // Restarting too aggressively is also not good because it starves out any\n        // intermediate loading state. So we use heuristics to determine when.\n        // Suspense Heuristics\n        //\n        // If nothing threw a Promise or all the same fallbacks are already showing,\n        // then don't suspend/restart.\n        //\n        // If this is an initial render of a new tree of Suspense boundaries and\n        // those trigger a fallback, then don't suspend/restart. We want to ensure\n        // that we can show the initial loading state as quickly as possible.\n        //\n        // If we hit a \\\\\"Delayed\\\\\" case, such as when we'd switch from content back into\n        // a fallback, then we should always suspend/restart. Transitions apply\n        // to this case. If none is defined, JND is used instead.\n        //\n        // If we're already showing a fallback and it gets \\\\\"retried\\\\\", allowing us to show\n        // another level, but there's still an inner boundary that would show a fallback,\n        // then we suspend/restart for 500ms since the last time we showed a fallback\n        // anywhere in the tree. This effectively throttles progressive loading into a\n        // consistent train of commits. This also gives us an opportunity to restart to\n        // get to the completed state slightly earlier.\n        //\n        // If there's ambiguity due to batching it's resolved in preference of:\n        // 1) \\\\\"delayed\\\\\", 2) \\\\\"initial render\\\\\", 3) \\\\\"retry\\\\\".\n        //\n        // We want to ensure that a \\\\\"busy\\\\\" state doesn't get force committed. We want to\n        // ensure that new initial loading states can commit as soon as possible.\n        attachPingListener(root, wakeable, rootRenderLanes);\n        _workInProgress.flags |= ShouldCapture;\n        _workInProgress.lanes = rootRenderLanes;\n        return;\n      } // This boundary already captured during this render. Continue to the next\n      // boundary.\n      _workInProgress = _workInProgress.return;\n    } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.\n    // TODO: Use invariant so the message is stripped in prod?\n    value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.' + '' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.');\n  } // We didn't find a boundary that could handle this type of exception. Start\n  // over and traverse parent path again, this time treating the exception\n  // as an error.\n  renderDidError();\n  value = createCapturedValue(value, sourceFiber);\n  var workInProgress = returnFiber;\n  do {\n    switch (workInProgress.tag) {\n      case HostRoot:\n        {\n          var _errorInfo = value;\n          workInProgress.flags |= ShouldCapture;\n          var lane = pickArbitraryLane(rootRenderLanes);\n          workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);\n          var _update = createRootErrorUpdate(workInProgress, _errorInfo, lane);\n          enqueueCapturedUpdate(workInProgress, _update);\n          return;\n        }\n      case ClassComponent:\n        // Capture and retry\n        var errorInfo = value;\n        var ctor = workInProgress.type;\n        var instance = workInProgress.stateNode;\n        if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {\n          workInProgress.flags |= ShouldCapture;\n          var _lane = pickArbitraryLane(rootRenderLanes);\n          workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state\n          var _update2 = createClassErrorUpdate(workInProgress, errorInfo, _lane);\n          enqueueCapturedUpdate(workInProgress, _update2);\n          return;\n        }\n        break;\n    }\n    workInProgress = workInProgress.return;\n  } while (workInProgress !== null);\n}\nvar didWarnAboutUndefinedSnapshotBeforeUpdate = null;\n{\n  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();\n}\nvar PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;\nvar callComponentWillUnmountWithTimer = function (current, instance) {\n  instance.props = current.memoizedProps;\n  instance.state = current.memoizedState;\n  {\n    instance.componentWillUnmount();\n  }\n}; // Capture errors so they don't interrupt unmounting.\nfunction safelyCallComponentWillUnmount(current, instance) {\n  {\n    invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);\n    if (hasCaughtError()) {\n      var unmountError = clearCaughtError();\n      captureCommitPhaseError(current, unmountError);\n    }\n  }\n}\nfunction safelyDetachRef(current) {\n  var ref = current.ref;\n  if (ref !== null) {\n    if (typeof ref === 'function') {\n      {\n        invokeGuardedCallback(null, ref, null, null);\n        if (hasCaughtError()) {\n          var refError = clearCaughtError();\n          captureCommitPhaseError(current, refError);\n        }\n      }\n    } else {\n      ref.current = null;\n    }\n  }\n}\nfunction safelyCallDestroy(current, destroy) {\n  {\n    invokeGuardedCallback(null, destroy, null);\n    if (hasCaughtError()) {\n      var error = clearCaughtError();\n      captureCommitPhaseError(current, error);\n    }\n  }\n}\nfunction commitBeforeMutationLifeCycles(current, finishedWork) {\n  switch (finishedWork.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        return;\n      }\n    case ClassComponent:\n      {\n        if (finishedWork.flags & Snapshot) {\n          if (current !== null) {\n            var prevProps = current.memoizedProps;\n            var prevState = current.memoizedState;\n            var instance = finishedWork.stateNode; // We could update instance props and state here,\n            // but instead we rely on them being set during last render.\n            // TODO: revisit this when we implement resuming.\n            {\n              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n                if (instance.props !== finishedWork.memoizedProps) {\n                  error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n                if (instance.state !== finishedWork.memoizedState) {\n                  error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.state\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n              }\n            }\n            var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);\n            {\n              var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;\n              if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {\n                didWarnSet.add(finishedWork.type);\n                error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));\n              }\n            }\n            instance.__reactInternalSnapshotBeforeUpdate = snapshot;\n          }\n        }\n        return;\n      }\n    case HostRoot:\n      {\n        {\n          if (finishedWork.flags & Snapshot) {\n            var root = finishedWork.stateNode;\n            clearContainer(root.containerInfo);\n          }\n        }\n        return;\n      }\n    case HostComponent:\n    case HostText:\n    case HostPortal:\n    case IncompleteClassComponent:\n      // Nothing to do for these component types\n      return;\n  }\n  {\n    {\n      throw Error( \\\\\"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction commitHookEffectListUnmount(tag, finishedWork) {\n  var updateQueue = finishedWork.updateQueue;\n  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n  if (lastEffect !== null) {\n    var firstEffect = lastEffect.next;\n    var effect = firstEffect;\n    do {\n      if ((effect.tag & tag) === tag) {\n        // Unmount\n        var destroy = effect.destroy;\n        effect.destroy = undefined;\n        if (destroy !== undefined) {\n          destroy();\n        }\n      }\n      effect = effect.next;\n    } while (effect !== firstEffect);\n  }\n}\nfunction commitHookEffectListMount(tag, finishedWork) {\n  var updateQueue = finishedWork.updateQueue;\n  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n  if (lastEffect !== null) {\n    var firstEffect = lastEffect.next;\n    var effect = firstEffect;\n    do {\n      if ((effect.tag & tag) === tag) {\n        // Mount\n        var create = effect.create;\n        effect.destroy = create();\n        {\n          var destroy = effect.destroy;\n          if (destroy !== undefined && typeof destroy !== 'function') {\n            var addendum = void 0;\n            if (destroy === null) {\n              addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';\n            } else if (typeof destroy.then === 'function') {\n              addendum = 'It looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:' + 'useEffect(() => {' + '  async function fetchData() {' + '    // You can await here' + '    const response = await MyAPI.getData(someId);' + '    // ...' + '  }' + '  fetchData();' + \\\\\"}, [someId]); // Or [] if effect doesn't need props or state\\\\\" + 'Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching';\n            } else {\n              addendum = ' You returned: ' + destroy;\n            }\n            error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s', addendum);\n          }\n        }\n      }\n      effect = effect.next;\n    } while (effect !== firstEffect);\n  }\n}\nfunction schedulePassiveEffects(finishedWork) {\n  var updateQueue = finishedWork.updateQueue;\n  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n  if (lastEffect !== null) {\n    var firstEffect = lastEffect.next;\n    var effect = firstEffect;\n    do {\n      var _effect = effect,\n          next = _effect.next,\n          tag = _effect.tag;\n      if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {\n        enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);\n        enqueuePendingPassiveHookEffectMount(finishedWork, effect);\n      }\n      effect = next;\n    } while (effect !== firstEffect);\n  }\n}\nfunction commitLifeCycles(finishedRoot, current, finishedWork, committedLanes) {\n  switch (finishedWork.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        // At this point layout effects have already been destroyed (during mutation phase).\n        // This is done to prevent sibling component effects from interfering with each other,\n        // e.g. a destroy function in one component should never override a ref set\n        // by a create function in another component during the same commit.\n        {\n          commitHookEffectListMount(Layout | HasEffect, finishedWork);\n        }\n        schedulePassiveEffects(finishedWork);\n        return;\n      }\n    case ClassComponent:\n      {\n        var instance = finishedWork.stateNode;\n        if (finishedWork.flags & Update) {\n          if (current === null) {\n            // We could update instance props and state here,\n            // but instead we rely on them being set during last render.\n            // TODO: revisit this when we implement resuming.\n            {\n              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n                if (instance.props !== finishedWork.memoizedProps) {\n                  error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n                if (instance.state !== finishedWork.memoizedState) {\n                  error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.state\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n              }\n            }\n            {\n              instance.componentDidMount();\n            }\n          } else {\n            var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);\n            var prevState = current.memoizedState; // We could update instance props and state here,\n            // but instead we rely on them being set during last render.\n            // TODO: revisit this when we implement resuming.\n            {\n              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n                if (instance.props !== finishedWork.memoizedProps) {\n                  error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n                if (instance.state !== finishedWork.memoizedState) {\n                  error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.state\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n              }\n            }\n            {\n              instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n            }\n          }\n        } // TODO: I think this is now always non-null by the time it reaches the\n        // commit phase. Consider removing the type check.\n        var updateQueue = finishedWork.updateQueue;\n        if (updateQueue !== null) {\n          {\n            if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n              if (instance.props !== finishedWork.memoizedProps) {\n                error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n              }\n              if (instance.state !== finishedWork.memoizedState) {\n                error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.state\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n              }\n            }\n          } // We could update instance props and state here,\n          // but instead we rely on them being set during last render.\n          // TODO: revisit this when we implement resuming.\n          commitUpdateQueue(finishedWork, updateQueue, instance);\n        }\n        return;\n      }\n    case HostRoot:\n      {\n        // TODO: I think this is now always non-null by the time it reaches the\n        // commit phase. Consider removing the type check.\n        var _updateQueue = finishedWork.updateQueue;\n        if (_updateQueue !== null) {\n          var _instance = null;\n          if (finishedWork.child !== null) {\n            switch (finishedWork.child.tag) {\n              case HostComponent:\n                _instance = getPublicInstance(finishedWork.child.stateNode);\n                break;\n              case ClassComponent:\n                _instance = finishedWork.child.stateNode;\n                break;\n            }\n          }\n          commitUpdateQueue(finishedWork, _updateQueue, _instance);\n        }\n        return;\n      }\n    case HostComponent:\n      {\n        var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted\n        // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n        // These effects should only be committed when components are first mounted,\n        // aka when there is no current/alternate.\n        if (current === null && finishedWork.flags & Update) {\n          var type = finishedWork.type;\n          var props = finishedWork.memoizedProps;\n          commitMount(_instance2, type, props);\n        }\n        return;\n      }\n    case HostText:\n      {\n        // We have no life-cycles associated with text.\n        return;\n      }\n    case HostPortal:\n      {\n        // We have no life-cycles associated with portals.\n        return;\n      }\n    case Profiler:\n      {\n        {\n          var _finishedWork$memoize2 = finishedWork.memoizedProps,\n              onCommit = _finishedWork$memoize2.onCommit,\n              onRender = _finishedWork$memoize2.onRender;\n          var effectDuration = finishedWork.stateNode.effectDuration;\n          var commitTime = getCommitTime();\n          if (typeof onRender === 'function') {\n            {\n              onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime, finishedRoot.memoizedInteractions);\n            }\n          }\n        }\n        return;\n      }\n    case SuspenseComponent:\n      {\n        commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);\n        return;\n      }\n    case SuspenseListComponent:\n    case IncompleteClassComponent:\n    case FundamentalComponent:\n    case ScopeComponent:\n    case OffscreenComponent:\n    case LegacyHiddenComponent:\n      return;\n  }\n  {\n    {\n      throw Error( \\\\\"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction hideOrUnhideAllChildren(finishedWork, isHidden) {\n  {\n    // We only have the top Fiber that was inserted but we need to recurse down its\n    // children to find all the terminal nodes.\n    var node = finishedWork;\n    while (true) {\n      if (node.tag === HostComponent) {\n        var instance = node.stateNode;\n        if (isHidden) {\n          hideInstance(instance);\n        } else {\n          unhideInstance(node.stateNode, node.memoizedProps);\n        }\n      } else if (node.tag === HostText) {\n        var _instance3 = node.stateNode;\n        if (isHidden) {\n          hideTextInstance(_instance3);\n        } else {\n          unhideTextInstance(_instance3, node.memoizedProps);\n        }\n      } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n      if (node === finishedWork) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node.return === null || node.return === finishedWork) {\n          return;\n        }\n        node = node.return;\n      }\n      node.sibling.return = node.return;\n      node = node.sibling;\n    }\n  }\n}\nfunction commitAttachRef(finishedWork) {\n  var ref = finishedWork.ref;\n  if (ref !== null) {\n    var instance = finishedWork.stateNode;\n    var instanceToUse;\n    switch (finishedWork.tag) {\n      case HostComponent:\n        instanceToUse = getPublicInstance(instance);\n        break;\n      default:\n        instanceToUse = instance;\n    } // Moved outside to ensure DCE works with this flag\n    if (typeof ref === 'function') {\n      ref(instanceToUse);\n    } else {\n      {\n        if (!ref.hasOwnProperty('current')) {\n          error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentName(finishedWork.type));\n        }\n      }\n      ref.current = instanceToUse;\n    }\n  }\n}\nfunction commitDetachRef(current) {\n  var currentRef = current.ref;\n  if (currentRef !== null) {\n    if (typeof currentRef === 'function') {\n      currentRef(null);\n    } else {\n      currentRef.current = null;\n    }\n  }\n} // User-originating errors (lifecycles and refs) should not interrupt\n// deletion, so don't let them throw. Host-originating errors should\n// interrupt deletion, so it's okay\nfunction commitUnmount(finishedRoot, current, renderPriorityLevel) {\n  onCommitUnmount(current);\n  switch (current.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case MemoComponent:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        var updateQueue = current.updateQueue;\n        if (updateQueue !== null) {\n          var lastEffect = updateQueue.lastEffect;\n          if (lastEffect !== null) {\n            var firstEffect = lastEffect.next;\n            var effect = firstEffect;\n            do {\n              var _effect2 = effect,\n                  destroy = _effect2.destroy,\n                  tag = _effect2.tag;\n              if (destroy !== undefined) {\n                if ((tag & Passive$1) !== NoFlags$1) {\n                  enqueuePendingPassiveHookEffectUnmount(current, effect);\n                } else {\n                  {\n                    safelyCallDestroy(current, destroy);\n                  }\n                }\n              }\n              effect = effect.next;\n            } while (effect !== firstEffect);\n          }\n        }\n        return;\n      }\n    case ClassComponent:\n      {\n        safelyDetachRef(current);\n        var instance = current.stateNode;\n        if (typeof instance.componentWillUnmount === 'function') {\n          safelyCallComponentWillUnmount(current, instance);\n        }\n        return;\n      }\n    case HostComponent:\n      {\n        safelyDetachRef(current);\n        return;\n      }\n    case HostPortal:\n      {\n        // TODO: this is recursive.\n        // We are also not using this parent because\n        // the portal will get pushed immediately.\n        {\n          unmountHostComponents(finishedRoot, current);\n        }\n        return;\n      }\n    case FundamentalComponent:\n      {\n        return;\n      }\n    case DehydratedFragment:\n      {\n        return;\n      }\n    case ScopeComponent:\n      {\n        return;\n      }\n  }\n}\nfunction commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {\n  // While we're inside a removed host node we don't want to call\n  // removeChild on the inner nodes because they're removed by the top\n  // call anyway. We also want to call componentWillUnmount on all\n  // composites before this host node is removed from the tree. Therefore\n  // we do an inner loop while we're still inside the host node.\n  var node = root;\n  while (true) {\n    commitUnmount(finishedRoot, node); // Visit children because they may contain more composite or host nodes.\n    // Skip portals because commitUnmount() currently visits them recursively.\n    if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.\n    // If we don't use mutation we drill down into portals here instead.\n     node.tag !== HostPortal)) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === root) {\n      return;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === root) {\n        return;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n}\nfunction detachFiberMutation(fiber) {\n  // Cut off the return pointers to disconnect it from the tree. Ideally, we\n  // should clear the child pointer of the parent alternate to let this\n  // get GC:ed but we don't know which for sure which parent is the current\n  // one so we'll settle for GC:ing the subtree of this child. This child\n  // itself will be GC:ed when the parent updates the next time.\n  // Note: we cannot null out sibling here, otherwise it can cause issues\n  // with findDOMNode and how it requires the sibling field to carry out\n  // traversal in a later effect. See PR #16820. We now clear the sibling\n  // field after effects, see: detachFiberAfterEffects.\n  //\n  // Don't disconnect stateNode now; it will be detached in detachFiberAfterEffects.\n  // It may be required if the current component is an error boundary,\n  // and one of its descendants throws while unmounting a passive effect.\n  fiber.alternate = null;\n  fiber.child = null;\n  fiber.dependencies = null;\n  fiber.firstEffect = null;\n  fiber.lastEffect = null;\n  fiber.memoizedProps = null;\n  fiber.memoizedState = null;\n  fiber.pendingProps = null;\n  fiber.return = null;\n  fiber.updateQueue = null;\n  {\n    fiber._debugOwner = null;\n  }\n}\nfunction getHostParentFiber(fiber) {\n  var parent = fiber.return;\n  while (parent !== null) {\n    if (isHostParent(parent)) {\n      return parent;\n    }\n    parent = parent.return;\n  }\n  {\n    {\n      throw Error( \\\\\"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction isHostParent(fiber) {\n  return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n}\nfunction getHostSibling(fiber) {\n  // We're going to search forward into the tree until we find a sibling host\n  // node. Unfortunately, if multiple insertions are done in a row we have to\n  // search past them. This leads to exponential search for the next sibling.\n  // TODO: Find a more efficient way to do this.\n  var node = fiber;\n  siblings: while (true) {\n    // If we didn't find anything, let's try the next sibling.\n    while (node.sibling === null) {\n      if (node.return === null || isHostParent(node.return)) {\n        // If we pop out of the root or hit the parent the fiber we are the\n        // last sibling.\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n    while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {\n      // If it is not host node and, we might have a host node inside it.\n      // Try to search down until we find one.\n      if (node.flags & Placement) {\n        // If we don't have a child, try the siblings instead.\n        continue siblings;\n      } // If we don't have a child, try the siblings instead.\n      // We also skip portals because they are not part of this host tree.\n      if (node.child === null || node.tag === HostPortal) {\n        continue siblings;\n      } else {\n        node.child.return = node;\n        node = node.child;\n      }\n    } // Check if this host node is stable or about to be placed.\n    if (!(node.flags & Placement)) {\n      // Found it!\n      return node.stateNode;\n    }\n  }\n}\nfunction commitPlacement(finishedWork) {\n  var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.\n  var parent;\n  var isContainer;\n  var parentStateNode = parentFiber.stateNode;\n  switch (parentFiber.tag) {\n    case HostComponent:\n      parent = parentStateNode;\n      isContainer = false;\n      break;\n    case HostRoot:\n      parent = parentStateNode.containerInfo;\n      isContainer = true;\n      break;\n    case HostPortal:\n      parent = parentStateNode.containerInfo;\n      isContainer = true;\n      break;\n    case FundamentalComponent:\n    // eslint-disable-next-line-no-fallthrough\n    default:\n      {\n        {\n          throw Error( \\\\\"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n        }\n      }\n  }\n  if (parentFiber.flags & ContentReset) {\n    // Reset the text content of the parent before doing any insertions\n    resetTextContent(parent); // Clear ContentReset from the effect tag\n    parentFiber.flags &= ~ContentReset;\n  }\n  var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its\n  // children to find all the terminal nodes.\n  if (isContainer) {\n    insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);\n  } else {\n    insertOrAppendPlacementNode(finishedWork, before, parent);\n  }\n}\nfunction insertOrAppendPlacementNodeIntoContainer(node, before, parent) {\n  var tag = node.tag;\n  var isHost = tag === HostComponent || tag === HostText;\n  if (isHost || enableFundamentalAPI ) {\n    var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n    if (before) {\n      insertInContainerBefore(parent, stateNode, before);\n    } else {\n      appendChildToContainer(parent, stateNode);\n    }\n  } else if (tag === HostPortal) ; else {\n    var child = node.child;\n    if (child !== null) {\n      insertOrAppendPlacementNodeIntoContainer(child, before, parent);\n      var sibling = child.sibling;\n      while (sibling !== null) {\n        insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);\n        sibling = sibling.sibling;\n      }\n    }\n  }\n}\nfunction insertOrAppendPlacementNode(node, before, parent) {\n  var tag = node.tag;\n  var isHost = tag === HostComponent || tag === HostText;\n  if (isHost || enableFundamentalAPI ) {\n    var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n    if (before) {\n      insertBefore(parent, stateNode, before);\n    } else {\n      appendChild(parent, stateNode);\n    }\n  } else if (tag === HostPortal) ; else {\n    var child = node.child;\n    if (child !== null) {\n      insertOrAppendPlacementNode(child, before, parent);\n      var sibling = child.sibling;\n      while (sibling !== null) {\n        insertOrAppendPlacementNode(sibling, before, parent);\n        sibling = sibling.sibling;\n      }\n    }\n  }\n}\nfunction unmountHostComponents(finishedRoot, current, renderPriorityLevel) {\n  // We only have the top Fiber that was deleted but we need to recurse down its\n  // children to find all the terminal nodes.\n  var node = current; // Each iteration, currentParent is populated with node's host parent if not\n  // currentParentIsValid.\n  var currentParentIsValid = false; // Note: these two variables *must* always be updated together.\n  var currentParent;\n  var currentParentIsContainer;\n  while (true) {\n    if (!currentParentIsValid) {\n      var parent = node.return;\n      findParent: while (true) {\n        if (!(parent !== null)) {\n          {\n            throw Error( \\\\\"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n          }\n        }\n        var parentStateNode = parent.stateNode;\n        switch (parent.tag) {\n          case HostComponent:\n            currentParent = parentStateNode;\n            currentParentIsContainer = false;\n            break findParent;\n          case HostRoot:\n            currentParent = parentStateNode.containerInfo;\n            currentParentIsContainer = true;\n            break findParent;\n          case HostPortal:\n            currentParent = parentStateNode.containerInfo;\n            currentParentIsContainer = true;\n            break findParent;\n        }\n        parent = parent.return;\n      }\n      currentParentIsValid = true;\n    }\n    if (node.tag === HostComponent || node.tag === HostText) {\n      commitNestedUnmounts(finishedRoot, node); // After all the children have unmounted, it is now safe to remove the\n      // node from the tree.\n      if (currentParentIsContainer) {\n        removeChildFromContainer(currentParent, node.stateNode);\n      } else {\n        removeChild(currentParent, node.stateNode);\n      } // Don't visit children because we already visited them.\n    } else if (node.tag === HostPortal) {\n      if (node.child !== null) {\n        // When we go into a portal, it becomes the parent to remove from.\n        // We will reassign it back when we pop the portal on the way up.\n        currentParent = node.stateNode.containerInfo;\n        currentParentIsContainer = true; // Visit children because portals might contain host components.\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n    } else {\n      commitUnmount(finishedRoot, node); // Visit children because we may find more host components below.\n      if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n    }\n    if (node === current) {\n      return;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === current) {\n        return;\n      }\n      node = node.return;\n      if (node.tag === HostPortal) {\n        // When we go out of the portal, we need to restore the parent.\n        // Since we don't keep a stack of them, we will search for it.\n        currentParentIsValid = false;\n      }\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n}\nfunction commitDeletion(finishedRoot, current, renderPriorityLevel) {\n  {\n    // Recursively delete all host nodes from the parent.\n    // Detach refs and call componentWillUnmount() on the whole subtree.\n    unmountHostComponents(finishedRoot, current);\n  }\n  var alternate = current.alternate;\n  detachFiberMutation(current);\n  if (alternate !== null) {\n    detachFiberMutation(alternate);\n  }\n}\nfunction commitWork(current, finishedWork) {\n  switch (finishedWork.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case MemoComponent:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        // Layout effects are destroyed during the mutation phase so that all\n        // destroy functions for all fibers are called before any create functions.\n        // This prevents sibling component effects from interfering with each other,\n        // e.g. a destroy function in one component should never override a ref set\n        // by a create function in another component during the same commit.\n        {\n          commitHookEffectListUnmount(Layout | HasEffect, finishedWork);\n        }\n        return;\n      }\n    case ClassComponent:\n      {\n        return;\n      }\n    case HostComponent:\n      {\n        var instance = finishedWork.stateNode;\n        if (instance != null) {\n          // Commit the work prepared earlier.\n          var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n          // as the newProps. The updatePayload will contain the real change in\n          // this case.\n          var oldProps = current !== null ? current.memoizedProps : newProps;\n          var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.\n          var updatePayload = finishedWork.updateQueue;\n          finishedWork.updateQueue = null;\n          if (updatePayload !== null) {\n            commitUpdate(instance, updatePayload, type, oldProps, newProps);\n          }\n        }\n        return;\n      }\n    case HostText:\n      {\n        if (!(finishedWork.stateNode !== null)) {\n          {\n            throw Error( \\\\\"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n          }\n        }\n        var textInstance = finishedWork.stateNode;\n        var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n        // as the newProps. The updatePayload will contain the real change in\n        // this case.\n        var oldText = current !== null ? current.memoizedProps : newText;\n        commitTextUpdate(textInstance, oldText, newText);\n        return;\n      }\n    case HostRoot:\n      {\n        {\n          var _root = finishedWork.stateNode;\n          if (_root.hydrate) {\n            // We've just hydrated. No need to hydrate again.\n            _root.hydrate = false;\n            commitHydratedContainer(_root.containerInfo);\n          }\n        }\n        return;\n      }\n    case Profiler:\n      {\n        return;\n      }\n    case SuspenseComponent:\n      {\n        commitSuspenseComponent(finishedWork);\n        attachSuspenseRetryListeners(finishedWork);\n        return;\n      }\n    case SuspenseListComponent:\n      {\n        attachSuspenseRetryListeners(finishedWork);\n        return;\n      }\n    case IncompleteClassComponent:\n      {\n        return;\n      }\n    case FundamentalComponent:\n      {\n        break;\n      }\n    case ScopeComponent:\n      {\n        break;\n      }\n    case OffscreenComponent:\n    case LegacyHiddenComponent:\n      {\n        var newState = finishedWork.memoizedState;\n        var isHidden = newState !== null;\n        hideOrUnhideAllChildren(finishedWork, isHidden);\n        return;\n      }\n  }\n  {\n    {\n      throw Error( \\\\\"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction commitSuspenseComponent(finishedWork) {\n  var newState = finishedWork.memoizedState;\n  if (newState !== null) {\n    markCommitTimeOfFallback();\n    {\n      // Hide the Offscreen component that contains the primary children. TODO:\n      // Ideally, this effect would have been scheduled on the Offscreen fiber\n      // itself. That's how unhiding works: the Offscreen component schedules an\n      // effect on itself. However, in this case, the component didn't complete,\n      // so the fiber was never added to the effect list in the normal path. We\n      // could have appended it to the effect list in the Suspense component's\n      // second pass, but doing it this way is less complicated. This would be\n      // simpler if we got rid of the effect list and traversed the tree, like\n      // we're planning to do.\n      var primaryChildParent = finishedWork.child;\n      hideOrUnhideAllChildren(primaryChildParent, true);\n    }\n  }\n}\nfunction commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {\n  var newState = finishedWork.memoizedState;\n  if (newState === null) {\n    var current = finishedWork.alternate;\n    if (current !== null) {\n      var prevState = current.memoizedState;\n      if (prevState !== null) {\n        var suspenseInstance = prevState.dehydrated;\n        if (suspenseInstance !== null) {\n          commitHydratedSuspenseInstance(suspenseInstance);\n        }\n      }\n    }\n  }\n}\nfunction attachSuspenseRetryListeners(finishedWork) {\n  // If this boundary just timed out, then it will have a set of wakeables.\n  // For each wakeable, attach a listener so that when it resolves, React\n  // attempts to re-render the boundary in the primary (pre-timeout) state.\n  var wakeables = finishedWork.updateQueue;\n  if (wakeables !== null) {\n    finishedWork.updateQueue = null;\n    var retryCache = finishedWork.stateNode;\n    if (retryCache === null) {\n      retryCache = finishedWork.stateNode = new PossiblyWeakSet();\n    }\n    wakeables.forEach(function (wakeable) {\n      // Memoize using the boundary fiber to prevent redundant listeners.\n      var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);\n      if (!retryCache.has(wakeable)) {\n        {\n          if (wakeable.__reactDoNotTraceInteractions !== true) {\n            retry = tracing$1.unstable_wrap(retry);\n          }\n        }\n        retryCache.add(wakeable);\n        wakeable.then(retry, retry);\n      }\n    });\n  }\n} // This function detects when a Suspense boundary goes from visible to hidden.\n// It returns false if the boundary is already hidden.\n// TODO: Use an effect tag.\nfunction isSuspenseBoundaryBeingHidden(current, finishedWork) {\n  if (current !== null) {\n    var oldState = current.memoizedState;\n    if (oldState === null || oldState.dehydrated !== null) {\n      var newState = finishedWork.memoizedState;\n      return newState !== null && newState.dehydrated === null;\n    }\n  }\n  return false;\n}\nfunction commitResetTextContent(current) {\n  resetTextContent(current.stateNode);\n}\nif (typeof Symbol === 'function' && Symbol.for) {\n  var symbolFor$1 = Symbol.for;\n  symbolFor$1('selector.component');\n  symbolFor$1('selector.has_pseudo_class');\n  symbolFor$1('selector.role');\n  symbolFor$1('selector.test_id');\n  symbolFor$1('selector.text');\n}\nvar commitHooks = [];\nfunction onCommitRoot$1() {\n  {\n    commitHooks.forEach(function (commitHook) {\n      return commitHook();\n    });\n  }\n}\nvar ceil = Math.ceil;\nvar ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,\n    ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,\n    IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;\nvar NoContext =\n/*             */\n0;\nvar BatchedContext =\n/*               */\n1;\nvar EventContext =\n/*                 */\n2;\nvar DiscreteEventContext =\n/*         */\n4;\nvar LegacyUnbatchedContext =\n/*       */\n8;\nvar RenderContext =\n/*                */\n16;\nvar CommitContext =\n/*                */\n32;\nvar RetryAfterError =\n/*       */\n64;\nvar RootIncomplete = 0;\nvar RootFatalErrored = 1;\nvar RootErrored = 2;\nvar RootSuspended = 3;\nvar RootSuspendedWithDelay = 4;\nvar RootCompleted = 5; // Describes where we are in the React execution stack\nvar executionContext = NoContext; // The root we're working on\nvar workInProgressRoot = null; // The fiber we're working on\nvar workInProgress = null; // The lanes we're rendering\nvar workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree\n// This is a superset of the lanes we started working on at the root. The only\n// case where it's different from \\`workInProgressRootRenderLanes\\` is when we\n// enter a subtree that is hidden and needs to be unhidden: Suspense and\n// Offscreen component.\n//\n// Most things in the work loop should deal with workInProgressRootRenderLanes.\n// Most things in begin/complete phases should deal with subtreeRenderLanes.\nvar subtreeRenderLanes = NoLanes;\nvar subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc.\nvar workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown\nvar workInProgressRootFatalError = null; // \\\\\"Included\\\\\" lanes refer to lanes that were worked on during this render. It's\n// slightly different than \\`renderLanes\\` because \\`renderLanes\\` can change as you\n// enter and exit an Offscreen tree. This value is the combination of all render\n// lanes for the entire render phase.\nvar workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only\n// includes unprocessed updates, not work in bailed out children.\nvar workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render.\nvar workInProgressRootUpdatedLanes = NoLanes; // Lanes that were pinged (in an interleaved event) during this render.\nvar workInProgressRootPingedLanes = NoLanes;\nvar mostRecentlyUpdatedRoot = null; // The most recent time we committed a fallback. This lets us ensure a train\n// model where we don't commit new loading states in too quick succession.\nvar globalMostRecentFallbackTime = 0;\nvar FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering\n// more and prefer CPU suspense heuristics instead.\nvar workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU\n// suspense heuristics and opt out of rendering more content.\nvar RENDER_TIMEOUT_MS = 500;\nfunction resetRenderTimer() {\n  workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;\n}\nfunction getRenderTargetTime() {\n  return workInProgressRootRenderTargetTime;\n}\nvar nextEffect = null;\nvar hasUncaughtError = false;\nvar firstUncaughtError = null;\nvar legacyErrorBoundariesThatAlreadyFailed = null;\nvar rootDoesHavePassiveEffects = false;\nvar rootWithPendingPassiveEffects = null;\nvar pendingPassiveEffectsRenderPriority = NoPriority$1;\nvar pendingPassiveEffectsLanes = NoLanes;\nvar pendingPassiveHookEffectsMount = [];\nvar pendingPassiveHookEffectsUnmount = [];\nvar rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates\nvar NESTED_UPDATE_LIMIT = 50;\nvar nestedUpdateCount = 0;\nvar rootWithNestedUpdates = null;\nvar NESTED_PASSIVE_UPDATE_LIMIT = 50;\nvar nestedPassiveUpdateCount = 0; // Marks the need to reschedule pending interactions at these lanes\n// during the commit phase. This enables them to be traced across components\n// that spawn new work during render. E.g. hidden boundaries, suspended SSR\n// hydration or SuspenseList.\n// TODO: Can use a bitmask instead of an array\nvar spawnedWorkDuringRender = null; // If two updates are scheduled within the same event, we should treat their\n// event times as simultaneous, even if the actual clock time has advanced\n// between the first and second call.\nvar currentEventTime = NoTimestamp;\nvar currentEventWipLanes = NoLanes;\nvar currentEventPendingLanes = NoLanes; // Dev only flag that tracks if passive effects are currently being flushed.\n// We warn about state updates for unmounted components differently in this case.\nvar isFlushingPassiveEffects = false;\nvar focusedInstanceHandle = null;\nvar shouldFireAfterActiveInstanceBlur = false;\nfunction getWorkInProgressRoot() {\n  return workInProgressRoot;\n}\nfunction requestEventTime() {\n  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n    // We're inside React, so it's fine to read the actual time.\n    return now();\n  } // We're not inside React, so we may be in the middle of a browser event.\n  if (currentEventTime !== NoTimestamp) {\n    // Use the same start time for all updates until we enter React again.\n    return currentEventTime;\n  } // This is the first update since React yielded. Compute a new start time.\n  currentEventTime = now();\n  return currentEventTime;\n}\nfunction requestUpdateLane(fiber) {\n  // Special cases\n  var mode = fiber.mode;\n  if ((mode & BlockingMode) === NoMode) {\n    return SyncLane;\n  } else if ((mode & ConcurrentMode) === NoMode) {\n    return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;\n  } // The algorithm for assigning an update to a lane should be stable for all\n  // updates at the same priority within the same event. To do this, the inputs\n  // to the algorithm must be the same. For example, we use the \\`renderLanes\\`\n  // to avoid choosing a lane that is already in the middle of rendering.\n  //\n  // However, the \\\\\"included\\\\\" lanes could be mutated in between updates in the\n  // same event, like if you perform an update inside \\`flushSync\\`. Or any other\n  // code path that might call \\`prepareFreshStack\\`.\n  //\n  // The trick we use is to cache the first of each of these inputs within an\n  // event. Then reset the cached values once we can be sure the event is over.\n  // Our heuristic for that is whenever we enter a concurrent work loop.\n  //\n  // We'll do the same for \\`currentEventPendingLanes\\` below.\n  if (currentEventWipLanes === NoLanes) {\n    currentEventWipLanes = workInProgressRootIncludedLanes;\n  }\n  var isTransition = requestCurrentTransition() !== NoTransition;\n  if (isTransition) {\n    if (currentEventPendingLanes !== NoLanes) {\n      currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;\n    }\n    return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);\n  } // TODO: Remove this dependency on the Scheduler priority.\n  // To do that, we're replacing it with an update lane priority.\n  var schedulerPriority = getCurrentPriorityLevel(); // The old behavior was using the priority level of the Scheduler.\n  // This couples React to the Scheduler internals, so we're replacing it\n  // with the currentUpdateLanePriority above. As an example of how this\n  // could be problematic, if we're not inside \\`Scheduler.runWithPriority\\`,\n  // then we'll get the priority of the current running Scheduler task,\n  // which is probably not what we want.\n  var lane;\n  if ( // TODO: Temporary. We're removing the concept of discrete updates.\n  (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2) {\n    lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);\n  } else {\n    var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);\n    lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);\n  }\n  return lane;\n}\nfunction requestRetryLane(fiber) {\n  // This is a fork of \\`requestUpdateLane\\` designed specifically for Suspense\n  // \\\\\"retries\\\\\" — a special update that attempts to flip a Suspense boundary\n  // from its placeholder state to its primary/resolved state.\n  // Special cases\n  var mode = fiber.mode;\n  if ((mode & BlockingMode) === NoMode) {\n    return SyncLane;\n  } else if ((mode & ConcurrentMode) === NoMode) {\n    return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;\n  } // See \\`requestUpdateLane\\` for explanation of \\`currentEventWipLanes\\`\n  if (currentEventWipLanes === NoLanes) {\n    currentEventWipLanes = workInProgressRootIncludedLanes;\n  }\n  return findRetryLane(currentEventWipLanes);\n}\nfunction scheduleUpdateOnFiber(fiber, lane, eventTime) {\n  checkForNestedUpdates();\n  warnAboutRenderPhaseUpdatesInDEV(fiber);\n  var root = markUpdateLaneFromFiberToRoot(fiber, lane);\n  if (root === null) {\n    warnAboutUpdateOnUnmountedFiberInDEV(fiber);\n    return null;\n  } // Mark that the root has a pending update.\n  markRootUpdated(root, lane, eventTime);\n  if (root === workInProgressRoot) {\n    // Received an update to a tree that's in the middle of rendering. Mark\n    // that there was an interleaved update work on this root. Unless the\n    // \\`deferRenderPhaseUpdateToNextBatch\\` flag is off and this is a render\n    // phase update. In that case, we don't treat render phase updates as if\n    // they were interleaved, for backwards compat reasons.\n    {\n      workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);\n    }\n    if (workInProgressRootExitStatus === RootSuspendedWithDelay) {\n      // The root already suspended with a delay, which means this render\n      // definitely won't finish. Since we have a new update, let's mark it as\n      // suspended now, right before marking the incoming update. This has the\n      // effect of interrupting the current render and switching to the update.\n      // TODO: Make sure this doesn't override pings that happen while we've\n      // already started rendering.\n      markRootSuspended$1(root, workInProgressRootRenderLanes);\n    }\n  } // TODO: requestUpdateLanePriority also reads the priority. Pass the\n  // priority as an argument to that function and this one.\n  var priorityLevel = getCurrentPriorityLevel();\n  if (lane === SyncLane) {\n    if ( // Check if we're inside unbatchedUpdates\n    (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering\n    (executionContext & (RenderContext | CommitContext)) === NoContext) {\n      // Register pending interactions on the root to avoid losing traced interaction data.\n      schedulePendingInteractions(root, lane); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed\n      // root inside of batchedUpdates should be synchronous, but layout updates\n      // should be deferred until the end of the batch.\n      performSyncWorkOnRoot(root);\n    } else {\n      ensureRootIsScheduled(root, eventTime);\n      schedulePendingInteractions(root, lane);\n      if (executionContext === NoContext) {\n        // Flush the synchronous work now, unless we're already working or inside\n        // a batch. This is intentionally inside scheduleUpdateOnFiber instead of\n        // scheduleCallbackForFiber to preserve the ability to schedule a callback\n        // without immediately flushing it. We only do this for user-initiated\n        // updates, to preserve historical behavior of legacy mode.\n        resetRenderTimer();\n        flushSyncCallbackQueue();\n      }\n    }\n  } else {\n    // Schedule a discrete update but only if it's not Sync.\n    if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered\n    // discrete, even inside a discrete event.\n    priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {\n      // This is the result of a discrete event. Track the lowest priority\n      // discrete update per root so we can flush them early, if needed.\n      if (rootsWithPendingDiscreteUpdates === null) {\n        rootsWithPendingDiscreteUpdates = new Set([root]);\n      } else {\n        rootsWithPendingDiscreteUpdates.add(root);\n      }\n    } // Schedule other updates after in case the callback is sync.\n    ensureRootIsScheduled(root, eventTime);\n    schedulePendingInteractions(root, lane);\n  } // We use this when assigning a lane for a transition inside\n  // \\`requestUpdateLane\\`. We assume it's the same as the root being updated,\n  // since in the common case of a single root app it probably is. If it's not\n  // the same root, then it's not a huge deal, we just might batch more stuff\n  // together more than necessary.\n  mostRecentlyUpdatedRoot = root;\n} // This is split into a separate function so we can mark a fiber with pending\n// work without treating it as a typical update that originates from an event;\n// e.g. retrying a Suspense boundary isn't an update, but it does schedule work\n// on a fiber.\nfunction markUpdateLaneFromFiberToRoot(sourceFiber, lane) {\n  // Update the source fiber's lanes\n  sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);\n  var alternate = sourceFiber.alternate;\n  if (alternate !== null) {\n    alternate.lanes = mergeLanes(alternate.lanes, lane);\n  }\n  {\n    if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {\n      warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);\n    }\n  } // Walk the parent path to the root and update the child expiration time.\n  var node = sourceFiber;\n  var parent = sourceFiber.return;\n  while (parent !== null) {\n    parent.childLanes = mergeLanes(parent.childLanes, lane);\n    alternate = parent.alternate;\n    if (alternate !== null) {\n      alternate.childLanes = mergeLanes(alternate.childLanes, lane);\n    } else {\n      {\n        if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {\n          warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);\n        }\n      }\n    }\n    node = parent;\n    parent = parent.return;\n  }\n  if (node.tag === HostRoot) {\n    var root = node.stateNode;\n    return root;\n  } else {\n    return null;\n  }\n} // Use this function to schedule a task for a root. There's only one task per\n// root; if a task was already scheduled, we'll check to make sure the priority\n// of the existing task is the same as the priority of the next level that the\n// root has work on. This function is called on every update, and right before\n// exiting a task.\nfunction ensureRootIsScheduled(root, currentTime) {\n  var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as\n  // expired so we know to work on those next.\n  markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority.\n  var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); // This returns the priority level computed during the \\`getNextLanes\\` call.\n  var newCallbackPriority = returnNextLanesPriority();\n  if (nextLanes === NoLanes) {\n    // Special case: There's nothing to work on.\n    if (existingCallbackNode !== null) {\n      cancelCallback(existingCallbackNode);\n      root.callbackNode = null;\n      root.callbackPriority = NoLanePriority;\n    }\n    return;\n  } // Check if there's an existing task. We may be able to reuse it.\n  if (existingCallbackNode !== null) {\n    var existingCallbackPriority = root.callbackPriority;\n    if (existingCallbackPriority === newCallbackPriority) {\n      // The priority hasn't changed. We can reuse the existing task. Exit.\n      return;\n    } // The priority changed. Cancel the existing callback. We'll schedule a new\n    // one below.\n    cancelCallback(existingCallbackNode);\n  } // Schedule a new callback.\n  var newCallbackNode;\n  if (newCallbackPriority === SyncLanePriority) {\n    // Special case: Sync React callbacks are scheduled on a special\n    // internal queue\n    newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n  } else if (newCallbackPriority === SyncBatchedLanePriority) {\n    newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root));\n  } else {\n    var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);\n    newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n  }\n  root.callbackPriority = newCallbackPriority;\n  root.callbackNode = newCallbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that\n// goes through Scheduler.\nfunction performConcurrentWorkOnRoot(root) {\n  // Since we know we're in a React event, we can clear the current\n  // event time. The next update will compute a new event time.\n  currentEventTime = NoTimestamp;\n  currentEventWipLanes = NoLanes;\n  currentEventPendingLanes = NoLanes;\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Should not already be working.\\\\\" );\n    }\n  } // Flush any pending passive effects before deciding which lanes to work on,\n  // in case they schedule additional work.\n  var originalCallbackNode = root.callbackNode;\n  var didFlushPassiveEffects = flushPassiveEffects();\n  if (didFlushPassiveEffects) {\n    // Something in the passive effect phase may have canceled the current task.\n    // Check if the task node for this root was changed.\n    if (root.callbackNode !== originalCallbackNode) {\n      // The current task was canceled. Exit. We don't need to call\n      // \\`ensureRootIsScheduled\\` because the check above implies either that\n      // there's a new task, or that there's no remaining work on this root.\n      return null;\n    }\n  } // Determine the next expiration time to work on, using the fields stored\n  // on the root.\n  var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);\n  if (lanes === NoLanes) {\n    // Defensive coding. This is never expected to happen.\n    return null;\n  }\n  var exitStatus = renderRootConcurrent(root, lanes);\n  if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n    // The render included lanes that were updated during the render phase.\n    // For example, when unhiding a hidden tree, we include all the lanes\n    // that were previously skipped when the tree was hidden. That set of\n    // lanes is a superset of the lanes we started rendering with.\n    //\n    // So we'll throw out the current work and restart.\n    prepareFreshStack(root, NoLanes);\n  } else if (exitStatus !== RootIncomplete) {\n    if (exitStatus === RootErrored) {\n      executionContext |= RetryAfterError; // If an error occurred during hydration,\n      // discard server response and fall back to client side render.\n      if (root.hydrate) {\n        root.hydrate = false;\n        clearContainer(root.containerInfo);\n      } // If something threw an error, try rendering one more time. We'll render\n      // synchronously to block concurrent data mutations, and we'll includes\n      // all pending updates are included. If it still fails after the second\n      // attempt, we'll give up and commit the resulting tree.\n      lanes = getLanesToRetrySynchronouslyOnError(root);\n      if (lanes !== NoLanes) {\n        exitStatus = renderRootSync(root, lanes);\n      }\n    }\n    if (exitStatus === RootFatalErrored) {\n      var fatalError = workInProgressRootFatalError;\n      prepareFreshStack(root, NoLanes);\n      markRootSuspended$1(root, lanes);\n      ensureRootIsScheduled(root, now());\n      throw fatalError;\n    } // We now have a consistent tree. The next step is either to commit it,\n    // or, if something suspended, wait to commit it after a timeout.\n    var finishedWork = root.current.alternate;\n    root.finishedWork = finishedWork;\n    root.finishedLanes = lanes;\n    finishConcurrentRender(root, exitStatus, lanes);\n  }\n  ensureRootIsScheduled(root, now());\n  if (root.callbackNode === originalCallbackNode) {\n    // The task node scheduled for this root is the same one that's\n    // currently executed. Need to return a continuation.\n    return performConcurrentWorkOnRoot.bind(null, root);\n  }\n  return null;\n}\nfunction finishConcurrentRender(root, exitStatus, lanes) {\n  switch (exitStatus) {\n    case RootIncomplete:\n    case RootFatalErrored:\n      {\n        {\n          {\n            throw Error( \\\\\"Root did not complete. This is a bug in React.\\\\\" );\n          }\n        }\n      }\n    // Flow knows about invariant, so it complains if I add a break\n    // statement, but eslint doesn't know about invariant, so it complains\n    // if I do. eslint-disable-next-line no-fallthrough\n    case RootErrored:\n      {\n        // We should have already attempted to retry this tree. If we reached\n        // this point, it errored again. Commit it.\n        commitRoot(root);\n        break;\n      }\n    case RootSuspended:\n      {\n        markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we\n        // should immediately commit it or wait a bit.\n        if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope\n        !shouldForceFlushFallbacksInDEV()) {\n          // This render only included retries, no updates. Throttle committing\n          // retries so that we don't show too many loading states too quickly.\n          var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.\n          if (msUntilTimeout > 10) {\n            var nextLanes = getNextLanes(root, NoLanes);\n            if (nextLanes !== NoLanes) {\n              // There's additional work on this root.\n              break;\n            }\n            var suspendedLanes = root.suspendedLanes;\n            if (!isSubsetOfLanes(suspendedLanes, lanes)) {\n              // We should prefer to render the fallback of at the last\n              // suspended level. Ping the last suspended level to try\n              // rendering it again.\n              // FIXME: What if the suspended lanes are Idle? Should not restart.\n              var eventTime = requestEventTime();\n              markRootPinged(root, suspendedLanes);\n              break;\n            } // The render is suspended, it hasn't timed out, and there's no\n            // lower priority work to do. Instead of committing the fallback\n            // immediately, wait for more data to arrive.\n            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);\n            break;\n          }\n        } // The work expired. Commit immediately.\n        commitRoot(root);\n        break;\n      }\n    case RootSuspendedWithDelay:\n      {\n        markRootSuspended$1(root, lanes);\n        if (includesOnlyTransitions(lanes)) {\n          // This is a transition, so we should exit without committing a\n          // placeholder and without scheduling a timeout. Delay indefinitely\n          // until we receive more data.\n          break;\n        }\n        {\n          // This is not a transition, but we did trigger an avoided state.\n          // Schedule a placeholder to display after a short delay, using the Just\n          // Noticeable Difference.\n          // TODO: Is the JND optimization worth the added complexity? If this is\n          // the only reason we track the event time, then probably not.\n          // Consider removing.\n          var mostRecentEventTime = getMostRecentEventTime(root, lanes);\n          var eventTimeMs = mostRecentEventTime;\n          var timeElapsedMs = now() - eventTimeMs;\n          var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.\n          if (_msUntilTimeout > 10) {\n            // Instead of committing the fallback immediately, wait for more data\n            // to arrive.\n            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);\n            break;\n          }\n        } // Commit the placeholder.\n        commitRoot(root);\n        break;\n      }\n    case RootCompleted:\n      {\n        // The work completed. Ready to commit.\n        commitRoot(root);\n        break;\n      }\n    default:\n      {\n        {\n          {\n            throw Error( \\\\\"Unknown root exit status.\\\\\" );\n          }\n        }\n      }\n  }\n}\nfunction markRootSuspended$1(root, suspendedLanes) {\n  // When suspending, we should always exclude lanes that were pinged or (more\n  // rarely, since we try to avoid it) updated during the render phase.\n  // TODO: Lol maybe there's a better way to factor this besides this\n  // obnoxiously named function :)\n  suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);\n  suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);\n  markRootSuspended(root, suspendedLanes);\n} // This is the entry point for synchronous tasks that don't go\n// through Scheduler\nfunction performSyncWorkOnRoot(root) {\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Should not already be working.\\\\\" );\n    }\n  }\n  flushPassiveEffects();\n  var lanes;\n  var exitStatus;\n  if (root === workInProgressRoot && includesSomeLane(root.expiredLanes, workInProgressRootRenderLanes)) {\n    // There's a partial tree, and at least one of its lanes has expired. Finish\n    // rendering it before rendering the rest of the expired work.\n    lanes = workInProgressRootRenderLanes;\n    exitStatus = renderRootSync(root, lanes);\n    if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n      // The render included lanes that were updated during the render phase.\n      // For example, when unhiding a hidden tree, we include all the lanes\n      // that were previously skipped when the tree was hidden. That set of\n      // lanes is a superset of the lanes we started rendering with.\n      //\n      // Note that this only happens when part of the tree is rendered\n      // concurrently. If the whole tree is rendered synchronously, then there\n      // are no interleaved events.\n      lanes = getNextLanes(root, lanes);\n      exitStatus = renderRootSync(root, lanes);\n    }\n  } else {\n    lanes = getNextLanes(root, NoLanes);\n    exitStatus = renderRootSync(root, lanes);\n  }\n  if (root.tag !== LegacyRoot && exitStatus === RootErrored) {\n    executionContext |= RetryAfterError; // If an error occurred during hydration,\n    // discard server response and fall back to client side render.\n    if (root.hydrate) {\n      root.hydrate = false;\n      clearContainer(root.containerInfo);\n    } // If something threw an error, try rendering one more time. We'll render\n    // synchronously to block concurrent data mutations, and we'll includes\n    // all pending updates are included. If it still fails after the second\n    // attempt, we'll give up and commit the resulting tree.\n    lanes = getLanesToRetrySynchronouslyOnError(root);\n    if (lanes !== NoLanes) {\n      exitStatus = renderRootSync(root, lanes);\n    }\n  }\n  if (exitStatus === RootFatalErrored) {\n    var fatalError = workInProgressRootFatalError;\n    prepareFreshStack(root, NoLanes);\n    markRootSuspended$1(root, lanes);\n    ensureRootIsScheduled(root, now());\n    throw fatalError;\n  } // We now have a consistent tree. Because this is a sync render, we\n  // will commit it even if something suspended.\n  var finishedWork = root.current.alternate;\n  root.finishedWork = finishedWork;\n  root.finishedLanes = lanes;\n  commitRoot(root); // Before exiting, make sure there's a callback scheduled for the next\n  // pending level.\n  ensureRootIsScheduled(root, now());\n  return null;\n}\nfunction flushDiscreteUpdates() {\n  // TODO: Should be able to flush inside batchedUpdates, but not inside \\`act\\`.\n  // However, \\`act\\` uses \\`batchedUpdates\\`, so there's no way to distinguish\n  // those two cases. Need to fix this before exposing flushDiscreteUpdates\n  // as a public API.\n  if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {\n    {\n      if ((executionContext & RenderContext) !== NoContext) {\n        error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');\n      }\n    } // We're already rendering, so we can't synchronously flush pending work.\n    // This is probably a nested event dispatch triggered by a lifecycle/effect,\n    // like \\`el.focus()\\`. Exit.\n    return;\n  }\n  flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that\n  // they fire before the next serial event.\n  flushPassiveEffects();\n}\nfunction flushPendingDiscreteUpdates() {\n  if (rootsWithPendingDiscreteUpdates !== null) {\n    // For each root with pending discrete updates, schedule a callback to\n    // immediately flush them.\n    var roots = rootsWithPendingDiscreteUpdates;\n    rootsWithPendingDiscreteUpdates = null;\n    roots.forEach(function (root) {\n      markDiscreteUpdatesExpired(root);\n      ensureRootIsScheduled(root, now());\n    });\n  } // Now flush the immediate queue.\n  flushSyncCallbackQueue();\n}\nfunction batchedUpdates$1(fn, a) {\n  var prevExecutionContext = executionContext;\n  executionContext |= BatchedContext;\n  try {\n    return fn(a);\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      resetRenderTimer();\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction batchedEventUpdates$1(fn, a) {\n  var prevExecutionContext = executionContext;\n  executionContext |= EventContext;\n  try {\n    return fn(a);\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      resetRenderTimer();\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction discreteUpdates$1(fn, a, b, c, d) {\n  var prevExecutionContext = executionContext;\n  executionContext |= DiscreteEventContext;\n  {\n    try {\n      return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a, b, c, d));\n    } finally {\n      executionContext = prevExecutionContext;\n      if (executionContext === NoContext) {\n        // Flush the immediate callbacks that were scheduled during this batch\n        resetRenderTimer();\n        flushSyncCallbackQueue();\n      }\n    }\n  }\n}\nfunction unbatchedUpdates(fn, a) {\n  var prevExecutionContext = executionContext;\n  executionContext &= ~BatchedContext;\n  executionContext |= LegacyUnbatchedContext;\n  try {\n    return fn(a);\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      resetRenderTimer();\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction flushSync(fn, a) {\n  var prevExecutionContext = executionContext;\n  if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {\n    {\n      error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.');\n    }\n    return fn(a);\n  }\n  executionContext |= BatchedContext;\n  {\n    try {\n      if (fn) {\n        return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a));\n      } else {\n        return undefined;\n      }\n    } finally {\n      executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.\n      // Note that this will happen even if batchedUpdates is higher up\n      // the stack.\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction pushRenderLanes(fiber, lanes) {\n  push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);\n  subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);\n  workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);\n}\nfunction popRenderLanes(fiber) {\n  subtreeRenderLanes = subtreeRenderLanesCursor.current;\n  pop(subtreeRenderLanesCursor, fiber);\n}\nfunction prepareFreshStack(root, lanes) {\n  root.finishedWork = null;\n  root.finishedLanes = NoLanes;\n  var timeoutHandle = root.timeoutHandle;\n  if (timeoutHandle !== noTimeout) {\n    // The root previous suspended and scheduled a timeout to commit a fallback\n    // state. Now that we have additional work, cancel the timeout.\n    root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above\n    cancelTimeout(timeoutHandle);\n  }\n  if (workInProgress !== null) {\n    var interruptedWork = workInProgress.return;\n    while (interruptedWork !== null) {\n      unwindInterruptedWork(interruptedWork);\n      interruptedWork = interruptedWork.return;\n    }\n  }\n  workInProgressRoot = root;\n  workInProgress = createWorkInProgress(root.current, null);\n  workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;\n  workInProgressRootExitStatus = RootIncomplete;\n  workInProgressRootFatalError = null;\n  workInProgressRootSkippedLanes = NoLanes;\n  workInProgressRootUpdatedLanes = NoLanes;\n  workInProgressRootPingedLanes = NoLanes;\n  {\n    spawnedWorkDuringRender = null;\n  }\n  {\n    ReactStrictModeWarnings.discardPendingWarnings();\n  }\n}\nfunction handleError(root, thrownValue) {\n  do {\n    var erroredWork = workInProgress;\n    try {\n      // Reset module-level state that was set during the render phase.\n      resetContextDependencies();\n      resetHooksAfterThrow();\n      resetCurrentFiber(); // TODO: I found and added this missing line while investigating a\n      // separate issue. Write a regression test using string refs.\n      ReactCurrentOwner$2.current = null;\n      if (erroredWork === null || erroredWork.return === null) {\n        // Expected to be working on a non-root fiber. This is a fatal error\n        // because there's no ancestor that can handle it; the root is\n        // supposed to capture all errors that weren't caught by an error\n        // boundary.\n        workInProgressRootExitStatus = RootFatalErrored;\n        workInProgressRootFatalError = thrownValue; // Set \\`workInProgress\\` to null. This represents advancing to the next\n        // sibling, or the parent if there are no siblings. But since the root\n        // has no siblings nor a parent, we set it to null. Usually this is\n        // handled by \\`completeUnitOfWork\\` or \\`unwindWork\\`, but since we're\n        // intentionally not calling those, we need set it here.\n        // TODO: Consider calling \\`unwindWork\\` to pop the contexts.\n        workInProgress = null;\n        return;\n      }\n      if (enableProfilerTimer && erroredWork.mode & ProfileMode) {\n        // Record the time spent rendering before an error was thrown. This\n        // avoids inaccurate Profiler durations in the case of a\n        // suspended render.\n        stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);\n      }\n      throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);\n      completeUnitOfWork(erroredWork);\n    } catch (yetAnotherThrownValue) {\n      // Something in the return path also threw.\n      thrownValue = yetAnotherThrownValue;\n      if (workInProgress === erroredWork && erroredWork !== null) {\n        // If this boundary has already errored, then we had trouble processing\n        // the error. Bubble it to the next boundary.\n        erroredWork = erroredWork.return;\n        workInProgress = erroredWork;\n      } else {\n        erroredWork = workInProgress;\n      }\n      continue;\n    } // Return to the normal work loop.\n    return;\n  } while (true);\n}\nfunction pushDispatcher() {\n  var prevDispatcher = ReactCurrentDispatcher$2.current;\n  ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;\n  if (prevDispatcher === null) {\n    // The React isomorphic package does not include a default dispatcher.\n    // Instead the first renderer will lazily attach one, in order to give\n    // nicer error messages.\n    return ContextOnlyDispatcher;\n  } else {\n    return prevDispatcher;\n  }\n}\nfunction popDispatcher(prevDispatcher) {\n  ReactCurrentDispatcher$2.current = prevDispatcher;\n}\nfunction pushInteractions(root) {\n  {\n    var prevInteractions = tracing$1.__interactionsRef.current;\n    tracing$1.__interactionsRef.current = root.memoizedInteractions;\n    return prevInteractions;\n  }\n}\nfunction popInteractions(prevInteractions) {\n  {\n    tracing$1.__interactionsRef.current = prevInteractions;\n  }\n}\nfunction markCommitTimeOfFallback() {\n  globalMostRecentFallbackTime = now();\n}\nfunction markSkippedUpdateLanes(lane) {\n  workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);\n}\nfunction renderDidSuspend() {\n  if (workInProgressRootExitStatus === RootIncomplete) {\n    workInProgressRootExitStatus = RootSuspended;\n  }\n}\nfunction renderDidSuspendDelayIfPossible() {\n  if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {\n    workInProgressRootExitStatus = RootSuspendedWithDelay;\n  } // Check if there are updates that we skipped tree that might have unblocked\n  // this render.\n  if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {\n    // Mark the current render as suspended so that we switch to working on\n    // the updates that were skipped. Usually we only suspend at the end of\n    // the render phase.\n    // TODO: We should probably always mark the root as suspended immediately\n    // (inside this function), since by suspending at the end of the render\n    // phase introduces a potential mistake where we suspend lanes that were\n    // pinged or updated while we were rendering.\n    markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);\n  }\n}\nfunction renderDidError() {\n  if (workInProgressRootExitStatus !== RootCompleted) {\n    workInProgressRootExitStatus = RootErrored;\n  }\n} // Called during render to determine if anything has suspended.\n// Returns false if we're not sure.\nfunction renderHasNotSuspendedYet() {\n  // If something errored or completed, we can't really be sure,\n  // so those are false.\n  return workInProgressRootExitStatus === RootIncomplete;\n}\nfunction renderRootSync(root, lanes) {\n  var prevExecutionContext = executionContext;\n  executionContext |= RenderContext;\n  var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack\n  // and prepare a fresh one. Otherwise we'll continue where we left off.\n  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {\n    prepareFreshStack(root, lanes);\n    startWorkOnPendingInteractions(root, lanes);\n  }\n  var prevInteractions = pushInteractions(root);\n  do {\n    try {\n      workLoopSync();\n      break;\n    } catch (thrownValue) {\n      handleError(root, thrownValue);\n    }\n  } while (true);\n  resetContextDependencies();\n  {\n    popInteractions(prevInteractions);\n  }\n  executionContext = prevExecutionContext;\n  popDispatcher(prevDispatcher);\n  if (workInProgress !== null) {\n    // This is a sync render, so we should have finished the whole tree.\n    {\n      {\n        throw Error( \\\\\"Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  }\n  workInProgressRoot = null;\n  workInProgressRootRenderLanes = NoLanes;\n  return workInProgressRootExitStatus;\n} // The work loop is an extremely hot path. Tell Closure not to inline it.\n/** @noinline */\nfunction workLoopSync() {\n  // Already timed out, so perform work without checking if we need to yield.\n  while (workInProgress !== null) {\n    performUnitOfWork(workInProgress);\n  }\n}\nfunction renderRootConcurrent(root, lanes) {\n  var prevExecutionContext = executionContext;\n  executionContext |= RenderContext;\n  var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack\n  // and prepare a fresh one. Otherwise we'll continue where we left off.\n  if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {\n    resetRenderTimer();\n    prepareFreshStack(root, lanes);\n    startWorkOnPendingInteractions(root, lanes);\n  }\n  var prevInteractions = pushInteractions(root);\n  do {\n    try {\n      workLoopConcurrent();\n      break;\n    } catch (thrownValue) {\n      handleError(root, thrownValue);\n    }\n  } while (true);\n  resetContextDependencies();\n  {\n    popInteractions(prevInteractions);\n  }\n  popDispatcher(prevDispatcher);\n  executionContext = prevExecutionContext;\n  if (workInProgress !== null) {\n    return RootIncomplete;\n  } else {\n    workInProgressRoot = null;\n    workInProgressRootRenderLanes = NoLanes; // Return the final exit status.\n    return workInProgressRootExitStatus;\n  }\n}\n/** @noinline */\nfunction workLoopConcurrent() {\n  // Perform work until Scheduler asks us to yield\n  while (workInProgress !== null && !shouldYield()) {\n    performUnitOfWork(workInProgress);\n  }\n}\nfunction performUnitOfWork(unitOfWork) {\n  // The current, flushed, state of this fiber is the alternate. Ideally\n  // nothing should rely on this, but relying on it here means that we don't\n  // need an additional field on the work in progress.\n  var current = unitOfWork.alternate;\n  setCurrentFiber(unitOfWork);\n  var next;\n  if ( (unitOfWork.mode & ProfileMode) !== NoMode) {\n    startProfilerTimer(unitOfWork);\n    next = beginWork$1(current, unitOfWork, subtreeRenderLanes);\n    stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);\n  } else {\n    next = beginWork$1(current, unitOfWork, subtreeRenderLanes);\n  }\n  resetCurrentFiber();\n  unitOfWork.memoizedProps = unitOfWork.pendingProps;\n  if (next === null) {\n    // If this doesn't spawn new work, complete the current work.\n    completeUnitOfWork(unitOfWork);\n  } else {\n    workInProgress = next;\n  }\n  ReactCurrentOwner$2.current = null;\n}\nfunction completeUnitOfWork(unitOfWork) {\n  // Attempt to complete the current unit of work, then move to the next\n  // sibling. If there are no more siblings, return to the parent fiber.\n  var completedWork = unitOfWork;\n  do {\n    // The current, flushed, state of this fiber is the alternate. Ideally\n    // nothing should rely on this, but relying on it here means that we don't\n    // need an additional field on the work in progress.\n    var current = completedWork.alternate;\n    var returnFiber = completedWork.return; // Check if the work completed or if something threw.\n    if ((completedWork.flags & Incomplete) === NoFlags) {\n      setCurrentFiber(completedWork);\n      var next = void 0;\n      if ( (completedWork.mode & ProfileMode) === NoMode) {\n        next = completeWork(current, completedWork, subtreeRenderLanes);\n      } else {\n        startProfilerTimer(completedWork);\n        next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error.\n        stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);\n      }\n      resetCurrentFiber();\n      if (next !== null) {\n        // Completing this fiber spawned new work. Work on that next.\n        workInProgress = next;\n        return;\n      }\n      resetChildLanes(completedWork);\n      if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete\n      (returnFiber.flags & Incomplete) === NoFlags) {\n        // Append all the effects of the subtree and this fiber onto the effect\n        // list of the parent. The completion order of the children affects the\n        // side-effect order.\n        if (returnFiber.firstEffect === null) {\n          returnFiber.firstEffect = completedWork.firstEffect;\n        }\n        if (completedWork.lastEffect !== null) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = completedWork.firstEffect;\n          }\n          returnFiber.lastEffect = completedWork.lastEffect;\n        } // If this fiber had side-effects, we append it AFTER the children's\n        // side-effects. We can perform certain side-effects earlier if needed,\n        // by doing multiple passes over the effect list. We don't want to\n        // schedule our own side-effect on our own list because if end up\n        // reusing children we'll schedule this effect onto itself since we're\n        // at the end.\n        var flags = completedWork.flags; // Skip both NoWork and PerformedWork tags when creating the effect\n        // list. PerformedWork effect is read by React DevTools but shouldn't be\n        // committed.\n        if (flags > PerformedWork) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = completedWork;\n          } else {\n            returnFiber.firstEffect = completedWork;\n          }\n          returnFiber.lastEffect = completedWork;\n        }\n      }\n    } else {\n      // This fiber did not complete because something threw. Pop values off\n      // the stack without entering the complete phase. If this is a boundary,\n      // capture values if possible.\n      var _next = unwindWork(completedWork); // Because this fiber did not complete, don't reset its expiration time.\n      if (_next !== null) {\n        // If completing this work spawned new work, do that next. We'll come\n        // back here again.\n        // Since we're restarting, remove anything that is not a host effect\n        // from the effect tag.\n        _next.flags &= HostEffectMask;\n        workInProgress = _next;\n        return;\n      }\n      if ( (completedWork.mode & ProfileMode) !== NoMode) {\n        // Record the render duration for the fiber that errored.\n        stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing.\n        var actualDuration = completedWork.actualDuration;\n        var child = completedWork.child;\n        while (child !== null) {\n          actualDuration += child.actualDuration;\n          child = child.sibling;\n        }\n        completedWork.actualDuration = actualDuration;\n      }\n      if (returnFiber !== null) {\n        // Mark the parent fiber as incomplete and clear its effect list.\n        returnFiber.firstEffect = returnFiber.lastEffect = null;\n        returnFiber.flags |= Incomplete;\n      }\n    }\n    var siblingFiber = completedWork.sibling;\n    if (siblingFiber !== null) {\n      // If there is more work to do in this returnFiber, do that next.\n      workInProgress = siblingFiber;\n      return;\n    } // Otherwise, return to the parent\n    completedWork = returnFiber; // Update the next thing we're working on in case something throws.\n    workInProgress = completedWork;\n  } while (completedWork !== null); // We've reached the root.\n  if (workInProgressRootExitStatus === RootIncomplete) {\n    workInProgressRootExitStatus = RootCompleted;\n  }\n}\nfunction resetChildLanes(completedWork) {\n  if ( // TODO: Move this check out of the hot path by moving \\`resetChildLanes\\`\n  // to switch statement in \\`completeWork\\`.\n  (completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes) {\n    // The children of this component are hidden. Don't bubble their\n    // expiration times.\n    return;\n  }\n  var newChildLanes = NoLanes; // Bubble up the earliest expiration time.\n  if ( (completedWork.mode & ProfileMode) !== NoMode) {\n    // In profiling mode, resetChildExpirationTime is also used to reset\n    // profiler durations.\n    var actualDuration = completedWork.actualDuration;\n    var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will\n    // only be updated if work is done on the fiber (i.e. it doesn't bailout).\n    // When work is done, it should bubble to the parent's actualDuration. If\n    // the fiber has not been cloned though, (meaning no work was done), then\n    // this value will reflect the amount of time spent working on a previous\n    // render. In that case it should not bubble. We determine whether it was\n    // cloned by comparing the child pointer.\n    var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;\n    var child = completedWork.child;\n    while (child !== null) {\n      newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));\n      if (shouldBubbleActualDurations) {\n        actualDuration += child.actualDuration;\n      }\n      treeBaseDuration += child.treeBaseDuration;\n      child = child.sibling;\n    }\n    var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;\n    if (isTimedOutSuspense) {\n      // Don't count time spent in a timed out Suspense subtree as part of the base duration.\n      var primaryChildFragment = completedWork.child;\n      if (primaryChildFragment !== null) {\n        treeBaseDuration -= primaryChildFragment.treeBaseDuration;\n      }\n    }\n    completedWork.actualDuration = actualDuration;\n    completedWork.treeBaseDuration = treeBaseDuration;\n  } else {\n    var _child = completedWork.child;\n    while (_child !== null) {\n      newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));\n      _child = _child.sibling;\n    }\n  }\n  completedWork.childLanes = newChildLanes;\n}\nfunction commitRoot(root) {\n  var renderPriorityLevel = getCurrentPriorityLevel();\n  runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root, renderPriorityLevel));\n  return null;\n}\nfunction commitRootImpl(root, renderPriorityLevel) {\n  do {\n    // \\`flushPassiveEffects\\` will call \\`flushSyncUpdateQueue\\` at the end, which\n    // means \\`flushPassiveEffects\\` will sometimes result in additional\n    // passive effects. So we need to keep flushing in a loop until there are\n    // no more pending effects.\n    // TODO: Might be better if \\`flushPassiveEffects\\` did not automatically\n    // flush synchronous work at the end, to avoid factoring hazards like this.\n    flushPassiveEffects();\n  } while (rootWithPendingPassiveEffects !== null);\n  flushRenderPhaseStrictModeWarningsInDEV();\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Should not already be working.\\\\\" );\n    }\n  }\n  var finishedWork = root.finishedWork;\n  var lanes = root.finishedLanes;\n  if (finishedWork === null) {\n    return null;\n  }\n  root.finishedWork = null;\n  root.finishedLanes = NoLanes;\n  if (!(finishedWork !== root.current)) {\n    {\n      throw Error( \\\\\"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  } // commitRoot never returns a continuation; it always finishes synchronously.\n  // So we can clear these now to allow a new callback to be scheduled.\n  root.callbackNode = null; // Update the first and last pending times on this root. The new first\n  // pending time is whatever is left on the root fiber.\n  var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);\n  markRootFinished(root, remainingLanes); // Clear already finished discrete updates in case that a later call of\n  // \\`flushDiscreteUpdates\\` starts a useless render pass which may cancels\n  // a scheduled timeout.\n  if (rootsWithPendingDiscreteUpdates !== null) {\n    if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root)) {\n      rootsWithPendingDiscreteUpdates.delete(root);\n    }\n  }\n  if (root === workInProgressRoot) {\n    // We can reset these now that they are finished.\n    workInProgressRoot = null;\n    workInProgress = null;\n    workInProgressRootRenderLanes = NoLanes;\n  } // Get the list of effects.\n  var firstEffect;\n  if (finishedWork.flags > PerformedWork) {\n    // A fiber's effect list consists only of its children, not itself. So if\n    // the root has an effect, we need to add it to the end of the list. The\n    // resulting list is the set that would belong to the root's parent, if it\n    // had one; that is, all the effects in the tree including the root.\n    if (finishedWork.lastEffect !== null) {\n      finishedWork.lastEffect.nextEffect = finishedWork;\n      firstEffect = finishedWork.firstEffect;\n    } else {\n      firstEffect = finishedWork;\n    }\n  } else {\n    // There is no effect on the root.\n    firstEffect = finishedWork.firstEffect;\n  }\n  if (firstEffect !== null) {\n    var prevExecutionContext = executionContext;\n    executionContext |= CommitContext;\n    var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles\n    ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass\n    // of the effect list for each phase: all mutation effects come before all\n    // layout effects, and so on.\n    // The first phase a \\\\\"before mutation\\\\\" phase. We use this phase to read the\n    // state of the host tree right before we mutate it. This is where\n    // getSnapshotBeforeUpdate is called.\n    focusedInstanceHandle = prepareForCommit(root.containerInfo);\n    shouldFireAfterActiveInstanceBlur = false;\n    nextEffect = firstEffect;\n    do {\n      {\n        invokeGuardedCallback(null, commitBeforeMutationEffects, null);\n        if (hasCaughtError()) {\n          if (!(nextEffect !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var error = clearCaughtError();\n          captureCommitPhaseError(nextEffect, error);\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    } while (nextEffect !== null); // We no longer need to track the active instance fiber\n    focusedInstanceHandle = null;\n    {\n      // Mark the current commit time to be shared by all Profilers in this\n      // batch. This enables them to be grouped later.\n      recordCommitTime();\n    } // The next phase is the mutation phase, where we mutate the host tree.\n    nextEffect = firstEffect;\n    do {\n      {\n        invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);\n        if (hasCaughtError()) {\n          if (!(nextEffect !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var _error = clearCaughtError();\n          captureCommitPhaseError(nextEffect, _error);\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    } while (nextEffect !== null);\n    resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after\n    // the mutation phase, so that the previous tree is still current during\n    // componentWillUnmount, but before the layout phase, so that the finished\n    // work is current during componentDidMount/Update.\n    root.current = finishedWork; // The next phase is the layout phase, where we call effects that read\n    // the host tree after it's been mutated. The idiomatic use case for this is\n    // layout, but class component lifecycles also fire here for legacy reasons.\n    nextEffect = firstEffect;\n    do {\n      {\n        invokeGuardedCallback(null, commitLayoutEffects, null, root, lanes);\n        if (hasCaughtError()) {\n          if (!(nextEffect !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var _error2 = clearCaughtError();\n          captureCommitPhaseError(nextEffect, _error2);\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    } while (nextEffect !== null);\n    nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an\n    // opportunity to paint.\n    requestPaint();\n    {\n      popInteractions(prevInteractions);\n    }\n    executionContext = prevExecutionContext;\n  } else {\n    // No effects.\n    root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were\n    // no effects.\n    // TODO: Maybe there's a better way to report this.\n    {\n      recordCommitTime();\n    }\n  }\n  var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;\n  if (rootDoesHavePassiveEffects) {\n    // This commit has passive effects. Stash a reference to them. But don't\n    // schedule a callback until after flushing layout work.\n    rootDoesHavePassiveEffects = false;\n    rootWithPendingPassiveEffects = root;\n    pendingPassiveEffectsLanes = lanes;\n    pendingPassiveEffectsRenderPriority = renderPriorityLevel;\n  } else {\n    // We are done with the effect chain at this point so let's clear the\n    // nextEffect pointers to assist with GC. If we have passive effects, we'll\n    // clear this in flushPassiveEffects.\n    nextEffect = firstEffect;\n    while (nextEffect !== null) {\n      var nextNextEffect = nextEffect.nextEffect;\n      nextEffect.nextEffect = null;\n      if (nextEffect.flags & Deletion) {\n        detachFiberAfterEffects(nextEffect);\n      }\n      nextEffect = nextNextEffect;\n    }\n  } // Read this again, since an effect might have updated it\n  remainingLanes = root.pendingLanes; // Check if there's remaining work on this root\n  if (remainingLanes !== NoLanes) {\n    {\n      if (spawnedWorkDuringRender !== null) {\n        var expirationTimes = spawnedWorkDuringRender;\n        spawnedWorkDuringRender = null;\n        for (var i = 0; i < expirationTimes.length; i++) {\n          scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);\n        }\n      }\n      schedulePendingInteractions(root, remainingLanes);\n    }\n  } else {\n    // If there's no remaining work, we can clear the set of already failed\n    // error boundaries.\n    legacyErrorBoundariesThatAlreadyFailed = null;\n  }\n  {\n    if (!rootDidHavePassiveEffects) {\n      // If there are no passive effects, then we can complete the pending interactions.\n      // Otherwise, we'll wait until after the passive effects are flushed.\n      // Wait to do this until after remaining work has been scheduled,\n      // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.\n      finishPendingInteractions(root, lanes);\n    }\n  }\n  if (remainingLanes === SyncLane) {\n    // Count the number of times the root synchronously re-renders without\n    // finishing. If there are too many, it indicates an infinite update loop.\n    if (root === rootWithNestedUpdates) {\n      nestedUpdateCount++;\n    } else {\n      nestedUpdateCount = 0;\n      rootWithNestedUpdates = root;\n    }\n  } else {\n    nestedUpdateCount = 0;\n  }\n  onCommitRoot(finishedWork.stateNode, renderPriorityLevel);\n  {\n    onCommitRoot$1();\n  } // Always call this before exiting \\`commitRoot\\`, to ensure that any\n  // additional work on this root is scheduled.\n  ensureRootIsScheduled(root, now());\n  if (hasUncaughtError) {\n    hasUncaughtError = false;\n    var _error3 = firstUncaughtError;\n    firstUncaughtError = null;\n    throw _error3;\n  }\n  if ((executionContext & LegacyUnbatchedContext) !== NoContext) {\n    // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired\n    // synchronously, but layout updates should be deferred until the end\n    // of the batch.\n    return null;\n  } // If layout work was scheduled, flush it now.\n  flushSyncCallbackQueue();\n  return null;\n}\nfunction commitBeforeMutationEffects() {\n  while (nextEffect !== null) {\n    var current = nextEffect.alternate;\n    if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {\n      if ((nextEffect.flags & Deletion) !== NoFlags) {\n        if (doesFiberContain(nextEffect, focusedInstanceHandle)) {\n          shouldFireAfterActiveInstanceBlur = true;\n        }\n      } else {\n        // TODO: Move this out of the hot path using a dedicated effect tag.\n        if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {\n          shouldFireAfterActiveInstanceBlur = true;\n        }\n      }\n    }\n    var flags = nextEffect.flags;\n    if ((flags & Snapshot) !== NoFlags) {\n      setCurrentFiber(nextEffect);\n      commitBeforeMutationLifeCycles(current, nextEffect);\n      resetCurrentFiber();\n    }\n    if ((flags & Passive) !== NoFlags) {\n      // If there are passive effects, schedule a callback to flush at\n      // the earliest opportunity.\n      if (!rootDoesHavePassiveEffects) {\n        rootDoesHavePassiveEffects = true;\n        scheduleCallback(NormalPriority$1, function () {\n          flushPassiveEffects();\n          return null;\n        });\n      }\n    }\n    nextEffect = nextEffect.nextEffect;\n  }\n}\nfunction commitMutationEffects(root, renderPriorityLevel) {\n  // TODO: Should probably move the bulk of this function to commitWork.\n  while (nextEffect !== null) {\n    setCurrentFiber(nextEffect);\n    var flags = nextEffect.flags;\n    if (flags & ContentReset) {\n      commitResetTextContent(nextEffect);\n    }\n    if (flags & Ref) {\n      var current = nextEffect.alternate;\n      if (current !== null) {\n        commitDetachRef(current);\n      }\n    } // The following switch statement is only concerned about placement,\n    // updates, and deletions. To avoid needing to add a case for every possible\n    // bitmap value, we remove the secondary effects from the effect tag and\n    // switch on that value.\n    var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);\n    switch (primaryFlags) {\n      case Placement:\n        {\n          commitPlacement(nextEffect); // Clear the \\\\\"placement\\\\\" from effect tag so that we know that this is\n          // inserted, before any life-cycles like componentDidMount gets called.\n          // TODO: findDOMNode doesn't rely on this any more but isMounted does\n          // and isMounted is deprecated anyway so we should be able to kill this.\n          nextEffect.flags &= ~Placement;\n          break;\n        }\n      case PlacementAndUpdate:\n        {\n          // Placement\n          commitPlacement(nextEffect); // Clear the \\\\\"placement\\\\\" from effect tag so that we know that this is\n          // inserted, before any life-cycles like componentDidMount gets called.\n          nextEffect.flags &= ~Placement; // Update\n          var _current = nextEffect.alternate;\n          commitWork(_current, nextEffect);\n          break;\n        }\n      case Hydrating:\n        {\n          nextEffect.flags &= ~Hydrating;\n          break;\n        }\n      case HydratingAndUpdate:\n        {\n          nextEffect.flags &= ~Hydrating; // Update\n          var _current2 = nextEffect.alternate;\n          commitWork(_current2, nextEffect);\n          break;\n        }\n      case Update:\n        {\n          var _current3 = nextEffect.alternate;\n          commitWork(_current3, nextEffect);\n          break;\n        }\n      case Deletion:\n        {\n          commitDeletion(root, nextEffect);\n          break;\n        }\n    }\n    resetCurrentFiber();\n    nextEffect = nextEffect.nextEffect;\n  }\n}\nfunction commitLayoutEffects(root, committedLanes) {\n  while (nextEffect !== null) {\n    setCurrentFiber(nextEffect);\n    var flags = nextEffect.flags;\n    if (flags & (Update | Callback)) {\n      var current = nextEffect.alternate;\n      commitLifeCycles(root, current, nextEffect);\n    }\n    {\n      if (flags & Ref) {\n        commitAttachRef(nextEffect);\n      }\n    }\n    resetCurrentFiber();\n    nextEffect = nextEffect.nextEffect;\n  }\n}\nfunction flushPassiveEffects() {\n  // Returns whether passive effects were flushed.\n  if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {\n    var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;\n    pendingPassiveEffectsRenderPriority = NoPriority$1;\n    {\n      return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);\n    }\n  }\n  return false;\n}\nfunction enqueuePendingPassiveHookEffectMount(fiber, effect) {\n  pendingPassiveHookEffectsMount.push(effect, fiber);\n  if (!rootDoesHavePassiveEffects) {\n    rootDoesHavePassiveEffects = true;\n    scheduleCallback(NormalPriority$1, function () {\n      flushPassiveEffects();\n      return null;\n    });\n  }\n}\nfunction enqueuePendingPassiveHookEffectUnmount(fiber, effect) {\n  pendingPassiveHookEffectsUnmount.push(effect, fiber);\n  {\n    fiber.flags |= PassiveUnmountPendingDev;\n    var alternate = fiber.alternate;\n    if (alternate !== null) {\n      alternate.flags |= PassiveUnmountPendingDev;\n    }\n  }\n  if (!rootDoesHavePassiveEffects) {\n    rootDoesHavePassiveEffects = true;\n    scheduleCallback(NormalPriority$1, function () {\n      flushPassiveEffects();\n      return null;\n    });\n  }\n}\nfunction invokePassiveEffectCreate(effect) {\n  var create = effect.create;\n  effect.destroy = create();\n}\nfunction flushPassiveEffectsImpl() {\n  if (rootWithPendingPassiveEffects === null) {\n    return false;\n  }\n  var root = rootWithPendingPassiveEffects;\n  var lanes = pendingPassiveEffectsLanes;\n  rootWithPendingPassiveEffects = null;\n  pendingPassiveEffectsLanes = NoLanes;\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Cannot flush passive effects while already rendering.\\\\\" );\n    }\n  }\n  {\n    isFlushingPassiveEffects = true;\n  }\n  var prevExecutionContext = executionContext;\n  executionContext |= CommitContext;\n  var prevInteractions = pushInteractions(root); // It's important that ALL pending passive effect destroy functions are called\n  // before ANY passive effect create functions are called.\n  // Otherwise effects in sibling components might interfere with each other.\n  // e.g. a destroy function in one component may unintentionally override a ref\n  // value set by a create function in another component.\n  // Layout effects have the same constraint.\n  // First pass: Destroy stale passive effects.\n  var unmountEffects = pendingPassiveHookEffectsUnmount;\n  pendingPassiveHookEffectsUnmount = [];\n  for (var i = 0; i < unmountEffects.length; i += 2) {\n    var _effect = unmountEffects[i];\n    var fiber = unmountEffects[i + 1];\n    var destroy = _effect.destroy;\n    _effect.destroy = undefined;\n    {\n      fiber.flags &= ~PassiveUnmountPendingDev;\n      var alternate = fiber.alternate;\n      if (alternate !== null) {\n        alternate.flags &= ~PassiveUnmountPendingDev;\n      }\n    }\n    if (typeof destroy === 'function') {\n      {\n        setCurrentFiber(fiber);\n        {\n          invokeGuardedCallback(null, destroy, null);\n        }\n        if (hasCaughtError()) {\n          if (!(fiber !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var error = clearCaughtError();\n          captureCommitPhaseError(fiber, error);\n        }\n        resetCurrentFiber();\n      }\n    }\n  } // Second pass: Create new passive effects.\n  var mountEffects = pendingPassiveHookEffectsMount;\n  pendingPassiveHookEffectsMount = [];\n  for (var _i = 0; _i < mountEffects.length; _i += 2) {\n    var _effect2 = mountEffects[_i];\n    var _fiber = mountEffects[_i + 1];\n    {\n      setCurrentFiber(_fiber);\n      {\n        invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);\n      }\n      if (hasCaughtError()) {\n        if (!(_fiber !== null)) {\n          {\n            throw Error( \\\\\"Should be working on an effect.\\\\\" );\n          }\n        }\n        var _error4 = clearCaughtError();\n        captureCommitPhaseError(_fiber, _error4);\n      }\n      resetCurrentFiber();\n    }\n  } // Note: This currently assumes there are no passive effects on the root fiber\n  // because the root is not part of its own effect list.\n  // This could change in the future.\n  var effect = root.current.firstEffect;\n  while (effect !== null) {\n    var nextNextEffect = effect.nextEffect; // Remove nextEffect pointer to assist GC\n    effect.nextEffect = null;\n    if (effect.flags & Deletion) {\n      detachFiberAfterEffects(effect);\n    }\n    effect = nextNextEffect;\n  }\n  {\n    popInteractions(prevInteractions);\n    finishPendingInteractions(root, lanes);\n  }\n  {\n    isFlushingPassiveEffects = false;\n  }\n  executionContext = prevExecutionContext;\n  flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this\n  // exceeds the limit, we'll fire a warning.\n  nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;\n  return true;\n}\nfunction isAlreadyFailedLegacyErrorBoundary(instance) {\n  return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);\n}\nfunction markLegacyErrorBoundaryAsFailed(instance) {\n  if (legacyErrorBoundariesThatAlreadyFailed === null) {\n    legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);\n  } else {\n    legacyErrorBoundariesThatAlreadyFailed.add(instance);\n  }\n}\nfunction prepareToThrowUncaughtError(error) {\n  if (!hasUncaughtError) {\n    hasUncaughtError = true;\n    firstUncaughtError = error;\n  }\n}\nvar onUncaughtError = prepareToThrowUncaughtError;\nfunction captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {\n  var errorInfo = createCapturedValue(error, sourceFiber);\n  var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);\n  enqueueUpdate(rootFiber, update);\n  var eventTime = requestEventTime();\n  var root = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);\n  if (root !== null) {\n    markRootUpdated(root, SyncLane, eventTime);\n    ensureRootIsScheduled(root, eventTime);\n    schedulePendingInteractions(root, SyncLane);\n  }\n}\nfunction captureCommitPhaseError(sourceFiber, error) {\n  if (sourceFiber.tag === HostRoot) {\n    // Error was thrown at the root. There is no parent, so the root\n    // itself should capture it.\n    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);\n    return;\n  }\n  var fiber = sourceFiber.return;\n  while (fiber !== null) {\n    if (fiber.tag === HostRoot) {\n      captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);\n      return;\n    } else if (fiber.tag === ClassComponent) {\n      var ctor = fiber.type;\n      var instance = fiber.stateNode;\n      if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n        var errorInfo = createCapturedValue(error, sourceFiber);\n        var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);\n        enqueueUpdate(fiber, update);\n        var eventTime = requestEventTime();\n        var root = markUpdateLaneFromFiberToRoot(fiber, SyncLane);\n        if (root !== null) {\n          markRootUpdated(root, SyncLane, eventTime);\n          ensureRootIsScheduled(root, eventTime);\n          schedulePendingInteractions(root, SyncLane);\n        } else {\n          // This component has already been unmounted.\n          // We can't schedule any follow up work for the root because the fiber is already unmounted,\n          // but we can still call the log-only boundary so the error isn't swallowed.\n          //\n          // TODO This is only a temporary bandaid for the old reconciler fork.\n          // We can delete this special case once the new fork is merged.\n          if (typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n            try {\n              instance.componentDidCatch(error, errorInfo);\n            } catch (errorToIgnore) {// TODO Ignore this error? Rethrow it?\n              // This is kind of an edge case.\n            }\n          }\n        }\n        return;\n      }\n    }\n    fiber = fiber.return;\n  }\n}\nfunction pingSuspendedRoot(root, wakeable, pingedLanes) {\n  var pingCache = root.pingCache;\n  if (pingCache !== null) {\n    // The wakeable resolved, so we no longer need to memoize, because it will\n    // never be thrown again.\n    pingCache.delete(wakeable);\n  }\n  var eventTime = requestEventTime();\n  markRootPinged(root, pingedLanes);\n  if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {\n    // Received a ping at the same priority level at which we're currently\n    // rendering. We might want to restart this render. This should mirror\n    // the logic of whether or not a root suspends once it completes.\n    // TODO: If we're rendering sync either due to Sync, Batched or expired,\n    // we should probably never restart.\n    // If we're suspended with delay, or if it's a retry, we'll always suspend\n    // so we can always restart.\n    if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {\n      // Restart from the root.\n      prepareFreshStack(root, NoLanes);\n    } else {\n      // Even though we can't restart right now, we might get an\n      // opportunity later. So we mark this render as having a ping.\n      workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);\n    }\n  }\n  ensureRootIsScheduled(root, eventTime);\n  schedulePendingInteractions(root, pingedLanes);\n}\nfunction retryTimedOutBoundary(boundaryFiber, retryLane) {\n  // The boundary fiber (a Suspense component or SuspenseList component)\n  // previously was rendered in its fallback state. One of the promises that\n  // suspended it has resolved, which means at least part of the tree was\n  // likely unblocked. Try rendering again, at a new expiration time.\n  if (retryLane === NoLane) {\n    retryLane = requestRetryLane(boundaryFiber);\n  } // TODO: Special case idle priority?\n  var eventTime = requestEventTime();\n  var root = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);\n  if (root !== null) {\n    markRootUpdated(root, retryLane, eventTime);\n    ensureRootIsScheduled(root, eventTime);\n    schedulePendingInteractions(root, retryLane);\n  }\n}\nfunction resolveRetryWakeable(boundaryFiber, wakeable) {\n  var retryLane = NoLane; // Default\n  var retryCache;\n  {\n    retryCache = boundaryFiber.stateNode;\n  }\n  if (retryCache !== null) {\n    // The wakeable resolved, so we no longer need to memoize, because it will\n    // never be thrown again.\n    retryCache.delete(wakeable);\n  }\n  retryTimedOutBoundary(boundaryFiber, retryLane);\n} // Computes the next Just Noticeable Difference (JND) boundary.\n// The theory is that a person can't tell the difference between small differences in time.\n// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable\n// difference in the experience. However, waiting for longer might mean that we can avoid\n// showing an intermediate loading state. The longer we have already waited, the harder it\n// is to tell small differences in time. Therefore, the longer we've already waited,\n// the longer we can wait additionally. At some point we have to give up though.\n// We pick a train model where the next boundary commits at a consistent schedule.\n// These particular numbers are vague estimates. We expect to adjust them based on research.\nfunction jnd(timeElapsed) {\n  return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;\n}\nfunction checkForNestedUpdates() {\n  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n    nestedUpdateCount = 0;\n    rootWithNestedUpdates = null;\n    {\n      {\n        throw Error( \\\\\"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\\\\\" );\n      }\n    }\n  }\n  {\n    if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {\n      nestedPassiveUpdateCount = 0;\n      error('Maximum update depth exceeded. This can happen when a component ' + \\\\\"calls setState inside useEffect, but useEffect either doesn't \\\\\" + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');\n    }\n  }\n}\nfunction flushRenderPhaseStrictModeWarningsInDEV() {\n  {\n    ReactStrictModeWarnings.flushLegacyContextWarning();\n    {\n      ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();\n    }\n  }\n}\nvar didWarnStateUpdateForNotYetMountedComponent = null;\nfunction warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {\n  {\n    if ((executionContext & RenderContext) !== NoContext) {\n      // We let the other warning about render phase updates deal with this one.\n      return;\n    }\n    if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {\n      return;\n    }\n    var tag = fiber.tag;\n    if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n      // Only warn for user-defined components, not internal ones like Suspense.\n      return;\n    } // We show the whole stack but dedupe on the top component's name because\n    // the problematic code almost always lies inside that component.\n    var componentName = getComponentName(fiber.type) || 'ReactComponent';\n    if (didWarnStateUpdateForNotYetMountedComponent !== null) {\n      if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {\n        return;\n      }\n      didWarnStateUpdateForNotYetMountedComponent.add(componentName);\n    } else {\n      didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]);\n    }\n    var previousFiber = current;\n    try {\n      setCurrentFiber(fiber);\n      error(\\\\\"Can't perform a React state update on a component that hasn't mounted yet. \\\\\" + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.');\n    } finally {\n      if (previousFiber) {\n        setCurrentFiber(fiber);\n      } else {\n        resetCurrentFiber();\n      }\n    }\n  }\n}\nvar didWarnStateUpdateForUnmountedComponent = null;\nfunction warnAboutUpdateOnUnmountedFiberInDEV(fiber) {\n  {\n    var tag = fiber.tag;\n    if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n      // Only warn for user-defined components, not internal ones like Suspense.\n      return;\n    } // If there are pending passive effects unmounts for this Fiber,\n    // we can assume that they would have prevented this update.\n    if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {\n      return;\n    } // We show the whole stack but dedupe on the top component's name because\n    // the problematic code almost always lies inside that component.\n    var componentName = getComponentName(fiber.type) || 'ReactComponent';\n    if (didWarnStateUpdateForUnmountedComponent !== null) {\n      if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {\n        return;\n      }\n      didWarnStateUpdateForUnmountedComponent.add(componentName);\n    } else {\n      didWarnStateUpdateForUnmountedComponent = new Set([componentName]);\n    }\n    if (isFlushingPassiveEffects) ; else {\n      var previousFiber = current;\n      try {\n        setCurrentFiber(fiber);\n        error(\\\\\"Can't perform a React state update on an unmounted component. This \\\\\" + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function');\n      } finally {\n        if (previousFiber) {\n          setCurrentFiber(fiber);\n        } else {\n          resetCurrentFiber();\n        }\n      }\n    }\n  }\n}\nvar beginWork$1;\n{\n  var dummyFiber = null;\n  beginWork$1 = function (current, unitOfWork, lanes) {\n    // If a component throws an error, we replay it again in a synchronously\n    // dispatched event, so that the debugger will treat it as an uncaught\n    // error See ReactErrorUtils for more information.\n    // Before entering the begin phase, copy the work-in-progress onto a dummy\n    // fiber. If beginWork throws, we'll use this to reset the state.\n    var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);\n    try {\n      return beginWork(current, unitOfWork, lanes);\n    } catch (originalError) {\n      if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {\n        // Don't replay promises. Treat everything else like an error.\n        throw originalError;\n      } // Keep this code in sync with handleError; any changes here must have\n      // corresponding changes there.\n      resetContextDependencies();\n      resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the\n      // same fiber again.\n      // Unwind the failed stack frame\n      unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.\n      assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n      if ( unitOfWork.mode & ProfileMode) {\n        // Reset the profiler timer.\n        startProfilerTimer(unitOfWork);\n      } // Run beginWork again.\n      invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);\n      if (hasCaughtError()) {\n        var replayError = clearCaughtError(); // \\`invokeGuardedCallback\\` sometimes sets an expando \\`_suppressLogging\\`.\n        // Rethrow this error instead of the original one.\n        throw replayError;\n      } else {\n        // This branch is reachable if the render phase is impure.\n        throw originalError;\n      }\n    }\n  };\n}\nvar didWarnAboutUpdateInRender = false;\nvar didWarnAboutUpdateInRenderForAnotherComponent;\n{\n  didWarnAboutUpdateInRenderForAnotherComponent = new Set();\n}\nfunction warnAboutRenderPhaseUpdatesInDEV(fiber) {\n  {\n    if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {\n      switch (fiber.tag) {\n        case FunctionComponent:\n        case ForwardRef:\n        case SimpleMemoComponent:\n          {\n            var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.\n            var dedupeKey = renderingComponentName;\n            if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {\n              didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);\n              var setStateComponentName = getComponentName(fiber.type) || 'Unknown';\n              error('Cannot update a component (\\`%s\\`) while rendering a ' + 'different component (\\`%s\\`). To locate the bad setState() call inside \\`%s\\`, ' + 'follow the stack trace as described in https://reactjs.org/link/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);\n            }\n            break;\n          }\n        case ClassComponent:\n          {\n            if (!didWarnAboutUpdateInRender) {\n              error('Cannot update during an existing state transition (such as ' + 'within \\`render\\`). Render methods should be a pure ' + 'function of props and state.');\n              didWarnAboutUpdateInRender = true;\n            }\n            break;\n          }\n      }\n    }\n  }\n} // a 'shared' variable that changes when act() opens/closes in tests.\nvar IsThisRendererActing = {\n  current: false\n};\nfunction warnIfNotScopedWithMatchingAct(fiber) {\n  {\n    if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {\n      var previousFiber = current;\n      try {\n        setCurrentFiber(fiber);\n        error(\\\\\"It looks like you're using the wrong act() around your test interactions.\\\\\" + 'Be sure to use the matching version of act() corresponding to your renderer:' + '// for react-dom:' + // Break up imports to avoid accidentally parsing them as dependencies.\n        'import {act} fr' + \\\\\"om 'react-dom/test-utils';\\\\\" + '// ...' + 'act(() => ...);' + '// for react-test-renderer:' + // Break up imports to avoid accidentally parsing them as dependencies.\n        'import TestRenderer fr' + \\\\\"om react-test-renderer';\\\\\" + 'const {act} = TestRenderer;' + '// ...' + 'act(() => ...);');\n      } finally {\n        if (previousFiber) {\n          setCurrentFiber(fiber);\n        } else {\n          resetCurrentFiber();\n        }\n      }\n    }\n  }\n}\nfunction warnIfNotCurrentlyActingEffectsInDEV(fiber) {\n  {\n    if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n      error('An update to %s ran an effect, but was not wrapped in act(...).' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):' + 'act(() => {' + '  /* fire events that update state */' + '});' + '/* assert on the output */' + \\\\\"This ensures that you're testing the behavior the user would see \\\\\" + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentName(fiber.type));\n    }\n  }\n}\nfunction warnIfNotCurrentlyActingUpdatesInDEV(fiber) {\n  {\n    if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n      var previousFiber = current;\n      try {\n        setCurrentFiber(fiber);\n        error('An update to %s inside a test was not wrapped in act(...).' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):' + 'act(() => {' + '  /* fire events that update state */' + '});' + '/* assert on the output */' + \\\\\"This ensures that you're testing the behavior the user would see \\\\\" + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentName(fiber.type));\n      } finally {\n        if (previousFiber) {\n          setCurrentFiber(fiber);\n        } else {\n          resetCurrentFiber();\n        }\n      }\n    }\n  }\n}\nvar warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.\nvar didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked\n// scheduler is the actual recommendation. The alternative could be a testing build,\n// a new lib, or whatever; we dunno just yet. This message is for early adopters\n// to get their tests right.\nfunction warnIfUnmockedScheduler(fiber) {\n  {\n    if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n      if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n        didWarnAboutUnmockedScheduler = true;\n        error('In Concurrent or Sync modes, the \\\\\"scheduler\\\\\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: ' + // Break up requires to avoid accidentally parsing them as dependencies.\n        \\\\\"jest.mock('scheduler', () => require\\\\\" + \\\\\"('scheduler/unstable_mock'));\\\\\" + 'For more info, visit https://reactjs.org/link/mock-scheduler');\n      }\n    }\n  }\n}\nfunction computeThreadID(root, lane) {\n  // Interaction threads are unique per root and expiration time.\n  // NOTE: Intentionally unsound cast. All that matters is that it's a number\n  // and it represents a batch of work. Could make a helper function instead,\n  // but meh this is fine for now.\n  return lane * 1000 + root.interactionThreadID;\n}\nfunction markSpawnedWork(lane) {\n  if (spawnedWorkDuringRender === null) {\n    spawnedWorkDuringRender = [lane];\n  } else {\n    spawnedWorkDuringRender.push(lane);\n  }\n}\nfunction scheduleInteractions(root, lane, interactions) {\n  if (interactions.size > 0) {\n    var pendingInteractionMap = root.pendingInteractionMap;\n    var pendingInteractions = pendingInteractionMap.get(lane);\n    if (pendingInteractions != null) {\n      interactions.forEach(function (interaction) {\n        if (!pendingInteractions.has(interaction)) {\n          // Update the pending async work count for previously unscheduled interaction.\n          interaction.__count++;\n        }\n        pendingInteractions.add(interaction);\n      });\n    } else {\n      pendingInteractionMap.set(lane, new Set(interactions)); // Update the pending async work count for the current interactions.\n      interactions.forEach(function (interaction) {\n        interaction.__count++;\n      });\n    }\n    var subscriber = tracing$1.__subscriberRef.current;\n    if (subscriber !== null) {\n      var threadID = computeThreadID(root, lane);\n      subscriber.onWorkScheduled(interactions, threadID);\n    }\n  }\n}\nfunction schedulePendingInteractions(root, lane) {\n  scheduleInteractions(root, lane, tracing$1.__interactionsRef.current);\n}\nfunction startWorkOnPendingInteractions(root, lanes) {\n  // we can accurately attribute time spent working on it, And so that cascading\n  // work triggered during the render phase will be associated with it.\n  var interactions = new Set();\n  root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledLane) {\n    if (includesSomeLane(lanes, scheduledLane)) {\n      scheduledInteractions.forEach(function (interaction) {\n        return interactions.add(interaction);\n      });\n    }\n  }); // Store the current set of interactions on the FiberRoot for a few reasons:\n  // We can re-use it in hot functions like performConcurrentWorkOnRoot()\n  // without having to recalculate it. We will also use it in commitWork() to\n  // pass to any Profiler onRender() hooks. This also provides DevTools with a\n  // way to access it when the onCommitRoot() hook is called.\n  root.memoizedInteractions = interactions;\n  if (interactions.size > 0) {\n    var subscriber = tracing$1.__subscriberRef.current;\n    if (subscriber !== null) {\n      var threadID = computeThreadID(root, lanes);\n      try {\n        subscriber.onWorkStarted(interactions, threadID);\n      } catch (error) {\n        // If the subscriber throws, rethrow it in a separate task\n        scheduleCallback(ImmediatePriority$1, function () {\n          throw error;\n        });\n      }\n    }\n  }\n}\nfunction finishPendingInteractions(root, committedLanes) {\n  var remainingLanesAfterCommit = root.pendingLanes;\n  var subscriber;\n  try {\n    subscriber = tracing$1.__subscriberRef.current;\n    if (subscriber !== null && root.memoizedInteractions.size > 0) {\n      // FIXME: More than one lane can finish in a single commit.\n      var threadID = computeThreadID(root, committedLanes);\n      subscriber.onWorkStopped(root.memoizedInteractions, threadID);\n    }\n  } catch (error) {\n    // If the subscriber throws, rethrow it in a separate task\n    scheduleCallback(ImmediatePriority$1, function () {\n      throw error;\n    });\n  } finally {\n    // Clear completed interactions from the pending Map.\n    // Unless the render was suspended or cascading work was scheduled,\n    // In which case– leave pending interactions until the subsequent render.\n    var pendingInteractionMap = root.pendingInteractionMap;\n    pendingInteractionMap.forEach(function (scheduledInteractions, lane) {\n      // Only decrement the pending interaction count if we're done.\n      // If there's still work at the current priority,\n      // That indicates that we are waiting for suspense data.\n      if (!includesSomeLane(remainingLanesAfterCommit, lane)) {\n        pendingInteractionMap.delete(lane);\n        scheduledInteractions.forEach(function (interaction) {\n          interaction.__count--;\n          if (subscriber !== null && interaction.__count === 0) {\n            try {\n              subscriber.onInteractionScheduledWorkCompleted(interaction);\n            } catch (error) {\n              // If the subscriber throws, rethrow it in a separate task\n              scheduleCallback(ImmediatePriority$1, function () {\n                throw error;\n              });\n            }\n          }\n        });\n      }\n    });\n  }\n} // \\`act\\` testing API\nfunction shouldForceFlushFallbacksInDEV() {\n  // Never force flush in production. This function should get stripped out.\n  return  actingUpdatesScopeDepth > 0;\n}\n// so we can tell if any async act() calls try to run in parallel.\nvar actingUpdatesScopeDepth = 0;\nfunction detachFiberAfterEffects(fiber) {\n  fiber.sibling = null;\n  fiber.stateNode = null;\n}\nvar resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.\nvar failedBoundaries = null;\nvar setRefreshHandler = function (handler) {\n  {\n    resolveFamily = handler;\n  }\n};\nfunction resolveFunctionForHotReloading(type) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return type;\n    }\n    var family = resolveFamily(type);\n    if (family === undefined) {\n      return type;\n    } // Use the latest known implementation.\n    return family.current;\n  }\n}\nfunction resolveClassForHotReloading(type) {\n  // No implementation differences.\n  return resolveFunctionForHotReloading(type);\n}\nfunction resolveForwardRefForHotReloading(type) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return type;\n    }\n    var family = resolveFamily(type);\n    if (family === undefined) {\n      // Check if we're dealing with a real forwardRef. Don't want to crash early.\n      if (type !== null && type !== undefined && typeof type.render === 'function') {\n        // ForwardRef is special because its resolved .type is an object,\n        // but it's possible that we only have its inner render function in the map.\n        // If that inner render function is different, we'll build a new forwardRef type.\n        var currentRender = resolveFunctionForHotReloading(type.render);\n        if (type.render !== currentRender) {\n          var syntheticType = {\n            $$typeof: REACT_FORWARD_REF_TYPE,\n            render: currentRender\n          };\n          if (type.displayName !== undefined) {\n            syntheticType.displayName = type.displayName;\n          }\n          return syntheticType;\n        }\n      }\n      return type;\n    } // Use the latest known implementation.\n    return family.current;\n  }\n}\nfunction isCompatibleFamilyForHotReloading(fiber, element) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return false;\n    }\n    var prevType = fiber.elementType;\n    var nextType = element.type; // If we got here, we know types aren't === equal.\n    var needsCompareFamilies = false;\n    var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;\n    switch (fiber.tag) {\n      case ClassComponent:\n        {\n          if (typeof nextType === 'function') {\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      case FunctionComponent:\n        {\n          if (typeof nextType === 'function') {\n            needsCompareFamilies = true;\n          } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n            // We don't know the inner type yet.\n            // We're going to assume that the lazy inner type is stable,\n            // and so it is sufficient to avoid reconciling it away.\n            // We're not going to unwrap or actually use the new lazy type.\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      case ForwardRef:\n        {\n          if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {\n            needsCompareFamilies = true;\n          } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      case MemoComponent:\n      case SimpleMemoComponent:\n        {\n          if ($$typeofNextType === REACT_MEMO_TYPE) {\n            // TODO: if it was but can no longer be simple,\n            // we shouldn't set this.\n            needsCompareFamilies = true;\n          } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      default:\n        return false;\n    } // Check if both types have a family and it's the same one.\n    if (needsCompareFamilies) {\n      // Note: memo() and forwardRef() we'll compare outer rather than inner type.\n      // This means both of them need to be registered to preserve state.\n      // If we unwrapped and compared the inner types for wrappers instead,\n      // then we would risk falsely saying two separate memo(Foo)\n      // calls are equivalent because they wrap the same Foo function.\n      var prevFamily = resolveFamily(prevType);\n      if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\nfunction markFailedErrorBoundaryForHotReloading(fiber) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return;\n    }\n    if (typeof WeakSet !== 'function') {\n      return;\n    }\n    if (failedBoundaries === null) {\n      failedBoundaries = new WeakSet();\n    }\n    failedBoundaries.add(fiber);\n  }\n}\nvar scheduleRefresh = function (root, update) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return;\n    }\n    var staleFamilies = update.staleFamilies,\n        updatedFamilies = update.updatedFamilies;\n    flushPassiveEffects();\n    flushSync(function () {\n      scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);\n    });\n  }\n};\nvar scheduleRoot = function (root, element) {\n  {\n    if (root.context !== emptyContextObject) {\n      // Super edge case: root has a legacy _renderSubtree context\n      // but we don't know the parentComponent so we can't pass it.\n      // Just ignore. We'll delete this with _renderSubtree code path later.\n      return;\n    }\n    flushPassiveEffects();\n    flushSync(function () {\n      updateContainer(element, root, null, null);\n    });\n  }\n};\nfunction scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {\n  {\n    var alternate = fiber.alternate,\n        child = fiber.child,\n        sibling = fiber.sibling,\n        tag = fiber.tag,\n        type = fiber.type;\n    var candidateType = null;\n    switch (tag) {\n      case FunctionComponent:\n      case SimpleMemoComponent:\n      case ClassComponent:\n        candidateType = type;\n        break;\n      case ForwardRef:\n        candidateType = type.render;\n        break;\n    }\n    if (resolveFamily === null) {\n      throw new Error('Expected resolveFamily to be set during hot reload.');\n    }\n    var needsRender = false;\n    var needsRemount = false;\n    if (candidateType !== null) {\n      var family = resolveFamily(candidateType);\n      if (family !== undefined) {\n        if (staleFamilies.has(family)) {\n          needsRemount = true;\n        } else if (updatedFamilies.has(family)) {\n          if (tag === ClassComponent) {\n            needsRemount = true;\n          } else {\n            needsRender = true;\n          }\n        }\n      }\n    }\n    if (failedBoundaries !== null) {\n      if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {\n        needsRemount = true;\n      }\n    }\n    if (needsRemount) {\n      fiber._debugNeedsRemount = true;\n    }\n    if (needsRemount || needsRender) {\n      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n    }\n    if (child !== null && !needsRemount) {\n      scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);\n    }\n    if (sibling !== null) {\n      scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);\n    }\n  }\n}\nvar findHostInstancesForRefresh = function (root, families) {\n  {\n    var hostInstances = new Set();\n    var types = new Set(families.map(function (family) {\n      return family.current;\n    }));\n    findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);\n    return hostInstances;\n  }\n};\nfunction findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {\n  {\n    var child = fiber.child,\n        sibling = fiber.sibling,\n        tag = fiber.tag,\n        type = fiber.type;\n    var candidateType = null;\n    switch (tag) {\n      case FunctionComponent:\n      case SimpleMemoComponent:\n      case ClassComponent:\n        candidateType = type;\n        break;\n      case ForwardRef:\n        candidateType = type.render;\n        break;\n    }\n    var didMatch = false;\n    if (candidateType !== null) {\n      if (types.has(candidateType)) {\n        didMatch = true;\n      }\n    }\n    if (didMatch) {\n      // We have a match. This only drills down to the closest host components.\n      // There's no need to search deeper because for the purpose of giving\n      // visual feedback, \\\\\"flashing\\\\\" outermost parent rectangles is sufficient.\n      findHostInstancesForFiberShallowly(fiber, hostInstances);\n    } else {\n      // If there's no match, maybe there will be one further down in the child tree.\n      if (child !== null) {\n        findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);\n      }\n    }\n    if (sibling !== null) {\n      findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);\n    }\n  }\n}\nfunction findHostInstancesForFiberShallowly(fiber, hostInstances) {\n  {\n    var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);\n    if (foundHostInstances) {\n      return;\n    } // If we didn't find any host children, fallback to closest host parent.\n    var node = fiber;\n    while (true) {\n      switch (node.tag) {\n        case HostComponent:\n          hostInstances.add(node.stateNode);\n          return;\n        case HostPortal:\n          hostInstances.add(node.stateNode.containerInfo);\n          return;\n        case HostRoot:\n          hostInstances.add(node.stateNode.containerInfo);\n          return;\n      }\n      if (node.return === null) {\n        throw new Error('Expected to reach root first.');\n      }\n      node = node.return;\n    }\n  }\n}\nfunction findChildHostInstancesForFiberShallowly(fiber, hostInstances) {\n  {\n    var node = fiber;\n    var foundHostInstances = false;\n    while (true) {\n      if (node.tag === HostComponent) {\n        // We got a match.\n        foundHostInstances = true;\n        hostInstances.add(node.stateNode); // There may still be more, so keep searching.\n      } else if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n      if (node === fiber) {\n        return foundHostInstances;\n      }\n      while (node.sibling === null) {\n        if (node.return === null || node.return === fiber) {\n          return foundHostInstances;\n        }\n        node = node.return;\n      }\n      node.sibling.return = node.return;\n      node = node.sibling;\n    }\n  }\n  return false;\n}\nvar hasBadMapPolyfill;\n{\n  hasBadMapPolyfill = false;\n  try {\n    var nonExtensibleObject = Object.preventExtensions({});\n    /* eslint-disable no-new */\n    new Map([[nonExtensibleObject, null]]);\n    new Set([nonExtensibleObject]);\n    /* eslint-enable no-new */\n  } catch (e) {\n    // TODO: Consider warning about bad polyfills\n    hasBadMapPolyfill = true;\n  }\n}\nvar debugCounter = 1;\nfunction FiberNode(tag, pendingProps, key, mode) {\n  // Instance\n  this.tag = tag;\n  this.key = key;\n  this.elementType = null;\n  this.type = null;\n  this.stateNode = null; // Fiber\n  this.return = null;\n  this.child = null;\n  this.sibling = null;\n  this.index = 0;\n  this.ref = null;\n  this.pendingProps = pendingProps;\n  this.memoizedProps = null;\n  this.updateQueue = null;\n  this.memoizedState = null;\n  this.dependencies = null;\n  this.mode = mode; // Effects\n  this.flags = NoFlags;\n  this.nextEffect = null;\n  this.firstEffect = null;\n  this.lastEffect = null;\n  this.lanes = NoLanes;\n  this.childLanes = NoLanes;\n  this.alternate = null;\n  {\n    // Note: The following is done to avoid a v8 performance cliff.\n    //\n    // Initializing the fields below to smis and later updating them with\n    // double values will cause Fibers to end up having separate shapes.\n    // This behavior/bug has something to do with Object.preventExtension().\n    // Fortunately this only impacts DEV builds.\n    // Unfortunately it makes React unusably slow for some applications.\n    // To work around this, initialize the fields below with doubles.\n    //\n    // Learn more about this here:\n    // https://github.com/facebook/react/issues/14365\n    // https://bugs.chromium.org/p/v8/issues/detail?id=8538\n    this.actualDuration = Number.NaN;\n    this.actualStartTime = Number.NaN;\n    this.selfBaseDuration = Number.NaN;\n    this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.\n    // This won't trigger the performance cliff mentioned above,\n    // and it simplifies other profiler code (including DevTools).\n    this.actualDuration = 0;\n    this.actualStartTime = -1;\n    this.selfBaseDuration = 0;\n    this.treeBaseDuration = 0;\n  }\n  {\n    // This isn't directly used but is handy for debugging internals:\n    this._debugID = debugCounter++;\n    this._debugSource = null;\n    this._debugOwner = null;\n    this._debugNeedsRemount = false;\n    this._debugHookTypes = null;\n    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n      Object.preventExtensions(this);\n    }\n  }\n} // This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n//    more difficult to predict when they get optimized and they are almost\n//    never inlined properly in static compilers.\n// 2) Nobody should rely on \\`instanceof Fiber\\` for type testing. We should\n//    always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n//    to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n//    is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n//    compatible.\nvar createFiber = function (tag, pendingProps, key, mode) {\n  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n  return new FiberNode(tag, pendingProps, key, mode);\n};\nfunction shouldConstruct$1(Component) {\n  var prototype = Component.prototype;\n  return !!(prototype && prototype.isReactComponent);\n}\nfunction isSimpleFunctionComponent(type) {\n  return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined;\n}\nfunction resolveLazyComponentTag(Component) {\n  if (typeof Component === 'function') {\n    return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;\n  } else if (Component !== undefined && Component !== null) {\n    var $$typeof = Component.$$typeof;\n    if ($$typeof === REACT_FORWARD_REF_TYPE) {\n      return ForwardRef;\n    }\n    if ($$typeof === REACT_MEMO_TYPE) {\n      return MemoComponent;\n    }\n  }\n  return IndeterminateComponent;\n} // This is used to create an alternate fiber to do work on.\nfunction createWorkInProgress(current, pendingProps) {\n  var workInProgress = current.alternate;\n  if (workInProgress === null) {\n    // We use a double buffering pooling technique because we know that we'll\n    // only ever need at most two versions of a tree. We pool the \\\\\"other\\\\\" unused\n    // node that we're free to reuse. This is lazily created to avoid allocating\n    // extra objects for things that are never updated. It also allow us to\n    // reclaim the extra memory if needed.\n    workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);\n    workInProgress.elementType = current.elementType;\n    workInProgress.type = current.type;\n    workInProgress.stateNode = current.stateNode;\n    {\n      // DEV-only fields\n      workInProgress._debugID = current._debugID;\n      workInProgress._debugSource = current._debugSource;\n      workInProgress._debugOwner = current._debugOwner;\n      workInProgress._debugHookTypes = current._debugHookTypes;\n    }\n    workInProgress.alternate = current;\n    current.alternate = workInProgress;\n  } else {\n    workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type.\n    workInProgress.type = current.type; // We already have an alternate.\n    // Reset the effect tag.\n    workInProgress.flags = NoFlags; // The effect list is no longer valid.\n    workInProgress.nextEffect = null;\n    workInProgress.firstEffect = null;\n    workInProgress.lastEffect = null;\n    {\n      // We intentionally reset, rather than copy, actualDuration & actualStartTime.\n      // This prevents time from endlessly accumulating in new commits.\n      // This has the downside of resetting values for different priority renders,\n      // But works for yielding (the common case) and should support resuming.\n      workInProgress.actualDuration = 0;\n      workInProgress.actualStartTime = -1;\n    }\n  }\n  workInProgress.childLanes = current.childLanes;\n  workInProgress.lanes = current.lanes;\n  workInProgress.child = current.child;\n  workInProgress.memoizedProps = current.memoizedProps;\n  workInProgress.memoizedState = current.memoizedState;\n  workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n  // it cannot be shared with the current fiber.\n  var currentDependencies = current.dependencies;\n  workInProgress.dependencies = currentDependencies === null ? null : {\n    lanes: currentDependencies.lanes,\n    firstContext: currentDependencies.firstContext\n  }; // These will be overridden during the parent's reconciliation\n  workInProgress.sibling = current.sibling;\n  workInProgress.index = current.index;\n  workInProgress.ref = current.ref;\n  {\n    workInProgress.selfBaseDuration = current.selfBaseDuration;\n    workInProgress.treeBaseDuration = current.treeBaseDuration;\n  }\n  {\n    workInProgress._debugNeedsRemount = current._debugNeedsRemount;\n    switch (workInProgress.tag) {\n      case IndeterminateComponent:\n      case FunctionComponent:\n      case SimpleMemoComponent:\n        workInProgress.type = resolveFunctionForHotReloading(current.type);\n        break;\n      case ClassComponent:\n        workInProgress.type = resolveClassForHotReloading(current.type);\n        break;\n      case ForwardRef:\n        workInProgress.type = resolveForwardRefForHotReloading(current.type);\n        break;\n    }\n  }\n  return workInProgress;\n} // Used to reuse a Fiber for a second pass.\nfunction resetWorkInProgress(workInProgress, renderLanes) {\n  // This resets the Fiber to what createFiber or createWorkInProgress would\n  // have set the values to before during the first pass. Ideally this wouldn't\n  // be necessary but unfortunately many code paths reads from the workInProgress\n  // when they should be reading from current and writing to workInProgress.\n  // We assume pendingProps, index, key, ref, return are still untouched to\n  // avoid doing another reconciliation.\n  // Reset the effect tag but keep any Placement tags, since that's something\n  // that child fiber is setting, not the reconciliation.\n  workInProgress.flags &= Placement; // The effect list is no longer valid.\n  workInProgress.nextEffect = null;\n  workInProgress.firstEffect = null;\n  workInProgress.lastEffect = null;\n  var current = workInProgress.alternate;\n  if (current === null) {\n    // Reset to createFiber's initial values.\n    workInProgress.childLanes = NoLanes;\n    workInProgress.lanes = renderLanes;\n    workInProgress.child = null;\n    workInProgress.memoizedProps = null;\n    workInProgress.memoizedState = null;\n    workInProgress.updateQueue = null;\n    workInProgress.dependencies = null;\n    workInProgress.stateNode = null;\n    {\n      // Note: We don't reset the actualTime counts. It's useful to accumulate\n      // actual time across multiple render passes.\n      workInProgress.selfBaseDuration = 0;\n      workInProgress.treeBaseDuration = 0;\n    }\n  } else {\n    // Reset to the cloned values that createWorkInProgress would've.\n    workInProgress.childLanes = current.childLanes;\n    workInProgress.lanes = current.lanes;\n    workInProgress.child = current.child;\n    workInProgress.memoizedProps = current.memoizedProps;\n    workInProgress.memoizedState = current.memoizedState;\n    workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type.\n    workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so\n    // it cannot be shared with the current fiber.\n    var currentDependencies = current.dependencies;\n    workInProgress.dependencies = currentDependencies === null ? null : {\n      lanes: currentDependencies.lanes,\n      firstContext: currentDependencies.firstContext\n    };\n    {\n      // Note: We don't reset the actualTime counts. It's useful to accumulate\n      // actual time across multiple render passes.\n      workInProgress.selfBaseDuration = current.selfBaseDuration;\n      workInProgress.treeBaseDuration = current.treeBaseDuration;\n    }\n  }\n  return workInProgress;\n}\nfunction createHostRootFiber(tag) {\n  var mode;\n  if (tag === ConcurrentRoot) {\n    mode = ConcurrentMode | BlockingMode | StrictMode;\n  } else if (tag === BlockingRoot) {\n    mode = BlockingMode | StrictMode;\n  } else {\n    mode = NoMode;\n  }\n  if ( isDevToolsPresent) {\n    // Always collect profile timings when DevTools are present.\n    // This enables DevTools to start capturing timing at any point–\n    // Without some nodes in the tree having empty base times.\n    mode |= ProfileMode;\n  }\n  return createFiber(HostRoot, null, null, mode);\n}\nfunction createFiberFromTypeAndProps(type, // React$ElementType\nkey, pendingProps, owner, mode, lanes) {\n  var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.\n  var resolvedType = type;\n  if (typeof type === 'function') {\n    if (shouldConstruct$1(type)) {\n      fiberTag = ClassComponent;\n      {\n        resolvedType = resolveClassForHotReloading(resolvedType);\n      }\n    } else {\n      {\n        resolvedType = resolveFunctionForHotReloading(resolvedType);\n      }\n    }\n  } else if (typeof type === 'string') {\n    fiberTag = HostComponent;\n  } else {\n    getTag: switch (type) {\n      case REACT_FRAGMENT_TYPE:\n        return createFiberFromFragment(pendingProps.children, mode, lanes, key);\n      case REACT_DEBUG_TRACING_MODE_TYPE:\n        fiberTag = Mode;\n        mode |= DebugTracingMode;\n        break;\n      case REACT_STRICT_MODE_TYPE:\n        fiberTag = Mode;\n        mode |= StrictMode;\n        break;\n      case REACT_PROFILER_TYPE:\n        return createFiberFromProfiler(pendingProps, mode, lanes, key);\n      case REACT_SUSPENSE_TYPE:\n        return createFiberFromSuspense(pendingProps, mode, lanes, key);\n      case REACT_SUSPENSE_LIST_TYPE:\n        return createFiberFromSuspenseList(pendingProps, mode, lanes, key);\n      case REACT_OFFSCREEN_TYPE:\n        return createFiberFromOffscreen(pendingProps, mode, lanes, key);\n      case REACT_LEGACY_HIDDEN_TYPE:\n        return createFiberFromLegacyHidden(pendingProps, mode, lanes, key);\n      case REACT_SCOPE_TYPE:\n      // eslint-disable-next-line no-fallthrough\n      default:\n        {\n          if (typeof type === 'object' && type !== null) {\n            switch (type.$$typeof) {\n              case REACT_PROVIDER_TYPE:\n                fiberTag = ContextProvider;\n                break getTag;\n              case REACT_CONTEXT_TYPE:\n                // This is a consumer\n                fiberTag = ContextConsumer;\n                break getTag;\n              case REACT_FORWARD_REF_TYPE:\n                fiberTag = ForwardRef;\n                {\n                  resolvedType = resolveForwardRefForHotReloading(resolvedType);\n                }\n                break getTag;\n              case REACT_MEMO_TYPE:\n                fiberTag = MemoComponent;\n                break getTag;\n              case REACT_LAZY_TYPE:\n                fiberTag = LazyComponent;\n                resolvedType = null;\n                break getTag;\n              case REACT_BLOCK_TYPE:\n                fiberTag = Block;\n                break getTag;\n            }\n          }\n          var info = '';\n          {\n            if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n              info += ' You likely forgot to export your component from the file ' + \\\\\"it's defined in, or you might have mixed up default and \\\\\" + 'named imports.';\n            }\n            var ownerName = owner ? getComponentName(owner.type) : null;\n            if (ownerName) {\n              info += 'Check the render method of \\`' + ownerName + '\\`.';\n            }\n          }\n          {\n            {\n              throw Error( \\\\\"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: \\\\\" + (type == null ? type : typeof type) + \\\\\".\\\\\" + info );\n            }\n          }\n        }\n    }\n  }\n  var fiber = createFiber(fiberTag, pendingProps, key, mode);\n  fiber.elementType = type;\n  fiber.type = resolvedType;\n  fiber.lanes = lanes;\n  {\n    fiber._debugOwner = owner;\n  }\n  return fiber;\n}\nfunction createFiberFromElement(element, mode, lanes) {\n  var owner = null;\n  {\n    owner = element._owner;\n  }\n  var type = element.type;\n  var key = element.key;\n  var pendingProps = element.props;\n  var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);\n  {\n    fiber._debugSource = element._source;\n    fiber._debugOwner = element._owner;\n  }\n  return fiber;\n}\nfunction createFiberFromFragment(elements, mode, lanes, key) {\n  var fiber = createFiber(Fragment, elements, key, mode);\n  fiber.lanes = lanes;\n  return fiber;\n}\nfunction createFiberFromProfiler(pendingProps, mode, lanes, key) {\n  {\n    if (typeof pendingProps.id !== 'string') {\n      error('Profiler must specify an \\\\\"id\\\\\" as a prop');\n    }\n  }\n  var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.\n  fiber.elementType = REACT_PROFILER_TYPE;\n  fiber.type = REACT_PROFILER_TYPE;\n  fiber.lanes = lanes;\n  {\n    fiber.stateNode = {\n      effectDuration: 0,\n      passiveEffectDuration: 0\n    };\n  }\n  return fiber;\n}\nfunction createFiberFromSuspense(pendingProps, mode, lanes, key) {\n  var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.\n  // This needs to be fixed in getComponentName so that it relies on the tag\n  // instead.\n  fiber.type = REACT_SUSPENSE_TYPE;\n  fiber.elementType = REACT_SUSPENSE_TYPE;\n  fiber.lanes = lanes;\n  return fiber;\n}\nfunction createFiberFromSuspenseList(pendingProps, mode, lanes, key) {\n  var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);\n  {\n    // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.\n    // This needs to be fixed in getComponentName so that it relies on the tag\n    // instead.\n    fiber.type = REACT_SUSPENSE_LIST_TYPE;\n  }\n  fiber.elementType = REACT_SUSPENSE_LIST_TYPE;\n  fiber.lanes = lanes;\n  return fiber;\n}\nfunction createFiberFromOffscreen(pendingProps, mode, lanes, key) {\n  var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); // TODO: The OffscreenComponent fiber shouldn't have a type. It has a tag.\n  // This needs to be fixed in getComponentName so that it relies on the tag\n  // instead.\n  {\n    fiber.type = REACT_OFFSCREEN_TYPE;\n  }\n  fiber.elementType = REACT_OFFSCREEN_TYPE;\n  fiber.lanes = lanes;\n  return fiber;\n}\nfunction createFiberFromLegacyHidden(pendingProps, mode, lanes, key) {\n  var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode); // TODO: The LegacyHidden fiber shouldn't have a type. It has a tag.\n  // This needs to be fixed in getComponentName so that it relies on the tag\n  // instead.\n  {\n    fiber.type = REACT_LEGACY_HIDDEN_TYPE;\n  }\n  fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;\n  fiber.lanes = lanes;\n  return fiber;\n}\nfunction createFiberFromText(content, mode, lanes) {\n  var fiber = createFiber(HostText, content, null, mode);\n  fiber.lanes = lanes;\n  return fiber;\n}\nfunction createFiberFromHostInstanceForDeletion() {\n  var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.\n  fiber.elementType = 'DELETED';\n  fiber.type = 'DELETED';\n  return fiber;\n}\nfunction createFiberFromPortal(portal, mode, lanes) {\n  var pendingProps = portal.children !== null ? portal.children : [];\n  var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);\n  fiber.lanes = lanes;\n  fiber.stateNode = {\n    containerInfo: portal.containerInfo,\n    pendingChildren: null,\n    // Used by persistent updates\n    implementation: portal.implementation\n  };\n  return fiber;\n} // Used for stashing WIP properties to replay failed work in DEV.\nfunction assignFiberPropertiesInDEV(target, source) {\n  if (target === null) {\n    // This Fiber's initial properties will always be overwritten.\n    // We only use a Fiber to ensure the same hidden class so DEV isn't slow.\n    target = createFiber(IndeterminateComponent, null, null, NoMode);\n  } // This is intentionally written as a list of all properties.\n  // We tried to use Object.assign() instead but this is called in\n  // the hottest path, and Object.assign() was too slow:\n  // https://github.com/facebook/react/issues/12502\n  // This code is DEV-only so size is not a concern.\n  target.tag = source.tag;\n  target.key = source.key;\n  target.elementType = source.elementType;\n  target.type = source.type;\n  target.stateNode = source.stateNode;\n  target.return = source.return;\n  target.child = source.child;\n  target.sibling = source.sibling;\n  target.index = source.index;\n  target.ref = source.ref;\n  target.pendingProps = source.pendingProps;\n  target.memoizedProps = source.memoizedProps;\n  target.updateQueue = source.updateQueue;\n  target.memoizedState = source.memoizedState;\n  target.dependencies = source.dependencies;\n  target.mode = source.mode;\n  target.flags = source.flags;\n  target.nextEffect = source.nextEffect;\n  target.firstEffect = source.firstEffect;\n  target.lastEffect = source.lastEffect;\n  target.lanes = source.lanes;\n  target.childLanes = source.childLanes;\n  target.alternate = source.alternate;\n  {\n    target.actualDuration = source.actualDuration;\n    target.actualStartTime = source.actualStartTime;\n    target.selfBaseDuration = source.selfBaseDuration;\n    target.treeBaseDuration = source.treeBaseDuration;\n  }\n  target._debugID = source._debugID;\n  target._debugSource = source._debugSource;\n  target._debugOwner = source._debugOwner;\n  target._debugNeedsRemount = source._debugNeedsRemount;\n  target._debugHookTypes = source._debugHookTypes;\n  return target;\n}\nfunction FiberRootNode(containerInfo, tag, hydrate) {\n  this.tag = tag;\n  this.containerInfo = containerInfo;\n  this.pendingChildren = null;\n  this.current = null;\n  this.pingCache = null;\n  this.finishedWork = null;\n  this.timeoutHandle = noTimeout;\n  this.context = null;\n  this.pendingContext = null;\n  this.hydrate = hydrate;\n  this.callbackNode = null;\n  this.callbackPriority = NoLanePriority;\n  this.eventTimes = createLaneMap(NoLanes);\n  this.expirationTimes = createLaneMap(NoTimestamp);\n  this.pendingLanes = NoLanes;\n  this.suspendedLanes = NoLanes;\n  this.pingedLanes = NoLanes;\n  this.expiredLanes = NoLanes;\n  this.mutableReadLanes = NoLanes;\n  this.finishedLanes = NoLanes;\n  this.entangledLanes = NoLanes;\n  this.entanglements = createLaneMap(NoLanes);\n  {\n    this.mutableSourceEagerHydrationData = null;\n  }\n  {\n    this.interactionThreadID = tracing$1.unstable_getThreadID();\n    this.memoizedInteractions = new Set();\n    this.pendingInteractionMap = new Map();\n  }\n  {\n    switch (tag) {\n      case BlockingRoot:\n        this._debugRootType = 'createBlockingRoot()';\n        break;\n      case ConcurrentRoot:\n        this._debugRootType = 'createRoot()';\n        break;\n      case LegacyRoot:\n        this._debugRootType = 'createLegacyRoot()';\n        break;\n    }\n  }\n}\nfunction createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {\n  var root = new FiberRootNode(containerInfo, tag, hydrate);\n  // stateNode is any.\n  var uninitializedFiber = createHostRootFiber(tag);\n  root.current = uninitializedFiber;\n  uninitializedFiber.stateNode = root;\n  initializeUpdateQueue(uninitializedFiber);\n  return root;\n}\n// This ensures that the version used for server rendering matches the one\n// that is eventually read during hydration.\n// If they don't match there's a potential tear and a full deopt render is required.\nfunction registerMutableSourceForHydration(root, mutableSource) {\n  var getVersion = mutableSource._getVersion;\n  var version = getVersion(mutableSource._source); // TODO Clear this data once all pending hydration work is finished.\n  // Retaining it forever may interfere with GC.\n  if (root.mutableSourceEagerHydrationData == null) {\n    root.mutableSourceEagerHydrationData = [mutableSource, version];\n  } else {\n    root.mutableSourceEagerHydrationData.push(mutableSource, version);\n  }\n}\nfunction createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n  return {\n    // This tag allow us to uniquely identify this as a React Portal\n    $$typeof: REACT_PORTAL_TYPE,\n    key: key == null ? null : '' + key,\n    children: children,\n    containerInfo: containerInfo,\n    implementation: implementation\n  };\n}\nvar didWarnAboutNestedUpdates;\nvar didWarnAboutFindNodeInStrictMode;\n{\n  didWarnAboutNestedUpdates = false;\n  didWarnAboutFindNodeInStrictMode = {};\n}\nfunction getContextForSubtree(parentComponent) {\n  if (!parentComponent) {\n    return emptyContextObject;\n  }\n  var fiber = get(parentComponent);\n  var parentContext = findCurrentUnmaskedContext(fiber);\n  if (fiber.tag === ClassComponent) {\n    var Component = fiber.type;\n    if (isContextProvider(Component)) {\n      return processChildContext(fiber, Component, parentContext);\n    }\n  }\n  return parentContext;\n}\nfunction findHostInstanceWithWarning(component, methodName) {\n  {\n    var fiber = get(component);\n    if (fiber === undefined) {\n      if (typeof component.render === 'function') {\n        {\n          {\n            throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n          }\n        }\n      } else {\n        {\n          {\n            throw Error( \\\\\"Argument appears to not be a ReactComponent. Keys: \\\\\" + Object.keys(component) );\n          }\n        }\n      }\n    }\n    var hostFiber = findCurrentHostFiber(fiber);\n    if (hostFiber === null) {\n      return null;\n    }\n    if (hostFiber.mode & StrictMode) {\n      var componentName = getComponentName(fiber.type) || 'Component';\n      if (!didWarnAboutFindNodeInStrictMode[componentName]) {\n        didWarnAboutFindNodeInStrictMode[componentName] = true;\n        var previousFiber = current;\n        try {\n          setCurrentFiber(hostFiber);\n          if (fiber.mode & StrictMode) {\n            error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);\n          } else {\n            error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName);\n          }\n        } finally {\n          // Ideally this should reset to previous but this shouldn't be called in\n          // render and there's another warning for that anyway.\n          if (previousFiber) {\n            setCurrentFiber(previousFiber);\n          } else {\n            resetCurrentFiber();\n          }\n        }\n      }\n    }\n    return hostFiber.stateNode;\n  }\n}\nfunction createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {\n  return createFiberRoot(containerInfo, tag, hydrate);\n}\nfunction updateContainer(element, container, parentComponent, callback) {\n  {\n    onScheduleRoot(container, element);\n  }\n  var current$1 = container.current;\n  var eventTime = requestEventTime();\n  {\n    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n    if ('undefined' !== typeof jest) {\n      warnIfUnmockedScheduler(current$1);\n      warnIfNotScopedWithMatchingAct(current$1);\n    }\n  }\n  var lane = requestUpdateLane(current$1);\n  var context = getContextForSubtree(parentComponent);\n  if (container.context === null) {\n    container.context = context;\n  } else {\n    container.pendingContext = context;\n  }\n  {\n    if (isRendering && current !== null && !didWarnAboutNestedUpdates) {\n      didWarnAboutNestedUpdates = true;\n      error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');\n    }\n  }\n  var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property\n  // being called \\\\\"element\\\\\".\n  update.payload = {\n    element: element\n  };\n  callback = callback === undefined ? null : callback;\n  if (callback !== null) {\n    {\n      if (typeof callback !== 'function') {\n        error('render(...): Expected the last optional \\`callback\\` argument to be a ' + 'function. Instead received: %s.', callback);\n      }\n    }\n    update.callback = callback;\n  }\n  enqueueUpdate(current$1, update);\n  scheduleUpdateOnFiber(current$1, lane, eventTime);\n  return lane;\n}\nfunction getPublicRootInstance(container) {\n  var containerFiber = container.current;\n  if (!containerFiber.child) {\n    return null;\n  }\n  switch (containerFiber.child.tag) {\n    case HostComponent:\n      return getPublicInstance(containerFiber.child.stateNode);\n    default:\n      return containerFiber.child.stateNode;\n  }\n}\nfunction markRetryLaneImpl(fiber, retryLane) {\n  var suspenseState = fiber.memoizedState;\n  if (suspenseState !== null && suspenseState.dehydrated !== null) {\n    suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);\n  }\n} // Increases the priority of thennables when they resolve within this boundary.\nfunction markRetryLaneIfNotHydrated(fiber, retryLane) {\n  markRetryLaneImpl(fiber, retryLane);\n  var alternate = fiber.alternate;\n  if (alternate) {\n    markRetryLaneImpl(alternate, retryLane);\n  }\n}\nfunction attemptUserBlockingHydration$1(fiber) {\n  if (fiber.tag !== SuspenseComponent) {\n    // We ignore HostRoots here because we can't increase\n    // their priority and they should not suspend on I/O,\n    // since you have to wrap anything that might suspend in\n    // Suspense.\n    return;\n  }\n  var eventTime = requestEventTime();\n  var lane = InputDiscreteHydrationLane;\n  scheduleUpdateOnFiber(fiber, lane, eventTime);\n  markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction attemptContinuousHydration$1(fiber) {\n  if (fiber.tag !== SuspenseComponent) {\n    // We ignore HostRoots here because we can't increase\n    // their priority and they should not suspend on I/O,\n    // since you have to wrap anything that might suspend in\n    // Suspense.\n    return;\n  }\n  var eventTime = requestEventTime();\n  var lane = SelectiveHydrationLane;\n  scheduleUpdateOnFiber(fiber, lane, eventTime);\n  markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction attemptHydrationAtCurrentPriority$1(fiber) {\n  if (fiber.tag !== SuspenseComponent) {\n    // We ignore HostRoots here because we can't increase\n    // their priority other than synchronously flush it.\n    return;\n  }\n  var eventTime = requestEventTime();\n  var lane = requestUpdateLane(fiber);\n  scheduleUpdateOnFiber(fiber, lane, eventTime);\n  markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction runWithPriority$2(priority, fn) {\n  try {\n    setCurrentUpdateLanePriority(priority);\n    return fn();\n  } finally {\n  }\n}\nfunction findHostInstanceWithNoPortals(fiber) {\n  var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n  if (hostFiber === null) {\n    return null;\n  }\n  if (hostFiber.tag === FundamentalComponent) {\n    return hostFiber.stateNode.instance;\n  }\n  return hostFiber.stateNode;\n}\nvar shouldSuspendImpl = function (fiber) {\n  return false;\n};\nfunction shouldSuspend(fiber) {\n  return shouldSuspendImpl(fiber);\n}\nvar overrideHookState = null;\nvar overrideHookStateDeletePath = null;\nvar overrideHookStateRenamePath = null;\nvar overrideProps = null;\nvar overridePropsDeletePath = null;\nvar overridePropsRenamePath = null;\nvar scheduleUpdate = null;\nvar setSuspenseHandler = null;\n{\n  var copyWithDeleteImpl = function (obj, path, index) {\n    var key = path[index];\n    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);\n    if (index + 1 === path.length) {\n      if (Array.isArray(updated)) {\n        updated.splice(key, 1);\n      } else {\n        delete updated[key];\n      }\n      return updated;\n    } // $FlowFixMe number or string is fine here\n    updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);\n    return updated;\n  };\n  var copyWithDelete = function (obj, path) {\n    return copyWithDeleteImpl(obj, path, 0);\n  };\n  var copyWithRenameImpl = function (obj, oldPath, newPath, index) {\n    var oldKey = oldPath[index];\n    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);\n    if (index + 1 === oldPath.length) {\n      var newKey = newPath[index]; // $FlowFixMe number or string is fine here\n      updated[newKey] = updated[oldKey];\n      if (Array.isArray(updated)) {\n        updated.splice(oldKey, 1);\n      } else {\n        delete updated[oldKey];\n      }\n    } else {\n      // $FlowFixMe number or string is fine here\n      updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here\n      obj[oldKey], oldPath, newPath, index + 1);\n    }\n    return updated;\n  };\n  var copyWithRename = function (obj, oldPath, newPath) {\n    if (oldPath.length !== newPath.length) {\n      warn('copyWithRename() expects paths of the same length');\n      return;\n    } else {\n      for (var i = 0; i < newPath.length - 1; i++) {\n        if (oldPath[i] !== newPath[i]) {\n          warn('copyWithRename() expects paths to be the same except for the deepest key');\n          return;\n        }\n      }\n    }\n    return copyWithRenameImpl(obj, oldPath, newPath, 0);\n  };\n  var copyWithSetImpl = function (obj, path, index, value) {\n    if (index >= path.length) {\n      return value;\n    }\n    var key = path[index];\n    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here\n    updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);\n    return updated;\n  };\n  var copyWithSet = function (obj, path, value) {\n    return copyWithSetImpl(obj, path, 0, value);\n  };\n  var findHook = function (fiber, id) {\n    // For now, the \\\\\"id\\\\\" of stateful hooks is just the stateful hook index.\n    // This may change in the future with e.g. nested hooks.\n    var currentHook = fiber.memoizedState;\n    while (currentHook !== null && id > 0) {\n      currentHook = currentHook.next;\n      id--;\n    }\n    return currentHook;\n  }; // Support DevTools editable values for useState and useReducer.\n  overrideHookState = function (fiber, id, path, value) {\n    var hook = findHook(fiber, id);\n    if (hook !== null) {\n      var newState = copyWithSet(hook.memoizedState, path, value);\n      hook.memoizedState = newState;\n      hook.baseState = newState; // We aren't actually adding an update to the queue,\n      // because there is no update we can add for useReducer hooks that won't trigger an error.\n      // (There's no appropriate action type for DevTools overrides.)\n      // As a result though, React will see the scheduled update as a noop and bailout.\n      // Shallow cloning props works as a workaround for now to bypass the bailout check.\n      fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n    }\n  };\n  overrideHookStateDeletePath = function (fiber, id, path) {\n    var hook = findHook(fiber, id);\n    if (hook !== null) {\n      var newState = copyWithDelete(hook.memoizedState, path);\n      hook.memoizedState = newState;\n      hook.baseState = newState; // We aren't actually adding an update to the queue,\n      // because there is no update we can add for useReducer hooks that won't trigger an error.\n      // (There's no appropriate action type for DevTools overrides.)\n      // As a result though, React will see the scheduled update as a noop and bailout.\n      // Shallow cloning props works as a workaround for now to bypass the bailout check.\n      fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n    }\n  };\n  overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) {\n    var hook = findHook(fiber, id);\n    if (hook !== null) {\n      var newState = copyWithRename(hook.memoizedState, oldPath, newPath);\n      hook.memoizedState = newState;\n      hook.baseState = newState; // We aren't actually adding an update to the queue,\n      // because there is no update we can add for useReducer hooks that won't trigger an error.\n      // (There's no appropriate action type for DevTools overrides.)\n      // As a result though, React will see the scheduled update as a noop and bailout.\n      // Shallow cloning props works as a workaround for now to bypass the bailout check.\n      fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n      scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n    }\n  }; // Support DevTools props for function components, forwardRef, memo, host components, etc.\n  overrideProps = function (fiber, path, value) {\n    fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);\n    if (fiber.alternate) {\n      fiber.alternate.pendingProps = fiber.pendingProps;\n    }\n    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n  };\n  overridePropsDeletePath = function (fiber, path) {\n    fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);\n    if (fiber.alternate) {\n      fiber.alternate.pendingProps = fiber.pendingProps;\n    }\n    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n  };\n  overridePropsRenamePath = function (fiber, oldPath, newPath) {\n    fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);\n    if (fiber.alternate) {\n      fiber.alternate.pendingProps = fiber.pendingProps;\n    }\n    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n  };\n  scheduleUpdate = function (fiber) {\n    scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n  };\n  setSuspenseHandler = function (newShouldSuspendImpl) {\n    shouldSuspendImpl = newShouldSuspendImpl;\n  };\n}\nfunction findHostInstanceByFiber(fiber) {\n  var hostFiber = findCurrentHostFiber(fiber);\n  if (hostFiber === null) {\n    return null;\n  }\n  return hostFiber.stateNode;\n}\nfunction emptyFindFiberByHostInstance(instance) {\n  return null;\n}\nfunction getCurrentFiberForDevTools() {\n  return current;\n}\nfunction injectIntoDevTools(devToolsConfig) {\n  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n  var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n  return injectInternals({\n    bundleType: devToolsConfig.bundleType,\n    version: devToolsConfig.version,\n    rendererPackageName: devToolsConfig.rendererPackageName,\n    rendererConfig: devToolsConfig.rendererConfig,\n    overrideHookState: overrideHookState,\n    overrideHookStateDeletePath: overrideHookStateDeletePath,\n    overrideHookStateRenamePath: overrideHookStateRenamePath,\n    overrideProps: overrideProps,\n    overridePropsDeletePath: overridePropsDeletePath,\n    overridePropsRenamePath: overridePropsRenamePath,\n    setSuspenseHandler: setSuspenseHandler,\n    scheduleUpdate: scheduleUpdate,\n    currentDispatcherRef: ReactCurrentDispatcher,\n    findHostInstanceByFiber: findHostInstanceByFiber,\n    findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,\n    // React Refresh\n    findHostInstancesForRefresh:  findHostInstancesForRefresh ,\n    scheduleRefresh:  scheduleRefresh ,\n    scheduleRoot:  scheduleRoot ,\n    setRefreshHandler:  setRefreshHandler ,\n    // Enables DevTools to append owner stacks to error messages in DEV mode.\n    getCurrentFiber:  getCurrentFiberForDevTools\n  });\n}\nfunction ReactDOMBlockingRoot(container, tag, options) {\n  this._internalRoot = createRootImpl(container, tag, options);\n}\nReactDOMBlockingRoot.prototype.render = function (children) {\n  var root = this._internalRoot;\n  {\n    if (typeof arguments[1] === 'function') {\n      error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n    }\n    var container = root.containerInfo;\n    if (container.nodeType !== COMMENT_NODE) {\n      var hostInstance = findHostInstanceWithNoPortals(root.current);\n      if (hostInstance) {\n        if (hostInstance.parentNode !== container) {\n          error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + \\\\\"root.unmount() to empty a root's container.\\\\\");\n        }\n      }\n    }\n  }\n  updateContainer(children, root, null, null);\n};\nReactDOMBlockingRoot.prototype.unmount = function () {\n  {\n    if (typeof arguments[0] === 'function') {\n      error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n    }\n  }\n  var root = this._internalRoot;\n  var container = root.containerInfo;\n  updateContainer(null, root, null, function () {\n    unmarkContainerAsRoot(container);\n  });\n};\nfunction createRootImpl(container, tag, options) {\n  // Tag is either LegacyRoot or Concurrent Root\n  var hydrate = options != null && options.hydrate === true;\n  var hydrationCallbacks = options != null && options.hydrationOptions || null;\n  var mutableSources = options != null && options.hydrationOptions != null && options.hydrationOptions.mutableSources || null;\n  var root = createContainer(container, tag, hydrate);\n  markContainerAsRoot(root.current, container);\n  var containerNodeType = container.nodeType;\n  {\n    var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;\n    listenToAllSupportedEvents(rootContainerElement);\n  }\n  if (mutableSources) {\n    for (var i = 0; i < mutableSources.length; i++) {\n      var mutableSource = mutableSources[i];\n      registerMutableSourceForHydration(root, mutableSource);\n    }\n  }\n  return root;\n}\nfunction createLegacyRoot(container, options) {\n  return new ReactDOMBlockingRoot(container, LegacyRoot, options);\n}\nfunction isValidContainer(node) {\n  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\nvar ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;\nvar topLevelUpdateWarnings;\nvar warnedAboutHydrateAPI = false;\n{\n  topLevelUpdateWarnings = function (container) {\n    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n      var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);\n      if (hostInstance) {\n        if (hostInstance.parentNode !== container) {\n          error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n        }\n      }\n    }\n    var isRootRenderedBySomeReact = !!container._reactRootContainer;\n    var rootEl = getReactRootElementInContainer(container);\n    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));\n    if (hasNonRootReactChild && !isRootRenderedBySomeReact) {\n      error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n    }\n    if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n      error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n    }\n  };\n}\nfunction getReactRootElementInContainer(container) {\n  if (!container) {\n    return null;\n  }\n  if (container.nodeType === DOCUMENT_NODE) {\n    return container.documentElement;\n  } else {\n    return container.firstChild;\n  }\n}\nfunction shouldHydrateDueToLegacyHeuristic(container) {\n  var rootElement = getReactRootElementInContainer(container);\n  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));\n}\nfunction legacyCreateRootFromDOMContainer(container, forceHydrate) {\n  var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.\n  if (!shouldHydrate) {\n    var warned = false;\n    var rootSibling;\n    while (rootSibling = container.lastChild) {\n      {\n        if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {\n          warned = true;\n          error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');\n        }\n      }\n      container.removeChild(rootSibling);\n    }\n  }\n  {\n    if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {\n      warnedAboutHydrateAPI = true;\n      warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v18. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');\n    }\n  }\n  return createLegacyRoot(container, shouldHydrate ? {\n    hydrate: true\n  } : undefined);\n}\nfunction warnOnInvalidCallback$1(callback, callerName) {\n  {\n    if (callback !== null && typeof callback !== 'function') {\n      error('%s(...): Expected the last optional \\`callback\\` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n    }\n  }\n}\nfunction legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n  {\n    topLevelUpdateWarnings(container);\n    warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');\n  } // TODO: Without \\`any\\` type, Flow says \\\\\"Property cannot be accessed on any\n  // member of intersection type.\\\\\" Whyyyyyy.\n  var root = container._reactRootContainer;\n  var fiberRoot;\n  if (!root) {\n    // Initial mount\n    root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);\n    fiberRoot = root._internalRoot;\n    if (typeof callback === 'function') {\n      var originalCallback = callback;\n      callback = function () {\n        var instance = getPublicRootInstance(fiberRoot);\n        originalCallback.call(instance);\n      };\n    } // Initial mount should not be batched.\n    unbatchedUpdates(function () {\n      updateContainer(children, fiberRoot, parentComponent, callback);\n    });\n  } else {\n    fiberRoot = root._internalRoot;\n    if (typeof callback === 'function') {\n      var _originalCallback = callback;\n      callback = function () {\n        var instance = getPublicRootInstance(fiberRoot);\n        _originalCallback.call(instance);\n      };\n    } // Update\n    updateContainer(children, fiberRoot, parentComponent, callback);\n  }\n  return getPublicRootInstance(fiberRoot);\n}\nfunction findDOMNode(componentOrElement) {\n  {\n    var owner = ReactCurrentOwner$3.current;\n    if (owner !== null && owner.stateNode !== null) {\n      var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n      if (!warnedAboutRefsInRender) {\n        error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');\n      }\n      owner.stateNode._warnedAboutRefsInRender = true;\n    }\n  }\n  if (componentOrElement == null) {\n    return null;\n  }\n  if (componentOrElement.nodeType === ELEMENT_NODE) {\n    return componentOrElement;\n  }\n  {\n    return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');\n  }\n}\nfunction hydrate(element, container, callback) {\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  }\n  {\n    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n    if (isModernRoot) {\n      error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');\n    }\n  } // TODO: throw or warn if we couldn't hydrate?\n  return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);\n}\nfunction render(element, container, callback) {\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  }\n  {\n    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n    if (isModernRoot) {\n      error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');\n    }\n  }\n  return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);\n}\nfunction unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n  if (!isValidContainer(containerNode)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  }\n  if (!(parentComponent != null && has(parentComponent))) {\n    {\n      throw Error( \\\\\"parentComponent must be a valid React Component\\\\\" );\n    }\n  }\n  return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n}\nfunction unmountComponentAtNode(container) {\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"unmountComponentAtNode(...): Target container is not a DOM element.\\\\\" );\n    }\n  }\n  {\n    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n    if (isModernRoot) {\n      error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');\n    }\n  }\n  if (container._reactRootContainer) {\n    {\n      var rootEl = getReactRootElementInContainer(container);\n      var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);\n      if (renderedByDifferentReact) {\n        error(\\\\\"unmountComponentAtNode(): The node you're attempting to unmount \\\\\" + 'was rendered by another copy of React.');\n      }\n    } // Unmount should not be batched.\n    unbatchedUpdates(function () {\n      legacyRenderSubtreeIntoContainer(null, null, container, false, function () {\n        // $FlowFixMe This should probably use \\`delete container._reactRootContainer\\`\n        container._reactRootContainer = null;\n        unmarkContainerAsRoot(container);\n      });\n    }); // If you call unmountComponentAtNode twice in quick succession, you'll\n    // get \\`true\\` twice. That's probably fine?\n    return true;\n  } else {\n    {\n      var _rootEl = getReactRootElementInContainer(container);\n      var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); // Check if the container itself is a React root node.\n      var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;\n      if (hasNonRootReactChild) {\n        error(\\\\\"unmountComponentAtNode(): The node you're attempting to unmount \\\\\" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n      }\n    }\n    return false;\n  }\n}\nsetAttemptUserBlockingHydration(attemptUserBlockingHydration$1);\nsetAttemptContinuousHydration(attemptContinuousHydration$1);\nsetAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);\nsetAttemptHydrationAtPriority(runWithPriority$2);\nvar didWarnAboutUnstableCreatePortal = false;\n{\n  if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype\n  Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype\n  Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n    error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');\n  }\n}\nsetRestoreImplementation(restoreControlledState$3);\nsetBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);\nfunction createPortal$1(children, container) {\n  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  } // TODO: pass ReactDOM portal implementation as third argument\n  // $FlowFixMe The Flow type is opaque but there's no way to actually create it.\n  return createPortal(children, container, null, key);\n}\nfunction renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n  return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);\n}\nfunction unstable_createPortal(children, container) {\n  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n  {\n    if (!didWarnAboutUnstableCreatePortal) {\n      didWarnAboutUnstableCreatePortal = true;\n      warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 18+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the \\\\\"unstable_\\\\\" prefix.');\n    }\n  }\n  return createPortal$1(children, container, key);\n}\nvar Internals = {\n  // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.\n  // This is an array for better minification.\n  Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, flushPassiveEffects, // TODO: This is related to \\`act\\`, not events. Move to separate key?\n  IsThisRendererActing]\n};\nvar foundDevTools = injectIntoDevTools({\n  findFiberByHostInstance: getClosestInstanceFromNode,\n  bundleType:  1 ,\n  version: ReactVersion,\n  rendererPackageName: 'react-dom'\n});\n{\n  if (!foundDevTools && canUseDOM && window.top === window.self) {\n    // If we're in Chrome or Firefox, provide a download link if not installed.\n    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\n      var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.\n      if (/^(https?|file):$/.test(protocol)) {\n        // eslint-disable-next-line react-internal/no-production-logging\n        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://reactjs.org/link/react-devtools' + (protocol === 'file:' ? 'You might need to use a local HTTP server (instead of file://): ' + 'https://reactjs.org/link/react-devtools-faq' : ''), 'font-weight:bold');\n      }\n    }\n  }\n}\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;\nexports.createPortal = createPortal$1;\nexports.findDOMNode = findDOMNode;\nexports.flushSync = flushSync;\nexports.hydrate = hydrate;\nexports.render = render;\nexports.unmountComponentAtNode = unmountComponentAtNode;\nexports.unstable_batchedUpdates = batchedUpdates$1;\nexports.unstable_createPortal = unstable_createPortal;\nexports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;\nexports.version = ReactVersion;\n  })();\n}\n});\nvar reactDom = createCommonjsModule(function (module) {\n{\n  module.exports = reactDom_development;\n}\n});\nvar __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = reactDom.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\nvar createPortal = reactDom.createPortal;\nexport default reactDom;\nvar findDOMNode = reactDom.findDOMNode;\nvar flushSync = reactDom.flushSync;\nvar hydrate = reactDom.hydrate;\nvar render = reactDom.render;\nvar unmountComponentAtNode = reactDom.unmountComponentAtNode;\nvar unstable_batchedUpdates = reactDom.unstable_batchedUpdates;\nvar unstable_createPortal = reactDom.unstable_createPortal;\nvar unstable_renderSubtreeIntoContainer = reactDom.unstable_renderSubtreeIntoContainer;\nvar version = reactDom.version;\nexport { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, reactDom as __moduleExports, createPortal, findDOMNode, flushSync, hydrate, render, unmountComponentAtNode, unstable_batchedUpdates, unstable_createPortal, unstable_renderSubtreeIntoContainer, version };\"\n`;\n"
  },
  {
    "path": "test/esinstall/exclude-external-packages/exclude-external-packages.test.js",
    "content": "const path = require('path');\nconst {\n  existsPackageJson,\n  runTest,\n  testLockFile,\n  testWebModules,\n} = require('../esinstall-test-utils.js');\n\nrequire('jest-specific-snapshot'); // allows to call expect().toMatchSpecificSnapshot(filename, snapshotName)\n\ndescribe('exclude-external-packages', () => {\n  it('matches the snapshot', async () => {\n    const cwd = __dirname;\n\n    if (existsPackageJson(cwd) === false) return;\n\n    // Run Test\n    const {output, snapshotFile} = await runTest(['react-dom'], {cwd, external: ['react']});\n\n    // Test output\n    expect(output).toMatchSpecificSnapshot(snapshotFile, 'cli output');\n\n    // Test Lockfile (if one exists)\n    await testLockFile(cwd);\n\n    // Cleanup\n    const {testAllSnapshots, testDiffs} = await testWebModules(cwd, snapshotFile);\n\n    // Assert that the snapshots match\n    testAllSnapshots();\n\n    // If any diffs are detected, we'll assert the difference so that we get nice output.\n    testDiffs();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/exclude-external-packages/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-exclude-external-packages\",\n  \"dependencies\": {\n    \"react\": \"17.0.1\",\n    \"react-dom\": \"17.0.1\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/exports-only/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/exports-only/exports-only.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\nconst execa = require('execa');\nconst path = require('path');\n\ndescribe('Package with only exports', () => {\n  it('Is able to install the dependencies without error', async () => {\n    const cwd = __dirname;\n\n    await execa('yarn', ['--silent', 'run', 'testinstall'], {\n      cwd,\n      reject: true,\n    });\n  });\n});\n"
  },
  {
    "path": "test/esinstall/exports-only/mod.js",
    "content": "import 'exports-only';\n"
  },
  {
    "path": "test/esinstall/exports-only/package.json",
    "content": "{\n  \"name\": \"@snowpack/test-exports-only\",\n  \"version\": \"1.0.0\",\n  \"main\": \"./mod.js\",\n  \"scripts\": {\n    \"testinstall\": \"snowpack prepare\",\n    \"debuginstall\": \"node --inspect-brk ../../../node_modules/.bin/snowpack prepare\"\n  },\n  \"dependencies\": {\n    \"exports-only\": \"file:./pkg\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/exports-only/pkg/mod.mjs",
    "content": "export let a = 'b';"
  },
  {
    "path": "test/esinstall/exports-only/pkg/package.json",
    "content": "{\n  \"name\": \"@snowpack/test-esinstall-pkg-no-exports\",\n  \"version\": \"1.0.0\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./mod.mjs\"\n    }\n  }\n}"
  },
  {
    "path": "test/esinstall/exports-only/snowpack.config.js",
    "content": "module.exports = {};\n"
  },
  {
    "path": "test/esinstall/exports-only-no-main/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/exports-only-no-main/exports-only-no-main.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\nconst execa = require('execa');\nconst path = require('path');\n\ndescribe('Package with only exports and no main', () => {\n  it('Is able to install the dependencies without error', async () => {\n    const cwd = __dirname;\n\n    await execa('yarn', ['--silent', 'run', 'testinstall'], {\n      cwd,\n      reject: true,\n    });\n  });\n});\n"
  },
  {
    "path": "test/esinstall/exports-only-no-main/mod.js",
    "content": "import 'exports-only-no-main/mod';\n"
  },
  {
    "path": "test/esinstall/exports-only-no-main/package.json",
    "content": "{\n  \"name\": \"@snowpack/test-exports-only-no-main\",\n  \"version\": \"1.0.0\",\n  \"main\": \"./mod.js\",\n  \"scripts\": {\n    \"testinstall\": \"snowpack prepare\",\n    \"debuginstall\": \"node --inspect-brk ../../../node_modules/.bin/snowpack prepare\"\n  },\n  \"dependencies\": {\n    \"exports-only-no-main\": \"file:./pkg\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/exports-only-no-main/pkg/mod.mjs",
    "content": "export let a = 'no main';"
  },
  {
    "path": "test/esinstall/exports-only-no-main/pkg/package.json",
    "content": "{\n  \"name\": \"@snowpack/test-esinstall-pkg-exports-only-no-main\",\n  \"version\": \"1.0.0\",\n  \"exports\": {\n    \"./mod\": {\n      \"import\": \"./mod.mjs\"\n    }\n  }\n}"
  },
  {
    "path": "test/esinstall/exports-only-no-main/snowpack.config.js",
    "content": "module.exports = {};\n"
  },
  {
    "path": "test/esinstall/import-assets/.gitignore",
    "content": "test-*\n"
  },
  {
    "path": "test/esinstall/import-assets/import-assets.test.js",
    "content": "const path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\nconst tests = [\n  {name: 'css', given: 'css.css'},\n  {name: 'jpg', given: 'jpg.jpg'},\n  {name: 'json', given: 'json.json'},\n  {name: 'svg', given: 'svg.svg'},\n];\n\ndescribe('import-assets', () => {\n  tests.forEach((t) => {\n    it(t.name, async () => {\n      const dest = path.join(__dirname, `test-${t.name}`);\n\n      // import the file directly\n      const spec = `mock-pkg-install-assets/${t.given}`;\n\n      // run it through esinstall\n      const {\n        importMap: {imports},\n      } = await runTest([spec], {cwd: __dirname, dest});\n\n      // test that esinstall completed successfully\n      expect(imports[spec]).toBeTruthy();\n    });\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-assets/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-import-assets\",\n  \"dependencies\": {\n    \"mock-pkg-install-assets\": \"file:./packages/mock-pkg-install-assets\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/import-assets/packages/mock-pkg-install-assets/css.css",
    "content": "body { background-color: blue; }\n"
  },
  {
    "path": "test/esinstall/import-assets/packages/mock-pkg-install-assets/json.json",
    "content": "{\"type\": \"json\"}\n"
  },
  {
    "path": "test/esinstall/import-assets/packages/mock-pkg-install-assets/package.json",
    "content": "{\n  \"version\": \"1.0.0\",\n  \"name\": \"mock-pkg-install-assets\"\n}\n"
  },
  {
    "path": "test/esinstall/import-astro/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/import-astro/import-astro.test.js",
    "content": "const path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('importing .astro files', () => {\n  it('included in the bundle', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-astro');\n\n    // Run Test\n    const {\n      importMap: {imports},\n    } = await runTest(['astro-components/Wow.astro'], {\n      cwd,\n      dest,\n      rollup: {\n        plugins: [\n          {\n            load() {\n              return 'export default \"so wow\";';\n            },\n          },\n        ],\n      },\n    });\n\n    expect(imports['astro-components/Wow.astro']).toBe('./astro-components/Wow.astro.js');\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-astro/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-dep-astro\",\n  \"dependencies\": {\n    \"astro-components\": \"file:./packages/components\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/import-astro/packages/components/Wow.astro",
    "content": "---\nconst foo = 'bar';\n---\n<div>Hello world</div>"
  },
  {
    "path": "test/esinstall/import-astro/packages/components/package.json",
    "content": "\n{\n  \"version\": \"1.0.0\",\n  \"name\": \"astro-components\",\n  \"main\": \"Wow.astro\"\n}\n"
  },
  {
    "path": "test/esinstall/import-missing/import-missing.test.js",
    "content": "const fs = require('fs-extra');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('include-missing-in-package-json', () => {\n  beforeAll(() => {\n    // copy packages/* to node_modules/*\n    fs.readdirSync(path.join(__dirname, 'packages')).forEach((pkg) => {\n      fs.copySync(path.join(__dirname, 'packages', pkg), path.join(__dirname, 'node_modules', pkg));\n    });\n  });\n\n  it('resolves packages in node_modules but not package.json', async () => {\n    const installTargets = ['@material/animation', 'tslib'];\n\n    // install\n    const {\n      importMap: {imports},\n    } = await runTest(installTargets, {cwd: __dirname});\n\n    // ensure all targets built\n    for (const target of installTargets) {\n      expect(imports[target]).toBeTruthy();\n    }\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-missing/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-import-missing\"\n}\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2014-2020 Google, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/README.md",
    "content": "<!--docs:\ntitle: \"Animation\"\nlayout: detail\nsection: components\nexcerpt: \"Animation timing curves and utilities for smooth and consistent motion.\"\niconId: animation\npath: /catalog/animation/\n-->\n\n# Animation\n\nMaterial in motion is responsive and natural. Use these easing curves and duration patterns to create smooth and consistent motion.\n\n## Design & API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-motion\">Material Design guidelines: Motion</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/animation\n```\n\n## Usage\n\n### Sass Variables\n\nWe provide timing functions which you can use with the `animation` or `transition` CSS properties\n\n```scss\n@use \"@material/animation\";\n\n.my-element--animating {\n  animation: foo-keyframe 175ms animation.$standard-curve-timing-function;\n}\n```\n\nVariable | Description\n--- | ---\n`$deceleration-curve-timing-function` | Timing function to decelerate\n`$standard-curve-timing-function` | Timing function to quickly accelerate and slowly decelerate\n`$acceleration-curve-timing-function` | Timing function to accelerate\n`$sharp-curve-timing-function` | Timing function to quickly accelerate and decelerate\n\nThe following functions create transitions given `$name` and the `$duration`. You can also specify `$delay`, but the default is 0ms. `$name` can either refer to the keyframe, or to CSS property used in `transition`.\n\n```scss\n@use \"@material/animation\";\n\n.my-element {\n  transition: animation.exit-permanent(/* $name: */ opacity, /* $duration: */ 175ms, /* $delay: */ 150ms);\n  opacity: 0;\n  will-change: opacity;\n\n  &--animating {\n    transition: animation.enter(/* $name: */ opacity, /* $duration: */ 175ms);\n    opacity: 1;\n  }\n}\n```\n\n\n```scss\n@use \"@material/animation\";\n\n@keyframes fade-in {\n  from {\n    transform: translateY(-80px);\n    opacity: 0;\n  }\n\n  to {\n    transform: translateY(0);\n    opacity: 1;\n  }\n}\n\n.my-element {\n  animation: animation.enter(/* $name: */ fade-in, /* $duration: */ 350ms);\n}\n```\n\nFunction | Description\n--- | ---\n`enter($name, $duration, $delay)` | Defines transition for entering the frame\n`exit-permanent($name, $duration, $delay)` | Defines transition for exiting the frame permanently\n`exit-temporary($name, $duration, $delay)` | Defines transition for exiting the frame temporarily\n\n### JavaScript\n\nThese functions handle prefixing across various browsers\n\n```js\nimport {getCorrectEventName} from '@material/animation';\n\nconst eventToListenFor = getCorrectEventName(window, 'animationstart');\n```\n\nMethod Signature | Description\n--- | ---\n`getCorrectEventName(windowObj: Window, eventType: StandardJsEventType) => StandardJsEventType \\| PrefixedJsEventType` | Returns a JavaScript event name, prefixed if necessary. See [`types.ts`](types.ts) for supported values.\n`getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName) => StandardCssPropertyName \\| PrefixedCssPropertyName` | Returns a CSS property name, prefixed if necessary. See [`types.ts`](types.ts) for supported values.\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/_functions.import.scss",
    "content": "@forward \"./index\" as mdc-animation-*;\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/_functions.scss",
    "content": "//\n// Copyright 2017 Google Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n@use \"./variables\";\n\n@function enter($name, $duration, $delay: 0ms) {\n  @return $name $duration $delay variables.$deceleration-curve-timing-function;\n}\n\n@function exit-permanent($name, $duration, $delay: 0ms) {\n  @return $name $duration $delay variables.$acceleration-curve-timing-function;\n}\n\n@function exit-temporary($name, $duration, $delay: 0ms) {\n  @return $name $duration $delay variables.$sharp-curve-timing-function;\n}\n\n@function standard($name, $duration, $delay: 0ms) {\n  @return $name $duration $delay variables.$standard-curve-timing-function;\n}\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/_index.scss",
    "content": "@forward \"./variables\";\n@forward \"./functions\";\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/_variables.import.scss",
    "content": "@forward \"./index\" as mdc-animation-* hide mdc-animation-enter, mdc-animation-exit-permanent, mdc-animation-exit-temporary, mdc-animation-standard;\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/_variables.scss",
    "content": "//\n// Copyright 2017 Google Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n$deceleration-curve-timing-function: cubic-bezier(0, 0, 0.2, 1) !default;\n$standard-curve-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !default;\n$acceleration-curve-timing-function: cubic-bezier(0.4, 0, 1, 1) !default;\n$sharp-curve-timing-function: cubic-bezier(0.4, 0, 0.6, 1) !default;\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/dist/mdc.animation.d.ts",
    "content": "// Generated by dts-bundle v0.7.3\n\ndeclare module '@material/animation' {\n    /**\n      * @license\n      * Copyright 2019 Google Inc.\n      *\n      * Permission is hereby granted, free of charge, to any person obtaining a copy\n      * of this software and associated documentation files (the \"Software\"), to deal\n      * in the Software without restriction, including without limitation the rights\n      * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n      * copies of the Software, and to permit persons to whom the Software is\n      * furnished to do so, subject to the following conditions:\n      *\n      * The above copyright notice and this permission notice shall be included in\n      * all copies or substantial portions of the Software.\n      *\n      * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n      * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n      * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n      * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n      * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n      * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n      * THE SOFTWARE.\n      */\n    import * as util from '@material/animation/util';\n    export { util };\n    export * from '@material/animation/types';\n    export * from '@material/animation/util';\n}\n\ndeclare module '@material/animation/util' {\n    /**\n      * @license\n      * Copyright 2016 Google Inc.\n      *\n      * Permission is hereby granted, free of charge, to any person obtaining a copy\n      * of this software and associated documentation files (the \"Software\"), to deal\n      * in the Software without restriction, including without limitation the rights\n      * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n      * copies of the Software, and to permit persons to whom the Software is\n      * furnished to do so, subject to the following conditions:\n      *\n      * The above copyright notice and this permission notice shall be included in\n      * all copies or substantial portions of the Software.\n      *\n      * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n      * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n      * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n      * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n      * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n      * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n      * THE SOFTWARE.\n      */\n    import { PrefixedCssPropertyName, PrefixedJsEventType, StandardCssPropertyName, StandardJsEventType } from '@material/animation/types';\n    export function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName): StandardCssPropertyName | PrefixedCssPropertyName;\n    export function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType): StandardJsEventType | PrefixedJsEventType;\n}\n\ndeclare module '@material/animation/types' {\n    /**\n      * @license\n      * Copyright 2019 Google Inc.\n      *\n      * Permission is hereby granted, free of charge, to any person obtaining a copy\n      * of this software and associated documentation files (the \"Software\"), to deal\n      * in the Software without restriction, including without limitation the rights\n      * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n      * copies of the Software, and to permit persons to whom the Software is\n      * furnished to do so, subject to the following conditions:\n      *\n      * The above copyright notice and this permission notice shall be included in\n      * all copies or substantial portions of the Software.\n      *\n      * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n      * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n      * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n      * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n      * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n      * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n      * THE SOFTWARE.\n      */\n    export type StandardCssPropertyName = 'animation' | 'transform' | 'transition';\n    export type PrefixedCssPropertyName = '-webkit-animation' | '-webkit-transform' | '-webkit-transition';\n    export type StandardJsEventType = 'animationend' | 'animationiteration' | 'animationstart' | 'transitionend';\n    export type PrefixedJsEventType = 'webkitAnimationEnd' | 'webkitAnimationIteration' | 'webkitAnimationStart' | 'webkitTransitionEnd';\n    export interface CssVendorProperty {\n        prefixed: PrefixedCssPropertyName;\n        standard: StandardCssPropertyName;\n    }\n    export interface JsVendorProperty {\n        cssProperty: StandardCssPropertyName;\n        prefixed: PrefixedJsEventType;\n        standard: StandardJsEventType;\n    }\n    export type CssVendorPropertyMap = {\n        [K in StandardCssPropertyName]: CssVendorProperty;\n    };\n    export type JsVendorPropertyMap = {\n        [K in StandardJsEventType]: JsVendorProperty;\n    };\n}\n\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/dist/mdc.animation.js",
    "content": "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"animation\"] = factory();\n\telse\n\t\troot[\"mdc\"] = root[\"mdc\"] || {}, root[\"mdc\"][\"animation\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./packages/mdc-animation/index.ts\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./packages/mdc-animation/index.ts\":\n/*!*****************************************!*\\\n  !*** ./packages/mdc-animation/index.ts ***!\n  \\*****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nfunction __export(m) {\n    for (var p in m) {\n        if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n    }\n}\nvar __importStar = this && this.__importStar || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) {\n        if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n    }result[\"default\"] = mod;\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util = __importStar(__webpack_require__(/*! ./util */ \"./packages/mdc-animation/util.ts\"));\nexports.util = util;\n__export(__webpack_require__(/*! ./util */ \"./packages/mdc-animation/util.ts\")); // Old namespace for backward compatibility\n\n/***/ }),\n\n/***/ \"./packages/mdc-animation/util.ts\":\n/*!****************************************!*\\\n  !*** ./packages/mdc-animation/util.ts ***!\n  \\****************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cssPropertyNameMap = {\n    animation: {\n        prefixed: '-webkit-animation',\n        standard: 'animation'\n    },\n    transform: {\n        prefixed: '-webkit-transform',\n        standard: 'transform'\n    },\n    transition: {\n        prefixed: '-webkit-transition',\n        standard: 'transition'\n    }\n};\nvar jsEventTypeMap = {\n    animationend: {\n        cssProperty: 'animation',\n        prefixed: 'webkitAnimationEnd',\n        standard: 'animationend'\n    },\n    animationiteration: {\n        cssProperty: 'animation',\n        prefixed: 'webkitAnimationIteration',\n        standard: 'animationiteration'\n    },\n    animationstart: {\n        cssProperty: 'animation',\n        prefixed: 'webkitAnimationStart',\n        standard: 'animationstart'\n    },\n    transitionend: {\n        cssProperty: 'transition',\n        prefixed: 'webkitTransitionEnd',\n        standard: 'transitionend'\n    }\n};\nfunction isWindow(windowObj) {\n    return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';\n}\nfunction getCorrectPropertyName(windowObj, cssProperty) {\n    if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {\n        var el = windowObj.document.createElement('div');\n        var _a = cssPropertyNameMap[cssProperty],\n            standard = _a.standard,\n            prefixed = _a.prefixed;\n        var isStandard = standard in el.style;\n        return isStandard ? standard : prefixed;\n    }\n    return cssProperty;\n}\nexports.getCorrectPropertyName = getCorrectPropertyName;\nfunction getCorrectEventName(windowObj, eventType) {\n    if (isWindow(windowObj) && eventType in jsEventTypeMap) {\n        var el = windowObj.document.createElement('div');\n        var _a = jsEventTypeMap[eventType],\n            standard = _a.standard,\n            prefixed = _a.prefixed,\n            cssProperty = _a.cssProperty;\n        var isStandard = cssProperty in el.style;\n        return isStandard ? standard : prefixed;\n    }\n    return eventType;\n}\nexports.getCorrectEventName = getCorrectEventName;\n\n/***/ })\n\n/******/ });\n});\n//# sourceMappingURL=mdc.animation.js.map"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/index.d.ts",
    "content": "/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as util from './util';\nexport { util };\nexport * from './types';\nexport * from './util';\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/index.js",
    "content": "/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as util from './util';\nexport { util }; // New namespace\nexport * from './util'; // Old namespace for backward compatibility\n//# sourceMappingURL=index.js.map"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/package.json",
    "content": "{\n  \"_from\": \"@material/animation@^7.0.0\",\n  \"_id\": \"@material/animation@7.0.0\",\n  \"_inBundle\": false,\n  \"_integrity\": \"sha512-h0Ge337zBQk8FRin0xnO2fkFkxhidgUhekEtjrDf8F6m39WFr+VTw7hm7MrF1TejW5wdf+V+app7bvRYICMu1A==\",\n  \"_location\": \"/@material/animation\",\n  \"_phantomChildren\": {},\n  \"_requested\": {\n    \"type\": \"range\",\n    \"registry\": true,\n    \"raw\": \"@material/animation@^7.0.0\",\n    \"name\": \"@material/animation\",\n    \"escapedName\": \"@material%2fanimation\",\n    \"scope\": \"@material\",\n    \"rawSpec\": \"^7.0.0\",\n    \"saveSpec\": null,\n    \"fetchSpec\": \"^7.0.0\"\n  },\n  \"_requiredBy\": [\n    \"/@material/ripple\"\n  ],\n  \"_resolved\": \"https://registry.npmjs.org/@material/animation/-/animation-7.0.0.tgz\",\n  \"_shasum\": \"77758cb2bc02595bf5f97fb1c08ff10bcdbe9fc6\",\n  \"_spec\": \"@material/animation@^7.0.0\",\n  \"_where\": \"tests/snowpack-install/include-missing-in-package-json/node_modules/@material/ripple\",\n  \"bugs\": {\n    \"url\": \"https://github.com/material-components/material-components-web/issues\"\n  },\n  \"bundleDependencies\": false,\n  \"dependencies\": {\n    \"tslib\": \"^1.9.3\"\n  },\n  \"deprecated\": false,\n  \"description\": \"Animation Variables and Mixins used by Material Components for the web\",\n  \"gitHead\": \"a3212b2099765947f2a41d71af2cd95fcbca4b97\",\n  \"homepage\": \"https://github.com/material-components/material-components-web#readme\",\n  \"keywords\": [\n    \"material components\",\n    \"material design\",\n    \"animation\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"dist/mdc.animation.js\",\n  \"module\": \"index.js\",\n  \"name\": \"@material/animation\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/material-components/material-components-web.git\",\n    \"directory\": \"packages/mdc-animation\"\n  },\n  \"sideEffects\": false,\n  \"types\": \"dist/mdc.animation.d.ts\",\n  \"version\": \"7.0.0\"\n}\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/types.d.ts",
    "content": "/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nexport declare type StandardCssPropertyName = 'animation' | 'transform' | 'transition';\nexport declare type PrefixedCssPropertyName = '-webkit-animation' | '-webkit-transform' | '-webkit-transition';\nexport declare type StandardJsEventType = 'animationend' | 'animationiteration' | 'animationstart' | 'transitionend';\nexport declare type PrefixedJsEventType = 'webkitAnimationEnd' | 'webkitAnimationIteration' | 'webkitAnimationStart' | 'webkitTransitionEnd';\nexport interface CssVendorProperty {\n    prefixed: PrefixedCssPropertyName;\n    standard: StandardCssPropertyName;\n}\nexport interface JsVendorProperty {\n    cssProperty: StandardCssPropertyName;\n    prefixed: PrefixedJsEventType;\n    standard: StandardJsEventType;\n}\nexport declare type CssVendorPropertyMap = {\n    [K in StandardCssPropertyName]: CssVendorProperty;\n};\nexport declare type JsVendorPropertyMap = {\n    [K in StandardJsEventType]: JsVendorProperty;\n};\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/types.js",
    "content": "/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n//# sourceMappingURL=types.js.map"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/util.d.ts",
    "content": "/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { PrefixedCssPropertyName, PrefixedJsEventType, StandardCssPropertyName, StandardJsEventType } from './types';\nexport declare function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName): StandardCssPropertyName | PrefixedCssPropertyName;\nexport declare function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType): StandardJsEventType | PrefixedJsEventType;\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/@material/animation/util.js",
    "content": "/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar cssPropertyNameMap = {\n    animation: {\n        prefixed: '-webkit-animation',\n        standard: 'animation',\n    },\n    transform: {\n        prefixed: '-webkit-transform',\n        standard: 'transform',\n    },\n    transition: {\n        prefixed: '-webkit-transition',\n        standard: 'transition',\n    },\n};\nvar jsEventTypeMap = {\n    animationend: {\n        cssProperty: 'animation',\n        prefixed: 'webkitAnimationEnd',\n        standard: 'animationend',\n    },\n    animationiteration: {\n        cssProperty: 'animation',\n        prefixed: 'webkitAnimationIteration',\n        standard: 'animationiteration',\n    },\n    animationstart: {\n        cssProperty: 'animation',\n        prefixed: 'webkitAnimationStart',\n        standard: 'animationstart',\n    },\n    transitionend: {\n        cssProperty: 'transition',\n        prefixed: 'webkitTransitionEnd',\n        standard: 'transitionend',\n    },\n};\nfunction isWindow(windowObj) {\n    return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';\n}\nexport function getCorrectPropertyName(windowObj, cssProperty) {\n    if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {\n        var el = windowObj.document.createElement('div');\n        var _a = cssPropertyNameMap[cssProperty], standard = _a.standard, prefixed = _a.prefixed;\n        var isStandard = standard in el.style;\n        return isStandard ? standard : prefixed;\n    }\n    return cssProperty;\n}\nexport function getCorrectEventName(windowObj, eventType) {\n    if (isWindow(windowObj) && eventType in jsEventTypeMap) {\n        var el = windowObj.document.createElement('div');\n        var _a = jsEventTypeMap[eventType], standard = _a.standard, prefixed = _a.prefixed, cssProperty = _a.cssProperty;\n        var isStandard = cssProperty in el.style;\n        return isStandard ? standard : prefixed;\n    }\n    return eventType;\n}\n//# sourceMappingURL=util.js.map"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/CopyrightNotice.txt",
    "content": "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/LICENSE.txt",
    "content": "Copyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE."
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/package.json",
    "content": "{\n  \"_from\": \"tslib@^1.9.3\",\n  \"_id\": \"tslib@1.13.0\",\n  \"_inBundle\": false,\n  \"_integrity\": \"sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==\",\n  \"_location\": \"/tslib\",\n  \"_phantomChildren\": {},\n  \"_requested\": {\n    \"type\": \"range\",\n    \"registry\": true,\n    \"raw\": \"tslib@^1.9.3\",\n    \"name\": \"tslib\",\n    \"escapedName\": \"tslib\",\n    \"rawSpec\": \"^1.9.3\",\n    \"saveSpec\": null,\n    \"fetchSpec\": \"^1.9.3\"\n  },\n  \"_requiredBy\": [\n    \"/@material/animation\",\n    \"/@material/base\",\n    \"/@material/dom\",\n    \"/@material/list\",\n    \"/@material/ripple\"\n  ],\n  \"_resolved\": \"https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz\",\n  \"_shasum\": \"c881e13cc7015894ed914862d276436fa9a47043\",\n  \"_spec\": \"tslib@^1.9.3\",\n  \"_where\": \"tests/snowpack-install/include-missing-in-package-json/node_modules/@material/list\",\n  \"author\": {\n    \"name\": \"Microsoft Corp.\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/Microsoft/TypeScript/issues\"\n  },\n  \"bundleDependencies\": false,\n  \"deprecated\": false,\n  \"description\": \"Runtime library for TypeScript helper functions\",\n  \"homepage\": \"https://www.typescriptlang.org/\",\n  \"jsnext:main\": \"tslib.es6.js\",\n  \"keywords\": [\n    \"TypeScript\",\n    \"Microsoft\",\n    \"compiler\",\n    \"language\",\n    \"javascript\",\n    \"tslib\",\n    \"runtime\"\n  ],\n  \"license\": \"0BSD\",\n  \"main\": \"tslib.js\",\n  \"module\": \"tslib.es6.js\",\n  \"name\": \"tslib\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/Microsoft/tslib.git\"\n  },\n  \"sideEffects\": false,\n  \"typings\": \"tslib.d.ts\",\n  \"version\": \"1.13.0\"\n}\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/tslib.d.ts",
    "content": "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\nexport declare function __extends(d: Function, b: Function): void;\r\nexport declare function __assign(t: any, ...sources: any[]): any;\r\nexport declare function __rest(t: any, propertyNames: (string | symbol)[]): any;\r\nexport declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;\r\nexport declare function __param(paramIndex: number, decorator: Function): Function;\r\nexport declare function __metadata(metadataKey: any, metadataValue: any): Function;\r\nexport declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;\r\nexport declare function __generator(thisArg: any, body: Function): any;\r\nexport declare function __exportStar(m: any, exports: any): void;\r\nexport declare function __values(o: any): any;\r\nexport declare function __read(o: any, n?: number): any[];\r\nexport declare function __spread(...args: any[][]): any[];\r\nexport declare function __spreadArrays(...args: any[][]): any[];\r\nexport declare function __await(v: any): any;\r\nexport declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;\r\nexport declare function __asyncDelegator(o: any): any;\r\nexport declare function __asyncValues(o: any): any;\r\nexport declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;\r\nexport declare function __importStar<T>(mod: T): T;\r\nexport declare function __importDefault<T>(mod: T): T | { default: T };\r\nexport declare function __classPrivateFieldGet<T extends object, V>(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V;\r\nexport declare function __classPrivateFieldSet<T extends object, V>(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V;\r\nexport declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/tslib.es6.html",
    "content": "<script src=\"tslib.es6.js\"></script>"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/tslib.es6.js",
    "content": "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n    for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n};\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n    result.default = mod;\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to get private field on non-instance\");\r\n    }\r\n    return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n    if (!privateMap.has(receiver)) {\r\n        throw new TypeError(\"attempted to set private field on non-instance\");\r\n    }\r\n    privateMap.set(receiver, value);\r\n    return value;\r\n}\r\n"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/tslib.html",
    "content": "<script src=\"tslib.js\"></script>"
  },
  {
    "path": "test/esinstall/import-missing/packages/tslib/tslib.js",
    "content": "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n    var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n    if (typeof define === \"function\" && define.amd) {\r\n        define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n    }\r\n    else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n        factory(createExporter(root, createExporter(module.exports)));\r\n    }\r\n    else {\r\n        factory(createExporter(root));\r\n    }\r\n    function createExporter(exports, previous) {\r\n        if (exports !== root) {\r\n            if (typeof Object.create === \"function\") {\r\n                Object.defineProperty(exports, \"__esModule\", { value: true });\r\n            }\r\n            else {\r\n                exports.__esModule = true;\r\n            }\r\n        }\r\n        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n    }\r\n})\r\n(function (exporter) {\r\n    var extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\n    __extends = function (d, b) {\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    };\r\n\r\n    __assign = Object.assign || function (t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    };\r\n\r\n    __rest = function (s, e) {\r\n        var t = {};\r\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n            t[p] = s[p];\r\n        if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                    t[p[i]] = s[p[i]];\r\n            }\r\n        return t;\r\n    };\r\n\r\n    __decorate = function (decorators, target, key, desc) {\r\n        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n        if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n        return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n    };\r\n\r\n    __param = function (paramIndex, decorator) {\r\n        return function (target, key) { decorator(target, key, paramIndex); }\r\n    };\r\n\r\n    __metadata = function (metadataKey, metadataValue) {\r\n        if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n    };\r\n\r\n    __awaiter = function (thisArg, _arguments, P, generator) {\r\n        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n        return new (P || (P = Promise))(function (resolve, reject) {\r\n            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n            function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n            step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n        });\r\n    };\r\n\r\n    __generator = function (thisArg, body) {\r\n        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n        return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n        function verb(n) { return function (v) { return step([n, v]); }; }\r\n        function step(op) {\r\n            if (f) throw new TypeError(\"Generator is already executing.\");\r\n            while (_) try {\r\n                if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n                if (y = 0, t) op = [op[0] & 2, t.value];\r\n                switch (op[0]) {\r\n                    case 0: case 1: t = op; break;\r\n                    case 4: _.label++; return { value: op[1], done: false };\r\n                    case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                    case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                    default:\r\n                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                        if (t[2]) _.ops.pop();\r\n                        _.trys.pop(); continue;\r\n                }\r\n                op = body.call(thisArg, _);\r\n            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n        }\r\n    };\r\n\r\n    __createBinding = function(o, m, k, k2) {\r\n        if (k2 === undefined) k2 = k;\r\n        o[k2] = m[k];\r\n    };\r\n\r\n    __exportStar = function (m, exports) {\r\n        for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n    };\r\n\r\n    __values = function (o) {\r\n        var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n        if (m) return m.call(o);\r\n        if (o && typeof o.length === \"number\") return {\r\n            next: function () {\r\n                if (o && i >= o.length) o = void 0;\r\n                return { value: o && o[i++], done: !o };\r\n            }\r\n        };\r\n        throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n    };\r\n\r\n    __read = function (o, n) {\r\n        var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n        if (!m) return o;\r\n        var i = m.call(o), r, ar = [], e;\r\n        try {\r\n            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n        }\r\n        catch (error) { e = { error: error }; }\r\n        finally {\r\n            try {\r\n                if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n            }\r\n            finally { if (e) throw e.error; }\r\n        }\r\n        return ar;\r\n    };\r\n\r\n    __spread = function () {\r\n        for (var ar = [], i = 0; i < arguments.length; i++)\r\n            ar = ar.concat(__read(arguments[i]));\r\n        return ar;\r\n    };\r\n\r\n    __spreadArrays = function () {\r\n        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n        for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n                r[k] = a[j];\r\n        return r;\r\n    };\r\n\r\n    __await = function (v) {\r\n        return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n    };\r\n\r\n    __asyncGenerator = function (thisArg, _arguments, generator) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n        return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);  }\r\n        function fulfill(value) { resume(\"next\", value); }\r\n        function reject(value) { resume(\"throw\", value); }\r\n        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n    };\r\n\r\n    __asyncDelegator = function (o) {\r\n        var i, p;\r\n        return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n    };\r\n\r\n    __asyncValues = function (o) {\r\n        if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n        var m = o[Symbol.asyncIterator], i;\r\n        return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n    };\r\n\r\n    __makeTemplateObject = function (cooked, raw) {\r\n        if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n        return cooked;\r\n    };\r\n\r\n    __importStar = function (mod) {\r\n        if (mod && mod.__esModule) return mod;\r\n        var result = {};\r\n        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n        result[\"default\"] = mod;\r\n        return result;\r\n    };\r\n\r\n    __importDefault = function (mod) {\r\n        return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n    };\r\n\r\n    __classPrivateFieldGet = function (receiver, privateMap) {\r\n        if (!privateMap.has(receiver)) {\r\n            throw new TypeError(\"attempted to get private field on non-instance\");\r\n        }\r\n        return privateMap.get(receiver);\r\n    };\r\n\r\n    __classPrivateFieldSet = function (receiver, privateMap, value) {\r\n        if (!privateMap.has(receiver)) {\r\n            throw new TypeError(\"attempted to set private field on non-instance\");\r\n        }\r\n        privateMap.set(receiver, value);\r\n        return value;\r\n    };\r\n\r\n    exporter(\"__extends\", __extends);\r\n    exporter(\"__assign\", __assign);\r\n    exporter(\"__rest\", __rest);\r\n    exporter(\"__decorate\", __decorate);\r\n    exporter(\"__param\", __param);\r\n    exporter(\"__metadata\", __metadata);\r\n    exporter(\"__awaiter\", __awaiter);\r\n    exporter(\"__generator\", __generator);\r\n    exporter(\"__exportStar\", __exportStar);\r\n    exporter(\"__createBinding\", __createBinding);\r\n    exporter(\"__values\", __values);\r\n    exporter(\"__read\", __read);\r\n    exporter(\"__spread\", __spread);\r\n    exporter(\"__spreadArrays\", __spreadArrays);\r\n    exporter(\"__await\", __await);\r\n    exporter(\"__asyncGenerator\", __asyncGenerator);\r\n    exporter(\"__asyncDelegator\", __asyncDelegator);\r\n    exporter(\"__asyncValues\", __asyncValues);\r\n    exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n    exporter(\"__importStar\", __importStar);\r\n    exporter(\"__importDefault\", __importDefault);\r\n    exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n    exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n"
  },
  {
    "path": "test/esinstall/import-missing/src/index.js",
    "content": "import {MDCList} from '@material/list';\n\nconst list = new MDCList(document.querySelector('.mdc-list'));\n"
  },
  {
    "path": "test/esinstall/import-named-from-default/import-named-from-default.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('import named exports from an ESM package with only default export', () => {\n  it('throws a helpful error', async () => {\n    return expect(() =>\n      runTest(\n        [\n          {\n            specifier: 'default-only-esm',\n            all: false,\n            default: false,\n            namespace: false,\n            named: ['EventEmitter'],\n          },\n        ],\n        {cwd: __dirname, treeshake: true},\n      ),\n    ).rejects.toThrowError(\n      `Module \\\"default-only-esm\\\" has no exported member \\\"EventEmitter\\\". Did you mean to use \\\"import EventEmitter from 'default-only-esm'\\\" instead?`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-named-from-default/package/default-only-esm/index.js",
    "content": "function EventEmitter() {}\n\nexport default EventEmitter;\n"
  },
  {
    "path": "test/esinstall/import-named-from-default/package/default-only-esm/package.json",
    "content": "{\n  \"name\": \"default-only-esm\",\n  \"version\": \"0.1.0\",\n  \"module\": \"index.js\"\n}\n"
  },
  {
    "path": "test/esinstall/import-named-from-default/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-import-named-from-default\",\n  \"dependencies\": {\n    \"default-only-esm\": \"file:./package/default-only-esm\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/import-node-builtin/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/import-node-builtin/error-node-builtin-unresolved.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\nconst path = require('path');\n\ndescribe('node builtins', () => {\n  it('throws without a polyfill', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-error-node-builtin');\n\n    const targets = ['bad-node-builtin-pkg'];\n\n    const run = async () => {\n      await runTest(targets, {\n        cwd,\n        dest,\n      });\n    };\n\n    return expect(run).rejects.toThrow();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-node-builtin/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-error-node-builtin-unresolved\",\n  \"dependencies\": {\n    \"bad-node-builtin-pkg\": \"file:./packages/bad-node-builtin-pkg\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/import-node-builtin/packages/bad-node-builtin-pkg/entrypoint.js",
    "content": "export const FOO = 42;\n// ERROR: This shouldn't work without polyfill support\nimport 'http';\n"
  },
  {
    "path": "test/esinstall/import-node-builtin/packages/bad-node-builtin-pkg/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"bad-node-builtin-pkg\",\n  \"module\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/import-nothing/import-nothing.test.js",
    "content": "const {install} = require('../../../esinstall/lib');\n\ndescribe('error-no-dep-list', () => {\n  it('importing nothing', async () => {\n    return expect(() =>\n      install(\n        [\n          /* nothing! */\n        ],\n        {cwd: __dirname},\n      ),\n    ).rejects.toThrowError(`No ESM dependencies found!\n  At least one dependency must have an ESM \"module\" entrypoint. You can find modern, web-ready packages at https://www.skypack.dev`);\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-nothing/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-import-nothing\",\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/import-types/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/import-types/import-types.test.js",
    "content": "const path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('importing types', () => {\n  it('generates an error', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-types-only');\n\n    // Run Test\n    try {\n      await runTest(['type-only-pkg', 'array-flatten'], {cwd, dest});\n      expect(false).toEqual(true); // should not finish\n    } catch (err) {\n      expect(err.message).toContain('Unable to find any entrypoint for \"type-only-pkg\"');\n    }\n  });\n});\n"
  },
  {
    "path": "test/esinstall/import-types/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-dep-types-only\",\n  \"dependencies\": {\n    \"array-flatten\": \"^3.0.0\",\n    \"type-only-pkg\": \"file:./packages/type-only-pkg\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/import-types/packages/type-only-pkg/index.d.ts",
    "content": "export type Foo = 'i am types only!';\n"
  },
  {
    "path": "test/esinstall/import-types/packages/type-only-pkg/package.json",
    "content": "\n{\n  \"version\": \"1.0.0\",\n  \"name\": \"type-only-package\",\n  \"types\": \"index.d.ts\"\n}\n"
  },
  {
    "path": "test/esinstall/named-exports/.gitignore",
    "content": "test-*\n"
  },
  {
    "path": "test/esinstall/named-exports/named-exports.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\nconst cwd = __dirname;\n\ndescribe('named-exports', () => {\n  it('cjs', async () => {\n    const pkg = 'cjs-named-exports-simple';\n    const dest = path.join(cwd, 'test-cjs');\n    await runTest([pkg], {cwd, dest});\n\n    const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8');\n\n    // test output (note: this may be a bit too close to a snapshot, but pay attention to changes here)\n    expect(output).toEqual(\n      expect.stringContaining(\n        `export { entrypoint as __moduleExports, export1, export2, export3, export4, export5 };`,\n      ),\n    );\n  });\n\n  it('cjs (export obj)', async () => {\n    const pkg = 'cjs-named-exports-obj';\n    const dest = path.join(cwd, 'test-cjs');\n    await runTest([pkg], {cwd, dest});\n\n    const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8');\n\n    // test output\n    expect(output).toEqual(\n      expect.stringContaining(`export { entrypoint as __moduleExports, export1, export2 };`),\n    );\n  });\n\n  it('cjs (re-exported)', async () => {\n    const pkg = 'cjs-named-exports-reexported';\n    const dest = path.join(cwd, 'test-cjs-02');\n    await runTest([pkg], {cwd, dest});\n\n    const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8');\n\n    // test output\n    expect(output).toEqual(\n      expect.stringContaining(`export { entrypoint as __moduleExports, export42$1 as export42 };`),\n    );\n  });\n\n  it('umd', async () => {\n    const pkg = 'umd-named-exports';\n    const dest = path.join(cwd, 'test-umd');\n    await runTest([pkg], {cwd, dest});\n\n    const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8');\n\n    // test output\n    expect(output).toEqual(expect.stringMatching(`export default autolayout;`));\n\n    expect(output).toEqual(\n      expect.stringContaining(\n        `export { Attribute, Priority, Relation, SubView, View, VisualFormat, autolayout as __moduleExports };`,\n      ),\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall/named-exports/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-esinstall-named-exports\",\n  \"description\": \"Handle automatic named export detection for cjs packages\",\n  \"scripts\": {\n    \"testinstall\": \"snowpack install\"\n  },\n  \"dependencies\": {\n    \"cjs-named-exports-obj\": \"file:./packages/cjs-named-exports-obj\",\n    \"cjs-named-exports-reexported\": \"file:./packages/cjs-named-exports-reexported\",\n    \"cjs-named-exports-simple\": \"file:./packages/cjs-named-exports-simple\",\n    \"umd-named-exports\": \"file:./packages/umd-named-exports\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-obj/entrypoint.js",
    "content": "module.exports = {\n  export1: 'foo',\n  export2: 'bar',\n};\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-obj/package.json",
    "content": "{\n  \"name\": \"cjs-named-exports-obj\",\n  \"version\": \"1.0.0\",\n  \"main\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-reexported/entrypoint.js",
    "content": "module.exports = require('./reexported');"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-reexported/package.json",
    "content": "{\n  \"name\": \"cjs-named-exports-reexported\",\n  \"version\": \"1.2.3\",\n  \"main\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-reexported/reexported.js",
    "content": "exports.export42 = 'foobar';\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-simple/entrypoint.js",
    "content": "exports.export1 = 1;\nexports.export2 = 'foo';\nexports.export3 = function foo() {}\nexports.export4 = () => {}\nexports.export5 = null;\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/cjs-named-exports-simple/package.json",
    "content": "{\n  \"name\": \"cjs-named-exports-simple\",\n  \"version\": \"1.2.3\",\n  \"main\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/named-exports/packages/umd-named-exports/autolayout.js",
    "content": "/**\n* AutoLayout.js is licensed under the MIT license. If a copy of the\n* MIT-license was not distributed with this file, You can obtain one at:\n* http://opensource.org/licenses/mit-license.html.\n*\n* @author: Hein Rutjes (IjzerenHein)\n* @license MIT\n* @copyright Gloey Apps, 2017\n*\n* @library autolayout.js\n* @version 0.7.0\n*/\n/**\n* Parts Copyright (C) 2011-2012, Alex Russell (slightlyoff@chromium.org)\n* Parts Copyright (C) Copyright (C) 1998-2000 Greg J. Badros\n*\n* Use of this source code is governed by the LGPL, which can be found in the\n* COPYING.LGPL file.\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.AutoLayout = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n    'use strict';\n    \n    var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n    \n    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n    \n    var c = require('cassowary/bin/c');\n    'use strict';\n    \n    /**\n     * Layout attributes.\n     * @enum {String}\n     */\n    var Attribute = {\n      CONST: 'const',\n      NOTANATTRIBUTE: 'const',\n      VARIABLE: 'var',\n      LEFT: 'left',\n      RIGHT: 'right',\n      TOP: 'top',\n      BOTTOM: 'bottom',\n      WIDTH: 'width',\n      HEIGHT: 'height',\n      CENTERX: 'centerX',\n      CENTERY: 'centerY',\n      /*LEADING: 'leading',\n      TRAILING: 'trailing'*/\n      /** Used by the extended VFL syntax. */\n      ZINDEX: 'zIndex'\n    };\n    \n    /**\n     * Relation types.\n     * @enum {String}\n     */\n    var Relation = {\n      /** Less than or equal */\n      LEQ: 'leq',\n      /** Equal */\n      EQU: 'equ',\n      /** Greater than or equal */\n      GEQ: 'geq'\n    };\n    \n    /**\n     * Layout priorities.\n     * @enum {String}\n     */\n    var Priority = {\n      REQUIRED: 1000,\n      DEFAULTHIGH: 750,\n      DEFAULTLOW: 250\n      //FITTINGSIZELEVEL: 50,\n    };\n    \n    var parser = function () {\n      /*\n       * Generated by PEG.js 0.8.0.\n       *\n       * http://pegjs.majda.cz/\n       */\n    \n      function peg$subclass(child, parent) {\n        function ctor() {\n          this.constructor = child;\n        }\n        ctor.prototype = parent.prototype;\n        child.prototype = new ctor();\n      }\n    \n      function SyntaxError(message, expected, found, offset, line, column) {\n        this.message = message;\n        this.expected = expected;\n        this.found = found;\n        this.offset = offset;\n        this.line = line;\n        this.column = column;\n    \n        this.name = \"SyntaxError\";\n      }\n    \n      peg$subclass(SyntaxError, Error);\n    \n      function parse(input) {\n        var options = arguments.length > 1 ? arguments[1] : {},\n            peg$FAILED = {},\n            peg$startRuleFunctions = { visualFormatString: peg$parsevisualFormatString },\n            peg$startRuleFunction = peg$parsevisualFormatString,\n            peg$c0 = peg$FAILED,\n            peg$c1 = null,\n            peg$c2 = \":\",\n            peg$c3 = { type: \"literal\", value: \":\", description: \"\\\":\\\"\" },\n            peg$c4 = [],\n            peg$c5 = function peg$c5(o, superto, view, views, tosuper) {\n          return {\n            orientation: o ? o[0] : 'horizontal',\n            cascade: (superto || []).concat([view], [].concat.apply([], views), tosuper || [])\n          };\n        },\n            peg$c6 = \"H\",\n            peg$c7 = { type: \"literal\", value: \"H\", description: \"\\\"H\\\"\" },\n            peg$c8 = \"V\",\n            peg$c9 = { type: \"literal\", value: \"V\", description: \"\\\"V\\\"\" },\n            peg$c10 = function peg$c10(orient) {\n          return orient == 'H' ? 'horizontal' : 'vertical';\n        },\n            peg$c11 = \"|\",\n            peg$c12 = { type: \"literal\", value: \"|\", description: \"\\\"|\\\"\" },\n            peg$c13 = function peg$c13() {\n          return { view: null };\n        },\n            peg$c14 = \"[\",\n            peg$c15 = { type: \"literal\", value: \"[\", description: \"\\\"[\\\"\" },\n            peg$c16 = \"]\",\n            peg$c17 = { type: \"literal\", value: \"]\", description: \"\\\"]\\\"\" },\n            peg$c18 = function peg$c18(view, predicates) {\n          return extend(view, predicates ? { constraints: predicates } : {});\n        },\n            peg$c19 = \"-\",\n            peg$c20 = { type: \"literal\", value: \"-\", description: \"\\\"-\\\"\" },\n            peg$c21 = function peg$c21(predicateList) {\n          return predicateList;\n        },\n            peg$c22 = function peg$c22() {\n          return [{ relation: 'equ', constant: 'default', $parserOffset: offset() }];\n        },\n            peg$c23 = \"\",\n            peg$c24 = function peg$c24() {\n          return [{ relation: 'equ', constant: 0, $parserOffset: offset() }];\n        },\n            peg$c25 = function peg$c25(n) {\n          return [{ relation: 'equ', constant: n, $parserOffset: offset() }];\n        },\n            peg$c26 = \"(\",\n            peg$c27 = { type: \"literal\", value: \"(\", description: \"\\\"(\\\"\" },\n            peg$c28 = \",\",\n            peg$c29 = { type: \"literal\", value: \",\", description: \"\\\",\\\"\" },\n            peg$c30 = \")\",\n            peg$c31 = { type: \"literal\", value: \")\", description: \"\\\")\\\"\" },\n            peg$c32 = function peg$c32(p, ps) {\n          return [p].concat(ps.map(function (p) {\n            return p[1];\n          }));\n        },\n            peg$c33 = \"@\",\n            peg$c34 = { type: \"literal\", value: \"@\", description: \"\\\"@\\\"\" },\n            peg$c35 = function peg$c35(r, o, p) {\n          return extend({ relation: 'equ' }, r || {}, o, p ? p[1] : {});\n        },\n            peg$c36 = \"==\",\n            peg$c37 = { type: \"literal\", value: \"==\", description: \"\\\"==\\\"\" },\n            peg$c38 = function peg$c38() {\n          return { relation: 'equ', $parserOffset: offset() };\n        },\n            peg$c39 = \"<=\",\n            peg$c40 = { type: \"literal\", value: \"<=\", description: \"\\\"<=\\\"\" },\n            peg$c41 = function peg$c41() {\n          return { relation: 'leq', $parserOffset: offset() };\n        },\n            peg$c42 = \">=\",\n            peg$c43 = { type: \"literal\", value: \">=\", description: \"\\\">=\\\"\" },\n            peg$c44 = function peg$c44() {\n          return { relation: 'geq', $parserOffset: offset() };\n        },\n            peg$c45 = /^[0-9]/,\n            peg$c46 = { type: \"class\", value: \"[0-9]\", description: \"[0-9]\" },\n            peg$c47 = function peg$c47(digits) {\n          return { priority: parseInt(digits.join(\"\"), 10) };\n        },\n            peg$c48 = function peg$c48(n) {\n          return { constant: n };\n        },\n            peg$c49 = /^[a-zA-Z_]/,\n            peg$c50 = { type: \"class\", value: \"[a-zA-Z_]\", description: \"[a-zA-Z_]\" },\n            peg$c51 = /^[a-zA-Z0-9_]/,\n            peg$c52 = { type: \"class\", value: \"[a-zA-Z0-9_]\", description: \"[a-zA-Z0-9_]\" },\n            peg$c53 = function peg$c53(f, v) {\n          return { view: f + v };\n        },\n            peg$c54 = \".\",\n            peg$c55 = { type: \"literal\", value: \".\", description: \"\\\".\\\"\" },\n            peg$c56 = function peg$c56(digits, decimals) {\n          return parseFloat(digits.concat(\".\").concat(decimals).join(\"\"), 10);\n        },\n            peg$c57 = function peg$c57(digits) {\n          return parseInt(digits.join(\"\"), 10);\n        },\n            peg$currPos = 0,\n            peg$reportedPos = 0,\n            peg$cachedPos = 0,\n            peg$cachedPosDetails = { line: 1, column: 1, seenCR: false },\n            peg$maxFailPos = 0,\n            peg$maxFailExpected = [],\n            peg$silentFails = 0,\n            peg$result;\n    \n        if (\"startRule\" in options) {\n          if (!(options.startRule in peg$startRuleFunctions)) {\n            throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n          }\n    \n          peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n        }\n    \n        function text() {\n          return input.substring(peg$reportedPos, peg$currPos);\n        }\n    \n        function offset() {\n          return peg$reportedPos;\n        }\n    \n        function line() {\n          return peg$computePosDetails(peg$reportedPos).line;\n        }\n    \n        function column() {\n          return peg$computePosDetails(peg$reportedPos).column;\n        }\n    \n        function expected(description) {\n          throw peg$buildException(null, [{ type: \"other\", description: description }], peg$reportedPos);\n        }\n    \n        function error(message) {\n          throw peg$buildException(message, null, peg$reportedPos);\n        }\n    \n        function peg$computePosDetails(pos) {\n          function advance(details, startPos, endPos) {\n            var p, ch;\n    \n            for (p = startPos; p < endPos; p++) {\n              ch = input.charAt(p);\n              if (ch === \"\\n\") {\n                if (!details.seenCR) {\n                  details.line++;\n                }\n                details.column = 1;\n                details.seenCR = false;\n              } else if (ch === \"\\r\" || ch === '\\u2028' || ch === '\\u2029') {\n                details.line++;\n                details.column = 1;\n                details.seenCR = true;\n              } else {\n                details.column++;\n                details.seenCR = false;\n              }\n            }\n          }\n    \n          if (peg$cachedPos !== pos) {\n            if (peg$cachedPos > pos) {\n              peg$cachedPos = 0;\n              peg$cachedPosDetails = { line: 1, column: 1, seenCR: false };\n            }\n            advance(peg$cachedPosDetails, peg$cachedPos, pos);\n            peg$cachedPos = pos;\n          }\n    \n          return peg$cachedPosDetails;\n        }\n    \n        function peg$fail(expected) {\n          if (peg$currPos < peg$maxFailPos) {\n            return;\n          }\n    \n          if (peg$currPos > peg$maxFailPos) {\n            peg$maxFailPos = peg$currPos;\n            peg$maxFailExpected = [];\n          }\n    \n          peg$maxFailExpected.push(expected);\n        }\n    \n        function peg$buildException(message, expected, pos) {\n          function cleanupExpected(expected) {\n            var i = 1;\n    \n            expected.sort(function (a, b) {\n              if (a.description < b.description) {\n                return -1;\n              } else if (a.description > b.description) {\n                return 1;\n              } else {\n                return 0;\n              }\n            });\n    \n            while (i < expected.length) {\n              if (expected[i - 1] === expected[i]) {\n                expected.splice(i, 1);\n              } else {\n                i++;\n              }\n            }\n          }\n    \n          function buildMessage(expected, found) {\n            function stringEscape(s) {\n              function hex(ch) {\n                return ch.charCodeAt(0).toString(16).toUpperCase();\n              }\n    \n              return s.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\x08/g, '\\\\b').replace(/\\t/g, '\\\\t').replace(/\\n/g, '\\\\n').replace(/\\f/g, '\\\\f').replace(/\\r/g, '\\\\r').replace(/[\\x00-\\x07\\x0B\\x0E\\x0F]/g, function (ch) {\n                return '\\\\x0' + hex(ch);\n              }).replace(/[\\x10-\\x1F\\x80-\\xFF]/g, function (ch) {\n                return '\\\\x' + hex(ch);\n              }).replace(/[\\u0180-\\u0FFF]/g, function (ch) {\n                return '\\\\u0' + hex(ch);\n              }).replace(/[\\u1080-\\uFFFF]/g, function (ch) {\n                return '\\\\u' + hex(ch);\n              });\n            }\n    \n            var expectedDescs = new Array(expected.length),\n                expectedDesc,\n                foundDesc,\n                i;\n    \n            for (i = 0; i < expected.length; i++) {\n              expectedDescs[i] = expected[i].description;\n            }\n    \n            expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(\", \") + \" or \" + expectedDescs[expected.length - 1] : expectedDescs[0];\n    \n            foundDesc = found ? \"\\\"\" + stringEscape(found) + \"\\\"\" : \"end of input\";\n    \n            return \"Expected \" + expectedDesc + \" but \" + foundDesc + \" found.\";\n          }\n    \n          var posDetails = peg$computePosDetails(pos),\n              found = pos < input.length ? input.charAt(pos) : null;\n    \n          if (expected !== null) {\n            cleanupExpected(expected);\n          }\n    \n          return new SyntaxError(message !== null ? message : buildMessage(expected, found), expected, found, pos, posDetails.line, posDetails.column);\n        }\n    \n        function peg$parsevisualFormatString() {\n          var s0, s1, s2, s3, s4, s5, s6, s7;\n    \n          s0 = peg$currPos;\n          s1 = peg$currPos;\n          s2 = peg$parseorientation();\n          if (s2 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 58) {\n              s3 = peg$c2;\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c3);\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              s2 = [s2, s3];\n              s1 = s2;\n            } else {\n              peg$currPos = s1;\n              s1 = peg$c0;\n            }\n          } else {\n            peg$currPos = s1;\n            s1 = peg$c0;\n          }\n          if (s1 === peg$FAILED) {\n            s1 = peg$c1;\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$currPos;\n            s3 = peg$parsesuperview();\n            if (s3 !== peg$FAILED) {\n              s4 = peg$parseconnection();\n              if (s4 !== peg$FAILED) {\n                s3 = [s3, s4];\n                s2 = s3;\n              } else {\n                peg$currPos = s2;\n                s2 = peg$c0;\n              }\n            } else {\n              peg$currPos = s2;\n              s2 = peg$c0;\n            }\n            if (s2 === peg$FAILED) {\n              s2 = peg$c1;\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parseview();\n              if (s3 !== peg$FAILED) {\n                s4 = [];\n                s5 = peg$currPos;\n                s6 = peg$parseconnection();\n                if (s6 !== peg$FAILED) {\n                  s7 = peg$parseview();\n                  if (s7 !== peg$FAILED) {\n                    s6 = [s6, s7];\n                    s5 = s6;\n                  } else {\n                    peg$currPos = s5;\n                    s5 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s5;\n                  s5 = peg$c0;\n                }\n                while (s5 !== peg$FAILED) {\n                  s4.push(s5);\n                  s5 = peg$currPos;\n                  s6 = peg$parseconnection();\n                  if (s6 !== peg$FAILED) {\n                    s7 = peg$parseview();\n                    if (s7 !== peg$FAILED) {\n                      s6 = [s6, s7];\n                      s5 = s6;\n                    } else {\n                      peg$currPos = s5;\n                      s5 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s5;\n                    s5 = peg$c0;\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  s5 = peg$currPos;\n                  s6 = peg$parseconnection();\n                  if (s6 !== peg$FAILED) {\n                    s7 = peg$parsesuperview();\n                    if (s7 !== peg$FAILED) {\n                      s6 = [s6, s7];\n                      s5 = s6;\n                    } else {\n                      peg$currPos = s5;\n                      s5 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s5;\n                    s5 = peg$c0;\n                  }\n                  if (s5 === peg$FAILED) {\n                    s5 = peg$c1;\n                  }\n                  if (s5 !== peg$FAILED) {\n                    peg$reportedPos = s0;\n                    s1 = peg$c5(s1, s2, s3, s4, s5);\n                    s0 = s1;\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseorientation() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 72) {\n            s1 = peg$c6;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c7);\n            }\n          }\n          if (s1 === peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 86) {\n              s1 = peg$c8;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c9);\n              }\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c10(s1);\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parsesuperview() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 124) {\n            s1 = peg$c11;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c12);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c13();\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parseview() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 91) {\n            s1 = peg$c14;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c15);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseviewName();\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parsepredicateListWithParens();\n              if (s3 === peg$FAILED) {\n                s3 = peg$c1;\n              }\n              if (s3 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 93) {\n                  s4 = peg$c16;\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c17);\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c18(s2, s3);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseconnection() {\n          var s0, s1, s2, s3;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 45) {\n            s1 = peg$c19;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c20);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsepredicateList();\n            if (s2 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 45) {\n                s3 = peg$c19;\n                peg$currPos++;\n              } else {\n                s3 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c20);\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c21(s2);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 45) {\n              s1 = peg$c19;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c20);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c22();\n            }\n            s0 = s1;\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              s1 = peg$c23;\n              if (s1 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c24();\n              }\n              s0 = s1;\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepredicateList() {\n          var s0;\n    \n          s0 = peg$parsesimplePredicate();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parsepredicateListWithParens();\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsesimplePredicate() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          s1 = peg$parsenumber();\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c25(s1);\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parsepredicateListWithParens() {\n          var s0, s1, s2, s3, s4, s5, s6;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 40) {\n            s1 = peg$c26;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c27);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsepredicate();\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              s4 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 44) {\n                s5 = peg$c28;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c29);\n                }\n              }\n              if (s5 !== peg$FAILED) {\n                s6 = peg$parsepredicate();\n                if (s6 !== peg$FAILED) {\n                  s5 = [s5, s6];\n                  s4 = s5;\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              } else {\n                peg$currPos = s4;\n                s4 = peg$c0;\n              }\n              while (s4 !== peg$FAILED) {\n                s3.push(s4);\n                s4 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 44) {\n                  s5 = peg$c28;\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c29);\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  s6 = peg$parsepredicate();\n                  if (s6 !== peg$FAILED) {\n                    s5 = [s5, s6];\n                    s4 = s5;\n                  } else {\n                    peg$currPos = s4;\n                    s4 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 41) {\n                  s4 = peg$c30;\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c31);\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c32(s2, s3);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepredicate() {\n          var s0, s1, s2, s3, s4, s5;\n    \n          s0 = peg$currPos;\n          s1 = peg$parserelation();\n          if (s1 === peg$FAILED) {\n            s1 = peg$c1;\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseobjectOfPredicate();\n            if (s2 !== peg$FAILED) {\n              s3 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 64) {\n                s4 = peg$c33;\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c34);\n                }\n              }\n              if (s4 !== peg$FAILED) {\n                s5 = peg$parsepriority();\n                if (s5 !== peg$FAILED) {\n                  s4 = [s4, s5];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$c0;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$c0;\n              }\n              if (s3 === peg$FAILED) {\n                s3 = peg$c1;\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c35(s1, s2, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parserelation() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 2) === peg$c36) {\n            s1 = peg$c36;\n            peg$currPos += 2;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c37);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c38();\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.substr(peg$currPos, 2) === peg$c39) {\n              s1 = peg$c39;\n              peg$currPos += 2;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c40);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c41();\n            }\n            s0 = s1;\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.substr(peg$currPos, 2) === peg$c42) {\n                s1 = peg$c42;\n                peg$currPos += 2;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c43);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c44();\n              }\n              s0 = s1;\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseobjectOfPredicate() {\n          var s0;\n    \n          s0 = peg$parseconstant();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parseviewName();\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepriority() {\n          var s0, s1, s2;\n    \n          s0 = peg$currPos;\n          s1 = [];\n          if (peg$c45.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c46);\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            while (s2 !== peg$FAILED) {\n              s1.push(s2);\n              if (peg$c45.test(input.charAt(peg$currPos))) {\n                s2 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s2 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c46);\n                }\n              }\n            }\n          } else {\n            s1 = peg$c0;\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c47(s1);\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parseconstant() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          s1 = peg$parsenumber();\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c48(s1);\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parseviewName() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = peg$currPos;\n          s2 = [];\n          if (peg$c49.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c50);\n            }\n          }\n          if (s3 !== peg$FAILED) {\n            while (s3 !== peg$FAILED) {\n              s2.push(s3);\n              if (peg$c49.test(input.charAt(peg$currPos))) {\n                s3 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s3 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c50);\n                }\n              }\n            }\n          } else {\n            s2 = peg$c0;\n          }\n          if (s2 !== peg$FAILED) {\n            s2 = input.substring(s1, peg$currPos);\n          }\n          s1 = s2;\n          if (s1 !== peg$FAILED) {\n            s2 = peg$currPos;\n            s3 = [];\n            if (peg$c51.test(input.charAt(peg$currPos))) {\n              s4 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c52);\n              }\n            }\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c51.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c52);\n                }\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              s3 = input.substring(s2, peg$currPos);\n            }\n            s2 = s3;\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c53(s1, s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsenumber() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = [];\n          if (peg$c45.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c46);\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            while (s2 !== peg$FAILED) {\n              s1.push(s2);\n              if (peg$c45.test(input.charAt(peg$currPos))) {\n                s2 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s2 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c46);\n                }\n              }\n            }\n          } else {\n            s1 = peg$c0;\n          }\n          if (s1 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 46) {\n              s2 = peg$c54;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c55);\n              }\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              if (peg$c45.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c46);\n                }\n              }\n              if (s4 !== peg$FAILED) {\n                while (s4 !== peg$FAILED) {\n                  s3.push(s4);\n                  if (peg$c45.test(input.charAt(peg$currPos))) {\n                    s4 = input.charAt(peg$currPos);\n                    peg$currPos++;\n                  } else {\n                    s4 = peg$FAILED;\n                    if (peg$silentFails === 0) {\n                      peg$fail(peg$c46);\n                    }\n                  }\n                }\n              } else {\n                s3 = peg$c0;\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c56(s1, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            s1 = [];\n            if (peg$c45.test(input.charAt(peg$currPos))) {\n              s2 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c46);\n              }\n            }\n            if (s2 !== peg$FAILED) {\n              while (s2 !== peg$FAILED) {\n                s1.push(s2);\n                if (peg$c45.test(input.charAt(peg$currPos))) {\n                  s2 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s2 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c46);\n                  }\n                }\n              }\n            } else {\n              s1 = peg$c0;\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c57(s1);\n            }\n            s0 = s1;\n          }\n    \n          return s0;\n        }\n    \n        function extend(dst) {\n          for (var i = 1; i < arguments.length; i++) {\n            for (var k in arguments[i]) {\n              dst[k] = arguments[i][k];\n            }\n          }\n          return dst;\n        }\n    \n        peg$result = peg$startRuleFunction();\n    \n        if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n          return peg$result;\n        } else {\n          if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n            peg$fail({ type: \"end\", description: \"end of input\" });\n          }\n    \n          throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);\n        }\n      }\n    \n      return {\n        SyntaxError: SyntaxError,\n        parse: parse\n      };\n    }();\n    \n    var parserExt = function () {\n      /*\n       * Generated by PEG.js 0.8.0.\n       *\n       * http://pegjs.majda.cz/\n       */\n    \n      function peg$subclass(child, parent) {\n        function ctor() {\n          this.constructor = child;\n        }\n        ctor.prototype = parent.prototype;\n        child.prototype = new ctor();\n      }\n    \n      function SyntaxError(message, expected, found, offset, line, column) {\n        this.message = message;\n        this.expected = expected;\n        this.found = found;\n        this.offset = offset;\n        this.line = line;\n        this.column = column;\n    \n        this.name = \"SyntaxError\";\n      }\n    \n      peg$subclass(SyntaxError, Error);\n    \n      function parse(input) {\n        var options = arguments.length > 1 ? arguments[1] : {},\n            peg$FAILED = {},\n            peg$startRuleFunctions = { visualFormatStringExt: peg$parsevisualFormatStringExt },\n            peg$startRuleFunction = peg$parsevisualFormatStringExt,\n            peg$c0 = peg$FAILED,\n            peg$c1 = \"C:\",\n            peg$c2 = { type: \"literal\", value: \"C:\", description: \"\\\"C:\\\"\" },\n            peg$c3 = [],\n            peg$c4 = null,\n            peg$c5 = function peg$c5(view, attribute, attributes, comments) {\n          return {\n            type: 'attribute',\n            view: view.view,\n            attributes: [attribute].concat(attributes)\n          };\n        },\n            peg$c6 = function peg$c6(attr, predicates) {\n          return { attr: attr, predicates: predicates };\n        },\n            peg$c7 = \":\",\n            peg$c8 = { type: \"literal\", value: \":\", description: \"\\\":\\\"\" },\n            peg$c9 = function peg$c9(o, superto, view, views, tosuper, comments) {\n          return {\n            type: 'vfl',\n            orientation: o ? o[0] : 'horizontal',\n            cascade: (superto || []).concat(view, [].concat.apply([], views), tosuper || [])\n          };\n        },\n            peg$c10 = \"HV\",\n            peg$c11 = { type: \"literal\", value: \"HV\", description: \"\\\"HV\\\"\" },\n            peg$c12 = function peg$c12() {\n          return 'horzvert';\n        },\n            peg$c13 = \"H\",\n            peg$c14 = { type: \"literal\", value: \"H\", description: \"\\\"H\\\"\" },\n            peg$c15 = function peg$c15() {\n          return 'horizontal';\n        },\n            peg$c16 = \"V\",\n            peg$c17 = { type: \"literal\", value: \"V\", description: \"\\\"V\\\"\" },\n            peg$c18 = function peg$c18() {\n          return 'vertical';\n        },\n            peg$c19 = \"Z\",\n            peg$c20 = { type: \"literal\", value: \"Z\", description: \"\\\"Z\\\"\" },\n            peg$c21 = function peg$c21() {\n          return 'zIndex';\n        },\n            peg$c22 = \" \",\n            peg$c23 = { type: \"literal\", value: \" \", description: \"\\\" \\\"\" },\n            peg$c24 = \"//\",\n            peg$c25 = { type: \"literal\", value: \"//\", description: \"\\\"//\\\"\" },\n            peg$c26 = { type: \"any\", description: \"any character\" },\n            peg$c27 = \"|\",\n            peg$c28 = { type: \"literal\", value: \"|\", description: \"\\\"|\\\"\" },\n            peg$c29 = function peg$c29() {\n          return { view: null };\n        },\n            peg$c30 = \"[\",\n            peg$c31 = { type: \"literal\", value: \"[\", description: \"\\\"[\\\"\" },\n            peg$c32 = \",\",\n            peg$c33 = { type: \"literal\", value: \",\", description: \"\\\",\\\"\" },\n            peg$c34 = \"]\",\n            peg$c35 = { type: \"literal\", value: \"]\", description: \"\\\"]\\\"\" },\n            peg$c36 = function peg$c36(view, views) {\n          return views.length ? [view].concat([].concat.apply([], views)) : view;\n        },\n            peg$c37 = function peg$c37(view, predicates, cascadedViews) {\n          return extend(extend(view, predicates ? { constraints: predicates } : {}), cascadedViews ? {\n            cascade: cascadedViews\n          } : {});\n        },\n            peg$c38 = function peg$c38(views, connection) {\n          return [].concat([].concat.apply([], views), [connection]);\n        },\n            peg$c39 = \"->\",\n            peg$c40 = { type: \"literal\", value: \"->\", description: \"\\\"->\\\"\" },\n            peg$c41 = function peg$c41() {\n          return [{ relation: 'none' }];\n        },\n            peg$c42 = \"-\",\n            peg$c43 = { type: \"literal\", value: \"-\", description: \"\\\"-\\\"\" },\n            peg$c44 = function peg$c44(predicateList) {\n          return predicateList;\n        },\n            peg$c45 = function peg$c45() {\n          return [{ relation: 'equ', constant: 'default' }];\n        },\n            peg$c46 = \"~\",\n            peg$c47 = { type: \"literal\", value: \"~\", description: \"\\\"~\\\"\" },\n            peg$c48 = function peg$c48() {\n          return [{ relation: 'equ', equalSpacing: true }];\n        },\n            peg$c49 = \"\",\n            peg$c50 = function peg$c50() {\n          return [{ relation: 'equ', constant: 0 }];\n        },\n            peg$c51 = function peg$c51(p) {\n          return [{ relation: 'equ', multiplier: p.multiplier }];\n        },\n            peg$c52 = function peg$c52(n) {\n          return [{ relation: 'equ', constant: n }];\n        },\n            peg$c53 = \"(\",\n            peg$c54 = { type: \"literal\", value: \"(\", description: \"\\\"(\\\"\" },\n            peg$c55 = \")\",\n            peg$c56 = { type: \"literal\", value: \")\", description: \"\\\")\\\"\" },\n            peg$c57 = function peg$c57(p, ps) {\n          return [p].concat(ps.map(function (p) {\n            return p[1];\n          }));\n        },\n            peg$c58 = \"@\",\n            peg$c59 = { type: \"literal\", value: \"@\", description: \"\\\"@\\\"\" },\n            peg$c60 = function peg$c60(r, o, p) {\n          return extend({ relation: 'equ' }, r || {}, o, p ? p[1] : {});\n        },\n            peg$c61 = function peg$c61(r, o, p) {\n          return extend({ relation: 'equ', equalSpacing: true }, r || {}, o, p ? p[1] : {});\n        },\n            peg$c62 = \"==\",\n            peg$c63 = { type: \"literal\", value: \"==\", description: \"\\\"==\\\"\" },\n            peg$c64 = function peg$c64() {\n          return { relation: 'equ' };\n        },\n            peg$c65 = \"<=\",\n            peg$c66 = { type: \"literal\", value: \"<=\", description: \"\\\"<=\\\"\" },\n            peg$c67 = function peg$c67() {\n          return { relation: 'leq' };\n        },\n            peg$c68 = \">=\",\n            peg$c69 = { type: \"literal\", value: \">=\", description: \"\\\">=\\\"\" },\n            peg$c70 = function peg$c70() {\n          return { relation: 'geq' };\n        },\n            peg$c71 = /^[0-9]/,\n            peg$c72 = { type: \"class\", value: \"[0-9]\", description: \"[0-9]\" },\n            peg$c73 = function peg$c73(digits) {\n          return { priority: parseInt(digits.join(\"\"), 10) };\n        },\n            peg$c74 = function peg$c74(n) {\n          return { constant: n };\n        },\n            peg$c75 = function peg$c75(n) {\n          return { constant: -n };\n        },\n            peg$c76 = \"+\",\n            peg$c77 = { type: \"literal\", value: \"+\", description: \"\\\"+\\\"\" },\n            peg$c78 = \"%\",\n            peg$c79 = { type: \"literal\", value: \"%\", description: \"\\\"%\\\"\" },\n            peg$c80 = function peg$c80(n) {\n          return { view: null, multiplier: n / 100 };\n        },\n            peg$c81 = function peg$c81(n) {\n          return { view: null, multiplier: n / -100 };\n        },\n            peg$c82 = function peg$c82(vn, a, m, c) {\n          return { view: vn.view, attribute: a ? a : undefined, multiplier: m ? m : 1, constant: c ? c : undefined };\n        },\n            peg$c83 = \".left\",\n            peg$c84 = { type: \"literal\", value: \".left\", description: \"\\\".left\\\"\" },\n            peg$c85 = function peg$c85() {\n          return 'left';\n        },\n            peg$c86 = \".right\",\n            peg$c87 = { type: \"literal\", value: \".right\", description: \"\\\".right\\\"\" },\n            peg$c88 = function peg$c88() {\n          return 'right';\n        },\n            peg$c89 = \".top\",\n            peg$c90 = { type: \"literal\", value: \".top\", description: \"\\\".top\\\"\" },\n            peg$c91 = function peg$c91() {\n          return 'top';\n        },\n            peg$c92 = \".bottom\",\n            peg$c93 = { type: \"literal\", value: \".bottom\", description: \"\\\".bottom\\\"\" },\n            peg$c94 = function peg$c94() {\n          return 'bottom';\n        },\n            peg$c95 = \".width\",\n            peg$c96 = { type: \"literal\", value: \".width\", description: \"\\\".width\\\"\" },\n            peg$c97 = function peg$c97() {\n          return 'width';\n        },\n            peg$c98 = \".height\",\n            peg$c99 = { type: \"literal\", value: \".height\", description: \"\\\".height\\\"\" },\n            peg$c100 = function peg$c100() {\n          return 'height';\n        },\n            peg$c101 = \".centerX\",\n            peg$c102 = { type: \"literal\", value: \".centerX\", description: \"\\\".centerX\\\"\" },\n            peg$c103 = function peg$c103() {\n          return 'centerX';\n        },\n            peg$c104 = \".centerY\",\n            peg$c105 = { type: \"literal\", value: \".centerY\", description: \"\\\".centerY\\\"\" },\n            peg$c106 = function peg$c106() {\n          return 'centerY';\n        },\n            peg$c107 = \"/\",\n            peg$c108 = { type: \"literal\", value: \"/\", description: \"\\\"/\\\"\" },\n            peg$c109 = function peg$c109(n) {\n          return 1 / n;\n        },\n            peg$c110 = \"/+\",\n            peg$c111 = { type: \"literal\", value: \"/+\", description: \"\\\"/+\\\"\" },\n            peg$c112 = \"/-\",\n            peg$c113 = { type: \"literal\", value: \"/-\", description: \"\\\"/-\\\"\" },\n            peg$c114 = function peg$c114(n) {\n          return -1 / n;\n        },\n            peg$c115 = \"*\",\n            peg$c116 = { type: \"literal\", value: \"*\", description: \"\\\"*\\\"\" },\n            peg$c117 = function peg$c117(n) {\n          return n;\n        },\n            peg$c118 = \"*+\",\n            peg$c119 = { type: \"literal\", value: \"*+\", description: \"\\\"*+\\\"\" },\n            peg$c120 = \"*-\",\n            peg$c121 = { type: \"literal\", value: \"*-\", description: \"\\\"*-\\\"\" },\n            peg$c122 = function peg$c122(n) {\n          return -n;\n        },\n            peg$c123 = /^[a-zA-Z_]/,\n            peg$c124 = { type: \"class\", value: \"[a-zA-Z_]\", description: \"[a-zA-Z_]\" },\n            peg$c125 = /^[a-zA-Z0-9_]/,\n            peg$c126 = { type: \"class\", value: \"[a-zA-Z0-9_]\", description: \"[a-zA-Z0-9_]\" },\n            peg$c127 = function peg$c127(f, v, r) {\n          return { view: f + v, range: r, $parserOffset: offset() };\n        },\n            peg$c128 = function peg$c128(f, v) {\n          return { view: f + v, $parserOffset: offset() };\n        },\n            peg$c129 = \"..\",\n            peg$c130 = { type: \"literal\", value: \"..\", description: \"\\\"..\\\"\" },\n            peg$c131 = function peg$c131(d) {\n          return parseInt(d);\n        },\n            peg$c132 = \".\",\n            peg$c133 = { type: \"literal\", value: \".\", description: \"\\\".\\\"\" },\n            peg$c134 = function peg$c134(digits, decimals) {\n          return parseFloat(digits.concat(\".\").concat(decimals).join(\"\"), 10);\n        },\n            peg$c135 = function peg$c135(digits) {\n          return parseInt(digits.join(\"\"), 10);\n        },\n            peg$currPos = 0,\n            peg$reportedPos = 0,\n            peg$cachedPos = 0,\n            peg$cachedPosDetails = { line: 1, column: 1, seenCR: false },\n            peg$maxFailPos = 0,\n            peg$maxFailExpected = [],\n            peg$silentFails = 0,\n            peg$result;\n    \n        if (\"startRule\" in options) {\n          if (!(options.startRule in peg$startRuleFunctions)) {\n            throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n          }\n    \n          peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n        }\n    \n        function text() {\n          return input.substring(peg$reportedPos, peg$currPos);\n        }\n    \n        function offset() {\n          return peg$reportedPos;\n        }\n    \n        function line() {\n          return peg$computePosDetails(peg$reportedPos).line;\n        }\n    \n        function column() {\n          return peg$computePosDetails(peg$reportedPos).column;\n        }\n    \n        function expected(description) {\n          throw peg$buildException(null, [{ type: \"other\", description: description }], peg$reportedPos);\n        }\n    \n        function error(message) {\n          throw peg$buildException(message, null, peg$reportedPos);\n        }\n    \n        function peg$computePosDetails(pos) {\n          function advance(details, startPos, endPos) {\n            var p, ch;\n    \n            for (p = startPos; p < endPos; p++) {\n              ch = input.charAt(p);\n              if (ch === \"\\n\") {\n                if (!details.seenCR) {\n                  details.line++;\n                }\n                details.column = 1;\n                details.seenCR = false;\n              } else if (ch === \"\\r\" || ch === '\\u2028' || ch === '\\u2029') {\n                details.line++;\n                details.column = 1;\n                details.seenCR = true;\n              } else {\n                details.column++;\n                details.seenCR = false;\n              }\n            }\n          }\n    \n          if (peg$cachedPos !== pos) {\n            if (peg$cachedPos > pos) {\n              peg$cachedPos = 0;\n              peg$cachedPosDetails = { line: 1, column: 1, seenCR: false };\n            }\n            advance(peg$cachedPosDetails, peg$cachedPos, pos);\n            peg$cachedPos = pos;\n          }\n    \n          return peg$cachedPosDetails;\n        }\n    \n        function peg$fail(expected) {\n          if (peg$currPos < peg$maxFailPos) {\n            return;\n          }\n    \n          if (peg$currPos > peg$maxFailPos) {\n            peg$maxFailPos = peg$currPos;\n            peg$maxFailExpected = [];\n          }\n    \n          peg$maxFailExpected.push(expected);\n        }\n    \n        function peg$buildException(message, expected, pos) {\n          function cleanupExpected(expected) {\n            var i = 1;\n    \n            expected.sort(function (a, b) {\n              if (a.description < b.description) {\n                return -1;\n              } else if (a.description > b.description) {\n                return 1;\n              } else {\n                return 0;\n              }\n            });\n    \n            while (i < expected.length) {\n              if (expected[i - 1] === expected[i]) {\n                expected.splice(i, 1);\n              } else {\n                i++;\n              }\n            }\n          }\n    \n          function buildMessage(expected, found) {\n            function stringEscape(s) {\n              function hex(ch) {\n                return ch.charCodeAt(0).toString(16).toUpperCase();\n              }\n    \n              return s.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\x08/g, '\\\\b').replace(/\\t/g, '\\\\t').replace(/\\n/g, '\\\\n').replace(/\\f/g, '\\\\f').replace(/\\r/g, '\\\\r').replace(/[\\x00-\\x07\\x0B\\x0E\\x0F]/g, function (ch) {\n                return '\\\\x0' + hex(ch);\n              }).replace(/[\\x10-\\x1F\\x80-\\xFF]/g, function (ch) {\n                return '\\\\x' + hex(ch);\n              }).replace(/[\\u0180-\\u0FFF]/g, function (ch) {\n                return '\\\\u0' + hex(ch);\n              }).replace(/[\\u1080-\\uFFFF]/g, function (ch) {\n                return '\\\\u' + hex(ch);\n              });\n            }\n    \n            var expectedDescs = new Array(expected.length),\n                expectedDesc,\n                foundDesc,\n                i;\n    \n            for (i = 0; i < expected.length; i++) {\n              expectedDescs[i] = expected[i].description;\n            }\n    \n            expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(\", \") + \" or \" + expectedDescs[expected.length - 1] : expectedDescs[0];\n    \n            foundDesc = found ? \"\\\"\" + stringEscape(found) + \"\\\"\" : \"end of input\";\n    \n            return \"Expected \" + expectedDesc + \" but \" + foundDesc + \" found.\";\n          }\n    \n          var posDetails = peg$computePosDetails(pos),\n              found = pos < input.length ? input.charAt(pos) : null;\n    \n          if (expected !== null) {\n            cleanupExpected(expected);\n          }\n    \n          return new SyntaxError(message !== null ? message : buildMessage(expected, found), expected, found, pos, posDetails.line, posDetails.column);\n        }\n    \n        function peg$parsevisualFormatStringExt() {\n          var s0;\n    \n          s0 = peg$parsevisualFormatString();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parsevisualFormatStringConstraintExpression();\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsevisualFormatStringConstraintExpression() {\n          var s0, s1, s2, s3, s4, s5;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 2) === peg$c1) {\n            s1 = peg$c1;\n            peg$currPos += 2;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c2);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseviewName();\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parseattributePredicate();\n              if (s3 !== peg$FAILED) {\n                s4 = [];\n                s5 = peg$parseattributePredicate();\n                while (s5 !== peg$FAILED) {\n                  s4.push(s5);\n                  s5 = peg$parseattributePredicate();\n                }\n                if (s4 !== peg$FAILED) {\n                  s5 = peg$parsecomments();\n                  if (s5 === peg$FAILED) {\n                    s5 = peg$c4;\n                  }\n                  if (s5 !== peg$FAILED) {\n                    peg$reportedPos = s0;\n                    s1 = peg$c5(s2, s3, s4, s5);\n                    s0 = s1;\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseattributePredicate() {\n          var s0, s1, s2;\n    \n          s0 = peg$currPos;\n          s1 = peg$parseattribute();\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsepredicateListWithParens();\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c6(s1, s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsevisualFormatString() {\n          var s0, s1, s2, s3, s4, s5, s6, s7;\n    \n          s0 = peg$currPos;\n          s1 = peg$currPos;\n          s2 = peg$parseorientation();\n          if (s2 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 58) {\n              s3 = peg$c7;\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c8);\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              s2 = [s2, s3];\n              s1 = s2;\n            } else {\n              peg$currPos = s1;\n              s1 = peg$c0;\n            }\n          } else {\n            peg$currPos = s1;\n            s1 = peg$c0;\n          }\n          if (s1 === peg$FAILED) {\n            s1 = peg$c4;\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$currPos;\n            s3 = peg$parsesuperview();\n            if (s3 !== peg$FAILED) {\n              s4 = peg$parseconnection();\n              if (s4 !== peg$FAILED) {\n                s3 = [s3, s4];\n                s2 = s3;\n              } else {\n                peg$currPos = s2;\n                s2 = peg$c0;\n              }\n            } else {\n              peg$currPos = s2;\n              s2 = peg$c0;\n            }\n            if (s2 === peg$FAILED) {\n              s2 = peg$c4;\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parseviewGroup();\n              if (s3 !== peg$FAILED) {\n                s4 = [];\n                s5 = peg$currPos;\n                s6 = peg$parseconnection();\n                if (s6 !== peg$FAILED) {\n                  s7 = peg$parseviewGroup();\n                  if (s7 !== peg$FAILED) {\n                    s6 = [s6, s7];\n                    s5 = s6;\n                  } else {\n                    peg$currPos = s5;\n                    s5 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s5;\n                  s5 = peg$c0;\n                }\n                while (s5 !== peg$FAILED) {\n                  s4.push(s5);\n                  s5 = peg$currPos;\n                  s6 = peg$parseconnection();\n                  if (s6 !== peg$FAILED) {\n                    s7 = peg$parseviewGroup();\n                    if (s7 !== peg$FAILED) {\n                      s6 = [s6, s7];\n                      s5 = s6;\n                    } else {\n                      peg$currPos = s5;\n                      s5 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s5;\n                    s5 = peg$c0;\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  s5 = peg$currPos;\n                  s6 = peg$parseconnection();\n                  if (s6 !== peg$FAILED) {\n                    s7 = peg$parsesuperview();\n                    if (s7 !== peg$FAILED) {\n                      s6 = [s6, s7];\n                      s5 = s6;\n                    } else {\n                      peg$currPos = s5;\n                      s5 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s5;\n                    s5 = peg$c0;\n                  }\n                  if (s5 === peg$FAILED) {\n                    s5 = peg$c4;\n                  }\n                  if (s5 !== peg$FAILED) {\n                    s6 = peg$parsecomments();\n                    if (s6 === peg$FAILED) {\n                      s6 = peg$c4;\n                    }\n                    if (s6 !== peg$FAILED) {\n                      peg$reportedPos = s0;\n                      s1 = peg$c9(s1, s2, s3, s4, s5, s6);\n                      s0 = s1;\n                    } else {\n                      peg$currPos = s0;\n                      s0 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseorientation() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 2) === peg$c10) {\n            s1 = peg$c10;\n            peg$currPos += 2;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c11);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c12();\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 72) {\n              s1 = peg$c13;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c14);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c15();\n            }\n            s0 = s1;\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 86) {\n                s1 = peg$c16;\n                peg$currPos++;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c17);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c18();\n              }\n              s0 = s1;\n              if (s0 === peg$FAILED) {\n                s0 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 90) {\n                  s1 = peg$c19;\n                  peg$currPos++;\n                } else {\n                  s1 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c20);\n                  }\n                }\n                if (s1 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c21();\n                }\n                s0 = s1;\n              }\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsecomments() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = [];\n          if (input.charCodeAt(peg$currPos) === 32) {\n            s2 = peg$c22;\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c23);\n            }\n          }\n          while (s2 !== peg$FAILED) {\n            s1.push(s2);\n            if (input.charCodeAt(peg$currPos) === 32) {\n              s2 = peg$c22;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c23);\n              }\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            if (input.substr(peg$currPos, 2) === peg$c24) {\n              s2 = peg$c24;\n              peg$currPos += 2;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c25);\n              }\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              if (input.length > peg$currPos) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c26);\n                }\n              }\n              while (s4 !== peg$FAILED) {\n                s3.push(s4);\n                if (input.length > peg$currPos) {\n                  s4 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c26);\n                  }\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                s1 = [s1, s2, s3];\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsesuperview() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 124) {\n            s1 = peg$c27;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c28);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c29();\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parseviewGroup() {\n          var s0, s1, s2, s3, s4, s5, s6;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 91) {\n            s1 = peg$c30;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c31);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseview();\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              s4 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 44) {\n                s5 = peg$c32;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c33);\n                }\n              }\n              if (s5 !== peg$FAILED) {\n                s6 = peg$parseview();\n                if (s6 !== peg$FAILED) {\n                  s5 = [s5, s6];\n                  s4 = s5;\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              } else {\n                peg$currPos = s4;\n                s4 = peg$c0;\n              }\n              while (s4 !== peg$FAILED) {\n                s3.push(s4);\n                s4 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 44) {\n                  s5 = peg$c32;\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c33);\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  s6 = peg$parseview();\n                  if (s6 !== peg$FAILED) {\n                    s5 = [s5, s6];\n                    s4 = s5;\n                  } else {\n                    peg$currPos = s4;\n                    s4 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 93) {\n                  s4 = peg$c34;\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c35);\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c36(s2, s3);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseview() {\n          var s0, s1, s2, s3;\n    \n          s0 = peg$currPos;\n          s1 = peg$parseviewNameRange();\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsepredicateListWithParens();\n            if (s2 === peg$FAILED) {\n              s2 = peg$c4;\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parsecascadedViews();\n              if (s3 === peg$FAILED) {\n                s3 = peg$c4;\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c37(s1, s2, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsecascadedViews() {\n          var s0, s1, s2, s3, s4, s5;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 58) {\n            s1 = peg$c7;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c8);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = [];\n            s3 = peg$currPos;\n            s4 = peg$parseconnection();\n            if (s4 !== peg$FAILED) {\n              s5 = peg$parseviewGroup();\n              if (s5 !== peg$FAILED) {\n                s4 = [s4, s5];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$c0;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$c0;\n            }\n            if (s3 !== peg$FAILED) {\n              while (s3 !== peg$FAILED) {\n                s2.push(s3);\n                s3 = peg$currPos;\n                s4 = peg$parseconnection();\n                if (s4 !== peg$FAILED) {\n                  s5 = peg$parseviewGroup();\n                  if (s5 !== peg$FAILED) {\n                    s4 = [s4, s5];\n                    s3 = s4;\n                  } else {\n                    peg$currPos = s3;\n                    s3 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$c0;\n                }\n              }\n            } else {\n              s2 = peg$c0;\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parseconnection();\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c38(s2, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseconnection() {\n          var s0, s1, s2, s3;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 2) === peg$c39) {\n            s1 = peg$c39;\n            peg$currPos += 2;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c40);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c41();\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 45) {\n              s1 = peg$c42;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c43);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parsepredicateList();\n              if (s2 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 45) {\n                  s3 = peg$c42;\n                  peg$currPos++;\n                } else {\n                  s3 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c43);\n                  }\n                }\n                if (s3 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c44(s2);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 45) {\n                s1 = peg$c42;\n                peg$currPos++;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c43);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c45();\n              }\n              s0 = s1;\n              if (s0 === peg$FAILED) {\n                s0 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 126) {\n                  s1 = peg$c46;\n                  peg$currPos++;\n                } else {\n                  s1 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c47);\n                  }\n                }\n                if (s1 !== peg$FAILED) {\n                  s2 = peg$parseequalSpacingPredicateList();\n                  if (s2 !== peg$FAILED) {\n                    if (input.charCodeAt(peg$currPos) === 126) {\n                      s3 = peg$c46;\n                      peg$currPos++;\n                    } else {\n                      s3 = peg$FAILED;\n                      if (peg$silentFails === 0) {\n                        peg$fail(peg$c47);\n                      }\n                    }\n                    if (s3 !== peg$FAILED) {\n                      peg$reportedPos = s0;\n                      s1 = peg$c44(s2);\n                      s0 = s1;\n                    } else {\n                      peg$currPos = s0;\n                      s0 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n                if (s0 === peg$FAILED) {\n                  s0 = peg$currPos;\n                  if (input.charCodeAt(peg$currPos) === 126) {\n                    s1 = peg$c46;\n                    peg$currPos++;\n                  } else {\n                    s1 = peg$FAILED;\n                    if (peg$silentFails === 0) {\n                      peg$fail(peg$c47);\n                    }\n                  }\n                  if (s1 !== peg$FAILED) {\n                    peg$reportedPos = s0;\n                    s1 = peg$c48();\n                  }\n                  s0 = s1;\n                  if (s0 === peg$FAILED) {\n                    s0 = peg$currPos;\n                    s1 = peg$c49;\n                    if (s1 !== peg$FAILED) {\n                      peg$reportedPos = s0;\n                      s1 = peg$c50();\n                    }\n                    s0 = s1;\n                  }\n                }\n              }\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepredicateList() {\n          var s0;\n    \n          s0 = peg$parsesimplePredicate();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parsepredicateListWithParens();\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsesimplePredicate() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          s1 = peg$parsepercentage();\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c51(s1);\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            s1 = peg$parsenumber();\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c52(s1);\n            }\n            s0 = s1;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepredicateListWithParens() {\n          var s0, s1, s2, s3, s4, s5, s6;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 40) {\n            s1 = peg$c53;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c54);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsepredicate();\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              s4 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 44) {\n                s5 = peg$c32;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c33);\n                }\n              }\n              if (s5 !== peg$FAILED) {\n                s6 = peg$parsepredicate();\n                if (s6 !== peg$FAILED) {\n                  s5 = [s5, s6];\n                  s4 = s5;\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              } else {\n                peg$currPos = s4;\n                s4 = peg$c0;\n              }\n              while (s4 !== peg$FAILED) {\n                s3.push(s4);\n                s4 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 44) {\n                  s5 = peg$c32;\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c33);\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  s6 = peg$parsepredicate();\n                  if (s6 !== peg$FAILED) {\n                    s5 = [s5, s6];\n                    s4 = s5;\n                  } else {\n                    peg$currPos = s4;\n                    s4 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 41) {\n                  s4 = peg$c55;\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c56);\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c57(s2, s3);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepredicate() {\n          var s0, s1, s2, s3, s4, s5;\n    \n          s0 = peg$currPos;\n          s1 = peg$parserelation();\n          if (s1 === peg$FAILED) {\n            s1 = peg$c4;\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseobjectOfPredicate();\n            if (s2 !== peg$FAILED) {\n              s3 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 64) {\n                s4 = peg$c58;\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c59);\n                }\n              }\n              if (s4 !== peg$FAILED) {\n                s5 = peg$parsepriority();\n                if (s5 !== peg$FAILED) {\n                  s4 = [s4, s5];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$c0;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$c0;\n              }\n              if (s3 === peg$FAILED) {\n                s3 = peg$c4;\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c60(s1, s2, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseequalSpacingPredicateList() {\n          var s0, s1, s2, s3, s4, s5, s6;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 40) {\n            s1 = peg$c53;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c54);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseequalSpacingPredicate();\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              s4 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 44) {\n                s5 = peg$c32;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c33);\n                }\n              }\n              if (s5 !== peg$FAILED) {\n                s6 = peg$parseequalSpacingPredicate();\n                if (s6 !== peg$FAILED) {\n                  s5 = [s5, s6];\n                  s4 = s5;\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              } else {\n                peg$currPos = s4;\n                s4 = peg$c0;\n              }\n              while (s4 !== peg$FAILED) {\n                s3.push(s4);\n                s4 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 44) {\n                  s5 = peg$c32;\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c33);\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  s6 = peg$parseequalSpacingPredicate();\n                  if (s6 !== peg$FAILED) {\n                    s5 = [s5, s6];\n                    s4 = s5;\n                  } else {\n                    peg$currPos = s4;\n                    s4 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s4;\n                  s4 = peg$c0;\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 41) {\n                  s4 = peg$c55;\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c56);\n                  }\n                }\n                if (s4 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c57(s2, s3);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseequalSpacingPredicate() {\n          var s0, s1, s2, s3, s4, s5;\n    \n          s0 = peg$currPos;\n          s1 = peg$parserelation();\n          if (s1 === peg$FAILED) {\n            s1 = peg$c4;\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseobjectOfPredicate();\n            if (s2 !== peg$FAILED) {\n              s3 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 64) {\n                s4 = peg$c58;\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c59);\n                }\n              }\n              if (s4 !== peg$FAILED) {\n                s5 = peg$parsepriority();\n                if (s5 !== peg$FAILED) {\n                  s4 = [s4, s5];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$c0;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$c0;\n              }\n              if (s3 === peg$FAILED) {\n                s3 = peg$c4;\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c61(s1, s2, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parserelation() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 2) === peg$c62) {\n            s1 = peg$c62;\n            peg$currPos += 2;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c63);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c64();\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.substr(peg$currPos, 2) === peg$c65) {\n              s1 = peg$c65;\n              peg$currPos += 2;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c66);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c67();\n            }\n            s0 = s1;\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.substr(peg$currPos, 2) === peg$c68) {\n                s1 = peg$c68;\n                peg$currPos += 2;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c69);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c70();\n              }\n              s0 = s1;\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseobjectOfPredicate() {\n          var s0;\n    \n          s0 = peg$parsepercentage();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parseconstant();\n            if (s0 === peg$FAILED) {\n              s0 = peg$parseviewPredicate();\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepriority() {\n          var s0, s1, s2;\n    \n          s0 = peg$currPos;\n          s1 = [];\n          if (peg$c71.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c72);\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            while (s2 !== peg$FAILED) {\n              s1.push(s2);\n              if (peg$c71.test(input.charAt(peg$currPos))) {\n                s2 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s2 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c72);\n                }\n              }\n            }\n          } else {\n            s1 = peg$c0;\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c73(s1);\n          }\n          s0 = s1;\n    \n          return s0;\n        }\n    \n        function peg$parseconstant() {\n          var s0, s1, s2;\n    \n          s0 = peg$currPos;\n          s1 = peg$parsenumber();\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c74(s1);\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 45) {\n              s1 = peg$c42;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c43);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parsenumber();\n              if (s2 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c75(s2);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 43) {\n                s1 = peg$c76;\n                peg$currPos++;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c77);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                s2 = peg$parsenumber();\n                if (s2 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c74(s2);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsepercentage() {\n          var s0, s1, s2, s3;\n    \n          s0 = peg$currPos;\n          s1 = peg$parsenumber();\n          if (s1 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 37) {\n              s2 = peg$c78;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c79);\n              }\n            }\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c80(s1);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 45) {\n              s1 = peg$c42;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c43);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parsenumber();\n              if (s2 !== peg$FAILED) {\n                if (input.charCodeAt(peg$currPos) === 37) {\n                  s3 = peg$c78;\n                  peg$currPos++;\n                } else {\n                  s3 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c79);\n                  }\n                }\n                if (s3 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c81(s2);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 43) {\n                s1 = peg$c76;\n                peg$currPos++;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c77);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                s2 = peg$parsenumber();\n                if (s2 !== peg$FAILED) {\n                  if (input.charCodeAt(peg$currPos) === 37) {\n                    s3 = peg$c78;\n                    peg$currPos++;\n                  } else {\n                    s3 = peg$FAILED;\n                    if (peg$silentFails === 0) {\n                      peg$fail(peg$c79);\n                    }\n                  }\n                  if (s3 !== peg$FAILED) {\n                    peg$reportedPos = s0;\n                    s1 = peg$c80(s2);\n                    s0 = s1;\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseviewPredicate() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = peg$parseviewName();\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parseattribute();\n            if (s2 === peg$FAILED) {\n              s2 = peg$c4;\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parsemultiplier();\n              if (s3 === peg$FAILED) {\n                s3 = peg$c4;\n              }\n              if (s3 !== peg$FAILED) {\n                s4 = peg$parseconstantExpr();\n                if (s4 === peg$FAILED) {\n                  s4 = peg$c4;\n                }\n                if (s4 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c82(s1, s2, s3, s4);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseattribute() {\n          var s0, s1;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 5) === peg$c83) {\n            s1 = peg$c83;\n            peg$currPos += 5;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c84);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            peg$reportedPos = s0;\n            s1 = peg$c85();\n          }\n          s0 = s1;\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.substr(peg$currPos, 6) === peg$c86) {\n              s1 = peg$c86;\n              peg$currPos += 6;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c87);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c88();\n            }\n            s0 = s1;\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.substr(peg$currPos, 4) === peg$c89) {\n                s1 = peg$c89;\n                peg$currPos += 4;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c90);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c91();\n              }\n              s0 = s1;\n              if (s0 === peg$FAILED) {\n                s0 = peg$currPos;\n                if (input.substr(peg$currPos, 7) === peg$c92) {\n                  s1 = peg$c92;\n                  peg$currPos += 7;\n                } else {\n                  s1 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c93);\n                  }\n                }\n                if (s1 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c94();\n                }\n                s0 = s1;\n                if (s0 === peg$FAILED) {\n                  s0 = peg$currPos;\n                  if (input.substr(peg$currPos, 6) === peg$c95) {\n                    s1 = peg$c95;\n                    peg$currPos += 6;\n                  } else {\n                    s1 = peg$FAILED;\n                    if (peg$silentFails === 0) {\n                      peg$fail(peg$c96);\n                    }\n                  }\n                  if (s1 !== peg$FAILED) {\n                    peg$reportedPos = s0;\n                    s1 = peg$c97();\n                  }\n                  s0 = s1;\n                  if (s0 === peg$FAILED) {\n                    s0 = peg$currPos;\n                    if (input.substr(peg$currPos, 7) === peg$c98) {\n                      s1 = peg$c98;\n                      peg$currPos += 7;\n                    } else {\n                      s1 = peg$FAILED;\n                      if (peg$silentFails === 0) {\n                        peg$fail(peg$c99);\n                      }\n                    }\n                    if (s1 !== peg$FAILED) {\n                      peg$reportedPos = s0;\n                      s1 = peg$c100();\n                    }\n                    s0 = s1;\n                    if (s0 === peg$FAILED) {\n                      s0 = peg$currPos;\n                      if (input.substr(peg$currPos, 8) === peg$c101) {\n                        s1 = peg$c101;\n                        peg$currPos += 8;\n                      } else {\n                        s1 = peg$FAILED;\n                        if (peg$silentFails === 0) {\n                          peg$fail(peg$c102);\n                        }\n                      }\n                      if (s1 !== peg$FAILED) {\n                        peg$reportedPos = s0;\n                        s1 = peg$c103();\n                      }\n                      s0 = s1;\n                      if (s0 === peg$FAILED) {\n                        s0 = peg$currPos;\n                        if (input.substr(peg$currPos, 8) === peg$c104) {\n                          s1 = peg$c104;\n                          peg$currPos += 8;\n                        } else {\n                          s1 = peg$FAILED;\n                          if (peg$silentFails === 0) {\n                            peg$fail(peg$c105);\n                          }\n                        }\n                        if (s1 !== peg$FAILED) {\n                          peg$reportedPos = s0;\n                          s1 = peg$c106();\n                        }\n                        s0 = s1;\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsemultiplier() {\n          var s0, s1, s2;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 47) {\n            s1 = peg$c107;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c108);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsenumber();\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c109(s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.substr(peg$currPos, 2) === peg$c110) {\n              s1 = peg$c110;\n              peg$currPos += 2;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c111);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parsenumber();\n              if (s2 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c109(s2);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n            if (s0 === peg$FAILED) {\n              s0 = peg$currPos;\n              if (input.substr(peg$currPos, 2) === peg$c112) {\n                s1 = peg$c112;\n                peg$currPos += 2;\n              } else {\n                s1 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c113);\n                }\n              }\n              if (s1 !== peg$FAILED) {\n                s2 = peg$parsenumber();\n                if (s2 !== peg$FAILED) {\n                  peg$reportedPos = s0;\n                  s1 = peg$c114(s2);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n              if (s0 === peg$FAILED) {\n                s0 = peg$currPos;\n                if (input.charCodeAt(peg$currPos) === 42) {\n                  s1 = peg$c115;\n                  peg$currPos++;\n                } else {\n                  s1 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c116);\n                  }\n                }\n                if (s1 !== peg$FAILED) {\n                  s2 = peg$parsenumber();\n                  if (s2 !== peg$FAILED) {\n                    peg$reportedPos = s0;\n                    s1 = peg$c117(s2);\n                    s0 = s1;\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$c0;\n                }\n                if (s0 === peg$FAILED) {\n                  s0 = peg$currPos;\n                  if (input.substr(peg$currPos, 2) === peg$c118) {\n                    s1 = peg$c118;\n                    peg$currPos += 2;\n                  } else {\n                    s1 = peg$FAILED;\n                    if (peg$silentFails === 0) {\n                      peg$fail(peg$c119);\n                    }\n                  }\n                  if (s1 !== peg$FAILED) {\n                    s2 = peg$parsenumber();\n                    if (s2 !== peg$FAILED) {\n                      peg$reportedPos = s0;\n                      s1 = peg$c117(s2);\n                      s0 = s1;\n                    } else {\n                      peg$currPos = s0;\n                      s0 = peg$c0;\n                    }\n                  } else {\n                    peg$currPos = s0;\n                    s0 = peg$c0;\n                  }\n                  if (s0 === peg$FAILED) {\n                    s0 = peg$currPos;\n                    if (input.substr(peg$currPos, 2) === peg$c120) {\n                      s1 = peg$c120;\n                      peg$currPos += 2;\n                    } else {\n                      s1 = peg$FAILED;\n                      if (peg$silentFails === 0) {\n                        peg$fail(peg$c121);\n                      }\n                    }\n                    if (s1 !== peg$FAILED) {\n                      s2 = peg$parsenumber();\n                      if (s2 !== peg$FAILED) {\n                        peg$reportedPos = s0;\n                        s1 = peg$c122(s2);\n                        s0 = s1;\n                      } else {\n                        peg$currPos = s0;\n                        s0 = peg$c0;\n                      }\n                    } else {\n                      peg$currPos = s0;\n                      s0 = peg$c0;\n                    }\n                  }\n                }\n              }\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseconstantExpr() {\n          var s0, s1, s2;\n    \n          s0 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 45) {\n            s1 = peg$c42;\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c43);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = peg$parsenumber();\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c122(s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 43) {\n              s1 = peg$c76;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c77);\n              }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parsenumber();\n              if (s2 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c117(s2);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseviewNameRange() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = peg$currPos;\n          s2 = [];\n          if (peg$c123.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c124);\n            }\n          }\n          if (s3 !== peg$FAILED) {\n            while (s3 !== peg$FAILED) {\n              s2.push(s3);\n              if (peg$c123.test(input.charAt(peg$currPos))) {\n                s3 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s3 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c124);\n                }\n              }\n            }\n          } else {\n            s2 = peg$c0;\n          }\n          if (s2 !== peg$FAILED) {\n            s2 = input.substring(s1, peg$currPos);\n          }\n          s1 = s2;\n          if (s1 !== peg$FAILED) {\n            s2 = peg$currPos;\n            s3 = [];\n            if (peg$c125.test(input.charAt(peg$currPos))) {\n              s4 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c126);\n              }\n            }\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c125.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c126);\n                }\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              s3 = input.substring(s2, peg$currPos);\n            }\n            s2 = s3;\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parserange();\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c127(s1, s2, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            s1 = peg$currPos;\n            s2 = [];\n            if (peg$c123.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c124);\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              while (s3 !== peg$FAILED) {\n                s2.push(s3);\n                if (peg$c123.test(input.charAt(peg$currPos))) {\n                  s3 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s3 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c124);\n                  }\n                }\n              }\n            } else {\n              s2 = peg$c0;\n            }\n            if (s2 !== peg$FAILED) {\n              s2 = input.substring(s1, peg$currPos);\n            }\n            s1 = s2;\n            if (s1 !== peg$FAILED) {\n              s2 = peg$currPos;\n              s3 = [];\n              if (peg$c125.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c126);\n                }\n              }\n              while (s4 !== peg$FAILED) {\n                s3.push(s4);\n                if (peg$c125.test(input.charAt(peg$currPos))) {\n                  s4 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s4 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c126);\n                  }\n                }\n              }\n              if (s3 !== peg$FAILED) {\n                s3 = input.substring(s2, peg$currPos);\n              }\n              s2 = s3;\n              if (s2 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c128(s1, s2);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          }\n    \n          return s0;\n        }\n    \n        function peg$parseviewName() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = peg$currPos;\n          s2 = [];\n          if (peg$c123.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c124);\n            }\n          }\n          if (s3 !== peg$FAILED) {\n            while (s3 !== peg$FAILED) {\n              s2.push(s3);\n              if (peg$c123.test(input.charAt(peg$currPos))) {\n                s3 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s3 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c124);\n                }\n              }\n            }\n          } else {\n            s2 = peg$c0;\n          }\n          if (s2 !== peg$FAILED) {\n            s2 = input.substring(s1, peg$currPos);\n          }\n          s1 = s2;\n          if (s1 !== peg$FAILED) {\n            s2 = peg$currPos;\n            s3 = [];\n            if (peg$c125.test(input.charAt(peg$currPos))) {\n              s4 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c126);\n              }\n            }\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c125.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c126);\n                }\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              s3 = input.substring(s2, peg$currPos);\n            }\n            s2 = s3;\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c128(s1, s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parserange() {\n          var s0, s1, s2, s3;\n    \n          s0 = peg$currPos;\n          if (input.substr(peg$currPos, 2) === peg$c129) {\n            s1 = peg$c129;\n            peg$currPos += 2;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c130);\n            }\n          }\n          if (s1 !== peg$FAILED) {\n            s2 = [];\n            if (peg$c71.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c72);\n              }\n            }\n            if (s3 !== peg$FAILED) {\n              while (s3 !== peg$FAILED) {\n                s2.push(s3);\n                if (peg$c71.test(input.charAt(peg$currPos))) {\n                  s3 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s3 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c72);\n                  }\n                }\n              }\n            } else {\n              s2 = peg$c0;\n            }\n            if (s2 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c131(s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n    \n          return s0;\n        }\n    \n        function peg$parsenumber() {\n          var s0, s1, s2, s3, s4;\n    \n          s0 = peg$currPos;\n          s1 = [];\n          if (peg$c71.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) {\n              peg$fail(peg$c72);\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            while (s2 !== peg$FAILED) {\n              s1.push(s2);\n              if (peg$c71.test(input.charAt(peg$currPos))) {\n                s2 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s2 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c72);\n                }\n              }\n            }\n          } else {\n            s1 = peg$c0;\n          }\n          if (s1 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 46) {\n              s2 = peg$c132;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c133);\n              }\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = [];\n              if (peg$c71.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) {\n                  peg$fail(peg$c72);\n                }\n              }\n              if (s4 !== peg$FAILED) {\n                while (s4 !== peg$FAILED) {\n                  s3.push(s4);\n                  if (peg$c71.test(input.charAt(peg$currPos))) {\n                    s4 = input.charAt(peg$currPos);\n                    peg$currPos++;\n                  } else {\n                    s4 = peg$FAILED;\n                    if (peg$silentFails === 0) {\n                      peg$fail(peg$c72);\n                    }\n                  }\n                }\n              } else {\n                s3 = peg$c0;\n              }\n              if (s3 !== peg$FAILED) {\n                peg$reportedPos = s0;\n                s1 = peg$c134(s1, s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$c0;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$c0;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$c0;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            s1 = [];\n            if (peg$c71.test(input.charAt(peg$currPos))) {\n              s2 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) {\n                peg$fail(peg$c72);\n              }\n            }\n            if (s2 !== peg$FAILED) {\n              while (s2 !== peg$FAILED) {\n                s1.push(s2);\n                if (peg$c71.test(input.charAt(peg$currPos))) {\n                  s2 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s2 = peg$FAILED;\n                  if (peg$silentFails === 0) {\n                    peg$fail(peg$c72);\n                  }\n                }\n              }\n            } else {\n              s1 = peg$c0;\n            }\n            if (s1 !== peg$FAILED) {\n              peg$reportedPos = s0;\n              s1 = peg$c135(s1);\n            }\n            s0 = s1;\n          }\n    \n          return s0;\n        }\n    \n        function extend(dst) {\n          for (var i = 1; i < arguments.length; i++) {\n            for (var k in arguments[i]) {\n              dst[k] = arguments[i][k];\n            }\n          }\n          return dst;\n        }\n    \n        peg$result = peg$startRuleFunction();\n    \n        if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n          return peg$result;\n        } else {\n          if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n            peg$fail({ type: \"end\", description: \"end of input\" });\n          }\n    \n          throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos);\n        }\n      }\n    \n      return {\n        SyntaxError: SyntaxError,\n        parse: parse\n      };\n    }();\n    \n    var Orientation = {\n      HORIZONTAL: 1,\n      VERTICAL: 2,\n      ZINDEX: 4\n    };\n    \n    /**\n     * Helper function that inserts equal spacers (~).\n     * @private\n     */\n    function _processEqualSpacer(context, stackView) {\n    \n      // Determine unique name for the spacer\n      context.equalSpacerIndex = context.equalSpacerIndex || 1;\n      var name = '_~' + context.lineIndex + ':' + context.equalSpacerIndex + '~';\n      if (context.equalSpacerIndex > 1) {\n    \n        // Ensure that all spacers have the same width/height\n        context.constraints.push({\n          view1: '_~' + context.lineIndex + ':1~',\n          attr1: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n          relation: context.relation.relation || Relation.EQU,\n          view2: name,\n          attr2: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n          priority: context.relation.priority\n        });\n      }\n      context.equalSpacerIndex++;\n    \n      // Enforce view/proportional width/height\n      if (context.relation.view || context.relation.multiplier && context.relation.multiplier !== 1) {\n        context.constraints.push({\n          view1: name,\n          attr1: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n          relation: context.relation.relation || Relation.EQU,\n          view2: context.relation.view,\n          attr2: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n          priority: context.relation.priority,\n          multiplier: context.relation.multiplier\n        });\n        context.relation.multiplier = undefined;\n      } else if (context.relation.constant) {\n        context.constraints.push({\n          view1: name,\n          attr1: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n          relation: Relation.EQU,\n          view2: null,\n          attr2: Attribute.CONST,\n          priority: context.relation.priority,\n          constant: context.relation.constant\n        });\n        context.relation.constant = undefined;\n      }\n    \n      // Add constraint\n      for (var i = 0; i < context.prevViews.length; i++) {\n        var prevView = context.prevViews[i];\n        switch (context.orientation) {\n          case Orientation.HORIZONTAL:\n            context.prevAttr = prevView !== stackView ? Attribute.RIGHT : Attribute.LEFT;\n            context.curAttr = Attribute.LEFT;\n            break;\n          case Orientation.VERTICAL:\n            context.prevAttr = prevView !== stackView ? Attribute.BOTTOM : Attribute.TOP;\n            context.curAttr = Attribute.TOP;\n            break;\n          case Orientation.ZINDEX:\n            context.prevAttr = Attribute.ZINDEX;\n            context.curAttr = Attribute.ZINDEX;\n            context.relation.constant = prevView !== stackView ? 'default' : 0;\n            break;\n        }\n        context.constraints.push({\n          view1: prevView,\n          attr1: context.prevAttr,\n          relation: context.relation.relation,\n          view2: name,\n          attr2: context.curAttr,\n          priority: context.relation.priority\n        });\n      }\n      context.prevViews = [name];\n    }\n    \n    /**\n     * Helper function that inserts proportional spacers (-12%-).\n     * @private\n     */\n    function _processProportionalSpacer(context, stackView) {\n      context.proportionalSpacerIndex = context.proportionalSpacerIndex || 1;\n      var name = '_-' + context.lineIndex + ':' + context.proportionalSpacerIndex + '-';\n      context.proportionalSpacerIndex++;\n      context.constraints.push({\n        view1: name,\n        attr1: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n        relation: context.relation.relation || Relation.EQU,\n        view2: context.relation.view, // or relative to the stackView... food for thought\n        attr2: context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT,\n        priority: context.relation.priority,\n        multiplier: context.relation.multiplier\n      });\n      context.relation.multiplier = undefined;\n    \n      // Add constraint\n      for (var i = 0; i < context.prevViews.length; i++) {\n        var prevView = context.prevViews[i];\n        switch (context.orientation) {\n          case Orientation.HORIZONTAL:\n            context.prevAttr = prevView !== stackView ? Attribute.RIGHT : Attribute.LEFT;\n            context.curAttr = Attribute.LEFT;\n            break;\n          case Orientation.VERTICAL:\n            context.prevAttr = prevView !== stackView ? Attribute.BOTTOM : Attribute.TOP;\n            context.curAttr = Attribute.TOP;\n            break;\n          case Orientation.ZINDEX:\n            context.prevAttr = Attribute.ZINDEX;\n            context.curAttr = Attribute.ZINDEX;\n            context.relation.constant = prevView !== stackView ? 'default' : 0;\n            break;\n        }\n        context.constraints.push({\n          view1: prevView,\n          attr1: context.prevAttr,\n          relation: context.relation.relation,\n          view2: name,\n          attr2: context.curAttr,\n          priority: context.relation.priority\n        });\n      }\n      context.prevViews = [name];\n    }\n    \n    /**\n     * In case of a stack-view, set constraints for opposite orientations\n     * @private\n     */\n    function _processStackView(context, name, subView) {\n      var viewName = void 0;\n      for (var orientation = 1; orientation <= 4; orientation *= 2) {\n        if (subView.orientations & orientation && subView.stack.orientation !== orientation && !(subView.stack.processedOrientations & orientation)) {\n          subView.stack.processedOrientations = subView.stack.processedOrientations | orientation;\n          viewName = viewName || {\n            name: name,\n            type: 'stack'\n          };\n          for (var i = 0, j = subView.stack.subViews.length; i < j; i++) {\n            if (orientation === Orientation.ZINDEX) {\n              context.constraints.push({\n                view1: viewName,\n                attr1: Attribute.ZINDEX,\n                relation: Relation.EQU,\n                view2: subView.stack.subViews[i],\n                attr2: Attribute.ZINDEX\n              });\n            } else {\n              context.constraints.push({\n                view1: viewName,\n                attr1: orientation === Orientation.VERTICAL ? Attribute.HEIGHT : Attribute.WIDTH,\n                relation: Relation.EQU,\n                view2: subView.stack.subViews[i],\n                attr2: orientation === Orientation.VERTICAL ? Attribute.HEIGHT : Attribute.WIDTH\n              });\n              context.constraints.push({\n                view1: viewName,\n                attr1: orientation === Orientation.VERTICAL ? Attribute.TOP : Attribute.LEFT,\n                relation: Relation.EQU,\n                view2: subView.stack.subViews[i],\n                attr2: orientation === Orientation.VERTICAL ? Attribute.TOP : Attribute.LEFT\n              });\n            }\n          }\n        }\n      }\n    }\n    \n    /**\n     * Recursive helper function converts a view-name and a range to a series\n     * of view-names (e.g. [child1, child2, child3, ...]).\n     * @private\n     */\n    function _getRange(name, range) {\n      if (range === true) {\n        range = name.match(/\\.\\.\\d+$/);\n        if (range) {\n          name = name.substring(0, name.length - range[0].length);\n          range = parseInt(range[0].substring(2));\n        }\n      }\n      if (!range) {\n        return [name];\n      }\n      var start = name.match(/\\d+$/);\n      var res = [];\n      var i;\n      if (start) {\n        name = name.substring(0, name.length - start[0].length);\n        for (i = parseInt(start); i <= range; i++) {\n          res.push(name + i);\n        }\n      } else {\n        res.push(name);\n        for (i = 2; i <= range; i++) {\n          res.push(name + i);\n        }\n      }\n      return res;\n    }\n    \n    /**\n     * Recursive helper function that processes the cascaded data.\n     * @private\n     */\n    function _processCascade(context, cascade, parentItem) {\n      var stackView = parentItem ? parentItem.view : null;\n      var subViews = [];\n      var curViews = [];\n      var subView = void 0;\n      if (stackView) {\n        cascade.push({ view: stackView });\n        curViews.push(stackView);\n      }\n      for (var i = 0; i < cascade.length; i++) {\n        var item = cascade[i];\n        if (!Array.isArray(item) && item.hasOwnProperty('view') || Array.isArray(item) && item[0].view && !item[0].relation) {\n          var items = Array.isArray(item) ? item : [item];\n          for (var z = 0; z < items.length; z++) {\n            item = items[z];\n            var viewRange = item === ',' ? [] : item.view ? _getRange(item.view, item.range) : [null];\n            for (var r = 0; r < viewRange.length; r++) {\n              var curView = viewRange[r];\n              curViews.push(curView);\n    \n              //\n              // Add this view to the collection of subViews\n              //\n              if (curView !== stackView) {\n                subViews.push(curView);\n                subView = context.subViews[curView];\n                if (!subView) {\n                  subView = { orientations: 0 };\n                  context.subViews[curView] = subView;\n                }\n                subView.orientations = subView.orientations | context.orientation;\n                if (subView.stack) {\n                  _processStackView(context, curView, subView);\n                }\n              }\n    \n              //\n              // Process the relationship between this and the previous views\n              //\n              if (context.prevViews !== undefined && curView !== undefined && context.relation) {\n                if (context.relation.relation !== 'none') {\n                  for (var p = 0; p < context.prevViews.length; p++) {\n                    var prevView = context.prevViews[p];\n                    switch (context.orientation) {\n                      case Orientation.HORIZONTAL:\n                        context.prevAttr = prevView !== stackView ? Attribute.RIGHT : Attribute.LEFT;\n                        context.curAttr = curView !== stackView ? Attribute.LEFT : Attribute.RIGHT;\n                        break;\n                      case Orientation.VERTICAL:\n                        context.prevAttr = prevView !== stackView ? Attribute.BOTTOM : Attribute.TOP;\n                        context.curAttr = curView !== stackView ? Attribute.TOP : Attribute.BOTTOM;\n                        break;\n                      case Orientation.ZINDEX:\n                        context.prevAttr = Attribute.ZINDEX;\n                        context.curAttr = Attribute.ZINDEX;\n                        context.relation.constant = !prevView ? 0 : context.relation.constant || 'default';\n                        break;\n                    }\n                    context.constraints.push({\n                      view1: prevView,\n                      attr1: context.prevAttr,\n                      relation: context.relation.relation,\n                      view2: curView,\n                      attr2: context.curAttr,\n                      multiplier: context.relation.multiplier,\n                      constant: context.relation.constant === 'default' || !context.relation.constant ? context.relation.constant : -context.relation.constant,\n                      priority: context.relation.priority\n                    });\n                  }\n                }\n              }\n    \n              //\n              // Process view size constraints\n              //\n              var constraints = item.constraints;\n              if (constraints) {\n                for (var n = 0; n < constraints.length; n++) {\n                  context.prevAttr = context.horizontal ? Attribute.WIDTH : Attribute.HEIGHT;\n                  context.curAttr = constraints[n].view || constraints[n].multiplier ? constraints[n].attribute || context.prevAttr : constraints[n].variable ? Attribute.VARIABLE : Attribute.CONST;\n                  context.constraints.push({\n                    view1: curView,\n                    attr1: context.prevAttr,\n                    relation: constraints[n].relation,\n                    view2: constraints[n].view,\n                    attr2: context.curAttr,\n                    multiplier: constraints[n].multiplier,\n                    constant: constraints[n].constant,\n                    priority: constraints[n].priority\n                  });\n                }\n              }\n    \n              //\n              // Process cascaded data (child stack-views)\n              //\n              if (item.cascade) {\n                _processCascade(context, item.cascade, item);\n              }\n            }\n          }\n        } else if (item !== ',') {\n          context.prevViews = curViews;\n          curViews = [];\n          context.relation = item[0];\n          if (context.prevViews !== undefined) {\n            if (context.relation.equalSpacing) {\n              _processEqualSpacer(context, stackView);\n            }\n            if (context.relation.multiplier) {\n              _processProportionalSpacer(context, stackView);\n            }\n          }\n        }\n      }\n    \n      if (stackView) {\n        subView = context.subViews[stackView];\n        if (!subView) {\n          subView = { orientations: context.orientation };\n          context.subViews[stackView] = subView;\n        } else if (subView.stack) {\n          var err = new Error('A stack named \"' + stackView + '\" has already been created');\n          err.column = parentItem.$parserOffset + 1;\n          throw err;\n        }\n        subView.stack = {\n          orientation: context.orientation,\n          processedOrientations: context.orientation,\n          subViews: subViews\n        };\n        _processStackView(context, stackView, subView);\n      }\n    }\n    \n    var metaInfoCategories = ['viewport', 'spacing', 'colors', 'shapes', 'widths', 'heights'];\n    \n    /**\n     * VisualFormat\n     *\n     * @namespace VisualFormat\n     */\n    \n    var VisualFormat = function () {\n      function VisualFormat() {\n        _classCallCheck(this, VisualFormat);\n      }\n    \n      _createClass(VisualFormat, null, [{\n        key: 'parseLine',\n    \n    \n        /**\n         * Parses a single line of vfl into an array of constraint definitions.\n         *\n         * When the visual-format could not be succesfully parsed an exception is thrown containing\n         * additional info about the parse error and column position.\n         *\n         * @param {String} visualFormat Visual format string (cannot contain line-endings!).\n         * @param {Object} [options] Configuration options.\n         * @param {Boolean} [options.extended] When set to true uses the extended syntax (default: false).\n         * @param {String} [options.outFormat] Output format (`constraints` or `raw`) (default: `constraints`).\n         * @param {Number} [options.lineIndex] Line-index used when auto generating equal-spacing constraints.\n         * @return {Array} Array of constraint definitions.\n         */\n        value: function parseLine(visualFormat, options) {\n          if (visualFormat.length === 0 || options && options.extended && visualFormat.indexOf('//') === 0) {\n            return [];\n          }\n          var res = options && options.extended ? parserExt.parse(visualFormat) : parser.parse(visualFormat);\n          if (options && options.outFormat === 'raw') {\n            return [res];\n          }\n          var context = {\n            constraints: [],\n            lineIndex: (options ? options.lineIndex : undefined) || 1,\n            subViews: (options ? options.subViews : undefined) || {}\n          };\n          if (res.type === 'attribute') {\n            for (var n = 0; n < res.attributes.length; n++) {\n              var attr = res.attributes[n];\n              for (var m = 0; m < attr.predicates.length; m++) {\n                var predicate = attr.predicates[m];\n                context.constraints.push({\n                  view1: res.view,\n                  attr1: attr.attr,\n                  relation: predicate.relation,\n                  view2: predicate.view,\n                  attr2: predicate.attribute || attr.attr,\n                  multiplier: predicate.multiplier,\n                  constant: predicate.constant,\n                  priority: predicate.priority\n                });\n              }\n            }\n          } else {\n            switch (res.orientation) {\n              case 'horizontal':\n                context.orientation = Orientation.HORIZONTAL;\n                context.horizontal = true;\n                _processCascade(context, res.cascade, null);\n                break;\n              case 'vertical':\n                context.orientation = Orientation.VERTICAL;\n                _processCascade(context, res.cascade, null);\n                break;\n              case 'horzvert':\n                context.orientation = Orientation.HORIZONTAL;\n                context.horizontal = true;\n                _processCascade(context, res.cascade, null);\n                context = {\n                  constraints: context.constraints,\n                  lineIndex: context.lineIndex,\n                  subViews: context.subViews,\n                  orientation: Orientation.VERTICAL\n                };\n                _processCascade(context, res.cascade, null);\n                break;\n              case 'zIndex':\n                context.orientation = Orientation.ZINDEX;\n                _processCascade(context, res.cascade, null);\n                break;\n            }\n          }\n          return context.constraints;\n        }\n    \n        /**\n         * Parses one or more visual format strings into an array of constraint definitions.\n         *\n         * When the visual-format could not be succesfully parsed an exception is thrown containing\n         * additional info about the parse error and column position.\n         *\n         * @param {String|Array} visualFormat One or more visual format strings.\n         * @param {Object} [options] Configuration options.\n         * @param {Boolean} [options.extended] When set to true uses the extended syntax (default: false).\n         * @param {Boolean} [options.strict] When set to false trims any leading/trailing spaces and ignores empty lines (default: true).\n         * @param {String} [options.lineSeparator] String that defines the end of a line (default `\\n`).\n         * @param {String} [options.outFormat] Output format (`constraints` or `raw`) (default: `constraints`).\n         * @return {Array} Array of constraint definitions.\n         */\n    \n      }, {\n        key: 'parse',\n        value: function parse(visualFormat, options) {\n          var lineSeparator = options && options.lineSeparator ? options.lineSeparator : '\\n';\n          if (!Array.isArray(visualFormat) && visualFormat.indexOf(lineSeparator) < 0) {\n            try {\n              return this.parseLine(visualFormat, options);\n            } catch (err) {\n              err.source = visualFormat;\n              throw err;\n            }\n          }\n    \n          // Decompose visual-format into an array of strings, and within those strings\n          // search for line-endings, and treat each line as a seperate visual-format.\n          visualFormat = Array.isArray(visualFormat) ? visualFormat : [visualFormat];\n          var lines = void 0;\n          var constraints = [];\n          var lineIndex = 0;\n          var line = void 0;\n          var parseOptions = {\n            lineIndex: lineIndex,\n            extended: options && options.extended,\n            strict: options && options.strict !== undefined ? options.strict : true,\n            outFormat: options ? options.outFormat : undefined,\n            subViews: {}\n          };\n          try {\n            for (var i = 0; i < visualFormat.length; i++) {\n              lines = visualFormat[i].split(lineSeparator);\n              for (var j = 0; j < lines.length; j++) {\n                line = lines[j];\n                lineIndex++;\n                parseOptions.lineIndex = lineIndex;\n                if (!parseOptions.strict) {\n                  line = line.trim();\n                }\n                if (parseOptions.strict || line.length) {\n                  constraints = constraints.concat(this.parseLine(line, parseOptions));\n                }\n              }\n            }\n          } catch (err) {\n            err.source = line;\n            err.line = lineIndex;\n            throw err;\n          }\n          return constraints;\n        }\n    \n        /**\n         * Parses meta information from the comments in the VFL.\n         *\n         * Additional meta information can be specified in the comments\n         * for previewing and rendering purposes. For instance, the view-port\n         * aspect-ratio, sub-view widths and colors, can be specified. The\n         * following example renders three colored circles in the visual-format editor:\n         *\n         * ```vfl\n         * //viewport aspect-ratio:3/1 max-height:300\n         * //colors red:#FF0000 green:#00FF00 blue:#0000FF\n         * //shapes red:circle green:circle blue:circle\n         * H:|-[row:[red(green,blue)]-[green]-[blue]]-|\n         * V:|[row]|\n         * ```\n         *\n         * Supported categories and properties:\n         *\n         * |Category|Property|Example|\n         * |--------|--------|-------|\n         * |`viewport`|`aspect-ratio:{width}/{height}`|`//viewport aspect-ratio:16/9`|\n         * ||`width:[{number}/intrinsic]`|`//viewport width:10`|\n         * ||`height:[{number}/intrinsic]`|`//viewport height:intrinsic`|\n         * ||`min-width:{number}`|\n         * ||`max-width:{number}`|\n         * ||`min-height:{number}`|\n         * ||`max-height:{number}`|\n         * |`spacing`|`[{number}/array]`|`//spacing:8` or `//spacing:[10, 20, 5]`|\n         * |`widths`|`{view-name}:[{number}/intrinsic]`|`//widths subview1:100`|\n         * |`heights`|`{view-name}:[{number}/intrinsic]`|`//heights subview1:intrinsic`|\n         * |`colors`|`{view-name}:{color}`|`//colors redview:#FF0000 blueview:#00FF00`|\n         * |`shapes`|`{view-name}:[circle/square]`|`//shapes avatar:circle`|\n         *\n         * @param {String|Array} visualFormat One or more visual format strings.\n         * @param {Object} [options] Configuration options.\n         * @param {String} [options.lineSeparator] String that defines the end of a line (default `\\n`).\n         * @param {String} [options.prefix] When specified, also processes the categories using that prefix (e.g. \"-dev-viewport max-height:10\").\n         * @return {Object} meta-info\n         */\n    \n      }, {\n        key: 'parseMetaInfo',\n        value: function parseMetaInfo(visualFormat, options) {\n          var lineSeparator = options && options.lineSeparator ? options.lineSeparator : '\\n';\n          var prefix = options ? options.prefix : undefined;\n          visualFormat = Array.isArray(visualFormat) ? visualFormat : [visualFormat];\n          var metaInfo = {};\n          var key;\n          for (var k = 0; k < visualFormat.length; k++) {\n            var lines = visualFormat[k].split(lineSeparator);\n            for (var i = 0; i < lines.length; i++) {\n              var line = lines[i];\n              for (var c = 0; c < metaInfoCategories.length; c++) {\n                for (var s = 0; s < (prefix ? 2 : 1); s++) {\n                  var category = metaInfoCategories[c];\n                  var prefixedCategory = (s === 0 ? '' : prefix) + category;\n                  if (line.indexOf('//' + prefixedCategory + ' ') === 0) {\n                    var items = line.substring(3 + prefixedCategory.length).split(' ');\n                    for (var j = 0; j < items.length; j++) {\n                      metaInfo[category] = metaInfo[category] || {};\n                      var item = items[j].split(':');\n                      var names = _getRange(item[0], true);\n                      for (var r = 0; r < names.length; r++) {\n                        metaInfo[category][names[r]] = item.length > 1 ? item[1] : '';\n                      }\n                    }\n                  } else if (line.indexOf('//' + prefixedCategory + ':') === 0) {\n                    metaInfo[category] = line.substring(3 + prefixedCategory.length);\n                  }\n                }\n              }\n            }\n          }\n          if (metaInfo.viewport) {\n            var viewport = metaInfo.viewport;\n            var aspectRatio = viewport['aspect-ratio'];\n            if (aspectRatio) {\n              aspectRatio = aspectRatio.split('/');\n              viewport['aspect-ratio'] = parseInt(aspectRatio[0]) / parseInt(aspectRatio[1]);\n            }\n            if (viewport.height !== undefined) {\n              viewport.height = viewport.height === 'intrinsic' ? true : parseInt(viewport.height);\n            }\n            if (viewport.width !== undefined) {\n              viewport.width = viewport.width === 'intrinsic' ? true : parseInt(viewport.width);\n            }\n            if (viewport['max-height'] !== undefined) {\n              viewport['max-height'] = parseInt(viewport['max-height']);\n            }\n            if (viewport['max-width'] !== undefined) {\n              viewport['max-width'] = parseInt(viewport['max-width']);\n            }\n            if (viewport['min-height'] !== undefined) {\n              viewport['min-height'] = parseInt(viewport['min-height']);\n            }\n            if (viewport['min-width'] !== undefined) {\n              viewport['min-width'] = parseInt(viewport['min-width']);\n            }\n          }\n          if (metaInfo.widths) {\n            for (key in metaInfo.widths) {\n              var width = metaInfo.widths[key] === 'intrinsic' ? true : parseInt(metaInfo.widths[key]);\n              metaInfo.widths[key] = width;\n              if (width === undefined || isNaN(width)) {\n                delete metaInfo.widths[key];\n              }\n            }\n          }\n          if (metaInfo.heights) {\n            for (key in metaInfo.heights) {\n              var height = metaInfo.heights[key] === 'intrinsic' ? true : parseInt(metaInfo.heights[key]);\n              metaInfo.heights[key] = height;\n              if (height === undefined || isNaN(height)) {\n                delete metaInfo.heights[key];\n              }\n            }\n          }\n          if (metaInfo.spacing) {\n            var value = JSON.parse(metaInfo.spacing);\n            metaInfo.spacing = value;\n            if (Array.isArray(value)) {\n              for (var sIdx = 0, len = value.length; sIdx < len; sIdx++) {\n                if (isNaN(value[sIdx])) {\n                  delete metaInfo.spacing;\n                  break;\n                }\n              }\n            } else if (value === undefined || isNaN(value)) {\n              delete metaInfo.spacing;\n            }\n          }\n          return metaInfo;\n        }\n      }]);\n    \n      return VisualFormat;\n    }();\n    \n    /**\n     * A SubView is automatically generated when constraints are added to a View.\n     *\n     * @namespace SubView\n     */\n    \n    \n    var SubView = function () {\n      function SubView(options) {\n        _classCallCheck(this, SubView);\n    \n        this._name = options.name;\n        this._type = options.type;\n        this._solver = options.solver;\n        this._attr = {};\n        if (!options.name) {\n          if (true) {\n            this._attr[Attribute.LEFT] = new c.Variable();\n            this._solver.addConstraint(new c.StayConstraint(this._attr[Attribute.LEFT], c.Strength.required));\n            this._attr[Attribute.TOP] = new c.Variable();\n            this._solver.addConstraint(new c.StayConstraint(this._attr[Attribute.TOP], c.Strength.required));\n            this._attr[Attribute.ZINDEX] = new c.Variable();\n            this._solver.addConstraint(new c.StayConstraint(this._attr[Attribute.ZINDEX], c.Strength.required));\n          } else {\n            this._attr[Attribute.LEFT] = new kiwi.Variable();\n            this._solver.addConstraint(new kiwi.Constraint(this._attr[Attribute.LEFT], kiwi.Operator.Eq, 0));\n            this._attr[Attribute.TOP] = new kiwi.Variable();\n            this._solver.addConstraint(new kiwi.Constraint(this._attr[Attribute.TOP], kiwi.Operator.Eq, 0));\n            this._attr[Attribute.ZINDEX] = new kiwi.Variable();\n            this._solver.addConstraint(new kiwi.Constraint(this._attr[Attribute.ZINDEX], kiwi.Operator.Eq, 0));\n          }\n        }\n      }\n    \n      _createClass(SubView, [{\n        key: 'toJSON',\n        value: function toJSON() {\n          return {\n            name: this.name,\n            left: this.left,\n            top: this.top,\n            width: this.width,\n            height: this.height\n          };\n        }\n      }, {\n        key: 'toString',\n        value: function toString() {\n          JSON.stringify(this.toJSON(), undefined, 2);\n        }\n    \n        /**\n         * Name of the sub-view.\n         * @readonly\n         * @type {String}\n         */\n    \n      }, {\n        key: 'getValue',\n    \n    \n        /**\n         * Gets the value of one of the attributes.\n         *\n         * @param {String|Attribute} attr Attribute name (e.g. 'right', 'centerY', Attribute.TOP).\n         * @return {Number} value or `undefined`\n         */\n        value: function getValue(attr) {\n          return this._attr[attr] ? this._attr[attr].value() : undefined;\n        }\n    \n        /**\n         * @private\n         */\n    \n      }, {\n        key: '_getAttr',\n        value: function _getAttr(attr) {\n          if (this._attr[attr]) {\n            return this._attr[attr];\n          }\n          this._attr[attr] = true ? new c.Variable() : new kiwi.Variable();\n          switch (attr) {\n            case Attribute.RIGHT:\n              this._getAttr(Attribute.LEFT);\n              this._getAttr(Attribute.WIDTH);\n              if (true) {\n                this._solver.addConstraint(new c.Equation(this._attr[attr], c.plus(this._attr[Attribute.LEFT], this._attr[Attribute.WIDTH])));\n              } else {\n                this._solver.addConstraint(new kiwi.Constraint(this._attr[attr], kiwi.Operator.Eq, this._attr[Attribute.LEFT].plus(this._attr[Attribute.WIDTH])));\n              }\n              break;\n            case Attribute.BOTTOM:\n              this._getAttr(Attribute.TOP);\n              this._getAttr(Attribute.HEIGHT);\n              if (true) {\n                this._solver.addConstraint(new c.Equation(this._attr[attr], c.plus(this._attr[Attribute.TOP], this._attr[Attribute.HEIGHT])));\n              } else {\n                this._solver.addConstraint(new kiwi.Constraint(this._attr[attr], kiwi.Operator.Eq, this._attr[Attribute.TOP].plus(this._attr[Attribute.HEIGHT])));\n              }\n              break;\n            case Attribute.CENTERX:\n              this._getAttr(Attribute.LEFT);\n              this._getAttr(Attribute.WIDTH);\n              if (true) {\n                this._solver.addConstraint(new c.Equation(this._attr[attr], c.plus(this._attr[Attribute.LEFT], c.divide(this._attr[Attribute.WIDTH], 2))));\n              } else {\n                this._solver.addConstraint(new kiwi.Constraint(this._attr[attr], kiwi.Operator.Eq, this._attr[Attribute.LEFT].plus(this._attr[Attribute.WIDTH].divide(2))));\n              }\n              break;\n            case Attribute.CENTERY:\n              this._getAttr(Attribute.TOP);\n              this._getAttr(Attribute.HEIGHT);\n              if (true) {\n                this._solver.addConstraint(new c.Equation(this._attr[attr], c.plus(this._attr[Attribute.TOP], c.divide(this._attr[Attribute.HEIGHT], 2))));\n              } else {\n                this._solver.addConstraint(new kiwi.Constraint(this._attr[attr], kiwi.Operator.Eq, this._attr[Attribute.TOP].plus(this._attr[Attribute.HEIGHT].divide(2))));\n              }\n              break;\n          }\n          if (!true) {\n            this._solver.updateVariables();\n          }\n          return this._attr[attr];\n        }\n    \n        /**\n         * @private\n         */\n    \n      }, {\n        key: '_getAttrValue',\n        value: function _getAttrValue(attr) {\n          if (true) {\n            return this._getAttr(attr).value;\n          } else {\n            return this._getAttr(attr).value();\n          }\n        }\n      }, {\n        key: 'name',\n        get: function get() {\n          return this._name;\n        }\n    \n        /**\n         * Left value (`Attribute.LEFT`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'left',\n        get: function get() {\n          return this._getAttrValue(Attribute.LEFT);\n        }\n    \n        /**\n         * Right value (`Attribute.RIGHT`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'right',\n        get: function get() {\n          return this._getAttrValue(Attribute.RIGHT);\n        }\n    \n        /**\n         * Width value (`Attribute.WIDTH`).\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'width',\n        get: function get() {\n          return this._getAttrValue(Attribute.WIDTH);\n        }\n    \n        /**\n         * Height value (`Attribute.HEIGHT`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'height',\n        get: function get() {\n          return this._getAttrValue(Attribute.HEIGHT);\n        }\n    \n        /**\n         * Intrinsic width of the sub-view.\n         *\n         * Use this property to explicitely set the width of the sub-view, e.g.:\n         * ```javascript\n         * var view = new AutoLayout.View(AutoLayout.VisualFormat.parse('|[child1][child2]|'), {\n         *   width: 500\n         * });\n         * view.subViews.child1.intrinsicWidth = 100;\n         * console.log('child2 width: ' + view.subViews.child2.width); // 400\n         * ```\n         *\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'intrinsicWidth',\n        get: function get() {\n          return this._intrinsicWidth;\n        },\n        set: function set(value) {\n          if (value !== undefined && value !== this._intrinsicWidth) {\n            var attr = this._getAttr(Attribute.WIDTH);\n            if (this._intrinsicWidth === undefined) {\n              if (true) {\n                this._solver.addEditVar(attr, new c.Strength('required', this._name ? 998 : 999, 1000, 1000));\n              } else {\n                this._solver.addEditVariable(attr, kiwi.Strength.create(this._name ? 998 : 999, 1000, 1000));\n              }\n            }\n            this._intrinsicWidth = value;\n            this._solver.suggestValue(attr, value);\n            if (true) {\n              this._solver.resolve();\n            } else {\n              this._solver.updateVariables();\n            }\n          }\n        }\n    \n        /**\n         * Intrinsic height of the sub-view.\n         *\n         * See `intrinsicWidth`.\n         *\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'intrinsicHeight',\n        get: function get() {\n          return this._intrinsicHeight;\n        },\n        set: function set(value) {\n          if (value !== undefined && value !== this._intrinsicHeight) {\n            var attr = this._getAttr(Attribute.HEIGHT);\n            if (this._intrinsicHeight === undefined) {\n              if (true) {\n                this._solver.addEditVar(attr, new c.Strength('required', this._name ? 998 : 999, 1000, 1000));\n              } else {\n                this._solver.addEditVariable(attr, kiwi.Strength.create(this._name ? 998 : 999, 1000, 1000));\n              }\n            }\n            this._intrinsicHeight = value;\n            this._solver.suggestValue(attr, value);\n            if (true) {\n              this._solver.resolve();\n            } else {\n              this._solver.updateVariables();\n            }\n          }\n        }\n    \n        /**\n         * Top value (`Attribute.TOP`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'top',\n        get: function get() {\n          return this._getAttrValue(Attribute.TOP);\n        }\n    \n        /**\n         * Bottom value (`Attribute.BOTTOM`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'bottom',\n        get: function get() {\n          return this._getAttrValue(Attribute.BOTTOM);\n        }\n    \n        /**\n         * Horizontal center (`Attribute.CENTERX`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'centerX',\n        get: function get() {\n          return this._getAttrValue(Attribute.CENTERX);\n        }\n    \n        /**\n         * Vertical center (`Attribute.CENTERY`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'centerY',\n        get: function get() {\n          return this._getAttrValue(Attribute.CENTERY);\n        }\n    \n        /**\n         * Z-index (`Attribute.ZINDEX`).\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'zIndex',\n        get: function get() {\n          return this._getAttrValue(Attribute.ZINDEX);\n        }\n    \n        /**\n         * Returns the type of the sub-view.\n         * @readonly\n         * @type {String}\n         */\n    \n      }, {\n        key: 'type',\n        get: function get() {\n          return this._type;\n        }\n      }]);\n    \n      return SubView;\n    }();\n    \n    var defaultPriorityStrength = true ? new c.Strength('defaultPriority', 0, 1000, 1000) : kiwi.Strength.create(0, 1000, 1000);\n    \n    function _getConst(name, value) {\n      if (true) {\n        var vr = new c.Variable({ value: value });\n        this._solver.addConstraint(new c.StayConstraint(vr, c.Strength.required, 0));\n        return vr;\n      } else {\n        var _vr = new kiwi.Variable();\n        this._solver.addConstraint(new kiwi.Constraint(_vr, kiwi.Operator.Eq, value));\n        return _vr;\n      }\n    }\n    \n    function _getSubView(viewName) {\n      if (!viewName) {\n        return this._parentSubView;\n      } else if (viewName.name) {\n        this._subViews[viewName.name] = this._subViews[viewName.name] || new SubView({\n          name: viewName.name,\n          solver: this._solver\n        });\n        this._subViews[viewName.name]._type = this._subViews[viewName.name]._type || viewName.type;\n        return this._subViews[viewName.name];\n      } else {\n        this._subViews[viewName] = this._subViews[viewName] || new SubView({\n          name: viewName,\n          solver: this._solver\n        });\n        return this._subViews[viewName];\n      }\n    }\n    \n    function _getSpacing(constraint) {\n      var index = 4;\n      if (!constraint.view1 && constraint.attr1 === 'left') {\n        index = 3;\n      } else if (!constraint.view1 && constraint.attr1 === 'top') {\n        index = 0;\n      } else if (!constraint.view2 && constraint.attr2 === 'right') {\n        index = 1;\n      } else if (!constraint.view2 && constraint.attr2 === 'bottom') {\n        index = 2;\n      } else {\n        switch (constraint.attr1) {\n          case 'left':\n          case 'right':\n          case 'centerX':\n          case 'leading':\n          case 'trailing':\n            index = 4;\n            break;\n          case 'zIndex':\n            index = 6;\n            break;\n          default:\n            index = 5;\n        }\n      }\n      this._spacingVars = this._spacingVars || new Array(7);\n      this._spacingExpr = this._spacingExpr || new Array(7);\n      if (!this._spacingVars[index]) {\n        if (true) {\n          this._spacingVars[index] = new c.Variable();\n          this._solver.addEditVar(this._spacingVars[index]);\n          this._spacingExpr[index] = c.minus(0, this._spacingVars[index]);\n        } else {\n          this._spacingVars[index] = new kiwi.Variable();\n          this._solver.addEditVariable(this._spacingVars[index], kiwi.Strength.create(999, 1000, 1000));\n          this._spacingExpr[index] = this._spacingVars[index].multiply(-1);\n        }\n        this._solver.suggestValue(this._spacingVars[index], this._spacing[index]);\n      }\n      return this._spacingExpr[index];\n    }\n    \n    function _addConstraint(constraint) {\n      //this.constraints.push(constraint);\n      var relation = void 0;\n      var multiplier = constraint.multiplier !== undefined ? constraint.multiplier : 1;\n      var constant = constraint.constant !== undefined ? constraint.constant : 0;\n      if (constant === 'default') {\n        constant = _getSpacing.call(this, constraint);\n      }\n      var attr1 = _getSubView.call(this, constraint.view1)._getAttr(constraint.attr1);\n      var attr2 = void 0;\n      if (true) {\n        if (constraint.attr2 === Attribute.CONST) {\n          attr2 = _getConst.call(this, undefined, constraint.constant);\n        } else {\n          attr2 = _getSubView.call(this, constraint.view2)._getAttr(constraint.attr2);\n          if (multiplier !== 1 && constant) {\n            attr2 = c.plus(c.times(attr2, multiplier), constant);\n          } else if (constant) {\n            attr2 = c.plus(attr2, constant);\n          } else if (multiplier !== 1) {\n            attr2 = c.times(attr2, multiplier);\n          }\n        }\n        var strength = constraint.priority !== undefined && constraint.priority < 1000 ? new c.Strength('priority', 0, constraint.priority, 1000) : defaultPriorityStrength;\n        switch (constraint.relation) {\n          case Relation.EQU:\n            relation = new c.Equation(attr1, attr2, strength);\n            break;\n          case Relation.GEQ:\n            relation = new c.Inequality(attr1, c.GEQ, attr2, strength);\n            break;\n          case Relation.LEQ:\n            relation = new c.Inequality(attr1, c.LEQ, attr2, strength);\n            break;\n          default:\n            throw 'Invalid relation specified: ' + constraint.relation;\n        }\n      } else {\n        if (constraint.attr2 === Attribute.CONST) {\n          attr2 = _getConst.call(this, undefined, constraint.constant);\n        } else {\n          attr2 = _getSubView.call(this, constraint.view2)._getAttr(constraint.attr2);\n          if (multiplier !== 1 && constant) {\n            attr2 = attr2.multiply(multiplier).plus(constant);\n          } else if (constant) {\n            attr2 = attr2.plus(constant);\n          } else if (multiplier !== 1) {\n            attr2 = attr2.multiply(multiplier);\n          }\n        }\n        var _strength = constraint.priority !== undefined && constraint.priority < 1000 ? kiwi.Strength.create(0, constraint.priority, 1000) : defaultPriorityStrength;\n        switch (constraint.relation) {\n          case Relation.EQU:\n            relation = new kiwi.Constraint(attr1, kiwi.Operator.Eq, attr2, _strength);\n            break;\n          case Relation.GEQ:\n            relation = new kiwi.Constraint(attr1, kiwi.Operator.Ge, attr2, _strength);\n            break;\n          case Relation.LEQ:\n            relation = new kiwi.Constraint(attr1, kiwi.Operator.Le, attr2, _strength);\n            break;\n          default:\n            throw 'Invalid relation specified: ' + constraint.relation;\n        }\n      }\n      this._solver.addConstraint(relation);\n    }\n    \n    function _compareSpacing(old, newz) {\n      if (old === newz) {\n        return true;\n      }\n      if (!old || !newz) {\n        return false;\n      }\n      for (var i = 0; i < 7; i++) {\n        if (old[i] !== newz[i]) {\n          return false;\n        }\n      }\n      return true;\n    }\n    \n    /**\n     * AutoLayoutJS API reference.\n     *\n     * ### Index\n     *\n     * |Entity|Type|Description|\n     * |---|---|---|\n     * |[AutoLayout](#autolayout)|`namespace`|Top level AutoLayout object.|\n     * |[VisualFormat](#autolayoutvisualformat--object)|`namespace`|Parses VFL into constraints.|\n     * |[View](#autolayoutview)|`class`|Main entity for adding & evaluating constraints.|\n     * |[SubView](#autolayoutsubview--object)|`class`|SubView's are automatically created when constraints are added to views. They give access to the evaluated results.|\n     * |[Attribute](#autolayoutattribute--enum)|`enum`|Attribute types that are supported when adding constraints.|\n     * |[Relation](#autolayoutrelation--enum)|`enum`|Relationship types that are supported when adding constraints.|\n     * |[Priority](#autolayoutpriority--enum)|`enum`|Default priority values for when adding constraints.|\n     *\n     * ### AutoLayout\n     *\n     * @module AutoLayout\n     */\n    \n    var View = function () {\n    \n      /**\n       * @class View\n       * @param {Object} [options] Configuration options.\n       * @param {Number} [options.width] Initial width of the view.\n       * @param {Number} [options.height] Initial height of the view.\n       * @param {Number|Object} [options.spacing] Spacing for the view (default: 8) (see `setSpacing`).\n       * @param {Array} [options.constraints] One or more constraint definitions (see `addConstraints`).\n       */\n      function View(options) {\n        _classCallCheck(this, View);\n    \n        this._solver = true ? new c.SimplexSolver() : new kiwi.Solver();\n        this._subViews = {};\n        //this._spacing = undefined;\n        this._parentSubView = new SubView({\n          solver: this._solver\n        });\n        this.setSpacing(options && options.spacing !== undefined ? options.spacing : 8);\n        //this.constraints = [];\n        if (options) {\n          if (options.width !== undefined || options.height !== undefined) {\n            this.setSize(options.width, options.height);\n          }\n          if (options.constraints) {\n            this.addConstraints(options.constraints);\n          }\n        }\n      }\n    \n      /**\n       * Sets the width and height of the view.\n       *\n       * @param {Number} width Width of the view.\n       * @param {Number} height Height of the view.\n       * @return {View} this\n       */\n    \n    \n      _createClass(View, [{\n        key: 'setSize',\n        value: function setSize(width, height /*, depth*/) {\n          this._parentSubView.intrinsicWidth = width;\n          this._parentSubView.intrinsicHeight = height;\n          return this;\n        }\n    \n        /**\n         * Width that was set using `setSize`.\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'setSpacing',\n    \n    \n        /**\n         * Sets the spacing for the view.\n         *\n         * The spacing can be set for 7 different variables:\n         * `top`, `right`, `bottom`, `left`, `width`, `height` and `zIndex`. The `left`-spacing is\n         * used when a spacer is used between the parent-view and a sub-view (e.g. `|-[subView]`).\n         * The same is true for the `right`, `top` and `bottom` spacers. The `width` and `height` are\n         * used for spacers in between sub-views (e.g. `[view1]-[view2]`).\n         *\n         * Instead of using the full spacing syntax, it is also possible to use shorthand notations:\n         *\n         * |Syntax|Type|Description|\n         * |---|---|---|\n         * |`[top, right, bottom, left, width, height, zIndex]`|Array(7)|Full syntax including z-index **(clockwise order)**.|\n         * |`[top, right, bottom, left, width, height]`|Array(6)|Full horizontal & vertical spacing syntax (no z-index) **(clockwise order)**.|\n         * |`[horizontal, vertical, zIndex]`|Array(3)|Horizontal = left, right, width, vertical = top, bottom, height.|\n         * |`[horizontal, vertical]`|Array(2)|Horizontal = left, right, width, vertical = top, bottom, height, z-index = 1.|\n         * |`spacing`|Number|Horizontal & vertical spacing are all the same, z-index = 1.|\n         *\n         * Examples:\n         * ```javascript\n         * view.setSpacing(10); // horizontal & vertical spacing 10\n         * view.setSpacing([10, 15, 2]); // horizontal spacing 10, vertical spacing 15, z-axis spacing 2\n         * view.setSpacing([10, 20, 10, 20, 5, 5]); // top, right, bottom, left, horizontal, vertical\n         * view.setSpacing([10, 20, 10, 20, 5, 5, 1]); // top, right, bottom, left, horizontal, vertical, z\n         * ```\n         *\n         * @param {Number|Array} spacing\n         * @return {View} this\n         */\n        value: function setSpacing(spacing) {\n          // convert spacing into array: [top, right, bottom, left, horz, vert, z-index]\n          switch (Array.isArray(spacing) ? spacing.length : -1) {\n            case -1:\n              spacing = [spacing, spacing, spacing, spacing, spacing, spacing, 1];break;\n            case 1:\n              spacing = [spacing[0], spacing[0], spacing[0], spacing[0], spacing[0], spacing[0], 1];break;\n            case 2:\n              spacing = [spacing[1], spacing[0], spacing[1], spacing[0], spacing[0], spacing[1], 1];break;\n            case 3:\n              spacing = [spacing[1], spacing[0], spacing[1], spacing[0], spacing[0], spacing[1], spacing[2]];break;\n            case 6:\n              spacing = [spacing[0], spacing[1], spacing[2], spacing[3], spacing[4], spacing[5], 1];break;\n            case 7:\n              break;\n            default:\n              throw 'Invalid spacing syntax';\n          }\n          if (!_compareSpacing(this._spacing, spacing)) {\n            this._spacing = spacing;\n            // update spacing variables\n            if (this._spacingVars) {\n              for (var i = 0; i < this._spacingVars.length; i++) {\n                if (this._spacingVars[i]) {\n                  this._solver.suggestValue(this._spacingVars[i], this._spacing[i]);\n                }\n              }\n              if (true) {\n                this._solver.resolve();\n              } else {\n                this._solver.updateVariables();\n              }\n            }\n          }\n          return this;\n        }\n    \n        /**\n         * Adds a constraint definition.\n         *\n         * A constraint definition has the following format:\n         *\n         * ```javascript\n         * constraint: {\n         *   view1: {String},\n         *   attr1: {AutoLayout.Attribute},\n         *   relation: {AutoLayout.Relation},\n         *   view2: {String},\n         *   attr2: {AutoLayout.Attribute},\n         *   multiplier: {Number},\n         *   constant: {Number},\n         *   priority: {Number}(0..1000)\n         * }\n         * ```\n         * @param {Object} constraint Constraint definition.\n         * @return {View} this\n         */\n    \n      }, {\n        key: 'addConstraint',\n        value: function addConstraint(constraint) {\n          _addConstraint.call(this, constraint);\n          if (!true) {\n            this._solver.updateVariables();\n          }\n          return this;\n        }\n    \n        /**\n         * Adds one or more constraint definitions.\n         *\n         * A constraint definition has the following format:\n         *\n         * ```javascript\n         * constraint: {\n         *   view1: {String},\n         *   attr1: {AutoLayout.Attribute},\n         *   relation: {AutoLayout.Relation},\n         *   view2: {String},\n         *   attr2: {AutoLayout.Attribute},\n         *   multiplier: {Number},\n         *   constant: {Number},\n         *   priority: {Number}(0..1000)\n         * }\n         * ```\n         * @param {Array} constraints One or more constraint definitions.\n         * @return {View} this\n         */\n    \n      }, {\n        key: 'addConstraints',\n        value: function addConstraints(constraints) {\n          for (var j = 0; j < constraints.length; j++) {\n            _addConstraint.call(this, constraints[j]);\n          }\n          if (!true) {\n            this._solver.updateVariables();\n          }\n          return this;\n        }\n    \n        /**\n         * Dictionary of `SubView` objects that have been created when adding constraints.\n         * @readonly\n         * @type {Object.SubView}\n         */\n    \n      }, {\n        key: 'width',\n        get: function get() {\n          return this._parentSubView.intrinsicWidth;\n        }\n    \n        /**\n         * Height that was set using `setSize`.\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'height',\n        get: function get() {\n          return this._parentSubView.intrinsicHeight;\n        }\n    \n        /**\n         * Width that is calculated from the constraints and the `.intrinsicWidth` of\n         * the sub-views.\n         *\n         * When the width has been explicitely set using `setSize`, the fittingWidth\n         * will **always** be the same as the explicitely set width. To calculate the size\n         * based on the content, use:\n         * ```javascript\n         * var view = new AutoLayout.View({\n         *   constraints: VisualFormat.parse('|-[view1]-[view2]-'),\n         *   spacing: 20\n         * });\n         * view.subViews.view1.intrinsicWidth = 100;\n         * view.subViews.view2.intrinsicWidth = 100;\n         * console.log('fittingWidth: ' + view.fittingWidth); // 260\n         * ```\n         *\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'fittingWidth',\n        get: function get() {\n          return this._parentSubView.width;\n        }\n    \n        /**\n         * Height that is calculated from the constraints and the `.intrinsicHeight` of\n         * the sub-views.\n         *\n         * See `.fittingWidth`.\n         *\n         * @readonly\n         * @type {Number}\n         */\n    \n      }, {\n        key: 'fittingHeight',\n        get: function get() {\n          return this._parentSubView.height;\n        }\n      }, {\n        key: 'subViews',\n        get: function get() {\n          return this._subViews;\n        }\n    \n        /**\n         * Checks whether the constraints incompletely specify the location\n         * of the subViews.\n         * @private\n         */\n        //get hasAmbiguousLayout() {\n        // Todo\n        //}\n    \n      }]);\n    \n      return View;\n    }();\n    \n    //import DOM from './DOM';\n    \n    /**\n     * AutoLayout.\n     *\n     * @namespace AutoLayout\n     * @property {Attribute} Attribute\n     * @property {Relation} Relation\n     * @property {Priority} Priority\n     * @property {VisualFormat} VisualFormat\n     * @property {View} View\n     * @property {SubView} SubView\n     */\n    \n    \n    var AutoLayout = {\n      Attribute: Attribute,\n      Relation: Relation,\n      Priority: Priority,\n      VisualFormat: VisualFormat,\n      View: View,\n      SubView: SubView\n      //DOM: DOM\n    };\n    \n    module.exports = AutoLayout;\n    \n    },{\"cassowary/bin/c\":2}],2:[function(require,module,exports){\n    /**\n     * Parts Copyright (C) 2011-2012, Alex Russell (slightlyoff@chromium.org)\n     * Parts Copyright (C) Copyright (C) 1998-2000 Greg J. Badros\n     *\n     * Use of this source code is governed by the LGPL, which can be found in the\n     * COPYING.LGPL file.\n     *\n     * This is a compiled version of Cassowary/JS. For source versions or to\n     * contribute, see the github project:\n     *\n     *  https://github.com/slightlyoff/cassowary-js-refactor\n     *\n     */\n    \n    (function() {\n    (function(a){\"use strict\";try{(function(){}).bind(a)}catch(b){Object.defineProperty(Function.prototype,\"bind\",{value:function(a){var b=this;return function(){return b.apply(a,arguments)}},enumerable:!1,configurable:!0,writable:!0})}var c=a.HTMLElement!==void 0,d=function(a){for(var b=null;a&&a!=Object.prototype;){if(a.tagName){b=a.tagName;break}a=a.prototype}return b||\"div\"},e=1e-8,f={},g=function(a,b){if(a&&b){if(\"function\"==typeof a[b])return a[b];var c=a.prototype;if(c&&\"function\"==typeof c[b])return c[b];if(c!==Object.prototype&&c!==Function.prototype)return\"function\"==typeof a.__super__?g(a.__super__,b):void 0}},h=a.c={debug:!1,trace:!1,verbose:!1,traceAdded:!1,GC:!1,GEQ:1,LEQ:2,inherit:function(b){var e=null,g=null;b[\"extends\"]&&(g=b[\"extends\"],delete b[\"extends\"]),b.initialize&&(e=b.initialize,delete b.initialize);var h=e||function(){};Object.defineProperty(h,\"__super__\",{value:g?g:Object,enumerable:!1,configurable:!0,writable:!1}),b._t&&(f[b._t]=h);var i=h.prototype=Object.create(g?g.prototype:Object.prototype);if(this.extend(i,b),c&&g&&g.prototype instanceof a.HTMLElement){var j=h,k=d(i),l=function(a){return a.__proto__=i,j.apply(a,arguments),i.created&&a.created(),i.decorate&&a.decorate(),a};this.extend(i,{upgrade:l}),h=function(){return l(a.document.createElement(k))},h.prototype=i,this.extend(h,{ctor:j})}return h},extend:function(a,b){return this.own(b,function(c){var d=Object.getOwnPropertyDescriptor(b,c);try{\"function\"==typeof d.get||\"function\"==typeof d.set?Object.defineProperty(a,c,d):\"function\"==typeof d.value||\"_\"===c.charAt(0)?(d.writable=!0,d.configurable=!0,d.enumerable=!1,Object.defineProperty(a,c,d)):a[c]=b[c]}catch(e){}}),a},own:function(b,c,d){return Object.getOwnPropertyNames(b).forEach(c,d||a),b},traceprint:function(a){h.verbose&&console.log(a)},fnenterprint:function(a){console.log(\"* \"+a)},fnexitprint:function(a){console.log(\"- \"+a)},assert:function(a,b){if(!a)throw new h.InternalError(\"Assertion failed: \"+b)},plus:function(a,b){return a instanceof h.Expression||(a=new h.Expression(a)),b instanceof h.Expression||(b=new h.Expression(b)),a.plus(b)},minus:function(a,b){return a instanceof h.Expression||(a=new h.Expression(a)),b instanceof h.Expression||(b=new h.Expression(b)),a.minus(b)},times:function(a,b){return(\"number\"==typeof a||a instanceof h.Variable)&&(a=new h.Expression(a)),(\"number\"==typeof b||b instanceof h.Variable)&&(b=new h.Expression(b)),a.times(b)},divide:function(a,b){return(\"number\"==typeof a||a instanceof h.Variable)&&(a=new h.Expression(a)),(\"number\"==typeof b||b instanceof h.Variable)&&(b=new h.Expression(b)),a.divide(b)},approx:function(a,b){if(a===b)return!0;var c,d;return c=a instanceof h.Variable?a.value:a,d=b instanceof h.Variable?b.value:b,0==c?e>Math.abs(d):0==d?e>Math.abs(c):Math.abs(c-d)<Math.abs(c)*e},_inc:function(a){return function(){return a++}}(0),parseJSON:function(a){return JSON.parse(a,function(a,b){if(\"object\"!=typeof b||\"string\"!=typeof b._t)return b;var c=b._t,d=f[c];if(c&&d){var e=g(d,\"fromJSON\");if(e)return e(b,d)}return b})}};\"function\"==typeof require&&\"undefined\"!=typeof module&&\"undefined\"==typeof load&&(a.exports=h)})(this),function(a){\"use strict\";var b=function(a){var b=a.hashCode?a.hashCode:\"\"+a;return b},c=function(a,b){Object.keys(a).forEach(function(c){b[c]=a[c]})},d={};a.HashTable=a.inherit({initialize:function(){this.size=0,this._store={},this._keyStrMap={},this._deleted=0},set:function(a,c){var d=b(a);this._store.hasOwnProperty(d)||this.size++,this._store[d]=c,this._keyStrMap[d]=a},get:function(a){if(!this.size)return null;a=b(a);var c=this._store[a];return c!==void 0?this._store[a]:null},clear:function(){this.size=0,this._store={},this._keyStrMap={}},_compact:function(){var a={};c(this._store,a),this._store=a},_compactThreshold:100,_perhapsCompact:function(){this._size>64||this._deleted>this._compactThreshold&&(this._compact(),this._deleted=0)},\"delete\":function(a){a=b(a),this._store.hasOwnProperty(a)&&(this._deleted++,delete this._store[a],this.size>0&&this.size--)},each:function(a,b){if(this.size){this._perhapsCompact();var c=this._store,d=this._keyStrMap;Object.keys(this._store).forEach(function(e){a.call(b||null,d[e],c[e])},this)}},escapingEach:function(a,b){if(this.size){this._perhapsCompact();for(var c=this,e=this._store,f=this._keyStrMap,g=d,h=Object.keys(e),i=0;h.length>i;i++)if(function(d){c._store.hasOwnProperty(d)&&(g=a.call(b||null,f[d],e[d]))}(h[i]),g){if(void 0!==g.retval)return g;if(g.brk)break}}},clone:function(){var b=new a.HashTable;return this.size&&(b.size=this.size,c(this._store,b._store),c(this._keyStrMap,b._keyStrMap)),b},equals:function(b){if(b===this)return!0;if(!(b instanceof a.HashTable)||b._size!==this._size)return!1;for(var c=Object.keys(this._store),d=0;c.length>d;d++){var e=c[d];if(this._keyStrMap[e]!==b._keyStrMap[e]||this._store[e]!==b._store[e])return!1}return!0},toString:function(){var b=\"\";return this.each(function(a,c){b+=a+\" => \"+c+\"\\n\"}),b}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.HashSet=a.inherit({_t:\"c.HashSet\",initialize:function(){this.storage=[],this.size=0},add:function(a){var b=this.storage;b.indexOf(a),-1==b.indexOf(a)&&b.push(a),this.size=this.storage.length},values:function(){return this.storage},has:function(a){var b=this.storage;return-1!=b.indexOf(a)},\"delete\":function(a){var b=this.storage.indexOf(a);return-1==b?null:(this.storage.splice(b,1)[0],this.size=this.storage.length,void 0)},clear:function(){this.storage.length=0},each:function(a,b){this.size&&this.storage.forEach(a,b)},escapingEach:function(a,b){this.size&&this.storage.forEach(a,b)},toString:function(){var a=this.size+\" {\",b=!0;return this.each(function(c){b?b=!1:a+=\", \",a+=c}),a+=\"}\\n\"},toJSON:function(){var a=[];return this.each(function(b){a.push(b.toJSON())}),{_t:\"c.HashSet\",data:a}},fromJSON:function(b){var c=new a.HashSet;return b.data&&(c.size=b.data.length,c.storage=b.data),c}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.Error=a.inherit({initialize:function(a){a&&(this._description=a)},_name:\"c.Error\",_description:\"An error has occured in Cassowary\",set description(a){this._description=a},get description(){return\"(\"+this._name+\") \"+this._description},get message(){return this.description},toString:function(){return this.description}});var b=function(b,c){return a.inherit({\"extends\":a.Error,initialize:function(){a.Error.apply(this,arguments)},_name:b||\"\",_description:c||\"\"})};a.ConstraintNotFound=b(\"c.ConstraintNotFound\",\"Tried to remove a constraint never added to the tableu\"),a.InternalError=b(\"c.InternalError\"),a.NonExpression=b(\"c.NonExpression\",\"The resulting expression would be non\"),a.NotEnoughStays=b(\"c.NotEnoughStays\",\"There are not enough stays to give specific values to every variable\"),a.RequiredFailure=b(\"c.RequiredFailure\",\"A required constraint cannot be satisfied\"),a.TooDifficult=b(\"c.TooDifficult\",\"The constraints are too difficult to solve\")}(this.c||module.parent.exports||{}),function(a){\"use strict\";var b=1e3;a.SymbolicWeight=a.inherit({_t:\"c.SymbolicWeight\",initialize:function(){this.value=0;for(var a=1,c=arguments.length-1;c>=0;--c)this.value+=arguments[c]*a,a*=b},toJSON:function(){return{_t:this._t,value:this.value}}})}(this.c||module.parent.exports||{}),function(a){a.Strength=a.inherit({initialize:function(b,c,d,e){this.name=b,this.symbolicWeight=c instanceof a.SymbolicWeight?c:new a.SymbolicWeight(c,d,e)},get required(){return this===a.Strength.required},toString:function(){return this.name+(this.isRequired?\"\":\":\"+this.symbolicWeight)}}),a.Strength.required=new a.Strength(\"<Required>\",1e3,1e3,1e3),a.Strength.strong=new a.Strength(\"strong\",1,0,0),a.Strength.medium=new a.Strength(\"medium\",0,1,0),a.Strength.weak=new a.Strength(\"weak\",0,0,1)}(this.c||(\"undefined\"!=typeof module?module.parent.exports.c:{})),function(a){\"use strict\";a.AbstractVariable=a.inherit({isDummy:!1,isExternal:!1,isPivotable:!1,isRestricted:!1,_init:function(b,c){this.hashCode=a._inc(),this.name=(c||\"\")+this.hashCode,b&&(b.name!==void 0&&(this.name=b.name),b.value!==void 0&&(this.value=b.value),b.prefix!==void 0&&(this._prefix=b.prefix))},_prefix:\"\",name:\"\",value:0,toJSON:function(){var a={};return this._t&&(a._t=this._t),this.name&&(a.name=this.name),this.value!==void 0&&(a.value=this.value),this._prefix&&(a._prefix=this._prefix),this._t&&(a._t=this._t),a},fromJSON:function(b,c){var d=new c;return a.extend(d,b),d},toString:function(){return this._prefix+\"[\"+this.name+\":\"+this.value+\"]\"}}),a.Variable=a.inherit({_t:\"c.Variable\",\"extends\":a.AbstractVariable,initialize:function(b){this._init(b,\"v\");var c=a.Variable._map;c&&(c[this.name]=this)},isExternal:!0}),a.DummyVariable=a.inherit({_t:\"c.DummyVariable\",\"extends\":a.AbstractVariable,initialize:function(a){this._init(a,\"d\")},isDummy:!0,isRestricted:!0,value:\"dummy\"}),a.ObjectiveVariable=a.inherit({_t:\"c.ObjectiveVariable\",\"extends\":a.AbstractVariable,initialize:function(a){this._init(a,\"o\")},value:\"obj\"}),a.SlackVariable=a.inherit({_t:\"c.SlackVariable\",\"extends\":a.AbstractVariable,initialize:function(a){this._init(a,\"s\")},isPivotable:!0,isRestricted:!0,value:\"slack\"})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.Point=a.inherit({initialize:function(b,c,d){if(b instanceof a.Variable)this._x=b;else{var e={value:b};d&&(e.name=\"x\"+d),this._x=new a.Variable(e)}if(c instanceof a.Variable)this._y=c;else{var f={value:c};d&&(f.name=\"y\"+d),this._y=new a.Variable(f)}},get x(){return this._x},set x(b){b instanceof a.Variable?this._x=b:this._x.value=b},get y(){return this._y},set y(b){b instanceof a.Variable?this._y=b:this._y.value=b},toString:function(){return\"(\"+this.x+\", \"+this.y+\")\"}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.Expression=a.inherit({initialize:function(b,c,d){a.GC&&console.log(\"new c.Expression\"),this.constant=\"number\"!=typeof d||isNaN(d)?0:d,this.terms=new a.HashTable,b instanceof a.AbstractVariable?this.setVariable(b,\"number\"==typeof c?c:1):\"number\"==typeof b&&(isNaN(b)?console.trace():this.constant=b)},initializeFromHash:function(b,c){return a.verbose&&(console.log(\"*******************************\"),console.log(\"clone c.initializeFromHash\"),console.log(\"*******************************\")),a.GC&&console.log(\"clone c.Expression\"),this.constant=b,this.terms=c.clone(),this},multiplyMe:function(a){this.constant*=a;var b=this.terms;return b.each(function(c,d){b.set(c,d*a)}),this},clone:function(){a.verbose&&(console.log(\"*******************************\"),console.log(\"clone c.Expression\"),console.log(\"*******************************\"));var b=new a.Expression;return b.initializeFromHash(this.constant,this.terms),b},times:function(b){if(\"number\"==typeof b)return this.clone().multiplyMe(b);if(this.isConstant)return b.times(this.constant);if(b.isConstant)return this.times(b.constant);throw new a.NonExpression},plus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,1):b instanceof a.Variable?this.clone().addVariable(b,1):void 0},minus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,-1):b instanceof a.Variable?this.clone().addVariable(b,-1):void 0},divide:function(b){if(\"number\"==typeof b){if(a.approx(b,0))throw new a.NonExpression;return this.times(1/b)}if(b instanceof a.Expression){if(!b.isConstant)throw new a.NonExpression;return this.times(1/b.constant)}},addExpression:function(b,c,d,e){return b instanceof a.AbstractVariable&&(b=new a.Expression(b),a.trace&&console.log(\"addExpression: Had to cast a var to an expression\")),c=c||1,this.constant+=c*b.constant,b.terms.each(function(a,b){this.addVariable(a,b*c,d,e)},this),this},addVariable:function(b,c,d,e){null==c&&(c=1),a.trace&&console.log(\"c.Expression::addVariable():\",b,c);var f=this.terms.get(b);if(f){var g=f+c;0==g||a.approx(g,0)?(e&&e.noteRemovedVariable(b,d),this.terms.delete(b)):this.setVariable(b,g)}else a.approx(c,0)||(this.setVariable(b,c),e&&e.noteAddedVariable(b,d));return this},setVariable:function(a,b){return this.terms.set(a,b),this},anyPivotableVariable:function(){if(this.isConstant)throw new a.InternalError(\"anyPivotableVariable called on a constant\");var b=this.terms.escapingEach(function(a){return a.isPivotable?{retval:a}:void 0});return b&&void 0!==b.retval?b.retval:null},substituteOut:function(b,c,d,e){a.trace&&(a.fnenterprint(\"CLE:substituteOut: \"+b+\", \"+c+\", \"+d+\", ...\"),a.traceprint(\"this = \"+this));var f=this.setVariable.bind(this),g=this.terms,h=g.get(b);g.delete(b),this.constant+=h*c.constant,c.terms.each(function(b,c){var i=g.get(b);if(i){var j=i+h*c;a.approx(j,0)?(e.noteRemovedVariable(b,d),g.delete(b)):f(b,j)}else f(b,h*c),e&&e.noteAddedVariable(b,d)}),a.trace&&a.traceprint(\"Now this is \"+this)},changeSubject:function(a,b){this.setVariable(a,this.newSubject(b))},newSubject:function(b){a.trace&&a.fnenterprint(\"newSubject:\"+b);var c=1/this.terms.get(b);return this.terms.delete(b),this.multiplyMe(-c),c},coefficientFor:function(a){return this.terms.get(a)||0},get isConstant(){return 0==this.terms.size},toString:function(){var b=\"\",c=!1;if(!a.approx(this.constant,0)||this.isConstant){if(b+=this.constant,this.isConstant)return b;c=!0}return this.terms.each(function(a,d){c&&(b+=\" + \"),b+=d+\"*\"+a,c=!0}),b},equals:function(b){return b===this?!0:b instanceof a.Expression&&b.constant===this.constant&&b.terms.equals(this.terms)},Plus:function(a,b){return a.plus(b)},Minus:function(a,b){return a.minus(b)},Times:function(a,b){return a.times(b)},Divide:function(a,b){return a.divide(b)}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.AbstractConstraint=a.inherit({initialize:function(b,c){this.hashCode=a._inc(),this.strength=b||a.Strength.required,this.weight=c||1},isEditConstraint:!1,isInequality:!1,isStayConstraint:!1,get required(){return this.strength===a.Strength.required},toString:function(){return this.strength+\" {\"+this.weight+\"} (\"+this.expression+\")\"}});var b=a.AbstractConstraint.prototype.toString,c=function(b,c,d){a.AbstractConstraint.call(this,c||a.Strength.strong,d),this.variable=b,this.expression=new a.Expression(b,-1,b.value)};a.EditConstraint=a.inherit({\"extends\":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isEditConstraint:!0,toString:function(){return\"edit:\"+b.call(this)}}),a.StayConstraint=a.inherit({\"extends\":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isStayConstraint:!0,toString:function(){return\"stay:\"+b.call(this)}});var d=a.Constraint=a.inherit({\"extends\":a.AbstractConstraint,initialize:function(b,c,d){a.AbstractConstraint.call(this,c,d),this.expression=b}});a.Inequality=a.inherit({\"extends\":a.Constraint,_cloneOrNewCle:function(b){return b.clone?b.clone():new a.Expression(b)},initialize:function(b,c,e,f,g){var h=b instanceof a.Expression,i=e instanceof a.Expression,j=b instanceof a.AbstractVariable,k=e instanceof a.AbstractVariable,l=\"number\"==typeof b,m=\"number\"==typeof e;if((h||l)&&k){var n=b,o=c,p=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.GEQ)throw new a.InternalError(\"Invalid operator in c.Inequality constructor\");this.expression.addVariable(p,-1)}}else if(j&&(i||m)){var n=e,o=c,p=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.LEQ)throw new a.InternalError(\"Invalid operator in c.Inequality constructor\");this.expression.addVariable(p,-1)}}else{if(h&&m){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.GEQ)throw new a.InternalError(\"Invalid operator in c.Inequality constructor\");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(l&&i){var s=e,o=c,t=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.LEQ)throw new a.InternalError(\"Invalid operator in c.Inequality constructor\");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(h&&i){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(t),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(s));else{if(o!=a.LEQ)throw new a.InternalError(\"Invalid operator in c.Inequality constructor\");this.expression.addExpression(this._cloneOrNewCle(s),-1)}}else{if(h)return d.call(this,b,c,e);if(c==a.GEQ)d.call(this,new a.Expression(e),f,g),this.expression.multiplyMe(-1),this.expression.addVariable(b);else{if(c!=a.LEQ)throw new a.InternalError(\"Invalid operator in c.Inequality constructor\");d.call(this,new a.Expression(e),f,g),this.expression.addVariable(b,-1)}}}},isInequality:!0,toString:function(){return d.prototype.toString.call(this)+\" >= 0) id: \"+this.hashCode}}),a.Equation=a.inherit({\"extends\":a.Constraint,initialize:function(b,c,e,f){if(b instanceof a.Expression&&!c||c instanceof a.Strength)d.call(this,b,c,e);else if(b instanceof a.AbstractVariable&&c instanceof a.Expression){var g=b,h=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.AbstractVariable&&\"number\"==typeof c){var g=b,k=c,i=e,j=f;d.call(this,new a.Expression(k),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.Expression&&c instanceof a.AbstractVariable){var h=b,g=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else{if(!(b instanceof a.Expression||b instanceof a.AbstractVariable||\"number\"==typeof b)||!(c instanceof a.Expression||c instanceof a.AbstractVariable||\"number\"==typeof c))throw\"Bad initializer to c.Equation\";b=b instanceof a.Expression?b.clone():new a.Expression(b),c=c instanceof a.Expression?c.clone():new a.Expression(c),d.call(this,b,e,f),this.expression.addExpression(c,-1)}a.assert(this.strength instanceof a.Strength,\"_strength not set\")},toString:function(){return d.prototype.toString.call(this)+\" = 0)\"}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.EditInfo=a.inherit({initialize:function(a,b,c,d,e){this.constraint=a,this.editPlus=b,this.editMinus=c,this.prevEditConstant=d,this.index=e},toString:function(){return\"<cn=\"+this.constraint+\", ep=\"+this.editPlus+\", em=\"+this.editMinus+\", pec=\"+this.prevEditConstant+\", index=\"+this.index+\">\"}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.Tableau=a.inherit({initialize:function(){this.columns=new a.HashTable,this.rows=new a.HashTable,this._infeasibleRows=new a.HashSet,this._externalRows=new a.HashSet,this._externalParametricVars=new a.HashSet},noteRemovedVariable:function(b,c){a.trace&&console.log(\"c.Tableau::noteRemovedVariable: \",b,c);var d=this.columns.get(b);c&&d&&d.delete(c)},noteAddedVariable:function(a,b){b&&this.insertColVar(a,b)},getInternalInfo:function(){var a=\"Tableau Information:\\n\";return a+=\"Rows: \"+this.rows.size,a+=\" (= \"+(this.rows.size-1)+\" constraints)\",a+=\"\\nColumns: \"+this.columns.size,a+=\"\\nInfeasible Rows: \"+this._infeasibleRows.size,a+=\"\\nExternal basic variables: \"+this._externalRows.size,a+=\"\\nExternal parametric variables: \",a+=this._externalParametricVars.size,a+=\"\\n\"},toString:function(){var a=\"Tableau:\\n\";return this.rows.each(function(b,c){a+=b,a+=\" <==> \",a+=c,a+=\"\\n\"}),a+=\"\\nColumns:\\n\",a+=this.columns,a+=\"\\nInfeasible rows: \",a+=this._infeasibleRows,a+=\"External basic variables: \",a+=this._externalRows,a+=\"External parametric variables: \",a+=this._externalParametricVars},insertColVar:function(b,c){var d=this.columns.get(b);d||(d=new a.HashSet,this.columns.set(b,d)),d.add(c)},addRow:function(b,c){a.trace&&a.fnenterprint(\"addRow: \"+b+\", \"+c),this.rows.set(b,c),c.terms.each(function(a){this.insertColVar(a,b),a.isExternal&&this._externalParametricVars.add(a)},this),b.isExternal&&this._externalRows.add(b),a.trace&&a.traceprint(\"\"+this)},removeColumn:function(b){a.trace&&a.fnenterprint(\"removeColumn:\"+b);var c=this.columns.get(b);c?(this.columns.delete(b),c.each(function(a){var c=this.rows.get(a);c.terms.delete(b)},this)):a.trace&&console.log(\"Could not find var\",b,\"in columns\"),b.isExternal&&(this._externalRows.delete(b),this._externalParametricVars.delete(b))},removeRow:function(b){a.trace&&a.fnenterprint(\"removeRow:\"+b);var c=this.rows.get(b);return a.assert(null!=c),c.terms.each(function(c){var e=this.columns.get(c);null!=e&&(a.trace&&console.log(\"removing from varset:\",b),e.delete(b))},this),this._infeasibleRows.delete(b),b.isExternal&&this._externalRows.delete(b),this.rows.delete(b),a.trace&&a.fnexitprint(\"returning \"+c),c},substituteOut:function(b,c){a.trace&&a.fnenterprint(\"substituteOut:\"+b+\", \"+c),a.trace&&a.traceprint(\"\"+this);var d=this.columns.get(b);d.each(function(a){var d=this.rows.get(a);d.substituteOut(b,c,a,this),a.isRestricted&&0>d.constant&&this._infeasibleRows.add(a)},this),b.isExternal&&(this._externalRows.add(b),this._externalParametricVars.delete(b)),this.columns.delete(b)},columnsHasKey:function(a){return!!this.columns.get(a)}})}(this.c||module.parent.exports||{}),function(a){var b=a.Tableau,c=b.prototype,d=1e-8,e=a.Strength.weak;a.SimplexSolver=a.inherit({\"extends\":a.Tableau,initialize:function(){a.Tableau.call(this),this._stayMinusErrorVars=[],this._stayPlusErrorVars=[],this._errorVars=new a.HashTable,this._markerVars=new a.HashTable,this._objective=new a.ObjectiveVariable({name:\"Z\"}),this._editVarMap=new a.HashTable,this._editVarList=[],this._slackCounter=0,this._artificialCounter=0,this._dummyCounter=0,this.autoSolve=!0,this._fNeedsSolving=!1,this._optimizeCount=0,this.rows.set(this._objective,new a.Expression),this._stkCedcns=[0],a.trace&&a.traceprint(\"objective expr == \"+this.rows.get(this._objective))},addLowerBound:function(b,c){var d=new a.Inequality(b,a.GEQ,new a.Expression(c));return this.addConstraint(d)},addUpperBound:function(b,c){var d=new a.Inequality(b,a.LEQ,new a.Expression(c));return this.addConstraint(d)},addBounds:function(a,b,c){return this.addLowerBound(a,b),this.addUpperBound(a,c),this},add:function(){for(var a=0;arguments.length>a;a++)this.addConstraint(arguments[a]);return this},addConstraint:function(b){a.trace&&a.fnenterprint(\"addConstraint: \"+b);var c=Array(2),d=Array(1),e=this.newExpression(b,c,d);if(d=d[0],this.tryAddingDirectly(e)||this.addWithArtificialVariable(e),this._fNeedsSolving=!0,b.isEditConstraint){var f=this._editVarMap.size,g=c[0],h=c[1];!g instanceof a.SlackVariable&&console.warn(\"cvEplus not a slack variable =\",g),!h instanceof a.SlackVariable&&console.warn(\"cvEminus not a slack variable =\",h),a.debug&&console.log(\"new c.EditInfo(\"+b+\", \"+g+\", \"+h+\", \"+d+\", \"+f+\")\");var i=new a.EditInfo(b,g,h,d,f);this._editVarMap.set(b.variable,i),this._editVarList[f]={v:b.variable,info:i}}return this.autoSolve&&(this.optimize(this._objective),this._setExternalVariables()),this},addConstraintNoException:function(b){a.trace&&a.fnenterprint(\"addConstraintNoException: \"+b);try{return this.addConstraint(b),!0}catch(c){return!1}},addEditVar:function(b,c){return a.trace&&a.fnenterprint(\"addEditVar: \"+b+\" @ \"+c),this.addConstraint(new a.EditConstraint(b,c||a.Strength.strong))},beginEdit:function(){return a.assert(this._editVarMap.size>0,\"_editVarMap.size > 0\"),this._infeasibleRows.clear(),this._resetStayConstants(),this._stkCedcns.push(this._editVarMap.size),this},endEdit:function(){return a.assert(this._editVarMap.size>0,\"_editVarMap.size > 0\"),this.resolve(),this._stkCedcns.pop(),this.removeEditVarsTo(this._stkCedcns[this._stkCedcns.length-1]),this},removeAllEditVars:function(){return this.removeEditVarsTo(0)},removeEditVarsTo:function(b){try{for(var c=this._editVarList.length,d=b;c>d;d++)this._editVarList[d]&&this.removeConstraint(this._editVarMap.get(this._editVarList[d].v).constraint);return this._editVarList.length=b,a.assert(this._editVarMap.size==b,\"_editVarMap.size == n\"),this}catch(e){throw new a.InternalError(\"Constraint not found in removeEditVarsTo\")}},addPointStays:function(b){return a.trace&&console.log(\"addPointStays\",b),b.forEach(function(a,b){this.addStay(a.x,e,Math.pow(2,b)),this.addStay(a.y,e,Math.pow(2,b))},this),this},addStay:function(b,c,d){var f=new a.StayConstraint(b,c||e,d||1);return this.addConstraint(f)},removeConstraint:function(a){return this.removeConstraintInternal(a),this},removeConstraintInternal:function(b){a.trace&&a.fnenterprint(\"removeConstraintInternal: \"+b),a.trace&&a.traceprint(\"\"+this),this._fNeedsSolving=!0,this._resetStayConstants();var c=this.rows.get(this._objective),d=this._errorVars.get(b);a.trace&&a.traceprint(\"eVars == \"+d),null!=d&&d.each(function(e){var f=this.rows.get(e);null==f?c.addVariable(e,-b.weight*b.strength.symbolicWeight.value,this._objective,this):c.addExpression(f,-b.weight*b.strength.symbolicWeight.value,this._objective,this),a.trace&&a.traceprint(\"now eVars == \"+d)},this);var e=this._markerVars.get(b);if(this._markerVars.delete(b),null==e)throw new a.InternalError(\"Constraint not found in removeConstraintInternal\");if(a.trace&&a.traceprint(\"Looking to remove var \"+e),null==this.rows.get(e)){var f=this.columns.get(e);a.trace&&a.traceprint(\"Must pivot -- columns are \"+f);var g=null,h=0;f.each(function(b){if(b.isRestricted){var c=this.rows.get(b),d=c.coefficientFor(e);if(a.trace&&a.traceprint(\"Marker \"+e+\"'s coefficient in \"+c+\" is \"+d),0>d){var f=-c.constant/d;(null==g||h>f||a.approx(f,h)&&b.hashCode<g.hashCode)&&(h=f,g=b)}}},this),null==g&&(a.trace&&a.traceprint(\"exitVar is still null\"),f.each(function(a){if(a.isRestricted){var b=this.rows.get(a),c=b.coefficientFor(e),d=b.constant/c;(null==g||h>d)&&(h=d,g=a)}},this)),null==g&&(0==f.size?this.removeColumn(e):f.escapingEach(function(a){return a!=this._objective?(g=a,{brk:!0}):void 0},this)),null!=g&&this.pivot(e,g)}if(null!=this.rows.get(e)&&this.removeRow(e),null!=d&&d.each(function(a){a!=e&&this.removeColumn(a)},this),b.isStayConstraint){if(null!=d)for(var j=0;this._stayPlusErrorVars.length>j;j++)d.delete(this._stayPlusErrorVars[j]),d.delete(this._stayMinusErrorVars[j])}else if(b.isEditConstraint){a.assert(null!=d,\"eVars != null\");var k=this._editVarMap.get(b.variable);this.removeColumn(k.editMinus),this._editVarMap.delete(b.variable)}return null!=d&&this._errorVars.delete(d),this.autoSolve&&(this.optimize(this._objective),this._setExternalVariables()),this},reset:function(){throw a.trace&&a.fnenterprint(\"reset\"),new a.InternalError(\"reset not implemented\")},resolveArray:function(b){a.trace&&a.fnenterprint(\"resolveArray\"+b);var c=b.length;this._editVarMap.each(function(a,d){var e=d.index;c>e&&this.suggestValue(a,b[e])},this),this.resolve()},resolvePair:function(a,b){this.suggestValue(this._editVarList[0].v,a),this.suggestValue(this._editVarList[1].v,b),this.resolve()},resolve:function(){a.trace&&a.fnenterprint(\"resolve()\"),this.dualOptimize(),this._setExternalVariables(),this._infeasibleRows.clear(),this._resetStayConstants()},suggestValue:function(b,c){a.trace&&console.log(\"suggestValue(\"+b+\", \"+c+\")\");var d=this._editVarMap.get(b);if(!d)throw new a.Error(\"suggestValue for variable \"+b+\", but var is not an edit variable\");var e=c-d.prevEditConstant;return d.prevEditConstant=c,this.deltaEditConstant(e,d.editPlus,d.editMinus),this},solve:function(){return this._fNeedsSolving&&(this.optimize(this._objective),this._setExternalVariables()),this},setEditedValue:function(b,c){if(!this.columnsHasKey(b)&&null==this.rows.get(b))return b.value=c,this;if(!a.approx(c,b.value)){this.addEditVar(b),this.beginEdit();try{this.suggestValue(b,c)}catch(d){throw new a.InternalError(\"Error in setEditedValue\")}this.endEdit()}return this},addVar:function(b){if(!this.columnsHasKey(b)&&null==this.rows.get(b)){try{this.addStay(b)}catch(c){throw new a.InternalError(\"Error in addVar -- required failure is impossible\")}a.trace&&a.traceprint(\"added initial stay on \"+b)}return this},getInternalInfo:function(){var a=c.getInternalInfo.call(this);return a+=\"\\nSolver info:\\n\",a+=\"Stay Error Variables: \",a+=this._stayPlusErrorVars.length+this._stayMinusErrorVars.length,a+=\" (\"+this._stayPlusErrorVars.length+\" +, \",a+=this._stayMinusErrorVars.length+\" -)\\n\",a+=\"Edit Variables: \"+this._editVarMap.size,a+=\"\\n\"},getDebugInfo:function(){return\"\"+this+this.getInternalInfo()+\"\\n\"},toString:function(){var a=c.getInternalInfo.call(this);return a+=\"\\n_stayPlusErrorVars: \",a+=\"[\"+this._stayPlusErrorVars+\"]\",a+=\"\\n_stayMinusErrorVars: \",a+=\"[\"+this._stayMinusErrorVars+\"]\",a+=\"\\n\",a+=\"_editVarMap:\\n\"+this._editVarMap,a+=\"\\n\"},getConstraintMap:function(){return this._markerVars},addWithArtificialVariable:function(b){a.trace&&a.fnenterprint(\"addWithArtificialVariable: \"+b);var c=new a.SlackVariable({value:++this._artificialCounter,prefix:\"a\"}),d=new a.ObjectiveVariable({name:\"az\"}),e=b.clone();a.trace&&a.traceprint(\"before addRows:\\n\"+this),this.addRow(d,e),this.addRow(c,b),a.trace&&a.traceprint(\"after addRows:\\n\"+this),this.optimize(d);var f=this.rows.get(d);if(a.trace&&a.traceprint(\"azTableauRow.constant == \"+f.constant),!a.approx(f.constant,0))throw this.removeRow(d),this.removeColumn(c),new a.RequiredFailure;var g=this.rows.get(c);if(null!=g){if(g.isConstant)return this.removeRow(c),this.removeRow(d),void 0;var h=g.anyPivotableVariable();this.pivot(h,c)}a.assert(null==this.rows.get(c),\"rowExpression(av) == null\"),this.removeColumn(c),this.removeRow(d)},tryAddingDirectly:function(b){a.trace&&a.fnenterprint(\"tryAddingDirectly: \"+b);var c=this.chooseSubject(b);return null==c?(a.trace&&a.fnexitprint(\"returning false\"),!1):(b.newSubject(c),this.columnsHasKey(c)&&this.substituteOut(c,b),this.addRow(c,b),a.trace&&a.fnexitprint(\"returning true\"),!0)},chooseSubject:function(b){a.trace&&a.fnenterprint(\"chooseSubject: \"+b);var c=null,d=!1,e=!1,f=b.terms,g=f.escapingEach(function(a,b){if(d){if(!a.isRestricted&&!this.columnsHasKey(a))return{retval:a}}else if(a.isRestricted){if(!e&&!a.isDummy&&0>b){var f=this.columns.get(a);(null==f||1==f.size&&this.columnsHasKey(this._objective))&&(c=a,e=!0)}}else c=a,d=!0},this);if(g&&void 0!==g.retval)return g.retval;if(null!=c)return c;var h=0,g=f.escapingEach(function(a,b){return a.isDummy?(this.columnsHasKey(a)||(c=a,h=b),void 0):{retval:null}},this);if(g&&void 0!==g.retval)return g.retval;if(!a.approx(b.constant,0))throw new a.RequiredFailure;return h>0&&b.multiplyMe(-1),c},deltaEditConstant:function(b,c,d){a.trace&&a.fnenterprint(\"deltaEditConstant :\"+b+\", \"+c+\", \"+d);var e=this.rows.get(c);if(null!=e)return e.constant+=b,0>e.constant&&this._infeasibleRows.add(c),void 0;var f=this.rows.get(d);if(null!=f)return f.constant+=-b,0>f.constant&&this._infeasibleRows.add(d),void 0;var g=this.columns.get(d);g||console.log(\"columnVars is null -- tableau is:\\n\"+this),g.each(function(a){var c=this.rows.get(a),e=c.coefficientFor(d);c.constant+=e*b,a.isRestricted&&0>c.constant&&this._infeasibleRows.add(a)},this)},dualOptimize:function(){a.trace&&a.fnenterprint(\"dualOptimize:\");for(var b=this.rows.get(this._objective);this._infeasibleRows.size;){var c=this._infeasibleRows.values()[0];this._infeasibleRows.delete(c);var d=null,e=this.rows.get(c);if(e&&0>e.constant){var g,f=Number.MAX_VALUE,h=e.terms;if(h.each(function(c,e){if(e>0&&c.isPivotable){var h=b.coefficientFor(c);g=h/e,(f>g||a.approx(g,f)&&c.hashCode<d.hashCode)&&(d=c,f=g)}}),f==Number.MAX_VALUE)throw new a.InternalError(\"ratio == nil (MAX_VALUE) in dualOptimize\");this.pivot(d,c)}}},newExpression:function(b,c,d){a.trace&&(a.fnenterprint(\"newExpression: \"+b),a.traceprint(\"cn.isInequality == \"+b.isInequality),a.traceprint(\"cn.required == \"+b.required));var e=b.expression,f=new a.Expression(e.constant),g=new a.SlackVariable,h=new a.DummyVariable,i=new a.SlackVariable,j=new a.SlackVariable,k=e.terms;if(k.each(function(a,b){var c=this.rows.get(a);c?f.addExpression(c,b):f.addVariable(a,b)},this),b.isInequality){if(a.trace&&a.traceprint(\"Inequality, adding slack\"),++this._slackCounter,g=new a.SlackVariable({value:this._slackCounter,prefix:\"s\"}),f.setVariable(g,-1),this._markerVars.set(b,g),!b.required){++this._slackCounter,i=new a.SlackVariable({value:this._slackCounter,prefix:\"em\"}),f.setVariable(i,1);\n    var l=this.rows.get(this._objective);l.setVariable(i,b.strength.symbolicWeight.value*b.weight),this.insertErrorVar(b,i),this.noteAddedVariable(i,this._objective)}}else if(b.required)a.trace&&a.traceprint(\"Equality, required\"),++this._dummyCounter,h=new a.DummyVariable({value:this._dummyCounter,prefix:\"d\"}),f.setVariable(h,1),this._markerVars.set(b,h),a.trace&&a.traceprint(\"Adding dummyVar == d\"+this._dummyCounter);else{a.trace&&a.traceprint(\"Equality, not required\"),++this._slackCounter,j=new a.SlackVariable({value:this._slackCounter,prefix:\"ep\"}),i=new a.SlackVariable({value:this._slackCounter,prefix:\"em\"}),f.setVariable(j,-1),f.setVariable(i,1),this._markerVars.set(b,j);var l=this.rows.get(this._objective);a.trace&&console.log(l);var m=b.strength.symbolicWeight.value*b.weight;0==m&&(a.trace&&a.traceprint(\"cn == \"+b),a.trace&&a.traceprint(\"adding \"+j+\" and \"+i+\" with swCoeff == \"+m)),l.setVariable(j,m),this.noteAddedVariable(j,this._objective),l.setVariable(i,m),this.noteAddedVariable(i,this._objective),this.insertErrorVar(b,i),this.insertErrorVar(b,j),b.isStayConstraint?(this._stayPlusErrorVars.push(j),this._stayMinusErrorVars.push(i)):b.isEditConstraint&&(c[0]=j,c[1]=i,d[0]=e.constant)}return 0>f.constant&&f.multiplyMe(-1),a.trace&&a.fnexitprint(\"returning \"+f),f},optimize:function(b){a.trace&&a.fnenterprint(\"optimize: \"+b),a.trace&&a.traceprint(\"\"+this),this._optimizeCount++;var c=this.rows.get(b);a.assert(null!=c,\"zRow != null\");for(var g,h,e=null,f=null;;){if(g=0,h=c.terms,h.escapingEach(function(a,b){return a.isPivotable&&g>b?(g=b,e=a,{brk:1}):void 0},this),g>=-d)return;a.trace&&console.log(\"entryVar:\",e,\"objectiveCoeff:\",g);var i=Number.MAX_VALUE,j=this.columns.get(e),k=0;if(j.each(function(b){if(a.trace&&a.traceprint(\"Checking \"+b),b.isPivotable){var c=this.rows.get(b),d=c.coefficientFor(e);a.trace&&a.traceprint(\"pivotable, coeff = \"+d),0>d&&(k=-c.constant/d,(i>k||a.approx(k,i)&&b.hashCode<f.hashCode)&&(i=k,f=b))}},this),i==Number.MAX_VALUE)throw new a.InternalError(\"Objective function is unbounded in optimize\");this.pivot(e,f),a.trace&&a.traceprint(\"\"+this)}},pivot:function(b,c){a.trace&&console.log(\"pivot: \",b,c);var d=!1;d&&console.time(\" SimplexSolver::pivot\"),null==b&&console.warn(\"pivot: entryVar == null\"),null==c&&console.warn(\"pivot: exitVar == null\"),d&&console.time(\"  removeRow\");var e=this.removeRow(c);d&&console.timeEnd(\"  removeRow\"),d&&console.time(\"  changeSubject\"),e.changeSubject(c,b),d&&console.timeEnd(\"  changeSubject\"),d&&console.time(\"  substituteOut\"),this.substituteOut(b,e),d&&console.timeEnd(\"  substituteOut\"),d&&console.time(\"  addRow\"),this.addRow(b,e),d&&console.timeEnd(\"  addRow\"),d&&console.timeEnd(\" SimplexSolver::pivot\")},_resetStayConstants:function(){a.trace&&console.log(\"_resetStayConstants\");for(var b=0;this._stayPlusErrorVars.length>b;b++){var c=this.rows.get(this._stayPlusErrorVars[b]);null==c&&(c=this.rows.get(this._stayMinusErrorVars[b])),null!=c&&(c.constant=0)}},_setExternalVariables:function(){a.trace&&a.fnenterprint(\"_setExternalVariables:\"),a.trace&&a.traceprint(\"\"+this),this._externalParametricVars.each(function(b){null!=this.rows.get(b)?a.trace&&console.log(\"Error: variable\"+b+\" in _externalParametricVars is basic\"):b.value=0},this),this._externalRows.each(function(a){var b=this.rows.get(a);a.value!=b.constant&&(a.value=b.constant)},this),this._fNeedsSolving=!1,this.onsolved()},onsolved:function(){},insertErrorVar:function(b,c){a.trace&&a.fnenterprint(\"insertErrorVar:\"+b+\", \"+c);var d=this._errorVars.get(c);d||(d=new a.HashSet,this._errorVars.set(b,d)),d.add(c)}})}(this.c||module.parent.exports||{}),function(a){\"use strict\";a.Timer=a.inherit({initialize:function(){this.isRunning=!1,this._elapsedMs=0},start:function(){return this.isRunning=!0,this._startReading=new Date,this},stop:function(){return this.isRunning=!1,this._elapsedMs+=new Date-this._startReading,this},reset:function(){return this.isRunning=!1,this._elapsedMs=0,this},elapsedTime:function(){return this.isRunning?(this._elapsedMs+(new Date-this._startReading))/1e3:this._elapsedMs/1e3}})}(this.c||module.parent.exports||{}),__cassowary_parser=function(){function a(a){return'\"'+a.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\x08/g,\"\\\\b\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\f/g,\"\\\\f\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g,escape)+'\"'}var b={parse:function(b,c){function k(a){g>e||(e>g&&(g=e,h=[]),h.push(a))}function l(){var a,b,c,d,f;if(d=e,f=e,a=z(),null!==a){if(c=m(),null!==c)for(b=[];null!==c;)b.push(c),c=m();else b=null;null!==b?(c=z(),null!==c?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return null!==a&&(a=function(a,b){return b}(d,a[1])),null===a&&(e=d),a}function m(){var a,b,c,d;return c=e,d=e,a=P(),null!==a?(b=s(),null!==b?a=[a,b]:(a=null,e=d)):(a=null,e=d),null!==a&&(a=function(a,b){return b}(c,a[0])),null===a&&(e=c),a}function n(){var a;return b.length>e?(a=b.charAt(e),e++):(a=null,0===f&&k(\"any character\")),a}function o(){var a;return/^[a-zA-Z]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,0===f&&k(\"[a-zA-Z]\")),null===a&&(36===b.charCodeAt(e)?(a=\"$\",e++):(a=null,0===f&&k('\"$\"')),null===a&&(95===b.charCodeAt(e)?(a=\"_\",e++):(a=null,0===f&&k('\"_\"')))),a}function p(){var a;return f++,/^[\\t\\x0B\\f \\xA0\\uFEFF]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,0===f&&k(\"[\\\\t\\\\x0B\\\\f \\\\xA0\\\\uFEFF]\")),f--,0===f&&null===a&&k(\"whitespace\"),a}function q(){var a;return/^[\\n\\r\\u2028\\u2029]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,0===f&&k(\"[\\\\n\\\\r\\\\u2028\\\\u2029]\")),a}function r(){var a;return f++,10===b.charCodeAt(e)?(a=\"\\n\",e++):(a=null,0===f&&k('\"\\\\n\"')),null===a&&(\"\\r\\n\"===b.substr(e,2)?(a=\"\\r\\n\",e+=2):(a=null,0===f&&k('\"\\\\r\\\\n\"')),null===a&&(13===b.charCodeAt(e)?(a=\"\\r\",e++):(a=null,0===f&&k('\"\\\\r\"')),null===a&&(8232===b.charCodeAt(e)?(a=\"\\u2028\",e++):(a=null,0===f&&k('\"\\\\u2028\"')),null===a&&(8233===b.charCodeAt(e)?(a=\"\\u2029\",e++):(a=null,0===f&&k('\"\\\\u2029\"')))))),f--,0===f&&null===a&&k(\"end of line\"),a}function s(){var a,c,d;return d=e,a=z(),null!==a?(59===b.charCodeAt(e)?(c=\";\",e++):(c=null,0===f&&k('\";\"')),null!==c?a=[a,c]:(a=null,e=d)):(a=null,e=d),null===a&&(d=e,a=y(),null!==a?(c=r(),null!==c?a=[a,c]:(a=null,e=d)):(a=null,e=d),null===a&&(d=e,a=z(),null!==a?(c=t(),null!==c?a=[a,c]:(a=null,e=d)):(a=null,e=d))),a}function t(){var a,c;return c=e,f++,b.length>e?(a=b.charAt(e),e++):(a=null,0===f&&k(\"any character\")),f--,null===a?a=\"\":(a=null,e=c),a}function u(){var a;return f++,a=v(),null===a&&(a=x()),f--,0===f&&null===a&&k(\"comment\"),a}function v(){var a,c,d,g,h,i,j;if(h=e,\"/*\"===b.substr(e,2)?(a=\"/*\",e+=2):(a=null,0===f&&k('\"/*\"')),null!==a){for(c=[],i=e,j=e,f++,\"*/\"===b.substr(e,2)?(d=\"*/\",e+=2):(d=null,0===f&&k('\"*/\"')),f--,null===d?d=\"\":(d=null,e=j),null!==d?(g=n(),null!==g?d=[d,g]:(d=null,e=i)):(d=null,e=i);null!==d;)c.push(d),i=e,j=e,f++,\"*/\"===b.substr(e,2)?(d=\"*/\",e+=2):(d=null,0===f&&k('\"*/\"')),f--,null===d?d=\"\":(d=null,e=j),null!==d?(g=n(),null!==g?d=[d,g]:(d=null,e=i)):(d=null,e=i);null!==c?(\"*/\"===b.substr(e,2)?(d=\"*/\",e+=2):(d=null,0===f&&k('\"*/\"')),null!==d?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a}function w(){var a,c,d,g,h,i,j;if(h=e,\"/*\"===b.substr(e,2)?(a=\"/*\",e+=2):(a=null,0===f&&k('\"/*\"')),null!==a){for(c=[],i=e,j=e,f++,\"*/\"===b.substr(e,2)?(d=\"*/\",e+=2):(d=null,0===f&&k('\"*/\"')),null===d&&(d=q()),f--,null===d?d=\"\":(d=null,e=j),null!==d?(g=n(),null!==g?d=[d,g]:(d=null,e=i)):(d=null,e=i);null!==d;)c.push(d),i=e,j=e,f++,\"*/\"===b.substr(e,2)?(d=\"*/\",e+=2):(d=null,0===f&&k('\"*/\"')),null===d&&(d=q()),f--,null===d?d=\"\":(d=null,e=j),null!==d?(g=n(),null!==g?d=[d,g]:(d=null,e=i)):(d=null,e=i);null!==c?(\"*/\"===b.substr(e,2)?(d=\"*/\",e+=2):(d=null,0===f&&k('\"*/\"')),null!==d?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a}function x(){var a,c,d,g,h,i,j;if(h=e,\"//\"===b.substr(e,2)?(a=\"//\",e+=2):(a=null,0===f&&k('\"//\"')),null!==a){for(c=[],i=e,j=e,f++,d=q(),f--,null===d?d=\"\":(d=null,e=j),null!==d?(g=n(),null!==g?d=[d,g]:(d=null,e=i)):(d=null,e=i);null!==d;)c.push(d),i=e,j=e,f++,d=q(),f--,null===d?d=\"\":(d=null,e=j),null!==d?(g=n(),null!==g?d=[d,g]:(d=null,e=i)):(d=null,e=i);null!==c?a=[a,c]:(a=null,e=h)}else a=null,e=h;return a}function y(){var a,b;for(a=[],b=p(),null===b&&(b=w(),null===b&&(b=x()));null!==b;)a.push(b),b=p(),null===b&&(b=w(),null===b&&(b=x()));return a}function z(){var a,b;for(a=[],b=p(),null===b&&(b=r(),null===b&&(b=u()));null!==b;)a.push(b),b=p(),null===b&&(b=r(),null===b&&(b=u()));return a}function A(){var a,b;return b=e,a=C(),null===a&&(a=B()),null!==a&&(a=function(a,b){return{type:\"NumericLiteral\",value:b}}(b,a)),null===a&&(e=b),a}function B(){var a,c,d;if(d=e,/^[0-9]/.test(b.charAt(e))?(c=b.charAt(e),e++):(c=null,0===f&&k(\"[0-9]\")),null!==c)for(a=[];null!==c;)a.push(c),/^[0-9]/.test(b.charAt(e))?(c=b.charAt(e),e++):(c=null,0===f&&k(\"[0-9]\"));else a=null;return null!==a&&(a=function(a,b){return parseInt(b.join(\"\"))}(d,a)),null===a&&(e=d),a}function C(){var a,c,d,g,h;return g=e,h=e,a=B(),null!==a?(46===b.charCodeAt(e)?(c=\".\",e++):(c=null,0===f&&k('\".\"')),null!==c?(d=B(),null!==d?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)):(a=null,e=h),null!==a&&(a=function(a,b){return parseFloat(b.join(\"\"))}(g,a)),null===a&&(e=g),a}function D(){var a,c,d,g;if(g=e,/^[\\-+]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,0===f&&k(\"[\\\\-+]\")),a=null!==a?a:\"\",null!==a){if(/^[0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,0===f&&k(\"[0-9]\")),null!==d)for(c=[];null!==d;)c.push(d),/^[0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,0===f&&k(\"[0-9]\"));else c=null;null!==c?a=[a,c]:(a=null,e=g)}else a=null,e=g;return a}function E(){var a,b;return f++,b=e,a=F(),null!==a&&(a=function(a,b){return b}(b,a)),null===a&&(e=b),f--,0===f&&null===a&&k(\"identifier\"),a}function F(){var a,b,c,d,g;if(f++,d=e,g=e,a=o(),null!==a){for(b=[],c=o();null!==c;)b.push(c),c=o();null!==b?a=[a,b]:(a=null,e=g)}else a=null,e=g;return null!==a&&(a=function(a,b,c){return b+c.join(\"\")}(d,a[0],a[1])),null===a&&(e=d),f--,0===f&&null===a&&k(\"identifier\"),a}function G(){var a,c,d,g,h,i,j;return i=e,a=E(),null!==a&&(a=function(a,b){return{type:\"Variable\",name:b}}(i,a)),null===a&&(e=i),null===a&&(a=A(),null===a&&(i=e,j=e,40===b.charCodeAt(e)?(a=\"(\",e++):(a=null,0===f&&k('\"(\"')),null!==a?(c=z(),null!==c?(d=P(),null!==d?(g=z(),null!==g?(41===b.charCodeAt(e)?(h=\")\",e++):(h=null,0===f&&k('\")\"')),null!==h?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)):(a=null,e=j)):(a=null,e=j)):(a=null,e=j),null!==a&&(a=function(a,b){return b}(i,a[2])),null===a&&(e=i))),a}function H(){var a,b,c,d,f;return a=G(),null===a&&(d=e,f=e,a=I(),null!==a?(b=z(),null!==b?(c=H(),null!==c?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)):(a=null,e=f),null!==a&&(a=function(a,b,c){return{type:\"UnaryExpression\",operator:b,expression:c}}(d,a[0],a[2])),null===a&&(e=d)),a}function I(){var a;return 43===b.charCodeAt(e)?(a=\"+\",e++):(a=null,0===f&&k('\"+\"')),null===a&&(45===b.charCodeAt(e)?(a=\"-\",e++):(a=null,0===f&&k('\"-\"')),null===a&&(33===b.charCodeAt(e)?(a=\"!\",e++):(a=null,0===f&&k('\"!\"')))),a}function J(){var a,b,c,d,f,g,h,i,j;if(h=e,i=e,a=H(),null!==a){for(b=[],j=e,c=z(),null!==c?(d=K(),null!==d?(f=z(),null!==f?(g=H(),null!==g?c=[c,d,f,g]:(c=null,e=j)):(c=null,e=j)):(c=null,e=j)):(c=null,e=j);null!==c;)b.push(c),j=e,c=z(),null!==c?(d=K(),null!==d?(f=z(),null!==f?(g=H(),null!==g?c=[c,d,f,g]:(c=null,e=j)):(c=null,e=j)):(c=null,e=j)):(c=null,e=j);null!==b?a=[a,b]:(a=null,e=i)}else a=null,e=i;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;c.length>e;e++)d={type:\"MultiplicativeExpression\",operator:c[e][1],left:d,right:c[e][3]};return d}(h,a[0],a[1])),null===a&&(e=h),a}function K(){var a;return 42===b.charCodeAt(e)?(a=\"*\",e++):(a=null,0===f&&k('\"*\"')),null===a&&(47===b.charCodeAt(e)?(a=\"/\",e++):(a=null,0===f&&k('\"/\"'))),a}function L(){var a,b,c,d,f,g,h,i,j;if(h=e,i=e,a=J(),null!==a){for(b=[],j=e,c=z(),null!==c?(d=M(),null!==d?(f=z(),null!==f?(g=J(),null!==g?c=[c,d,f,g]:(c=null,e=j)):(c=null,e=j)):(c=null,e=j)):(c=null,e=j);null!==c;)b.push(c),j=e,c=z(),null!==c?(d=M(),null!==d?(f=z(),null!==f?(g=J(),null!==g?c=[c,d,f,g]:(c=null,e=j)):(c=null,e=j)):(c=null,e=j)):(c=null,e=j);null!==b?a=[a,b]:(a=null,e=i)}else a=null,e=i;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;c.length>e;e++)d={type:\"AdditiveExpression\",operator:c[e][1],left:d,right:c[e][3]};return d}(h,a[0],a[1])),null===a&&(e=h),a}function M(){var a;return 43===b.charCodeAt(e)?(a=\"+\",e++):(a=null,0===f&&k('\"+\"')),null===a&&(45===b.charCodeAt(e)?(a=\"-\",e++):(a=null,0===f&&k('\"-\"'))),a}function N(){var a,b,c,d,f,g,h,i,j;if(h=e,i=e,a=L(),null!==a){for(b=[],j=e,c=z(),null!==c?(d=O(),null!==d?(f=z(),null!==f?(g=L(),null!==g?c=[c,d,f,g]:(c=null,e=j)):(c=null,e=j)):(c=null,e=j)):(c=null,e=j);null!==c;)b.push(c),j=e,c=z(),null!==c?(d=O(),null!==d?(f=z(),null!==f?(g=L(),null!==g?c=[c,d,f,g]:(c=null,e=j)):(c=null,e=j)):(c=null,e=j)):(c=null,e=j);null!==b?a=[a,b]:(a=null,e=i)}else a=null,e=i;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;c.length>e;e++)d={type:\"Inequality\",operator:c[e][1],left:d,right:c[e][3]};return d}(h,a[0],a[1])),null===a&&(e=h),a}function O(){var a;return\"<=\"===b.substr(e,2)?(a=\"<=\",e+=2):(a=null,0===f&&k('\"<=\"')),null===a&&(\">=\"===b.substr(e,2)?(a=\">=\",e+=2):(a=null,0===f&&k('\">=\"')),null===a&&(60===b.charCodeAt(e)?(a=\"<\",e++):(a=null,0===f&&k('\"<\"')),null===a&&(62===b.charCodeAt(e)?(a=\">\",e++):(a=null,0===f&&k('\">\"'))))),a}function P(){var a,c,d,g,h,i,j,l,m;if(j=e,l=e,a=N(),null!==a){for(c=[],m=e,d=z(),null!==d?(\"==\"===b.substr(e,2)?(g=\"==\",e+=2):(g=null,0===f&&k('\"==\"')),null!==g?(h=z(),null!==h?(i=N(),null!==i?d=[d,g,h,i]:(d=null,e=m)):(d=null,e=m)):(d=null,e=m)):(d=null,e=m);null!==d;)c.push(d),m=e,d=z(),null!==d?(\"==\"===b.substr(e,2)?(g=\"==\",e+=2):(g=null,0===f&&k('\"==\"')),null!==g?(h=z(),null!==h?(i=N(),null!==i?d=[d,g,h,i]:(d=null,e=m)):(d=null,e=m)):(d=null,e=m)):(d=null,e=m);null!==c?a=[a,c]:(a=null,e=l)}else a=null,e=l;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;c.length>e;e++)d={type:\"Equality\",operator:c[e][1],left:d,right:c[e][3]};return d}(j,a[0],a[1])),null===a&&(e=j),a}function Q(a){a.sort();for(var b=null,c=[],d=0;a.length>d;d++)a[d]!==b&&(c.push(a[d]),b=a[d]);return c}function R(){for(var a=1,c=1,d=!1,f=0;Math.max(e,g)>f;f++){var h=b.charAt(f);\"\\n\"===h?(d||a++,c=1,d=!1):\"\\r\"===h||\"\\u2028\"===h||\"\\u2029\"===h?(a++,c=1,d=!0):(c++,d=!1)}return{line:a,column:c}}var d={start:l,Statement:m,SourceCharacter:n,IdentifierStart:o,WhiteSpace:p,LineTerminator:q,LineTerminatorSequence:r,EOS:s,EOF:t,Comment:u,MultiLineComment:v,MultiLineCommentNoLineTerminator:w,SingleLineComment:x,_:y,__:z,Literal:A,Integer:B,Real:C,SignedInteger:D,Identifier:E,IdentifierName:F,PrimaryExpression:G,UnaryExpression:H,UnaryOperator:I,MultiplicativeExpression:J,MultiplicativeOperator:K,AdditiveExpression:L,AdditiveOperator:M,InequalityExpression:N,InequalityOperator:O,LinearExpression:P};if(void 0!==c){if(void 0===d[c])throw Error(\"Invalid rule name: \"+a(c)+\".\")}else c=\"start\";var e=0,f=0,g=0,h=[],S=d[c]();if(null===S||e!==b.length){var T=Math.max(e,g),U=b.length>T?b.charAt(T):null,V=R();throw new this.SyntaxError(Q(h),U,T,V.line,V.column)}return S},toSource:function(){return this._source}};return b.SyntaxError=function(b,c,d,e,f){function g(b,c){var d,e;switch(b.length){case 0:d=\"end of input\";break;case 1:d=b[0];break;default:d=b.slice(0,b.length-1).join(\", \")+\" or \"+b[b.length-1]}return e=c?a(c):\"end of input\",\"Expected \"+d+\" but \"+e+\" found.\"}this.name=\"SyntaxError\",this.expected=b,this.found=c,this.message=g(b,c),this.offset=d,this.line=e,this.column=f},b.SyntaxError.prototype=Error.prototype,b}();\n    }).call(\n      (typeof module != \"undefined\") ?\n          (module.compiled = true && module) : this\n    );\n    \n    },{}]},{},[1])(1)\n    });"
  },
  {
    "path": "test/esinstall/named-exports/packages/umd-named-exports/package.json",
    "content": "{\n  \"name\": \"umd-named-exports\",\n  \"version\": \"0.7.0\",\n  \"main\": \"autolayout.js\"\n}\n"
  },
  {
    "path": "test/esinstall/node-env/.gitignore",
    "content": "test-*\n"
  },
  {
    "path": "test/esinstall/node-env/node-env.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('node-env', () => {\n  it('inlines data if specified', async () => {\n    const dest = path.join(__dirname, 'test-basic');\n\n    const env = {\n      ENV_STRING: 'string',\n      ENV_NUMBER: 23,\n      ENV_BOOLEAN: true,\n      ENV_ARRAY: [1],\n      ENV_OBJECT: {obj: true},\n      ENV_NULL: null,\n      ENV_UNDEFINED: undefined,\n    };\n\n    await runTest(['node-env-mock-pkg'], {dest, env, cwd: 'test-success'});\n\n    const nodeEnvMockPkg = fs.readFileSync(path.join(dest, 'node-env-mock-pkg.js'), 'utf8');\n\n    // positive test\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const string = \"string\";`));\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const number = 23;`));\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const boolean = undefined;`));\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const array = [1];`));\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const object = {\"obj\":true};`));\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const nullValue = null;`));\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const undefinedValue = undefined;`));\n\n    // inverse test (ensure polyfill not loaded)\n    expect(nodeEnvMockPkg).not.toEqual(expect.stringContaining(`/* SNOWPACK PROCESS POLYFILL`));\n  });\n\n  it('loads polyfill if env vars missing', async () => {\n    const dest = path.join(__dirname, 'test-polyfill');\n    const env = {\n      ENV_STRING: 'string',\n    };\n\n    await runTest(['node-env-mock-pkg'], {dest, env, cwd: __dirname});\n\n    const nodeEnvMockPkg = fs.readFileSync(path.join(dest, 'node-env-mock-pkg.js'), 'utf8');\n\n    // positive test\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`const string = \"string\";`));\n    expect(nodeEnvMockPkg).toEqual(\n      expect.stringContaining(`const number = process.env.ENV_NUMBER;`),\n    );\n    expect(nodeEnvMockPkg).toEqual(expect.stringContaining(`/* SNOWPACK PROCESS POLYFILL`));\n\n    // inverse test (ensure value is not inlined also somewhere)\n    expect(nodeEnvMockPkg).not.toEqual(expect.stringContaining(`const number = 23;`));\n  });\n});\n"
  },
  {
    "path": "test/esinstall/node-env/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-node-env\",\n  \"dependencies\": {\n    \"node-env-mock-pkg\": \"file:./packages/node-env-mock-pkg\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/node-env/packages/node-env-mock-pkg/entrypoint.js",
    "content": "export const string = process.env.ENV_STRING;\nexport const number = process.env.ENV_NUMBER;\nexport const boolean = process.env.ENV_BOOLEAN;\nexport const array = process.env.ENV_ARRAY;\nexport const object = process.env.ENV_OBJECT;\nexport const nullValue = process.env.ENV_NULL;\nexport const undefinedValue = process.env.ENV_UNDEFINED;\n"
  },
  {
    "path": "test/esinstall/node-env/packages/node-env-mock-pkg/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"node-env-mock-pkg\",\n  \"browser\": {\n    \"./index.js\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot/package.json",
    "content": "{\n  \"name\": \"browser-dot\",\n  \"version\": \"1.2.3\",\n  \"browser\": {\n    \".\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot-slash/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot-slash/package.json",
    "content": "{\n  \"name\": \"browser-dot-slash\",\n  \"version\": \"1.2.3\",\n  \"browser\": {\n    \"./\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot-slash-index/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot-slash-index/package.json",
    "content": "{\n  \"name\": \"browser-dot-slash-index\",\n  \"version\": \"1.2.3\",\n  \"browser\": {\n    \"./index\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot-slash-index-js/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-dot-slash-index-js/package.json",
    "content": "{\n  \"name\": \"browser-dot-slash-index-js\",\n  \"version\": \"1.2.3\",\n  \"browser\": {\n    \"./index.js\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-index/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-index/package.json",
    "content": "{\n  \"name\": \"browser-index\",\n  \"version\": \"1.2.3\",\n  \"browser\": {\n    \"index\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-index-js/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-index-js/package.json",
    "content": "{\n  \"name\": \"browser-index-js\",\n  \"version\": \"1.2.3\",\n  \"browser\": {\n    \"index.js\": \"entrypoint.js\",\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-no-valid/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-no-valid/package.json",
    "content": "{\n  \"name\": \"browser-no-valid\",\n  \"version\": \"1.2.3\",\n  \"main\": \"entrypoint.js\",\n  \"browser\": {\n    \"./bad\": \"bad\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-path/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/browser-path/package.json",
    "content": "{\n  \"name\": \"browser-path\",\n  \"version\": \"1.2.3\",\n  \"browser\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-dot-no-slash/entrypoint.js",
    "content": "export const FOO = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-dot-no-slash/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-dot-no-slash\",\n  \"description\": \"./\",\n  \"exports\": {\n    \".\": \"./entrypoint.js\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-dot-slash/entrypoint.js",
    "content": "export const a = 'b';\n\n// ERROR: This shouldn't work without polyfill support\nimport 'http';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-dot-slash/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-dot-slash\",\n  \"description\": \"With dot slash\",\n  \"exports\": {\n    \"./\": \"./entrypoint.js\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-internal-imports/entrypoint.js",
    "content": "import * as pkg from 'export-map-internal-imports/imported-by-entrypoint';\nconsole.log(pkg);\nexport const a = 3;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-internal-imports/imported-by-entrypoint.js",
    "content": "export const a = 2;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-internal-imports/imports-entrypoint.js",
    "content": "import * as pkg from 'export-map-internal-imports';\nconsole.log(pkg);\n\nexport const a = 1;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-internal-imports/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-internal-imports\",\n  \"exports\": {\n    \".\": \"./entrypoint.js\",\n    \"./imported-by-entrypoint\": \"./imported-by-entrypoint.js\",\n    \"./imports-entrypoint\": \"./imports-entrypoint.js\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-browser/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-browser/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-object-browser\",\n  \"description\": \"With dot slash\",\n  \"exports\": {\n    \".\": {\n      \"default\": \"./no-exist.js\",\n      \"browser\": \"./entrypoint.js\"\n    }\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-browser-object/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-browser-object/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-object-browser\",\n  \"description\": \"With dot slash\",\n  \"module\": \"./entrypoint.js\",\n  \"exports\": {\n    \".\": {\n      \"browser\": {\n        \"development\": \"./no-exists.js\",\n        \"production\": \"./also-no-exists.js\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-default/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-default/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-object-default\",\n  \"description\": \"With dot slash\",\n  \"exports\": {\n    \".\": {\n      \"default\": \"./entrypoint.js\"\n    }\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-import/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-import/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-object-import\",\n  \"description\": \"With dot slash\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./entrypoint.js\"\n    }\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-no-key/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-no-key/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-object-no-key\",\n  \"description\": \"With dot slash\",\n  \"exports\": {\n    \"default\": \"./no-exist.js\",\n    \"browser\": \"./entrypoint.js\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-require/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-object-require/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-object-require\",\n  \"description\": \"With dot slash\",\n  \"exports\": {\n    \".\": {\n      \"require\": \"./entrypoint.js\"\n    }\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-star/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-star/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-star\",\n  \"description\": \"With star (wildcards)\",\n  \"exports\": {\n    \".\": \"./entrypoint.js\",\n    \"./extras/*\": \"./src/extras/*.js\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-star/src/extras/one.js",
    "content": "export const one = 'one';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-star/src/extras/other.css",
    "content": "/* This should not be included */\nbody { background: darkorchid; }"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-star/src/extras/three.js",
    "content": "export const three = 'three';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-star/src/extras/two.js",
    "content": "export const two = 'two';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/dist/esm/helpers.js",
    "content": "export const helpers = 'helpers';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/dist/index.js",
    "content": "export const index = 'index';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"export-map-star\",\n  \"description\": \"With star (wildcards)\",\n  \"exports\": {\n    \".\": \"./entrypoint.js\",\n    \"./extras/\": \"./src/extras/\",\n    \"./more/\": {\n      \"default\": \"./src/more/\",\n      \"fake_prop\": \"./error/more/\"\n    }\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/one.js",
    "content": "export const one = 'one';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/other.css",
    "content": "/* This should not be included */\nbody { background: darkorchid; }"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/three.js",
    "content": "export const three = 'three';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/src/extras/two.js",
    "content": "export const two = 'two';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/export-map-trailing-slash/src/more/one.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/implicit-main/index.d.ts",
    "content": "export interface HelloJS {\n  type: number;\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/implicit-main/index.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/implicit-main/package.json",
    "content": "{\n  \"name\": \"implicit-main\",\n  \"version\": \"1.2.3\",\n  \"types\": \"index.d.ts\"\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/jsnext-main/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/jsnext-main/package.json",
    "content": "{\n  \"name\": \"jsnext-main\",\n  \"version\": \"1.2.3\",\n  \"main\": \"./lol-this-doesnt-exist.js\",\n  \"jsnext:main\": \"./entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/main-folder/entrypoint/index.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/main-folder/package.json",
    "content": "{\n  \"name\": \"esinstall-test-main-folder\",\n  \"version\": \"1.2.3\",\n  \"main\": \"./entrypoint\"\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/module/entrypoint.js",
    "content": "export const foobar = 42;\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/module/package.json",
    "content": "{\n  \"name\": \"module\",\n  \"version\": \"1.2.3\",\n  \"main\": \"./lol-this-doesnt-exist.js\",\n  \"module\": \"./entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/package-entrypoints-browser.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\nconst path = require('path');\n\n/**\n * Browser configuration\n * https://github.com/defunctzombie/package-browser-field-spec\n */\ndescribe('package-entrypoints browser configuration', () => {\n  it('is able to resolve browser: path configuration', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-browser-path');\n\n    const targets = [\n      // \"browser\": \"index.js\"\n      'browser-path',\n    ];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n\n  it('is able to resolve browser object configuration', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-browser-object');\n\n    const targets = [\n      // The following are object based\n      // ./index.js\n      'browser-dot-slash-index-js',\n\n      // ./index\n      'browser-dot-slash-index',\n\n      // index\n      'browser-index',\n\n      // index.js\n      'browser-index-js',\n\n      // .\n      'browser-dot',\n\n      // ./\n      'browser-dot-slash',\n\n      // invalid\n      'browser-no-valid',\n    ];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n});\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/package-entrypoints-export-map.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\nconst path = require('path');\n\ndescribe('package-entrypoints exports configuration', () => {\n  it('supports all of the variations', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-map-variations');\n\n    const targets = [\n      // \".\": \"index.js\"\n      'export-map-dot-no-slash',\n\n      // \".\": { \"browser\": \"index.js\" }\n      'export-map-object-browser',\n\n      // \".\": { \"import\": \"index.js\" }\n      'export-map-object-import',\n\n      // \".\": { \"default\": \"index.js\" }\n      'export-map-object-default',\n\n      // \".\": { \"require\": \"index.js\" }\n      'export-map-object-require',\n\n      // \".\" : { \"browser\": { \"development\": \"index.js\" } }\n      'export-map-object-browser-object',\n\n      // { \"browser\": \"index.js\" }\n      'export-map-object-no-key',\n    ];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n\n  it('export-map-internal-imports', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-map-internal-imports');\n\n    const {importMap} = await runTest(\n      [\n        'export-map-internal-imports',\n        'export-map-internal-imports/imported-by-entrypoint',\n        'export-map-internal-imports/imports-entrypoint',\n      ],\n      {\n        cwd,\n        dest,\n      },\n    );\n\n    expect(importMap).toStrictEqual({\n      imports: {\n        'export-map-internal-imports': './export-map-internal-imports.js',\n        'export-map-internal-imports/imported-by-entrypoint':\n          './export-map-internal-imports/imported-by-entrypoint.js',\n        'export-map-internal-imports/imports-entrypoint':\n          './export-map-internal-imports/imports-entrypoint.js',\n      },\n    });\n  });\n\n  it.skip('\"exports\": \"./index.js\"', async () => {\n    // This should be in the \"supports all of the variations\" test, putting here for visibility.\n  });\n\n  it.skip('\"exports\": { browser, import, etc. }', async () => {\n    // This should be in the \"supports all of the variations\" test, putting here for visibility.\n    /**\n     * \"exports\": {\n          \"browser\": \"./esm/index.js\",\n          \"require\": \"./cjs/index.js\"\n        }\n     */\n  });\n\n  it.skip('\"exports\": { \".\": \"./index.js\" }', async () => {\n    // This should be in the \"supports all of the variations\" test, putting here for visibility.\n    /**\n     * \"exports\": {\n          \".\": \"./index.js\",\n     */\n  });\n\n  it('\"exports\" wildcards', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-map-star');\n    const targets = [\n      'export-map-star',\n      'export-map-star/extras/one',\n      'export-map-star/extras/two',\n      'export-map-star/extras/three',\n    ];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    expect(imports).toStrictEqual({\n      'export-map-star': './export-map-star.js',\n      'export-map-star/extras/one': './export-map-star/extras/one.js',\n      'export-map-star/extras/three': './export-map-star/extras/three.js',\n      'export-map-star/extras/two': './export-map-star/extras/two.js',\n    });\n  });\n\n  it('\"exports\" trailing slash', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-map-trailing-slash');\n    const targets = [\n      'export-map-trailing-slash',\n      'export-map-trailing-slash/extras/one.js',\n      'export-map-trailing-slash/extras/two.js',\n      'export-map-trailing-slash/extras/three.js',\n      'export-map-trailing-slash/more/one.js',\n    ];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    expect(imports).toStrictEqual({\n      'export-map-trailing-slash': './export-map-trailing-slash.js',\n      'export-map-trailing-slash/extras/one.js': './export-map-trailing-slash/extras/one.js',\n      'export-map-trailing-slash/extras/three.js': './export-map-trailing-slash/extras/three.js',\n      'export-map-trailing-slash/extras/two.js': './export-map-trailing-slash/extras/two.js',\n      'export-map-trailing-slash/more/one.js': './export-map-trailing-slash/more/one.js',\n    });\n  });\n\n  it.skip('\"exports\" with arrays', async () => {\n    // This should be in the \"supports all of the variations\" test, putting here for visibility.\n    /**\n     * WHY!\n     *   \"exports\": {\n            \".\": [\"./index.js\", \"./fallback.js\"]\n          }\n     */\n  });\n\n  it(\"supports preact's configuration\", async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-preact');\n\n    const targets = ['preact', 'preact/hooks', 'preact/debug'];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n\n  it('export . with slash throws', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-dot-slash');\n\n    const targets = ['export-map-dot-slash'];\n\n    const run = async () => {\n      await runTest(targets, {\n        cwd,\n        dest,\n      });\n    };\n\n    return expect(run).rejects.toThrow();\n  });\n\n  it('loading a missing export throws', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-missing-export');\n    const targets = ['preact/debug/src/check-props'];\n\n    const run = async () => {\n      await runTest(targets, {\n        cwd,\n        dest,\n      });\n    };\n\n    return expect(run).rejects.toThrow(\n      'Package \"preact\" exists but package.json \"exports\" does not include entry for \"./debug/src/check-props\".',\n    );\n  });\n\n  it('loading a missing export throws (with hint)', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-export-missing-export-hint');\n\n    await expect(() => runTest(['preact/hooks.js'], {cwd, dest})).rejects.toThrow(\n      'Package \"preact\" exists but package.json \"exports\" does not include entry for \"./hooks.js\".\\nDid you mean \"./hooks\"?',\n    );\n    await expect(() => runTest(['preact/hooks.cjs'], {cwd, dest})).rejects.toThrow(\n      'Package \"preact\" exists but package.json \"exports\" does not include entry for \"./hooks.cjs\".\\nDid you mean \"./hooks\"?',\n    );\n    await expect(() => runTest(['preact/hooks.mjs'], {cwd, dest})).rejects.toThrow(\n      'Package \"preact\" exists but package.json \"exports\" does not include entry for \"./hooks.mjs\".\\nDid you mean \"./hooks\"?',\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/package-entrypoints-general.test.js",
    "content": "const {runTest} = require('../esinstall-test-utils.js');\nconst path = require('path');\n\ndescribe('package-entrypoints general tests', () => {\n  it('Supports packages with a dot in the name', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-dot-in-name');\n\n    const targets = ['pkg-with-dot.in-the-name'];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n\n  it('Prefers the module field to main', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-module');\n    const targets = ['module'];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n\n  it('Prefers the jsnext:main field to main', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-jsnext-main');\n    const targets = ['jsnext-main'];\n\n    const {\n      importMap: {imports},\n    } = await runTest(targets, {\n      cwd,\n      dest,\n    });\n\n    // Loop over every target and ensure we are able to install\n    for (let pkg of targets) {\n      expect(imports[pkg]).toBeTruthy();\n    }\n  });\n\n  it('Supports \"main\" when it points to a folder', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-main-folder');\n    const spec = 'main-folder';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n    });\n\n    expect(Object.keys(imports)).toHaveLength(1);\n    expect(imports['main-folder']).toBeTruthy();\n  });\n\n  it('Supports an implicit main when types also exist', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-implicit-main');\n    const spec = 'implicit-main';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n    });\n\n    expect(Object.keys(imports)).toHaveLength(1);\n    expect(imports['implicit-main']).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-package-entrypoint\",\n  \"description\": \"Test that we properly handle all package entry points.\",\n  \"scripts\": {},\n  \"dependencies\": {\n    \"main-folder\": \"file:./main-folder\",\n    \"browser-path\": \"file:./browser-path\",\n    \"browser-dot\": \"file:./browser-dot\",\n    \"browser-dot-slash\": \"file:./browser-dot-slash\",\n    \"browser-dot-slash-index\": \"file:./browser-dot-slash-index\",\n    \"browser-dot-slash-index-js\": \"file:./browser-dot-slash-index-js\",\n    \"browser-index\": \"file:./browser-index\",\n    \"browser-index-js\": \"file:./browser-index-js\",\n    \"browser-no-valid\": \"file:./browser-no-valid\",\n    \"jsnext-main\": \"file:./jsnext-main\",\n    \"module\": \"file:./module\",\n    \"pkg-with-dot.in-the-name\": \"file:./pkg-with-dot.in-the-name\",\n    \"export-map-dot-no-slash\": \"file:./export-map-dot-no-slash\",\n    \"export-map-dot-slash\": \"file:./export-map-dot-slash\",\n    \"export-map-internal-imports\": \"file:./export-map-internal-imports\",\n    \"export-map-object-browser\": \"file:./export-map-object-browser\",\n    \"export-map-object-browser-object\": \"file:./export-map-object-browser-object\",\n    \"export-map-object-import\": \"file:./export-map-object-import\",\n    \"export-map-object-default\": \"file:./export-map-object-default\",\n    \"export-map-object-require\": \"file:./export-map-object-require\",\n    \"export-map-object-no-key\": \"file:./export-map-object-no-key\",\n    \"export-map-star\": \"file:./export-map-star\",\n    \"export-map-trailing-slash\": \"file:./export-map-trailing-slash\",\n    \"preact\": \"^10.0.0\",\n    \"implicit-main\": \"file:./implicit-main\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/pkg-with-dot.in-the-name/entrypoint.js",
    "content": "export const a = 'b';\n"
  },
  {
    "path": "test/esinstall/package-entrypoints/pkg-with-dot.in-the-name/package.json",
    "content": "{\n  \"name\": \"pkg-with-dot.in-the-name\",\n  \"version\": \"1.0.0\",\n  \"main\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/package-node-fetch/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/package-node-fetch/package-node-fetch.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('package node-fetch', () => {\n  it('allows importing node-fetch', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-node-fetch');\n    const spec = 'node-fetch';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n    });\n\n    const output = fs.readFileSync(path.join(dest, `${spec}.js`), 'utf8');\n    expect(output).toEqual(\n      // This is testing that path.dirname is implemented\n      expect.stringContaining(`global.fetch.bind(global);`),\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall/package-node-fetch/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-dep-node-fetch\",\n  \"description\": \"Handle specific node.js fetch polyfill packages\",\n  \"scripts\": {\n    \"testinstall\": \"snowpack install\"\n  },\n  \"snowpack\": {\n    \"packageOptions\": {\n      \"knownEntrypoints\": [\n        \"dep-node-fetch-mock-pkg\"\n      ]\n    }\n  },\n  \"dependencies\": {\n    \"dep-node-fetch-mock-pkg\": \"file:./packages/dep-node-fetch-mock-pkg\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-node-fetch/packages/dep-node-fetch-mock-pkg/entrypoint.js",
    "content": "import * as fetch from 'node-fetch';\nimport * as fetch_ from 'whatwg-fetch';\nconsole.log(fetch, fetch_);\n"
  },
  {
    "path": "test/esinstall/package-node-fetch/packages/dep-node-fetch-mock-pkg/package.json",
    "content": "{\n  \"version\": \"1.0.0\",\n  \"name\": \"dep-node-fetch-mock-pkg\",\n  \"module\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/package-react/__snapshots__",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`package-react matches the snapshot: allFiles 1`] = `\nArray [\n  \"import-map.json\",\n  \"react-dom.js\",\n  \"react.js\",\n]\n`;\n\nexports[`package-react matches the snapshot: cli output 1`] = `\"\"`;\n\nexports[`package-react matches the snapshot: web_modules/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"react\\\\\": \\\\\"./react.js\\\\\",\n    \\\\\"react-dom\\\\\": \\\\\"./react-dom.js\\\\\"\n  }\n}\"\n`;\n\nexports[`package-react matches the snapshot: web_modules/react.js 1`] = `\n\"import { r as react } from './common/index-XXXXXXXX.js';\nexport { r as __moduleExports, r as default } from './common/index-XXXXXXXX.js';\nvar Children = react.Children;\nvar Component = react.Component;\nvar Fragment = react.Fragment;\nvar Profiler = react.Profiler;\nvar PureComponent = react.PureComponent;\nvar StrictMode = react.StrictMode;\nvar Suspense = react.Suspense;\nvar __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\nvar cloneElement = react.cloneElement;\nvar createContext = react.createContext;\nvar createElement = react.createElement;\nvar createFactory = react.createFactory;\nvar createRef = react.createRef;\nvar forwardRef = react.forwardRef;\nvar isValidElement = react.isValidElement;\nvar lazy = react.lazy;\nvar memo = react.memo;\nvar useCallback = react.useCallback;\nvar useContext = react.useContext;\nvar useDebugValue = react.useDebugValue;\nvar useEffect = react.useEffect;\nvar useImperativeHandle = react.useImperativeHandle;\nvar useLayoutEffect = react.useLayoutEffect;\nvar useMemo = react.useMemo;\nvar useReducer = react.useReducer;\nvar useRef = react.useRef;\nvar useState = react.useState;\nvar version = react.version;\nexport { Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version };\"\n`;\n\nexports[`package-react matches the snapshot: web_modules/react-dom.js 1`] = `\n\"import { c as createCommonjsModule, r as react, o as objectAssign, a as checkPropTypes_1 } from './common/index-XXXXXXXX.js';\nvar scheduler_development = createCommonjsModule(function (module, exports) {\n{\n  (function() {\nvar enableSchedulerDebugging = false;\nvar enableProfiling = true;\nvar requestHostCallback;\nvar requestHostTimeout;\nvar cancelHostTimeout;\nvar shouldYieldToHost;\nvar requestPaint;\nif ( // If Scheduler runs in a non-DOM environment, it falls back to a naive\n// implementation using setTimeout.\ntypeof window === 'undefined' || // Check if MessageChannel is supported, too.\ntypeof MessageChannel !== 'function') {\n  // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,\n  // fallback to a naive implementation.\n  var _callback = null;\n  var _timeoutID = null;\n  var _flushCallback = function () {\n    if (_callback !== null) {\n      try {\n        var currentTime = exports.unstable_now();\n        var hasRemainingTime = true;\n        _callback(hasRemainingTime, currentTime);\n        _callback = null;\n      } catch (e) {\n        setTimeout(_flushCallback, 0);\n        throw e;\n      }\n    }\n  };\n  var initialTime = Date.now();\n  exports.unstable_now = function () {\n    return Date.now() - initialTime;\n  };\n  requestHostCallback = function (cb) {\n    if (_callback !== null) {\n      // Protect against re-entrancy.\n      setTimeout(requestHostCallback, 0, cb);\n    } else {\n      _callback = cb;\n      setTimeout(_flushCallback, 0);\n    }\n  };\n  requestHostTimeout = function (cb, ms) {\n    _timeoutID = setTimeout(cb, ms);\n  };\n  cancelHostTimeout = function () {\n    clearTimeout(_timeoutID);\n  };\n  shouldYieldToHost = function () {\n    return false;\n  };\n  requestPaint = exports.unstable_forceFrameRate = function () {};\n} else {\n  // Capture local references to native APIs, in case a polyfill overrides them.\n  var performance = window.performance;\n  var _Date = window.Date;\n  var _setTimeout = window.setTimeout;\n  var _clearTimeout = window.clearTimeout;\n  if (typeof console !== 'undefined') {\n    // TODO: Scheduler no longer requires these methods to be polyfilled. But\n    // maybe we want to continue warning if they don't exist, to preserve the\n    // option to rely on it in the future?\n    var requestAnimationFrame = window.requestAnimationFrame;\n    var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link\n    if (typeof requestAnimationFrame !== 'function') {\n      // Using console['error'] to evade Babel and ESLint\n      console['error'](\\\\\"This browser doesn't support requestAnimationFrame. \\\\\" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n    }\n    if (typeof cancelAnimationFrame !== 'function') {\n      // Using console['error'] to evade Babel and ESLint\n      console['error'](\\\\\"This browser doesn't support cancelAnimationFrame. \\\\\" + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n    }\n  }\n  if (typeof performance === 'object' && typeof performance.now === 'function') {\n    exports.unstable_now = function () {\n      return performance.now();\n    };\n  } else {\n    var _initialTime = _Date.now();\n    exports.unstable_now = function () {\n      return _Date.now() - _initialTime;\n    };\n  }\n  var isMessageLoopRunning = false;\n  var scheduledHostCallback = null;\n  var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main\n  // thread, like user events. By default, it yields multiple times per frame.\n  // It does not attempt to align with frame boundaries, since most tasks don't\n  // need to be frame aligned; for those that do, use requestAnimationFrame.\n  var yieldInterval = 5;\n  var deadline = 0; // TODO: Make this configurable\n  {\n    // \\`isInputPending\\` is not available. Since we have no way of knowing if\n    // there's pending input, always yield at the end of the frame.\n    shouldYieldToHost = function () {\n      return exports.unstable_now() >= deadline;\n    }; // Since we yield every frame regardless, \\`requestPaint\\` has no effect.\n    requestPaint = function () {};\n  }\n  exports.unstable_forceFrameRate = function (fps) {\n    if (fps < 0 || fps > 125) {\n      // Using console['error'] to evade Babel and ESLint\n      console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');\n      return;\n    }\n    if (fps > 0) {\n      yieldInterval = Math.floor(1000 / fps);\n    } else {\n      // reset the framerate\n      yieldInterval = 5;\n    }\n  };\n  var performWorkUntilDeadline = function () {\n    if (scheduledHostCallback !== null) {\n      var currentTime = exports.unstable_now(); // Yield after \\`yieldInterval\\` ms, regardless of where we are in the vsync\n      // cycle. This means there's always time remaining at the beginning of\n      // the message event.\n      deadline = currentTime + yieldInterval;\n      var hasTimeRemaining = true;\n      try {\n        var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);\n        if (!hasMoreWork) {\n          isMessageLoopRunning = false;\n          scheduledHostCallback = null;\n        } else {\n          // If there's more work, schedule the next message event at the end\n          // of the preceding one.\n          port.postMessage(null);\n        }\n      } catch (error) {\n        // If a scheduler task throws, exit the current browser task so the\n        // error can be observed.\n        port.postMessage(null);\n        throw error;\n      }\n    } else {\n      isMessageLoopRunning = false;\n    } // Yielding to the browser will give it a chance to paint, so we can\n  };\n  var channel = new MessageChannel();\n  var port = channel.port2;\n  channel.port1.onmessage = performWorkUntilDeadline;\n  requestHostCallback = function (callback) {\n    scheduledHostCallback = callback;\n    if (!isMessageLoopRunning) {\n      isMessageLoopRunning = true;\n      port.postMessage(null);\n    }\n  };\n  requestHostTimeout = function (callback, ms) {\n    taskTimeoutID = _setTimeout(function () {\n      callback(exports.unstable_now());\n    }, ms);\n  };\n  cancelHostTimeout = function () {\n    _clearTimeout(taskTimeoutID);\n    taskTimeoutID = -1;\n  };\n}\nfunction push(heap, node) {\n  var index = heap.length;\n  heap.push(node);\n  siftUp(heap, node, index);\n}\nfunction peek(heap) {\n  var first = heap[0];\n  return first === undefined ? null : first;\n}\nfunction pop(heap) {\n  var first = heap[0];\n  if (first !== undefined) {\n    var last = heap.pop();\n    if (last !== first) {\n      heap[0] = last;\n      siftDown(heap, last, 0);\n    }\n    return first;\n  } else {\n    return null;\n  }\n}\nfunction siftUp(heap, node, i) {\n  var index = i;\n  while (true) {\n    var parentIndex = index - 1 >>> 1;\n    var parent = heap[parentIndex];\n    if (parent !== undefined && compare(parent, node) > 0) {\n      // The parent is larger. Swap positions.\n      heap[parentIndex] = node;\n      heap[index] = parent;\n      index = parentIndex;\n    } else {\n      // The parent is smaller. Exit.\n      return;\n    }\n  }\n}\nfunction siftDown(heap, node, i) {\n  var index = i;\n  var length = heap.length;\n  while (index < length) {\n    var leftIndex = (index + 1) * 2 - 1;\n    var left = heap[leftIndex];\n    var rightIndex = leftIndex + 1;\n    var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.\n    if (left !== undefined && compare(left, node) < 0) {\n      if (right !== undefined && compare(right, left) < 0) {\n        heap[index] = right;\n        heap[rightIndex] = node;\n        index = rightIndex;\n      } else {\n        heap[index] = left;\n        heap[leftIndex] = node;\n        index = leftIndex;\n      }\n    } else if (right !== undefined && compare(right, node) < 0) {\n      heap[index] = right;\n      heap[rightIndex] = node;\n      index = rightIndex;\n    } else {\n      // Neither child is smaller. Exit.\n      return;\n    }\n  }\n}\nfunction compare(a, b) {\n  // Compare sort index first, then task id.\n  var diff = a.sortIndex - b.sortIndex;\n  return diff !== 0 ? diff : a.id - b.id;\n}\n// TODO: Use symbols?\nvar NoPriority = 0;\nvar ImmediatePriority = 1;\nvar UserBlockingPriority = 2;\nvar NormalPriority = 3;\nvar LowPriority = 4;\nvar IdlePriority = 5;\nvar runIdCounter = 0;\nvar mainThreadIdCounter = 0;\nvar profilingStateSize = 4;\nvar sharedProfilingBuffer =  // $FlowFixMe Flow doesn't know about SharedArrayBuffer\ntypeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer\ntypeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9\n;\nvar profilingState =  sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks\nvar PRIORITY = 0;\nvar CURRENT_TASK_ID = 1;\nvar CURRENT_RUN_ID = 2;\nvar QUEUE_SIZE = 3;\n{\n  profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue\n  // array might include canceled tasks.\n  profilingState[QUEUE_SIZE] = 0;\n  profilingState[CURRENT_TASK_ID] = 0;\n} // Bytes per element is 4\nvar INITIAL_EVENT_LOG_SIZE = 131072;\nvar MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes\nvar eventLogSize = 0;\nvar eventLogBuffer = null;\nvar eventLog = null;\nvar eventLogIndex = 0;\nvar TaskStartEvent = 1;\nvar TaskCompleteEvent = 2;\nvar TaskErrorEvent = 3;\nvar TaskCancelEvent = 4;\nvar TaskRunEvent = 5;\nvar TaskYieldEvent = 6;\nvar SchedulerSuspendEvent = 7;\nvar SchedulerResumeEvent = 8;\nfunction logEvent(entries) {\n  if (eventLog !== null) {\n    var offset = eventLogIndex;\n    eventLogIndex += entries.length;\n    if (eventLogIndex + 1 > eventLogSize) {\n      eventLogSize *= 2;\n      if (eventLogSize > MAX_EVENT_LOG_SIZE) {\n        // Using console['error'] to evade Babel and ESLint\n        console['error'](\\\\\"Scheduler Profiling: Event log exceeded maximum size. Don't \\\\\" + 'forget to call \\`stopLoggingProfilingEvents()\\`.');\n        stopLoggingProfilingEvents();\n        return;\n      }\n      var newEventLog = new Int32Array(eventLogSize * 4);\n      newEventLog.set(eventLog);\n      eventLogBuffer = newEventLog.buffer;\n      eventLog = newEventLog;\n    }\n    eventLog.set(entries, offset);\n  }\n}\nfunction startLoggingProfilingEvents() {\n  eventLogSize = INITIAL_EVENT_LOG_SIZE;\n  eventLogBuffer = new ArrayBuffer(eventLogSize * 4);\n  eventLog = new Int32Array(eventLogBuffer);\n  eventLogIndex = 0;\n}\nfunction stopLoggingProfilingEvents() {\n  var buffer = eventLogBuffer;\n  eventLogSize = 0;\n  eventLogBuffer = null;\n  eventLog = null;\n  eventLogIndex = 0;\n  return buffer;\n}\nfunction markTaskStart(task, ms) {\n  {\n    profilingState[QUEUE_SIZE]++;\n    if (eventLog !== null) {\n      // performance.now returns a float, representing milliseconds. When the\n      // event is logged, it's coerced to an int. Convert to microseconds to\n      // maintain extra degrees of precision.\n      logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);\n    }\n  }\n}\nfunction markTaskCompleted(task, ms) {\n  {\n    profilingState[PRIORITY] = NoPriority;\n    profilingState[CURRENT_TASK_ID] = 0;\n    profilingState[QUEUE_SIZE]--;\n    if (eventLog !== null) {\n      logEvent([TaskCompleteEvent, ms * 1000, task.id]);\n    }\n  }\n}\nfunction markTaskCanceled(task, ms) {\n  {\n    profilingState[QUEUE_SIZE]--;\n    if (eventLog !== null) {\n      logEvent([TaskCancelEvent, ms * 1000, task.id]);\n    }\n  }\n}\nfunction markTaskErrored(task, ms) {\n  {\n    profilingState[PRIORITY] = NoPriority;\n    profilingState[CURRENT_TASK_ID] = 0;\n    profilingState[QUEUE_SIZE]--;\n    if (eventLog !== null) {\n      logEvent([TaskErrorEvent, ms * 1000, task.id]);\n    }\n  }\n}\nfunction markTaskRun(task, ms) {\n  {\n    runIdCounter++;\n    profilingState[PRIORITY] = task.priorityLevel;\n    profilingState[CURRENT_TASK_ID] = task.id;\n    profilingState[CURRENT_RUN_ID] = runIdCounter;\n    if (eventLog !== null) {\n      logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);\n    }\n  }\n}\nfunction markTaskYield(task, ms) {\n  {\n    profilingState[PRIORITY] = NoPriority;\n    profilingState[CURRENT_TASK_ID] = 0;\n    profilingState[CURRENT_RUN_ID] = 0;\n    if (eventLog !== null) {\n      logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);\n    }\n  }\n}\nfunction markSchedulerSuspended(ms) {\n  {\n    mainThreadIdCounter++;\n    if (eventLog !== null) {\n      logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);\n    }\n  }\n}\nfunction markSchedulerUnsuspended(ms) {\n  {\n    if (eventLog !== null) {\n      logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);\n    }\n  }\n}\n/* eslint-disable no-var */\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\nvar maxSigned31BitInt = 1073741823; // Times out immediately\nvar IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out\nvar USER_BLOCKING_PRIORITY = 250;\nvar NORMAL_PRIORITY_TIMEOUT = 5000;\nvar LOW_PRIORITY_TIMEOUT = 10000; // Never times out\nvar IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap\nvar taskQueue = [];\nvar timerQueue = []; // Incrementing id counter. Used to maintain insertion order.\nvar taskIdCounter = 1; // Pausing the scheduler is useful for debugging.\nvar currentTask = null;\nvar currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.\nvar isPerformingWork = false;\nvar isHostCallbackScheduled = false;\nvar isHostTimeoutScheduled = false;\nfunction advanceTimers(currentTime) {\n  // Check for tasks that are no longer delayed and add them to the queue.\n  var timer = peek(timerQueue);\n  while (timer !== null) {\n    if (timer.callback === null) {\n      // Timer was cancelled.\n      pop(timerQueue);\n    } else if (timer.startTime <= currentTime) {\n      // Timer fired. Transfer to the task queue.\n      pop(timerQueue);\n      timer.sortIndex = timer.expirationTime;\n      push(taskQueue, timer);\n      {\n        markTaskStart(timer, currentTime);\n        timer.isQueued = true;\n      }\n    } else {\n      // Remaining timers are pending.\n      return;\n    }\n    timer = peek(timerQueue);\n  }\n}\nfunction handleTimeout(currentTime) {\n  isHostTimeoutScheduled = false;\n  advanceTimers(currentTime);\n  if (!isHostCallbackScheduled) {\n    if (peek(taskQueue) !== null) {\n      isHostCallbackScheduled = true;\n      requestHostCallback(flushWork);\n    } else {\n      var firstTimer = peek(timerQueue);\n      if (firstTimer !== null) {\n        requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n      }\n    }\n  }\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n  {\n    markSchedulerUnsuspended(initialTime);\n  } // We'll need a host callback the next time work is scheduled.\n  isHostCallbackScheduled = false;\n  if (isHostTimeoutScheduled) {\n    // We scheduled a timeout but it's no longer needed. Cancel it.\n    isHostTimeoutScheduled = false;\n    cancelHostTimeout();\n  }\n  isPerformingWork = true;\n  var previousPriorityLevel = currentPriorityLevel;\n  try {\n    if (enableProfiling) {\n      try {\n        return workLoop(hasTimeRemaining, initialTime);\n      } catch (error) {\n        if (currentTask !== null) {\n          var currentTime = exports.unstable_now();\n          markTaskErrored(currentTask, currentTime);\n          currentTask.isQueued = false;\n        }\n        throw error;\n      }\n    }\n  } finally {\n    currentTask = null;\n    currentPriorityLevel = previousPriorityLevel;\n    isPerformingWork = false;\n    {\n      var _currentTime = exports.unstable_now();\n      markSchedulerSuspended(_currentTime);\n    }\n  }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n  var currentTime = initialTime;\n  advanceTimers(currentTime);\n  currentTask = peek(taskQueue);\n  while (currentTask !== null && !(enableSchedulerDebugging )) {\n    if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n      // This currentTask hasn't expired, and we've reached the deadline.\n      break;\n    }\n    var callback = currentTask.callback;\n    if (callback !== null) {\n      currentTask.callback = null;\n      currentPriorityLevel = currentTask.priorityLevel;\n      var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n      markTaskRun(currentTask, currentTime);\n      var continuationCallback = callback(didUserCallbackTimeout);\n      currentTime = exports.unstable_now();\n      if (typeof continuationCallback === 'function') {\n        currentTask.callback = continuationCallback;\n        markTaskYield(currentTask, currentTime);\n      } else {\n        {\n          markTaskCompleted(currentTask, currentTime);\n          currentTask.isQueued = false;\n        }\n        if (currentTask === peek(taskQueue)) {\n          pop(taskQueue);\n        }\n      }\n      advanceTimers(currentTime);\n    } else {\n      pop(taskQueue);\n    }\n    currentTask = peek(taskQueue);\n  } // Return whether there's additional work\n  if (currentTask !== null) {\n    return true;\n  } else {\n    var firstTimer = peek(timerQueue);\n    if (firstTimer !== null) {\n      requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n    }\n    return false;\n  }\n}\nfunction unstable_runWithPriority(priorityLevel, eventHandler) {\n  switch (priorityLevel) {\n    case ImmediatePriority:\n    case UserBlockingPriority:\n    case NormalPriority:\n    case LowPriority:\n    case IdlePriority:\n      break;\n    default:\n      priorityLevel = NormalPriority;\n  }\n  var previousPriorityLevel = currentPriorityLevel;\n  currentPriorityLevel = priorityLevel;\n  try {\n    return eventHandler();\n  } finally {\n    currentPriorityLevel = previousPriorityLevel;\n  }\n}\nfunction unstable_next(eventHandler) {\n  var priorityLevel;\n  switch (currentPriorityLevel) {\n    case ImmediatePriority:\n    case UserBlockingPriority:\n    case NormalPriority:\n      // Shift down to normal priority\n      priorityLevel = NormalPriority;\n      break;\n    default:\n      // Anything lower than normal priority should remain at the current level.\n      priorityLevel = currentPriorityLevel;\n      break;\n  }\n  var previousPriorityLevel = currentPriorityLevel;\n  currentPriorityLevel = priorityLevel;\n  try {\n    return eventHandler();\n  } finally {\n    currentPriorityLevel = previousPriorityLevel;\n  }\n}\nfunction unstable_wrapCallback(callback) {\n  var parentPriorityLevel = currentPriorityLevel;\n  return function () {\n    // This is a fork of runWithPriority, inlined for performance.\n    var previousPriorityLevel = currentPriorityLevel;\n    currentPriorityLevel = parentPriorityLevel;\n    try {\n      return callback.apply(this, arguments);\n    } finally {\n      currentPriorityLevel = previousPriorityLevel;\n    }\n  };\n}\nfunction timeoutForPriorityLevel(priorityLevel) {\n  switch (priorityLevel) {\n    case ImmediatePriority:\n      return IMMEDIATE_PRIORITY_TIMEOUT;\n    case UserBlockingPriority:\n      return USER_BLOCKING_PRIORITY;\n    case IdlePriority:\n      return IDLE_PRIORITY;\n    case LowPriority:\n      return LOW_PRIORITY_TIMEOUT;\n    case NormalPriority:\n    default:\n      return NORMAL_PRIORITY_TIMEOUT;\n  }\n}\nfunction unstable_scheduleCallback(priorityLevel, callback, options) {\n  var currentTime = exports.unstable_now();\n  var startTime;\n  var timeout;\n  if (typeof options === 'object' && options !== null) {\n    var delay = options.delay;\n    if (typeof delay === 'number' && delay > 0) {\n      startTime = currentTime + delay;\n    } else {\n      startTime = currentTime;\n    }\n    timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);\n  } else {\n    timeout = timeoutForPriorityLevel(priorityLevel);\n    startTime = currentTime;\n  }\n  var expirationTime = startTime + timeout;\n  var newTask = {\n    id: taskIdCounter++,\n    callback: callback,\n    priorityLevel: priorityLevel,\n    startTime: startTime,\n    expirationTime: expirationTime,\n    sortIndex: -1\n  };\n  {\n    newTask.isQueued = false;\n  }\n  if (startTime > currentTime) {\n    // This is a delayed task.\n    newTask.sortIndex = startTime;\n    push(timerQueue, newTask);\n    if (peek(taskQueue) === null && newTask === peek(timerQueue)) {\n      // All tasks are delayed, and this is the task with the earliest delay.\n      if (isHostTimeoutScheduled) {\n        // Cancel an existing timeout.\n        cancelHostTimeout();\n      } else {\n        isHostTimeoutScheduled = true;\n      } // Schedule a timeout.\n      requestHostTimeout(handleTimeout, startTime - currentTime);\n    }\n  } else {\n    newTask.sortIndex = expirationTime;\n    push(taskQueue, newTask);\n    {\n      markTaskStart(newTask, currentTime);\n      newTask.isQueued = true;\n    } // Schedule a host callback, if needed. If we're already performing work,\n    // wait until the next time we yield.\n    if (!isHostCallbackScheduled && !isPerformingWork) {\n      isHostCallbackScheduled = true;\n      requestHostCallback(flushWork);\n    }\n  }\n  return newTask;\n}\nfunction unstable_pauseExecution() {\n}\nfunction unstable_continueExecution() {\n  if (!isHostCallbackScheduled && !isPerformingWork) {\n    isHostCallbackScheduled = true;\n    requestHostCallback(flushWork);\n  }\n}\nfunction unstable_getFirstCallbackNode() {\n  return peek(taskQueue);\n}\nfunction unstable_cancelCallback(task) {\n  {\n    if (task.isQueued) {\n      var currentTime = exports.unstable_now();\n      markTaskCanceled(task, currentTime);\n      task.isQueued = false;\n    }\n  } // Null out the callback to indicate the task has been canceled. (Can't\n  // remove from the queue because you can't remove arbitrary nodes from an\n  // array based heap, only the first one.)\n  task.callback = null;\n}\nfunction unstable_getCurrentPriorityLevel() {\n  return currentPriorityLevel;\n}\nfunction unstable_shouldYield() {\n  var currentTime = exports.unstable_now();\n  advanceTimers(currentTime);\n  var firstTask = peek(taskQueue);\n  return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();\n}\nvar unstable_requestPaint = requestPaint;\nvar unstable_Profiling =  {\n  startLoggingProfilingEvents: startLoggingProfilingEvents,\n  stopLoggingProfilingEvents: stopLoggingProfilingEvents,\n  sharedProfilingBuffer: sharedProfilingBuffer\n} ;\nexports.unstable_IdlePriority = IdlePriority;\nexports.unstable_ImmediatePriority = ImmediatePriority;\nexports.unstable_LowPriority = LowPriority;\nexports.unstable_NormalPriority = NormalPriority;\nexports.unstable_Profiling = unstable_Profiling;\nexports.unstable_UserBlockingPriority = UserBlockingPriority;\nexports.unstable_cancelCallback = unstable_cancelCallback;\nexports.unstable_continueExecution = unstable_continueExecution;\nexports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;\nexports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;\nexports.unstable_next = unstable_next;\nexports.unstable_pauseExecution = unstable_pauseExecution;\nexports.unstable_requestPaint = unstable_requestPaint;\nexports.unstable_runWithPriority = unstable_runWithPriority;\nexports.unstable_scheduleCallback = unstable_scheduleCallback;\nexports.unstable_shouldYield = unstable_shouldYield;\nexports.unstable_wrapCallback = unstable_wrapCallback;\n  })();\n}\n});\nvar scheduler = createCommonjsModule(function (module) {\n{\n  module.exports = scheduler_development;\n}\n});\nvar schedulerTracing_development = createCommonjsModule(function (module, exports) {\n{\n  (function() {\nvar DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.\nvar interactionIDCounter = 0;\nvar threadIDCounter = 0; // Set of currently traced interactions.\n// Interactions \\\\\"stack\\\\\"–\n// Meaning that newly traced interactions are appended to the previously active set.\n// When an interaction goes out of scope, the previous set (if any) is restored.\nexports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.\nexports.__subscriberRef = null;\n{\n  exports.__interactionsRef = {\n    current: new Set()\n  };\n  exports.__subscriberRef = {\n    current: null\n  };\n}\nfunction unstable_clear(callback) {\n  var prevInteractions = exports.__interactionsRef.current;\n  exports.__interactionsRef.current = new Set();\n  try {\n    return callback();\n  } finally {\n    exports.__interactionsRef.current = prevInteractions;\n  }\n}\nfunction unstable_getCurrent() {\n  {\n    return exports.__interactionsRef.current;\n  }\n}\nfunction unstable_getThreadID() {\n  return ++threadIDCounter;\n}\nfunction unstable_trace(name, timestamp, callback) {\n  var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;\n  var interaction = {\n    __count: 1,\n    id: interactionIDCounter++,\n    name: name,\n    timestamp: timestamp\n  };\n  var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.\n  // To do that, clone the current interactions.\n  // The previous set will be restored upon completion.\n  var interactions = new Set(prevInteractions);\n  interactions.add(interaction);\n  exports.__interactionsRef.current = interactions;\n  var subscriber = exports.__subscriberRef.current;\n  var returnValue;\n  try {\n    if (subscriber !== null) {\n      subscriber.onInteractionTraced(interaction);\n    }\n  } finally {\n    try {\n      if (subscriber !== null) {\n        subscriber.onWorkStarted(interactions, threadID);\n      }\n    } finally {\n      try {\n        returnValue = callback();\n      } finally {\n        exports.__interactionsRef.current = prevInteractions;\n        try {\n          if (subscriber !== null) {\n            subscriber.onWorkStopped(interactions, threadID);\n          }\n        } finally {\n          interaction.__count--; // If no async work was scheduled for this interaction,\n          // Notify subscribers that it's completed.\n          if (subscriber !== null && interaction.__count === 0) {\n            subscriber.onInteractionScheduledWorkCompleted(interaction);\n          }\n        }\n      }\n    }\n  }\n  return returnValue;\n}\nfunction unstable_wrap(callback) {\n  var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;\n  var wrappedInteractions = exports.__interactionsRef.current;\n  var subscriber = exports.__subscriberRef.current;\n  if (subscriber !== null) {\n    subscriber.onWorkScheduled(wrappedInteractions, threadID);\n  } // Update the pending async work count for the current interactions.\n  // Update after calling subscribers in case of error.\n  wrappedInteractions.forEach(function (interaction) {\n    interaction.__count++;\n  });\n  var hasRun = false;\n  function wrapped() {\n    var prevInteractions = exports.__interactionsRef.current;\n    exports.__interactionsRef.current = wrappedInteractions;\n    subscriber = exports.__subscriberRef.current;\n    try {\n      var returnValue;\n      try {\n        if (subscriber !== null) {\n          subscriber.onWorkStarted(wrappedInteractions, threadID);\n        }\n      } finally {\n        try {\n          returnValue = callback.apply(undefined, arguments);\n        } finally {\n          exports.__interactionsRef.current = prevInteractions;\n          if (subscriber !== null) {\n            subscriber.onWorkStopped(wrappedInteractions, threadID);\n          }\n        }\n      }\n      return returnValue;\n    } finally {\n      if (!hasRun) {\n        // We only expect a wrapped function to be executed once,\n        // But in the event that it's executed more than once–\n        // Only decrement the outstanding interaction counts once.\n        hasRun = true; // Update pending async counts for all wrapped interactions.\n        // If this was the last scheduled async work for any of them,\n        // Mark them as completed.\n        wrappedInteractions.forEach(function (interaction) {\n          interaction.__count--;\n          if (subscriber !== null && interaction.__count === 0) {\n            subscriber.onInteractionScheduledWorkCompleted(interaction);\n          }\n        });\n      }\n    }\n  }\n  wrapped.cancel = function cancel() {\n    subscriber = exports.__subscriberRef.current;\n    try {\n      if (subscriber !== null) {\n        subscriber.onWorkCanceled(wrappedInteractions, threadID);\n      }\n    } finally {\n      // Update pending async counts for all wrapped interactions.\n      // If this was the last scheduled async work for any of them,\n      // Mark them as completed.\n      wrappedInteractions.forEach(function (interaction) {\n        interaction.__count--;\n        if (subscriber && interaction.__count === 0) {\n          subscriber.onInteractionScheduledWorkCompleted(interaction);\n        }\n      });\n    }\n  };\n  return wrapped;\n}\nvar subscribers = null;\n{\n  subscribers = new Set();\n}\nfunction unstable_subscribe(subscriber) {\n  {\n    subscribers.add(subscriber);\n    if (subscribers.size === 1) {\n      exports.__subscriberRef.current = {\n        onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,\n        onInteractionTraced: onInteractionTraced,\n        onWorkCanceled: onWorkCanceled,\n        onWorkScheduled: onWorkScheduled,\n        onWorkStarted: onWorkStarted,\n        onWorkStopped: onWorkStopped\n      };\n    }\n  }\n}\nfunction unstable_unsubscribe(subscriber) {\n  {\n    subscribers.delete(subscriber);\n    if (subscribers.size === 0) {\n      exports.__subscriberRef.current = null;\n    }\n  }\n}\nfunction onInteractionTraced(interaction) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onInteractionTraced(interaction);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onInteractionScheduledWorkCompleted(interaction) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onInteractionScheduledWorkCompleted(interaction);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkScheduled(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkScheduled(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkStarted(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkStarted(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkStopped(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkStopped(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nfunction onWorkCanceled(interactions, threadID) {\n  var didCatchError = false;\n  var caughtError = null;\n  subscribers.forEach(function (subscriber) {\n    try {\n      subscriber.onWorkCanceled(interactions, threadID);\n    } catch (error) {\n      if (!didCatchError) {\n        didCatchError = true;\n        caughtError = error;\n      }\n    }\n  });\n  if (didCatchError) {\n    throw caughtError;\n  }\n}\nexports.unstable_clear = unstable_clear;\nexports.unstable_getCurrent = unstable_getCurrent;\nexports.unstable_getThreadID = unstable_getThreadID;\nexports.unstable_subscribe = unstable_subscribe;\nexports.unstable_trace = unstable_trace;\nexports.unstable_unsubscribe = unstable_unsubscribe;\nexports.unstable_wrap = unstable_wrap;\n  })();\n}\n});\nvar tracing = createCommonjsModule(function (module) {\n{\n  module.exports = schedulerTracing_development;\n}\n});\nvar reactDom_development = createCommonjsModule(function (module, exports) {\n{\n  (function() {\nvar React = react;\nvar _assign = objectAssign;\nvar Scheduler = scheduler;\nvar checkPropTypes = checkPropTypes_1;\nvar tracing$1 = tracing;\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.\n// Current owner and dispatcher used to share the same ref,\n// but PR #14548 split them out to better support the react-debug-tools package.\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {\n  ReactSharedInternals.ReactCurrentDispatcher = {\n    current: null\n  };\n}\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {\n  ReactSharedInternals.ReactCurrentBatchConfig = {\n    suspense: null\n  };\n}\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\nfunction warn(format) {\n  {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n    printWarning('warn', format, args);\n  }\n}\nfunction error(format) {\n  {\n    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n      args[_key2 - 1] = arguments[_key2];\n    }\n    printWarning('error', format, args);\n  }\n}\nfunction printWarning(level, format, args) {\n  // When changing this logic, you might want to also\n  // update consoleWithStackDev.www.js as well.\n  {\n    var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('    in') === 0;\n    if (!hasExistingStack) {\n      var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n      var stack = ReactDebugCurrentFrame.getStackAddendum();\n      if (stack !== '') {\n        format += '%s';\n        args = args.concat([stack]);\n      }\n    }\n    var argsWithFormat = args.map(function (item) {\n      return '' + item;\n    }); // Careful: RN currently depends on this prefix\n    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n    // breaks IE9: https://github.com/facebook/react/issues/13610\n    // eslint-disable-next-line react-internal/no-production-logging\n    Function.prototype.apply.call(console[level], console, argsWithFormat);\n    try {\n      // --- Welcome to debugging React ---\n      // This error was thrown as a convenience so that you can use this stack\n      // to find the callsite that caused this warning to fire.\n      var argIndex = 0;\n      var message = 'Warning: ' + format.replace(/%s/g, function () {\n        return args[argIndex++];\n      });\n      throw new Error(message);\n    } catch (x) {}\n  }\n}\nif (!React) {\n  {\n    throw Error( \\\\\"ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.\\\\\" );\n  }\n}\nvar invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {\n  var funcArgs = Array.prototype.slice.call(arguments, 3);\n  try {\n    func.apply(context, funcArgs);\n  } catch (error) {\n    this.onError(error);\n  }\n};\n{\n  // In DEV mode, we swap out invokeGuardedCallback for a special version\n  // that plays more nicely with the browser's DevTools. The idea is to preserve\n  // \\\\\"Pause on exceptions\\\\\" behavior. Because React wraps all user-provided\n  // functions in invokeGuardedCallback, and the production version of\n  // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n  // like caught exceptions, and the DevTools won't pause unless the developer\n  // takes the extra step of enabling pause on caught exceptions. This is\n  // unintuitive, though, because even though React has caught the error, from\n  // the developer's perspective, the error is uncaught.\n  //\n  // To preserve the expected \\\\\"Pause on exceptions\\\\\" behavior, we don't use a\n  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n  // DOM node, and call the user-provided callback from inside an event handler\n  // for that fake event. If the callback throws, the error is \\\\\"captured\\\\\" using\n  // a global event handler. But because the error happens in a different\n  // event loop context, it does not interrupt the normal program flow.\n  // Effectively, this gives us try-catch behavior without actually using\n  // try-catch. Neat!\n  // Check that the browser supports the APIs we need to implement our special\n  // DEV version of invokeGuardedCallback\n  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n    var fakeNode = document.createElement('react');\n    var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n      // If document doesn't exist we know for sure we will crash in this method\n      // when we call document.createEvent(). However this can cause confusing\n      // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n      // So we preemptively throw with a better message instead.\n      if (!(typeof document !== 'undefined')) {\n        {\n          throw Error( \\\\\"The \\`document\\` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in \\`componentWillUnmount\\`), or you can change the test itself to be asynchronous.\\\\\" );\n        }\n      }\n      var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We\n      // set this to true at the beginning, then set it to false right after\n      // calling the function. If the function errors, \\`didError\\` will never be\n      // set to false. This strategy works even if the browser is flaky and\n      // fails to call our global error handler, because it doesn't rely on\n      // the error event at all.\n      var didError = true; // Keeps track of the value of window.event so that we can reset it\n      // during the callback to let user code access window.event in the\n      // browsers that support it.\n      var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n      // dispatching: https://github.com/facebook/react/issues/13688\n      var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously\n      // dispatch our fake event using \\`dispatchEvent\\`. Inside the handler, we\n      // call the user-provided callback.\n      var funcArgs = Array.prototype.slice.call(arguments, 3);\n      function callCallback() {\n        // We immediately remove the callback from event listeners so that\n        // nested \\`invokeGuardedCallback\\` calls do not clash. Otherwise, a\n        // nested call would trigger the fake event handlers of any call higher\n        // in the stack.\n        fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n        // window.event assignment in both IE <= 10 as they throw an error\n        // \\\\\"Member not found\\\\\" in strict mode, and in Firefox which does not\n        // support window.event.\n        if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n          window.event = windowEvent;\n        }\n        func.apply(context, funcArgs);\n        didError = false;\n      } // Create a global error event handler. We use this to capture the value\n      // that was thrown. It's possible that this error handler will fire more\n      // than once; for example, if non-React code also calls \\`dispatchEvent\\`\n      // and a handler for that event throws. We should be resilient to most of\n      // those cases. Even if our error event handler fires more than once, the\n      // last error event is always used. If the callback actually does error,\n      // we know that the last error event is the correct one, because it's not\n      // possible for anything else to have happened in between our callback\n      // erroring and the code that follows the \\`dispatchEvent\\` call below. If\n      // the callback doesn't error, but the error event was fired, we know to\n      // ignore it because \\`didError\\` will be false, as described above.\n      var error; // Use this to track whether the error event is ever called.\n      var didSetError = false;\n      var isCrossOriginError = false;\n      function handleWindowError(event) {\n        error = event.error;\n        didSetError = true;\n        if (error === null && event.colno === 0 && event.lineno === 0) {\n          isCrossOriginError = true;\n        }\n        if (event.defaultPrevented) {\n          // Some other error handler has prevented default.\n          // Browsers silence the error report if this happens.\n          // We'll remember this to later decide whether to log it or not.\n          if (error != null && typeof error === 'object') {\n            try {\n              error._suppressLogging = true;\n            } catch (inner) {// Ignore.\n            }\n          }\n        }\n      } // Create a fake event type.\n      var evtType = \\\\\"react-\\\\\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n      window.addEventListener('error', handleWindowError);\n      fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n      // errors, it will trigger our global error handler.\n      evt.initEvent(evtType, false, false);\n      fakeNode.dispatchEvent(evt);\n      if (windowEventDescriptor) {\n        Object.defineProperty(window, 'event', windowEventDescriptor);\n      }\n      if (didError) {\n        if (!didSetError) {\n          // The callback errored, but the error event never fired.\n          error = new Error('An error was thrown inside one of your components, but React ' + \\\\\"doesn't know what it was. This is likely due to browser \\\\\" + 'flakiness. React does its best to preserve the \\\\\"Pause on ' + 'exceptions\\\\\" behavior of the DevTools, which requires some ' + \\\\\"DEV-mode only tricks. It's possible that these don't work in \\\\\" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n        } else if (isCrossOriginError) {\n          error = new Error(\\\\\"A cross-origin error was thrown. React doesn't have access to \\\\\" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n        }\n        this.onError(error);\n      } // Remove our event listeners\n      window.removeEventListener('error', handleWindowError);\n    };\n    invokeGuardedCallbackImpl = invokeGuardedCallbackDev;\n  }\n}\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n  onError: function (error) {\n    hasError = true;\n    caughtError = error;\n  }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n  hasError = false;\n  caughtError = null;\n  invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by \\`rethrowCaughtError\\` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n  invokeGuardedCallback.apply(this, arguments);\n  if (hasError) {\n    var error = clearCaughtError();\n    if (!hasRethrowError) {\n      hasRethrowError = true;\n      rethrowError = error;\n    }\n  }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\nfunction rethrowCaughtError() {\n  if (hasRethrowError) {\n    var error = rethrowError;\n    hasRethrowError = false;\n    rethrowError = null;\n    throw error;\n  }\n}\nfunction hasCaughtError() {\n  return hasError;\n}\nfunction clearCaughtError() {\n  if (hasError) {\n    var error = caughtError;\n    hasError = false;\n    caughtError = null;\n    return error;\n  } else {\n    {\n      {\n        throw Error( \\\\\"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  }\n}\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\nfunction setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {\n  getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;\n  getInstanceFromNode = getInstanceFromNodeImpl;\n  getNodeFromInstance = getNodeFromInstanceImpl;\n  {\n    if (!getNodeFromInstance || !getInstanceFromNode) {\n      error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');\n    }\n  }\n}\nvar validateEventDispatches;\n{\n  validateEventDispatches = function (event) {\n    var dispatchListeners = event._dispatchListeners;\n    var dispatchInstances = event._dispatchInstances;\n    var listenersIsArr = Array.isArray(dispatchListeners);\n    var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n    var instancesIsArr = Array.isArray(dispatchInstances);\n    var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n    if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {\n      error('EventPluginUtils: Invalid \\`event\\`.');\n    }\n  };\n}\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\nfunction executeDispatch(event, listener, inst) {\n  var type = event.type || 'unknown-event';\n  event.currentTarget = getNodeFromInstance(inst);\n  invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n  event.currentTarget = null;\n}\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\nfunction executeDispatchesInOrder(event) {\n  var dispatchListeners = event._dispatchListeners;\n  var dispatchInstances = event._dispatchInstances;\n  {\n    validateEventDispatches(event);\n  }\n  if (Array.isArray(dispatchListeners)) {\n    for (var i = 0; i < dispatchListeners.length; i++) {\n      if (event.isPropagationStopped()) {\n        break;\n      } // Listeners and Instances are two parallel arrays that are always in sync.\n      executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n    }\n  } else if (dispatchListeners) {\n    executeDispatch(event, dispatchListeners, dispatchInstances);\n  }\n  event._dispatchListeners = null;\n  event._dispatchInstances = null;\n}\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar FundamentalComponent = 20;\nvar ScopeComponent = 21;\nvar Block = 22;\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n/**\n * Injectable mapping from names to event plugin modules.\n */\nvar namesToPlugins = {};\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\nfunction recomputePluginOrdering() {\n  if (!eventPluginOrder) {\n    // Wait until an \\`eventPluginOrder\\` is injected.\n    return;\n  }\n  for (var pluginName in namesToPlugins) {\n    var pluginModule = namesToPlugins[pluginName];\n    var pluginIndex = eventPluginOrder.indexOf(pluginName);\n    if (!(pluginIndex > -1)) {\n      {\n        throw Error( \\\\\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, \\`\\\\\" + pluginName + \\\\\"\\`.\\\\\" );\n      }\n    }\n    if (plugins[pluginIndex]) {\n      continue;\n    }\n    if (!pluginModule.extractEvents) {\n      {\n        throw Error( \\\\\"EventPluginRegistry: Event plugins must implement an \\`extractEvents\\` method, but \\`\\\\\" + pluginName + \\\\\"\\` does not.\\\\\" );\n      }\n    }\n    plugins[pluginIndex] = pluginModule;\n    var publishedEvents = pluginModule.eventTypes;\n    for (var eventName in publishedEvents) {\n      if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n        {\n          throw Error( \\\\\"EventPluginRegistry: Failed to publish event \\`\\\\\" + eventName + \\\\\"\\` for plugin \\`\\\\\" + pluginName + \\\\\"\\`.\\\\\" );\n        }\n      }\n    }\n  }\n}\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n  if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {\n    {\n      throw Error( \\\\\"EventPluginRegistry: More than one plugin attempted to publish the same event name, \\`\\\\\" + eventName + \\\\\"\\`.\\\\\" );\n    }\n  }\n  eventNameDispatchConfigs[eventName] = dispatchConfig;\n  var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n  if (phasedRegistrationNames) {\n    for (var phaseName in phasedRegistrationNames) {\n      if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n        var phasedRegistrationName = phasedRegistrationNames[phaseName];\n        publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n      }\n    }\n    return true;\n  } else if (dispatchConfig.registrationName) {\n    publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n    return true;\n  }\n  return false;\n}\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n  if (!!registrationNameModules[registrationName]) {\n    {\n      throw Error( \\\\\"EventPluginRegistry: More than one plugin attempted to publish the same registration name, \\`\\\\\" + registrationName + \\\\\"\\`.\\\\\" );\n    }\n  }\n  registrationNameModules[registrationName] = pluginModule;\n  registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n  {\n    var lowerCasedName = registrationName.toLowerCase();\n    possibleRegistrationNames[lowerCasedName] = registrationName;\n    if (registrationName === 'onDoubleClick') {\n      possibleRegistrationNames.ondblclick = registrationName;\n    }\n  }\n}\n/**\n * Registers plugins so that they can extract and dispatch events.\n */\n/**\n * Ordered list of injected plugins.\n */\nvar plugins = [];\n/**\n * Mapping from event name to dispatch config\n */\nvar eventNameDispatchConfigs = {};\n/**\n * Mapping from registration name to plugin module\n */\nvar registrationNameModules = {};\n/**\n * Mapping from registration name to event name\n */\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\nvar possibleRegistrationNames =  {} ; // Trust the developer to only use possibleRegistrationNames in true\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n */\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n  if (!!eventPluginOrder) {\n    {\n      throw Error( \\\\\"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.\\\\\" );\n    }\n  } // Clone the ordering so it cannot be dynamically mutated.\n  eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n  recomputePluginOrdering();\n}\n/**\n * Injects plugins to be used by plugin event system. The plugin names must be\n * in the ordering injected by \\`injectEventPluginOrder\\`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n */\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n  var isOrderingDirty = false;\n  for (var pluginName in injectedNamesToPlugins) {\n    if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n      continue;\n    }\n    var pluginModule = injectedNamesToPlugins[pluginName];\n    if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n      if (!!namesToPlugins[pluginName]) {\n        {\n          throw Error( \\\\\"EventPluginRegistry: Cannot inject two different event plugins using the same name, \\`\\\\\" + pluginName + \\\\\"\\`.\\\\\" );\n        }\n      }\n      namesToPlugins[pluginName] = pluginModule;\n      isOrderingDirty = true;\n    }\n  }\n  if (isOrderingDirty) {\n    recomputePluginOrdering();\n  }\n}\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\nvar PLUGIN_EVENT_SYSTEM = 1;\nvar IS_REPLAYED = 1 << 5;\nvar IS_FIRST_ANCESTOR = 1 << 6;\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\nfunction restoreStateOfTarget(target) {\n  // We perform this translation at the end of the event loop so that we\n  // always receive the correct fiber here\n  var internalInstance = getInstanceFromNode(target);\n  if (!internalInstance) {\n    // Unmounted\n    return;\n  }\n  if (!(typeof restoreImpl === 'function')) {\n    {\n      throw Error( \\\\\"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.\n  if (stateNode) {\n    var _props = getFiberCurrentPropsFromNode(stateNode);\n    restoreImpl(internalInstance.stateNode, internalInstance.type, _props);\n  }\n}\nfunction setRestoreImplementation(impl) {\n  restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n  if (restoreTarget) {\n    if (restoreQueue) {\n      restoreQueue.push(target);\n    } else {\n      restoreQueue = [target];\n    }\n  } else {\n    restoreTarget = target;\n  }\n}\nfunction needsStateRestore() {\n  return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n  if (!restoreTarget) {\n    return;\n  }\n  var target = restoreTarget;\n  var queuedTargets = restoreQueue;\n  restoreTarget = null;\n  restoreQueue = null;\n  restoreStateOfTarget(target);\n  if (queuedTargets) {\n    for (var i = 0; i < queuedTargets.length; i++) {\n      restoreStateOfTarget(queuedTargets[i]);\n    }\n  }\n}\nvar enableProfilerTimer = true; // Trace which interactions trigger each commit.\nvar enableDeprecatedFlareAPI = false; // Experimental Host Component support.\nvar enableFundamentalAPI = false; // Experimental Scope support.\nvar warnAboutStringRefs = false;\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n  return fn(bookkeeping);\n};\nvar discreteUpdatesImpl = function (fn, a, b, c, d) {\n  return fn(a, b, c, d);\n};\nvar flushDiscreteUpdatesImpl = function () {};\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\nfunction finishEventHandler() {\n  // Here we wait until all updates have propagated, which is important\n  // when using controlled components within layers:\n  // https://github.com/facebook/react/issues/1698\n  // Then we restore state of any controlled component.\n  var controlledComponentsHavePendingUpdates = needsStateRestore();\n  if (controlledComponentsHavePendingUpdates) {\n    // If a controlled event was fired, we may need to restore the state of\n    // the DOM node back to the controlled value. This is necessary when React\n    // bails out of the update without touching the DOM.\n    flushDiscreteUpdatesImpl();\n    restoreStateIfNeeded();\n  }\n}\nfunction batchedUpdates(fn, bookkeeping) {\n  if (isInsideEventHandler) {\n    // If we are currently inside another batch, we need to wait until it\n    // fully completes before restoring state.\n    return fn(bookkeeping);\n  }\n  isInsideEventHandler = true;\n  try {\n    return batchedUpdatesImpl(fn, bookkeeping);\n  } finally {\n    isInsideEventHandler = false;\n    finishEventHandler();\n  }\n}\nfunction batchedEventUpdates(fn, a, b) {\n  if (isBatchingEventUpdates) {\n    // If we are currently inside another batch, we need to wait until it\n    // fully completes before restoring state.\n    return fn(a, b);\n  }\n  isBatchingEventUpdates = true;\n  try {\n    return batchedEventUpdatesImpl(fn, a, b);\n  } finally {\n    isBatchingEventUpdates = false;\n    finishEventHandler();\n  }\n} // This is for the React Flare event system\nfunction discreteUpdates(fn, a, b, c, d) {\n  var prevIsInsideEventHandler = isInsideEventHandler;\n  isInsideEventHandler = true;\n  try {\n    return discreteUpdatesImpl(fn, a, b, c, d);\n  } finally {\n    isInsideEventHandler = prevIsInsideEventHandler;\n    if (!isInsideEventHandler) {\n      finishEventHandler();\n    }\n  }\n}\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n  // event.timeStamp isn't overly reliable due to inconsistencies in\n  // how different browsers have historically provided the time stamp.\n  // Some browsers provide high-resolution time stamps for all events,\n  // some provide low-resolution time stamps for all events. FF < 52\n  // even mixes both time stamps together. Some browsers even report\n  // negative time stamps or time stamps that are 0 (iOS9) in some cases.\n  // Given we are only comparing two time stamps with equality (!==),\n  // we are safe from the resolution differences. If the time stamp is 0\n  // we bail-out of preventing the flush, which can affect semantics,\n  // such as if an earlier flush removes or adds event listeners that\n  // are fired in the subsequent flush. However, this is the same\n  // behaviour as we had before this change, so the risks are low.\n  if (!isInsideEventHandler && (!enableDeprecatedFlareAPI  )) {\n    flushDiscreteUpdatesImpl();\n  }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n  batchedUpdatesImpl = _batchedUpdatesImpl;\n  discreteUpdatesImpl = _discreteUpdatesImpl;\n  flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n  batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the whitelist are presumed to have this type.\nvar STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n// \\\\\"enumerated\\\\\" attributes with \\\\\"true\\\\\" and \\\\\"false\\\\\" as possible values.\n// When true, it should be set to a \\\\\"true\\\\\" string.\n// When false, it should be set to a \\\\\"false\\\\\" string.\nvar BOOLEANISH_STRING = 2; // A real boolean attribute.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\nvar BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n// For any other value, should be present with that value.\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\nvar POSITIVE_NUMERIC = 6;\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \\\\\":A-Z_a-z\\\\\\\\\\\\\\\\u00C0-\\\\\\\\\\\\\\\\u00D6\\\\\\\\\\\\\\\\u00D8-\\\\\\\\\\\\\\\\u00F6\\\\\\\\\\\\\\\\u00F8-\\\\\\\\\\\\\\\\u02FF\\\\\\\\\\\\\\\\u0370-\\\\\\\\\\\\\\\\u037D\\\\\\\\\\\\\\\\u037F-\\\\\\\\\\\\\\\\u1FFF\\\\\\\\\\\\\\\\u200C-\\\\\\\\\\\\\\\\u200D\\\\\\\\\\\\\\\\u2070-\\\\\\\\\\\\\\\\u218F\\\\\\\\\\\\\\\\u2C00-\\\\\\\\\\\\\\\\u2FEF\\\\\\\\\\\\\\\\u3001-\\\\\\\\\\\\\\\\uD7FF\\\\\\\\\\\\\\\\uF900-\\\\\\\\\\\\\\\\uFDCF\\\\\\\\\\\\\\\\uFDF0-\\\\\\\\\\\\\\\\uFFFD\\\\\";\n/* eslint-enable max-len */\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \\\\\"\\\\\\\\\\\\\\\\-.0-9\\\\\\\\\\\\\\\\u00B7\\\\\\\\\\\\\\\\u0300-\\\\\\\\\\\\\\\\u036F\\\\\\\\\\\\\\\\u203F-\\\\\\\\\\\\\\\\u2040\\\\\";\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n    return true;\n  }\n  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n    return false;\n  }\n  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n    validatedAttributeNameCache[attributeName] = true;\n    return true;\n  }\n  illegalAttributeNameCache[attributeName] = true;\n  {\n    error('Invalid attribute name: \\`%s\\`', attributeName);\n  }\n  return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n  if (propertyInfo !== null) {\n    return propertyInfo.type === RESERVED;\n  }\n  if (isCustomComponentTag) {\n    return false;\n  }\n  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n    return true;\n  }\n  return false;\n}\nfunction shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n  if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n    return false;\n  }\n  switch (typeof value) {\n    case 'function': // $FlowIssue symbol is perfectly valid here\n    case 'symbol':\n      // eslint-disable-line\n      return true;\n    case 'boolean':\n      {\n        if (isCustomComponentTag) {\n          return false;\n        }\n        if (propertyInfo !== null) {\n          return !propertyInfo.acceptsBooleans;\n        } else {\n          var prefix = name.toLowerCase().slice(0, 5);\n          return prefix !== 'data-' && prefix !== 'aria-';\n        }\n      }\n    default:\n      return false;\n  }\n}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n  if (value === null || typeof value === 'undefined') {\n    return true;\n  }\n  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n    return true;\n  }\n  if (isCustomComponentTag) {\n    return false;\n  }\n  if (propertyInfo !== null) {\n    switch (propertyInfo.type) {\n      case BOOLEAN:\n        return !value;\n      case OVERLOADED_BOOLEAN:\n        return value === false;\n      case NUMERIC:\n        return isNaN(value);\n      case POSITIVE_NUMERIC:\n        return isNaN(value) || value < 1;\n    }\n  }\n  return false;\n}\nfunction getPropertyInfo(name) {\n  return properties.hasOwnProperty(name) ? properties[name] : null;\n}\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {\n  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n  this.attributeName = attributeName;\n  this.attributeNamespace = attributeNamespace;\n  this.mustUseProperty = mustUseProperty;\n  this.propertyName = name;\n  this.type = type;\n  this.sanitizeURL = sanitizeURL;\n} // When adding attributes to this list, be sure to also add them to\n// the \\`possibleStandardNames\\` module to ensure casing and incorrect\n// name warnings.\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\nvar reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n// elements (not just inputs). Now that ReactDOMInput assigns to the\n// defaultValue property -- do we need this?\n'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\nreservedProps.forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false);\n}); // A few React string attributes have a different name.\n// This is a mapping from React prop names to the attribute names.\n[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n  var name = _ref[0],\n      attributeName = _ref[1];\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are \\\\\"enumerated\\\\\" HTML attributes that accept \\\\\"true\\\\\" and \\\\\"false\\\\\".\n// In React, we let users pass \\`true\\` and \\`false\\` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n  name.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are \\\\\"enumerated\\\\\" SVG attributes that accept \\\\\"true\\\\\" and \\\\\"false\\\\\".\n// In React, we let users pass \\`true\\` and \\`false\\` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n// Since these are SVG attributes, their attribute names are case-sensitive.\n['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are HTML boolean attributes.\n['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n// on the client side because the browsers are inconsistent. Instead we call focus().\n'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n'itemScope'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n  name.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are the few React props that we set as DOM properties\n// rather than attributes. These are all booleans.\n['checked', // Note: \\`option.selected\\` is not updated if \\`select.multiple\\` is\n// disabled with \\`removeAttribute\\`. We have special logic for handling this.\n'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are HTML attributes that are \\\\\"overloaded booleans\\\\\": they behave like\n// booleans, but can also accept a string value.\n['capture', 'download' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are HTML attributes that must be positive numbers.\n['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n  name, // attributeName\n  null, // attributeNamespace\n  false);\n}); // These are HTML attributes that must be numbers.\n['rowSpan', 'start'].forEach(function (name) {\n  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n  name.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false);\n});\nvar CAMELIZE = /[\\\\\\\\-\\\\\\\\:]([a-z])/g;\nvar capitalize = function (token) {\n  return token[1].toUpperCase();\n}; // This is a list of all SVG attributes that need special casing, namespacing,\n// or boolean value assignment. Regular attributes that just accept strings\n// and have the same names are omitted, just like in the HTML whitelist.\n// Some of these attributes can be hard to find. This list was created by\n// scraping the MDN documentation.\n['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n  var name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, null, // attributeNamespace\n  false);\n}); // String SVG attributes with the xlink namespace.\n['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n  var name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, 'http://www.w3.org/1999/xlink', false);\n}); // String SVG attributes with the xml namespace.\n['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,\n// you'll need to set attributeName to name.toLowerCase()\n// instead in the assignment below.\n].forEach(function (attributeName) {\n  var name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n  attributeName, 'http://www.w3.org/XML/1998/namespace', false);\n}); // These attribute exists both in HTML and SVG.\n// The attribute name is case-sensitive in SVG so we can't just use\n// the React name like we do for attributes that exist only in HTML.\n['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n  attributeName.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  false);\n}); // These attributes accept URLs. These must not allow javascript: URLS.\n// These will also need to accept Trusted Types object in the future.\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true);\n['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n  attributeName.toLowerCase(), // attributeName\n  null, // attributeNamespace\n  true);\n});\n{\n  ReactSharedInternals.ReactDebugCurrentFrame;\n} // A javascript: URL can contain leading C0 control or \\\\\\\\u0020 SPACE,\n// and any newline or tab are filtered out as if they're not part of the URL.\n// https://url.spec.whatwg.org/#url-parsing\n// Tab or newline are defined as \\\\\\\\t:\n// https://infra.spec.whatwg.org/#ascii-tab-or-newline\n// A C0 control is a code point in the range \\\\\\\\u0000 NULL to \\\\\\\\u001F\n// INFORMATION SEPARATOR ONE, inclusive:\n// https://infra.spec.whatwg.org/#c0-control-or-space\n/* eslint-disable max-len */\nvar isJavaScriptProtocol = /^[\\\\\\\\u0000-\\\\\\\\u001F ]*j[\\\\\\\\t]*a[\\\\\\\\t]*v[\\\\\\\\t]*a[\\\\\\\\t]*s[\\\\\\\\t]*c[\\\\\\\\t]*r[\\\\\\\\t]*i[\\\\\\\\t]*p[\\\\\\\\t]*t[\\\\\\\\t]*\\\\\\\\:/i;\nvar didWarn = false;\nfunction sanitizeURL(url) {\n  {\n    if (!didWarn && isJavaScriptProtocol.test(url)) {\n      didWarn = true;\n      error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n    }\n  }\n}\n/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \\\\\"expected\\\\\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n  {\n    if (propertyInfo.mustUseProperty) {\n      var propertyName = propertyInfo.propertyName;\n      return node[propertyName];\n    } else {\n      if ( propertyInfo.sanitizeURL) {\n        // If we haven't fully disabled javascript: URLs, and if\n        // the hydration is successful of a javascript: URL, we\n        // still want to warn on the client.\n        sanitizeURL('' + expected);\n      }\n      var attributeName = propertyInfo.attributeName;\n      var stringValue = null;\n      if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n        if (node.hasAttribute(attributeName)) {\n          var value = node.getAttribute(attributeName);\n          if (value === '') {\n            return true;\n          }\n          if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n            return value;\n          }\n          if (value === '' + expected) {\n            return expected;\n          }\n          return value;\n        }\n      } else if (node.hasAttribute(attributeName)) {\n        if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n          // We had an attribute but shouldn't have had one, so read it\n          // for the error message.\n          return node.getAttribute(attributeName);\n        }\n        if (propertyInfo.type === BOOLEAN) {\n          // If this was a boolean, it doesn't matter what the value is\n          // the fact that we have it is the same as the expected.\n          return expected;\n        } // Even if this property uses a namespace we use getAttribute\n        // because we assume its namespaced name is the same as our config.\n        // To use getAttributeNS we need the local name which we don't have\n        // in our config atm.\n        stringValue = node.getAttribute(attributeName);\n      }\n      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n        return stringValue === null ? expected : stringValue;\n      } else if (stringValue === '' + expected) {\n        return expected;\n      } else {\n        return stringValue;\n      }\n    }\n  }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\nfunction getValueForAttribute(node, name, expected) {\n  {\n    if (!isAttributeNameSafe(name)) {\n      return;\n    }\n    if (!node.hasAttribute(name)) {\n      return expected === undefined ? undefined : null;\n    }\n    var value = node.getAttribute(name);\n    if (value === '' + expected) {\n      return expected;\n    }\n    return value;\n  }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n  var propertyInfo = getPropertyInfo(name);\n  if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n    return;\n  }\n  if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n    value = null;\n  } // If the prop isn't in the special list, treat it as a simple attribute.\n  if (isCustomComponentTag || propertyInfo === null) {\n    if (isAttributeNameSafe(name)) {\n      var _attributeName = name;\n      if (value === null) {\n        node.removeAttribute(_attributeName);\n      } else {\n        node.setAttribute(_attributeName,  '' + value);\n      }\n    }\n    return;\n  }\n  var mustUseProperty = propertyInfo.mustUseProperty;\n  if (mustUseProperty) {\n    var propertyName = propertyInfo.propertyName;\n    if (value === null) {\n      var type = propertyInfo.type;\n      node[propertyName] = type === BOOLEAN ? false : '';\n    } else {\n      // Contrary to \\`setAttribute\\`, object properties are properly\n      // \\`toString\\`ed by IE8/9.\n      node[propertyName] = value;\n    }\n    return;\n  } // The rest are treated as attributes with special cases.\n  var attributeName = propertyInfo.attributeName,\n      attributeNamespace = propertyInfo.attributeNamespace;\n  if (value === null) {\n    node.removeAttribute(attributeName);\n  } else {\n    var _type = propertyInfo.type;\n    var attributeValue;\n    if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n      // If attribute type is boolean, we know for sure it won't be an execution sink\n      // and we won't require Trusted Type here.\n      attributeValue = '';\n    } else {\n      // \\`setAttribute\\` with objects becomes only \\`[object]\\` in IE8/9,\n      // ('' + value) makes it output the correct toString()-value.\n      {\n        attributeValue = '' + value;\n      }\n      if (propertyInfo.sanitizeURL) {\n        sanitizeURL(attributeValue.toString());\n      }\n    }\n    if (attributeNamespace) {\n      node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n    } else {\n      node.setAttribute(attributeName, attributeValue);\n    }\n  }\n}\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\\\\\\\\\\\\\\\\\\\/]/;\nfunction describeComponentFrame (name, source, ownerName) {\n  var sourceInfo = '';\n  if (source) {\n    var path = source.fileName;\n    var fileName = path.replace(BEFORE_SLASH_RE, '');\n    {\n      // In DEV, include code for a common special case:\n      // prefer \\\\\"folder/index.js\\\\\" instead of just \\\\\"index.js\\\\\".\n      if (/^index\\\\\\\\./.test(fileName)) {\n        var match = path.match(BEFORE_SLASH_RE);\n        if (match) {\n          var pathBeforeSlash = match[1];\n          if (pathBeforeSlash) {\n            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n            fileName = folderName + '/' + fileName;\n          }\n        }\n      }\n    }\n    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n  } else if (ownerName) {\n    sourceInfo = ' (created by ' + ownerName + ')';\n  }\n  return '    in ' + (name || 'Unknown') + sourceInfo;\n}\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n  if (maybeIterable === null || typeof maybeIterable !== 'object') {\n    return null;\n  }\n  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n  if (typeof maybeIterator === 'function') {\n    return maybeIterator;\n  }\n  return null;\n}\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\nfunction refineResolvedLazyComponent(lazyComponent) {\n  return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\nfunction initializeLazyComponentType(lazyComponent) {\n  if (lazyComponent._status === Uninitialized) {\n    lazyComponent._status = Pending;\n    var ctor = lazyComponent._ctor;\n    var thenable = ctor();\n    lazyComponent._result = thenable;\n    thenable.then(function (moduleObject) {\n      if (lazyComponent._status === Pending) {\n        var defaultExport = moduleObject.default;\n        {\n          if (defaultExport === undefined) {\n            error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %sYour code should look like:   ' + \\\\\"const MyComponent = lazy(() => import('./MyComponent'))\\\\\", moduleObject);\n          }\n        }\n        lazyComponent._status = Resolved;\n        lazyComponent._result = defaultExport;\n      }\n    }, function (error) {\n      if (lazyComponent._status === Pending) {\n        lazyComponent._status = Rejected;\n        lazyComponent._result = error;\n      }\n    });\n  }\n}\nfunction getWrappedName(outerType, innerType, wrapperName) {\n  var functionName = innerType.displayName || innerType.name || '';\n  return outerType.displayName || (functionName !== '' ? wrapperName + \\\\\"(\\\\\" + functionName + \\\\\")\\\\\" : wrapperName);\n}\nfunction getComponentName(type) {\n  if (type == null) {\n    // Host root, text node or just invalid type.\n    return null;\n  }\n  {\n    if (typeof type.tag === 'number') {\n      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n    }\n  }\n  if (typeof type === 'function') {\n    return type.displayName || type.name || null;\n  }\n  if (typeof type === 'string') {\n    return type;\n  }\n  switch (type) {\n    case REACT_FRAGMENT_TYPE:\n      return 'Fragment';\n    case REACT_PORTAL_TYPE:\n      return 'Portal';\n    case REACT_PROFILER_TYPE:\n      return \\\\\"Profiler\\\\\";\n    case REACT_STRICT_MODE_TYPE:\n      return 'StrictMode';\n    case REACT_SUSPENSE_TYPE:\n      return 'Suspense';\n    case REACT_SUSPENSE_LIST_TYPE:\n      return 'SuspenseList';\n  }\n  if (typeof type === 'object') {\n    switch (type.$$typeof) {\n      case REACT_CONTEXT_TYPE:\n        return 'Context.Consumer';\n      case REACT_PROVIDER_TYPE:\n        return 'Context.Provider';\n      case REACT_FORWARD_REF_TYPE:\n        return getWrappedName(type, type.render, 'ForwardRef');\n      case REACT_MEMO_TYPE:\n        return getComponentName(type.type);\n      case REACT_BLOCK_TYPE:\n        return getComponentName(type.render);\n      case REACT_LAZY_TYPE:\n        {\n          var thenable = type;\n          var resolvedThenable = refineResolvedLazyComponent(thenable);\n          if (resolvedThenable) {\n            return getComponentName(resolvedThenable);\n          }\n          break;\n        }\n    }\n  }\n  return null;\n}\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\nfunction describeFiber(fiber) {\n  switch (fiber.tag) {\n    case HostRoot:\n    case HostPortal:\n    case HostText:\n    case Fragment:\n    case ContextProvider:\n    case ContextConsumer:\n      return '';\n    default:\n      var owner = fiber._debugOwner;\n      var source = fiber._debugSource;\n      var name = getComponentName(fiber.type);\n      var ownerName = null;\n      if (owner) {\n        ownerName = getComponentName(owner.type);\n      }\n      return describeComponentFrame(name, source, ownerName);\n  }\n}\nfunction getStackByFiberInDevAndProd(workInProgress) {\n  var info = '';\n  var node = workInProgress;\n  do {\n    info += describeFiber(node);\n    node = node.return;\n  } while (node);\n  return info;\n}\nvar current = null;\nvar isRendering = false;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n  {\n    if (current === null) {\n      return null;\n    }\n    var owner = current._debugOwner;\n    if (owner !== null && typeof owner !== 'undefined') {\n      return getComponentName(owner.type);\n    }\n  }\n  return null;\n}\nfunction getCurrentFiberStackInDev() {\n  {\n    if (current === null) {\n      return '';\n    } // Safe because if current fiber exists, we are reconciling,\n    // and it is guaranteed to be the work-in-progress version.\n    return getStackByFiberInDevAndProd(current);\n  }\n}\nfunction resetCurrentFiber() {\n  {\n    ReactDebugCurrentFrame$1.getCurrentStack = null;\n    current = null;\n    isRendering = false;\n  }\n}\nfunction setCurrentFiber(fiber) {\n  {\n    ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;\n    current = fiber;\n    isRendering = false;\n  }\n}\nfunction setIsRendering(rendering) {\n  {\n    isRendering = rendering;\n  }\n}\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n  return '' + value;\n}\nfunction getToStringValue(value) {\n  switch (typeof value) {\n    case 'boolean':\n    case 'number':\n    case 'object':\n    case 'string':\n    case 'undefined':\n      return value;\n    default:\n      // function, symbol are assigned as empty strings\n      return '';\n  }\n}\nvar ReactDebugCurrentFrame$2 = null;\nvar ReactControlledValuePropTypes = {\n  checkPropTypes: null\n};\n{\n  ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;\n  var hasReadOnlyValue = {\n    button: true,\n    checkbox: true,\n    image: true,\n    hidden: true,\n    radio: true,\n    reset: true,\n    submit: true\n  };\n  var propTypes = {\n    value: function (props, propName, componentName) {\n      if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {\n        return null;\n      }\n      return new Error('You provided a \\`value\\` prop to a form field without an ' + '\\`onChange\\` handler. This will render a read-only field. If ' + 'the field should be mutable use \\`defaultValue\\`. Otherwise, ' + 'set either \\`onChange\\` or \\`readOnly\\`.');\n    },\n    checked: function (props, propName, componentName) {\n      if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {\n        return null;\n      }\n      return new Error('You provided a \\`checked\\` prop to a form field without an ' + '\\`onChange\\` handler. This will render a read-only field. If ' + 'the field should be mutable use \\`defaultChecked\\`. Otherwise, ' + 'set either \\`onChange\\` or \\`readOnly\\`.');\n    }\n  };\n  /**\n   * Provide a linked \\`value\\` attribute for controlled forms. You should not use\n   * this outside of the ReactDOM controlled form components.\n   */\n  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {\n    checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);\n  };\n}\nfunction isCheckable(elem) {\n  var type = elem.type;\n  var nodeName = elem.nodeName;\n  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\nfunction getTracker(node) {\n  return node._valueTracker;\n}\nfunction detachTracker(node) {\n  node._valueTracker = null;\n}\nfunction getValueFromNode(node) {\n  var value = '';\n  if (!node) {\n    return value;\n  }\n  if (isCheckable(node)) {\n    value = node.checked ? 'true' : 'false';\n  } else {\n    value = node.value;\n  }\n  return value;\n}\nfunction trackValueOnNode(node) {\n  var valueField = isCheckable(node) ? 'checked' : 'value';\n  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n  var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n  // and don't track value will cause over reporting of changes,\n  // but it's better then a hard failure\n  // (needed for certain tests that spyOn input values and Safari)\n  if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n    return;\n  }\n  var get = descriptor.get,\n      set = descriptor.set;\n  Object.defineProperty(node, valueField, {\n    configurable: true,\n    get: function () {\n      return get.call(this);\n    },\n    set: function (value) {\n      currentValue = '' + value;\n      set.call(this, value);\n    }\n  }); // We could've passed this the first time\n  // but it triggers a bug in IE11 and Edge 14/15.\n  // Calling defineProperty() again should be equivalent.\n  // https://github.com/facebook/react/issues/11768\n  Object.defineProperty(node, valueField, {\n    enumerable: descriptor.enumerable\n  });\n  var tracker = {\n    getValue: function () {\n      return currentValue;\n    },\n    setValue: function (value) {\n      currentValue = '' + value;\n    },\n    stopTracking: function () {\n      detachTracker(node);\n      delete node[valueField];\n    }\n  };\n  return tracker;\n}\nfunction track(node) {\n  if (getTracker(node)) {\n    return;\n  } // TODO: Once it's just Fiber we can move this to node._wrapperState\n  node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n  if (!node) {\n    return false;\n  }\n  var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n  // that trying again will succeed\n  if (!tracker) {\n    return true;\n  }\n  var lastValue = tracker.getValue();\n  var nextValue = getValueFromNode(node);\n  if (nextValue !== lastValue) {\n    tracker.setValue(nextValue);\n    return true;\n  }\n  return false;\n}\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\nfunction isControlled(props) {\n  var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n  return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an <input> host component that allows setting these optional\n * props: \\`checked\\`, \\`value\\`, \\`defaultChecked\\`, and \\`defaultValue\\`.\n *\n * If \\`checked\\` or \\`value\\` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or \\`defaultChecked\\`)\n * with an empty value (or \\`defaultValue\\`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\nfunction getHostProps(element, props) {\n  var node = element;\n  var checked = props.checked;\n  var hostProps = _assign({}, props, {\n    defaultChecked: undefined,\n    defaultValue: undefined,\n    value: undefined,\n    checked: checked != null ? checked : node._wrapperState.initialChecked\n  });\n  return hostProps;\n}\nfunction initWrapperState(element, props) {\n  {\n    ReactControlledValuePropTypes.checkPropTypes('input', props);\n    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n      error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n      didWarnCheckedDefaultChecked = true;\n    }\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n      error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n      didWarnValueDefaultValue = true;\n    }\n  }\n  var node = element;\n  var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n  node._wrapperState = {\n    initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n    initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n    controlled: isControlled(props)\n  };\n}\nfunction updateChecked(element, props) {\n  var node = element;\n  var checked = props.checked;\n  if (checked != null) {\n    setValueForProperty(node, 'checked', checked, false);\n  }\n}\nfunction updateWrapper(element, props) {\n  var node = element;\n  {\n    var controlled = isControlled(props);\n    if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n      error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n      didWarnUncontrolledToControlled = true;\n    }\n    if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n      error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n      didWarnControlledToUncontrolled = true;\n    }\n  }\n  updateChecked(element, props);\n  var value = getToStringValue(props.value);\n  var type = props.type;\n  if (value != null) {\n    if (type === 'number') {\n      if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n      // eslint-disable-next-line\n      node.value != value) {\n        node.value = toString(value);\n      }\n    } else if (node.value !== toString(value)) {\n      node.value = toString(value);\n    }\n  } else if (type === 'submit' || type === 'reset') {\n    // Submit/reset inputs need the attribute removed completely to avoid\n    // blank-text buttons.\n    node.removeAttribute('value');\n    return;\n  }\n  {\n    // When syncing the value attribute, the value comes from a cascade of\n    // properties:\n    //  1. The value React property\n    //  2. The defaultValue React property\n    //  3. Otherwise there should be no change\n    if (props.hasOwnProperty('value')) {\n      setDefaultValue(node, props.type, value);\n    } else if (props.hasOwnProperty('defaultValue')) {\n      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n    }\n  }\n  {\n    // When syncing the checked attribute, it only changes when it needs\n    // to be removed, such as transitioning from a checkbox into a text input\n    if (props.checked == null && props.defaultChecked != null) {\n      node.defaultChecked = !!props.defaultChecked;\n    }\n  }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n  var node = element; // Do not assign value if it is already set. This prevents user text input\n  // from being lost during SSR hydration.\n  if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n    var type = props.type;\n    var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n    // default value provided by the browser. See: #12872\n    if (isButton && (props.value === undefined || props.value === null)) {\n      return;\n    }\n    var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n    // from being lost during SSR hydration.\n    if (!isHydrating) {\n      {\n        // When syncing the value attribute, the value property should use\n        // the wrapperState._initialValue property. This uses:\n        //\n        //   1. The value React property when present\n        //   2. The defaultValue React property when present\n        //   3. An empty string\n        if (initialValue !== node.value) {\n          node.value = initialValue;\n        }\n      }\n    }\n    {\n      // Otherwise, the value attribute is synchronized to the property,\n      // so we assign defaultValue to the same thing as the value property\n      // assignment step above.\n      node.defaultValue = initialValue;\n    }\n  } // Normally, we'd just do \\`node.checked = node.checked\\` upon initial mount, less this bug\n  // this is needed to work around a chrome bug where setting defaultChecked\n  // will sometimes influence the value of checked (even after detachment).\n  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n  // We need to temporarily unset name to avoid disrupting radio button groups.\n  var name = node.name;\n  if (name !== '') {\n    node.name = '';\n  }\n  {\n    // When syncing the checked attribute, both the checked property and\n    // attribute are assigned at the same time using defaultChecked. This uses:\n    //\n    //   1. The checked React property when present\n    //   2. The defaultChecked React property when present\n    //   3. Otherwise, false\n    node.defaultChecked = !node.defaultChecked;\n    node.defaultChecked = !!node._wrapperState.initialChecked;\n  }\n  if (name !== '') {\n    node.name = name;\n  }\n}\nfunction restoreControlledState(element, props) {\n  var node = element;\n  updateWrapper(node, props);\n  updateNamedCousins(node, props);\n}\nfunction updateNamedCousins(rootNode, props) {\n  var name = props.name;\n  if (props.type === 'radio' && name != null) {\n    var queryRoot = rootNode;\n    while (queryRoot.parentNode) {\n      queryRoot = queryRoot.parentNode;\n    } // If \\`rootNode.form\\` was non-null, then we could try \\`form.elements\\`,\n    // but that sometimes behaves strangely in IE8. We could also try using\n    // \\`form.getElementsByName\\`, but that will only return direct children\n    // and won't include inputs that use the HTML5 \\`form=\\` attribute. Since\n    // the input might not even be in a form. It might not even be in the\n    // document. Let's just use the local \\`querySelectorAll\\` to ensure we don't\n    // miss anything.\n    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\\\\\"radio\\\\\"]');\n    for (var i = 0; i < group.length; i++) {\n      var otherNode = group[i];\n      if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n        continue;\n      } // This will throw if radio buttons rendered by different copies of React\n      // and the same name are rendered into the same form (same as #1939).\n      // That's probably okay; we don't support it just as we don't support\n      // mixing React radio buttons with non-React ones.\n      var otherProps = getFiberCurrentPropsFromNode$1(otherNode);\n      if (!otherProps) {\n        {\n          throw Error( \\\\\"ReactDOMInput: Mixing React and non-React radio inputs with the same \\`name\\` is not supported.\\\\\" );\n        }\n      } // We need update the tracked value on the named cousin since the value\n      // was changed but the input saw no event or value set\n      updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n      // was previously checked to update will cause it to be come re-checked\n      // as appropriate.\n      updateWrapper(otherNode, otherProps);\n    }\n  }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \\\\\"The specified value <x> is not a valid email address\\\\\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\nfunction setDefaultValue(node, type, value) {\n  if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n  type !== 'number' || node.ownerDocument.activeElement !== node) {\n    if (value == null) {\n      node.defaultValue = toString(node._wrapperState.initialValue);\n    } else if (node.defaultValue !== toString(value)) {\n      node.defaultValue = toString(value);\n    }\n  }\n}\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\nfunction flattenChildren(children) {\n  var content = ''; // Flatten children. We'll warn if they are invalid\n  // during validateProps() which runs for hydration too.\n  // Note that this would throw on non-element objects.\n  // Elements are stringified (which is normally irrelevant\n  // but matters for <fbt>).\n  React.Children.forEach(children, function (child) {\n    if (child == null) {\n      return;\n    }\n    content += child; // Note: we don't warn about invalid children here.\n    // Instead, this is done separately below so that\n    // it happens during the hydration codepath too.\n  });\n  return content;\n}\n/**\n * Implements an <option> host component that warns when \\`selected\\` is set.\n */\nfunction validateProps(element, props) {\n  {\n    // This mirrors the codepath above, but runs for hydration too.\n    // Warn about invalid children here so that client and hydration are consistent.\n    // TODO: this seems like it could cause a DEV-only throw for hydration\n    // if children contains a non-element object. We should try to avoid that.\n    if (typeof props.children === 'object' && props.children !== null) {\n      React.Children.forEach(props.children, function (child) {\n        if (child == null) {\n          return;\n        }\n        if (typeof child === 'string' || typeof child === 'number') {\n          return;\n        }\n        if (typeof child.type !== 'string') {\n          return;\n        }\n        if (!didWarnInvalidChild) {\n          didWarnInvalidChild = true;\n          error('Only strings and numbers are supported as <option> children.');\n        }\n      });\n    } // TODO: Remove support for \\`selected\\` in <option>.\n    if (props.selected != null && !didWarnSelectedSetOnOption) {\n      error('Use the \\`defaultValue\\` or \\`value\\` props on <select> instead of ' + 'setting \\`selected\\` on <option>.');\n      didWarnSelectedSetOnOption = true;\n    }\n  }\n}\nfunction postMountWrapper$1(element, props) {\n  // value=\\\\\"\\\\\" should make a value attribute (#6219)\n  if (props.value != null) {\n    element.setAttribute('value', toString(getToStringValue(props.value)));\n  }\n}\nfunction getHostProps$1(element, props) {\n  var hostProps = _assign({\n    children: undefined\n  }, props);\n  var content = flattenChildren(props.children);\n  if (content) {\n    hostProps.children = content;\n  }\n  return hostProps;\n}\nvar didWarnValueDefaultValue$1;\n{\n  didWarnValueDefaultValue$1 = false;\n}\nfunction getDeclarationErrorAddendum() {\n  var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n  if (ownerName) {\n    return 'Check the render method of \\`' + ownerName + '\\`.';\n  }\n  return '';\n}\nvar valuePropNames = ['value', 'defaultValue'];\n/**\n * Validation function for \\`value\\` and \\`defaultValue\\`.\n */\nfunction checkSelectPropTypes(props) {\n  {\n    ReactControlledValuePropTypes.checkPropTypes('select', props);\n    for (var i = 0; i < valuePropNames.length; i++) {\n      var propName = valuePropNames[i];\n      if (props[propName] == null) {\n        continue;\n      }\n      var isArray = Array.isArray(props[propName]);\n      if (props.multiple && !isArray) {\n        error('The \\`%s\\` prop supplied to <select> must be an array if ' + '\\`multiple\\` is true.%s', propName, getDeclarationErrorAddendum());\n      } else if (!props.multiple && isArray) {\n        error('The \\`%s\\` prop supplied to <select> must be a scalar ' + 'value if \\`multiple\\` is false.%s', propName, getDeclarationErrorAddendum());\n      }\n    }\n  }\n}\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n  var options = node.options;\n  if (multiple) {\n    var selectedValues = propValue;\n    var selectedValue = {};\n    for (var i = 0; i < selectedValues.length; i++) {\n      // Prefix to avoid chaos with special keys.\n      selectedValue['$' + selectedValues[i]] = true;\n    }\n    for (var _i = 0; _i < options.length; _i++) {\n      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n      if (options[_i].selected !== selected) {\n        options[_i].selected = selected;\n      }\n      if (selected && setDefaultSelected) {\n        options[_i].defaultSelected = true;\n      }\n    }\n  } else {\n    // Do not set \\`select.value\\` as exact behavior isn't consistent across all\n    // browsers for all cases.\n    var _selectedValue = toString(getToStringValue(propValue));\n    var defaultSelected = null;\n    for (var _i2 = 0; _i2 < options.length; _i2++) {\n      if (options[_i2].value === _selectedValue) {\n        options[_i2].selected = true;\n        if (setDefaultSelected) {\n          options[_i2].defaultSelected = true;\n        }\n        return;\n      }\n      if (defaultSelected === null && !options[_i2].disabled) {\n        defaultSelected = options[_i2];\n      }\n    }\n    if (defaultSelected !== null) {\n      defaultSelected.selected = true;\n    }\n  }\n}\n/**\n * Implements a <select> host component that allows optionally setting the\n * props \\`value\\` and \\`defaultValue\\`. If \\`multiple\\` is false, the prop must be a\n * stringable. If \\`multiple\\` is true, the prop must be an array of stringables.\n *\n * If \\`value\\` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the \\`value\\` prop must change in\n * order for the rendered options to update.\n *\n * If \\`defaultValue\\` is provided, any options with the supplied values will be\n * selected.\n */\nfunction getHostProps$2(element, props) {\n  return _assign({}, props, {\n    value: undefined\n  });\n}\nfunction initWrapperState$1(element, props) {\n  var node = element;\n  {\n    checkSelectPropTypes(props);\n  }\n  node._wrapperState = {\n    wasMultiple: !!props.multiple\n  };\n  {\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n      error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');\n      didWarnValueDefaultValue$1 = true;\n    }\n  }\n}\nfunction postMountWrapper$2(element, props) {\n  var node = element;\n  node.multiple = !!props.multiple;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  } else if (props.defaultValue != null) {\n    updateOptions(node, !!props.multiple, props.defaultValue, true);\n  }\n}\nfunction postUpdateWrapper(element, props) {\n  var node = element;\n  var wasMultiple = node._wrapperState.wasMultiple;\n  node._wrapperState.wasMultiple = !!props.multiple;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  } else if (wasMultiple !== !!props.multiple) {\n    // For simplicity, reapply \\`defaultValue\\` if \\`multiple\\` is toggled.\n    if (props.defaultValue != null) {\n      updateOptions(node, !!props.multiple, props.defaultValue, true);\n    } else {\n      // Revert the select back to its default unselected state.\n      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n    }\n  }\n}\nfunction restoreControlledState$1(element, props) {\n  var node = element;\n  var value = props.value;\n  if (value != null) {\n    updateOptions(node, !!props.multiple, value, false);\n  }\n}\nvar didWarnValDefaultVal = false;\n/**\n * Implements a <textarea> host component that allows setting \\`value\\`, and\n * \\`defaultValue\\`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If \\`value\\` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If \\`value\\` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the \\`value\\` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * \\`defaultValue\\` if specified, or the children content (deprecated).\n */\nfunction getHostProps$3(element, props) {\n  var node = element;\n  if (!(props.dangerouslySetInnerHTML == null)) {\n    {\n      throw Error( \\\\\"\\`dangerouslySetInnerHTML\\` does not make sense on <textarea>.\\\\\" );\n    }\n  } // Always set children to the same thing. In IE9, the selection range will\n  // get reset if \\`textContent\\` is mutated.  We could add a check in setTextContent\n  // to only set the value if/when the value differs from the node value (which would\n  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n  // solution. The value can be a boolean or object so that's why it's forced\n  // to be a string.\n  var hostProps = _assign({}, props, {\n    value: undefined,\n    defaultValue: undefined,\n    children: toString(node._wrapperState.initialValue)\n  });\n  return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n  var node = element;\n  {\n    ReactControlledValuePropTypes.checkPropTypes('textarea', props);\n    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n      error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n      didWarnValDefaultVal = true;\n    }\n  }\n  var initialValue = props.value; // Only bother fetching default value if we're going to use it\n  if (initialValue == null) {\n    var children = props.children,\n        defaultValue = props.defaultValue;\n    if (children != null) {\n      {\n        error('Use the \\`defaultValue\\` or \\`value\\` props instead of setting ' + 'children on <textarea>.');\n      }\n      {\n        if (!(defaultValue == null)) {\n          {\n            throw Error( \\\\\"If you supply \\`defaultValue\\` on a <textarea>, do not pass children.\\\\\" );\n          }\n        }\n        if (Array.isArray(children)) {\n          if (!(children.length <= 1)) {\n            {\n              throw Error( \\\\\"<textarea> can only have at most one child.\\\\\" );\n            }\n          }\n          children = children[0];\n        }\n        defaultValue = children;\n      }\n    }\n    if (defaultValue == null) {\n      defaultValue = '';\n    }\n    initialValue = defaultValue;\n  }\n  node._wrapperState = {\n    initialValue: getToStringValue(initialValue)\n  };\n}\nfunction updateWrapper$1(element, props) {\n  var node = element;\n  var value = getToStringValue(props.value);\n  var defaultValue = getToStringValue(props.defaultValue);\n  if (value != null) {\n    // Cast \\`value\\` to a string to ensure the value is set correctly. While\n    // browsers typically do this as necessary, jsdom doesn't.\n    var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed\n    if (newValue !== node.value) {\n      node.value = newValue;\n    }\n    if (props.defaultValue == null && node.defaultValue !== newValue) {\n      node.defaultValue = newValue;\n    }\n  }\n  if (defaultValue != null) {\n    node.defaultValue = toString(defaultValue);\n  }\n}\nfunction postMountWrapper$3(element, props) {\n  var node = element; // This is in postMount because we need access to the DOM node, which is not\n  // available until after the component has mounted.\n  var textContent = node.textContent; // Only set node.value if textContent is equal to the expected\n  // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n  // will populate textContent as well.\n  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n  if (textContent === node._wrapperState.initialValue) {\n    if (textContent !== '' && textContent !== null) {\n      node.value = textContent;\n    }\n  }\n}\nfunction restoreControlledState$2(element, props) {\n  // DOM component is still mounted; update\n  updateWrapper$1(element, props);\n}\nvar HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nvar Namespaces = {\n  html: HTML_NAMESPACE,\n  mathml: MATH_NAMESPACE,\n  svg: SVG_NAMESPACE\n}; // Assumes there is no parent namespace.\nfunction getIntrinsicNamespace(type) {\n  switch (type) {\n    case 'svg':\n      return SVG_NAMESPACE;\n    case 'math':\n      return MATH_NAMESPACE;\n    default:\n      return HTML_NAMESPACE;\n  }\n}\nfunction getChildNamespace(parentNamespace, type) {\n  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n    // No (or default) parent namespace: potential entry point.\n    return getIntrinsicNamespace(type);\n  }\n  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n    // We're leaving SVG.\n    return HTML_NAMESPACE;\n  } // By default, pass namespace below.\n  return parentNamespace;\n}\n/* globals MSApp */\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n    return function (arg0, arg1, arg2, arg3) {\n      MSApp.execUnsafeLocalFunction(function () {\n        return func(arg0, arg1, arg2, arg3);\n      });\n    };\n  } else {\n    return func;\n  }\n};\nvar reusableSVGContainer;\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n  if (node.namespaceURI === Namespaces.svg) {\n    if (!('innerHTML' in node)) {\n      // IE does not have innerHTML for SVG nodes, so instead we inject the\n      // new markup in a temp node and then move the child nodes across into\n      // the target node\n      reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n      reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';\n      var svgNode = reusableSVGContainer.firstChild;\n      while (node.firstChild) {\n        node.removeChild(node.firstChild);\n      }\n      while (svgNode.firstChild) {\n        node.appendChild(svgNode.firstChild);\n      }\n      return;\n    }\n  }\n  node.innerHTML = html;\n});\n/**\n * HTML nodeType values that represent the type of the node\n */\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n/**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the \\`nodeValue\\` of the Text node directly instead of using\n * \\`.textContent\\` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\nvar setTextContent = function (node, text) {\n  if (text) {\n    var firstChild = node.firstChild;\n    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n      firstChild.nodeValue = text;\n      return;\n    }\n  }\n  node.textContent = text;\n};\n// Do not use the below two methods directly!\n// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.\n// (It is the only module that is allowed to access these methods.)\nfunction unsafeCastStringToDOMTopLevelType(topLevelType) {\n  return topLevelType;\n}\nfunction unsafeCastDOMTopLevelTypeToString(topLevelType) {\n  return topLevelType;\n}\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\nfunction makePrefixMap(styleProp, eventName) {\n  var prefixes = {};\n  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n  prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n  prefixes['Moz' + styleProp] = 'moz' + eventName;\n  return prefixes;\n}\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\nvar vendorPrefixes = {\n  animationend: makePrefixMap('Animation', 'AnimationEnd'),\n  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n  animationstart: makePrefixMap('Animation', 'AnimationStart'),\n  transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\nvar prefixedEventNames = {};\n/**\n * Element to check for prefixes on.\n */\nvar style = {};\n/**\n * Bootstrap if a DOM exists.\n */\nif (canUseDOM) {\n  style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,\n  // the un-prefixed \\\\\"animation\\\\\" and \\\\\"transition\\\\\" properties are defined on the\n  // style object but the events that fire will still be prefixed, so we need\n  // to check if the un-prefixed events are usable, and if not remove them from the map.\n  if (!('AnimationEvent' in window)) {\n    delete vendorPrefixes.animationend.animation;\n    delete vendorPrefixes.animationiteration.animation;\n    delete vendorPrefixes.animationstart.animation;\n  } // Same as above\n  if (!('TransitionEvent' in window)) {\n    delete vendorPrefixes.transitionend.transition;\n  }\n}\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\nfunction getVendorPrefixedEventName(eventName) {\n  if (prefixedEventNames[eventName]) {\n    return prefixedEventNames[eventName];\n  } else if (!vendorPrefixes[eventName]) {\n    return eventName;\n  }\n  var prefixMap = vendorPrefixes[eventName];\n  for (var styleProp in prefixMap) {\n    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n      return prefixedEventNames[eventName] = prefixMap[styleProp];\n    }\n  }\n  return eventName;\n}\n/**\n * To identify top level events in ReactDOM, we use constants defined by this\n * module. This is the only module that uses the unsafe* methods to express\n * that the constants actually correspond to the browser event names. This lets\n * us save some bundle size by avoiding a top level type -> event name map.\n * The rest of ReactDOM code should import top level types from this file.\n */\nvar TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');\nvar TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));\nvar TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));\nvar TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));\nvar TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');\nvar TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');\nvar TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');\nvar TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');\nvar TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');\nvar TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');\nvar TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');\nvar TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');\nvar TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');\nvar TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');\nvar TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');\nvar TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');\nvar TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');\nvar TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');\nvar TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');\nvar TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');\nvar TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');\nvar TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');\nvar TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');\nvar TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');\nvar TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');\nvar TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');\nvar TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');\nvar TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');\nvar TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');\nvar TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');\nvar TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');\nvar TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');\nvar TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');\nvar TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');\nvar TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');\nvar TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');\nvar TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');\nvar TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');\nvar TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');\nvar TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');\nvar TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');\nvar TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');\nvar TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');\nvar TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');\nvar TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');\nvar TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');\nvar TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');\nvar TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');\nvar TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');\nvar TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');\nvar TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');\nvar TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');\nvar TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');\nvar TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');\nvar TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');\nvar TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');\nvar TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');\nvar TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');\nvar TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');\nvar TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');\nvar TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');\nvar TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');\nvar TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');\nvar TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');\nvar TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');\nvar TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');\nvar TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');\nvar TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');\nvar TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');\nvar TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');\nvar TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');\nvar TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');\nvar TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');\nvar TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');\nvar TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');\nvar TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');\nvar TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));\nvar TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');\nvar TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');\nvar TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.\n// Note that events in this list will *not* be listened to at the top level\n// unless they're explicitly whitelisted in \\`ReactBrowserEventEmitter.listenTo\\`.\nvar mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];\nfunction getRawEventName(topLevelType) {\n  return unsafeCastDOMTopLevelTypeToString(topLevelType);\n}\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // prettier-ignore\nvar elementListenerMap = new PossiblyWeakMap();\nfunction getListenerMapForElement(element) {\n  var listenerMap = elementListenerMap.get(element);\n  if (listenerMap === undefined) {\n    listenerMap = new Map();\n    elementListenerMap.set(element, listenerMap);\n  }\n  return listenerMap;\n}\n/**\n * \\`ReactInstanceMap\\` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\nfunction get(key) {\n  return key._reactInternalFiber;\n}\nfunction has(key) {\n  return key._reactInternalFiber !== undefined;\n}\nfunction set(key, value) {\n  key._reactInternalFiber = value;\n}\n// Don't change these two values. They're used by React Dev Tools.\nvar NoEffect =\n/*              */\n0;\nvar PerformedWork =\n/*         */\n1; // You can change the rest (and add more).\nvar Placement =\n/*             */\n2;\nvar Update =\n/*                */\n4;\nvar PlacementAndUpdate =\n/*    */\n6;\nvar Deletion =\n/*              */\n8;\nvar ContentReset =\n/*          */\n16;\nvar Callback =\n/*              */\n32;\nvar DidCapture =\n/*            */\n64;\nvar Ref =\n/*                   */\n128;\nvar Snapshot =\n/*              */\n256;\nvar Passive =\n/*               */\n512;\nvar Hydrating =\n/*             */\n1024;\nvar HydratingAndUpdate =\n/*    */\n1028; // Passive & Update & Callback & Ref & Snapshot\nvar LifecycleEffectMask =\n/*   */\n932; // Union of all host effects\nvar HostEffectMask =\n/*        */\n2047;\nvar Incomplete =\n/*            */\n2048;\nvar ShouldCapture =\n/*         */\n4096;\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n  var node = fiber;\n  var nearestMounted = fiber;\n  if (!fiber.alternate) {\n    // If there is no alternate, this might be a new tree that isn't inserted\n    // yet. If it is, then it will have a pending insertion effect on it.\n    var nextNode = node;\n    do {\n      node = nextNode;\n      if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {\n        // This is an insertion or in-progress hydration. The nearest possible\n        // mounted fiber is the parent but we need to continue to figure out\n        // if that one is still mounted.\n        nearestMounted = node.return;\n      }\n      nextNode = node.return;\n    } while (nextNode);\n  } else {\n    while (node.return) {\n      node = node.return;\n    }\n  }\n  if (node.tag === HostRoot) {\n    // TODO: Check if this was a nested HostRoot when used with\n    // renderContainerIntoSubtree.\n    return nearestMounted;\n  } // If we didn't hit the root, that means that we're in an disconnected tree\n  // that has been unmounted.\n  return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n  if (fiber.tag === SuspenseComponent) {\n    var suspenseState = fiber.memoizedState;\n    if (suspenseState === null) {\n      var current = fiber.alternate;\n      if (current !== null) {\n        suspenseState = current.memoizedState;\n      }\n    }\n    if (suspenseState !== null) {\n      return suspenseState.dehydrated;\n    }\n  }\n  return null;\n}\nfunction getContainerFromFiber(fiber) {\n  return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n  return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n  {\n    var owner = ReactCurrentOwner.current;\n    if (owner !== null && owner.tag === ClassComponent) {\n      var ownerFiber = owner;\n      var instance = ownerFiber.stateNode;\n      if (!instance._warnedAboutRefsInRender) {\n        error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');\n      }\n      instance._warnedAboutRefsInRender = true;\n    }\n  }\n  var fiber = get(component);\n  if (!fiber) {\n    return false;\n  }\n  return getNearestMountedFiber(fiber) === fiber;\n}\nfunction assertIsMounted(fiber) {\n  if (!(getNearestMountedFiber(fiber) === fiber)) {\n    {\n      throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n    }\n  }\n}\nfunction findCurrentFiberUsingSlowPath(fiber) {\n  var alternate = fiber.alternate;\n  if (!alternate) {\n    // If there is no alternate, then we only need to check if it is mounted.\n    var nearestMounted = getNearestMountedFiber(fiber);\n    if (!(nearestMounted !== null)) {\n      {\n        throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n      }\n    }\n    if (nearestMounted !== fiber) {\n      return null;\n    }\n    return fiber;\n  } // If we have two possible branches, we'll walk backwards up to the root\n  // to see what path the root points to. On the way we may hit one of the\n  // special cases and we'll deal with them.\n  var a = fiber;\n  var b = alternate;\n  while (true) {\n    var parentA = a.return;\n    if (parentA === null) {\n      // We're at the root.\n      break;\n    }\n    var parentB = parentA.alternate;\n    if (parentB === null) {\n      // There is no alternate. This is an unusual case. Currently, it only\n      // happens when a Suspense component is hidden. An extra fragment fiber\n      // is inserted in between the Suspense fiber and its children. Skip\n      // over this extra fragment fiber and proceed to the next parent.\n      var nextParent = parentA.return;\n      if (nextParent !== null) {\n        a = b = nextParent;\n        continue;\n      } // If there's no parent, we're at the root.\n      break;\n    } // If both copies of the parent fiber point to the same child, we can\n    // assume that the child is current. This happens when we bailout on low\n    // priority: the bailed out fiber's child reuses the current child.\n    if (parentA.child === parentB.child) {\n      var child = parentA.child;\n      while (child) {\n        if (child === a) {\n          // We've determined that A is the current branch.\n          assertIsMounted(parentA);\n          return fiber;\n        }\n        if (child === b) {\n          // We've determined that B is the current branch.\n          assertIsMounted(parentA);\n          return alternate;\n        }\n        child = child.sibling;\n      } // We should never have an alternate for any mounting node. So the only\n      // way this could possibly happen is if this was unmounted, if at all.\n      {\n        {\n          throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n        }\n      }\n    }\n    if (a.return !== b.return) {\n      // The return pointer of A and the return pointer of B point to different\n      // fibers. We assume that return pointers never criss-cross, so A must\n      // belong to the child set of A.return, and B must belong to the child\n      // set of B.return.\n      a = parentA;\n      b = parentB;\n    } else {\n      // The return pointers point to the same fiber. We'll have to use the\n      // default, slow path: scan the child sets of each parent alternate to see\n      // which child belongs to which set.\n      //\n      // Search parent A's child set\n      var didFindChild = false;\n      var _child = parentA.child;\n      while (_child) {\n        if (_child === a) {\n          didFindChild = true;\n          a = parentA;\n          b = parentB;\n          break;\n        }\n        if (_child === b) {\n          didFindChild = true;\n          b = parentA;\n          a = parentB;\n          break;\n        }\n        _child = _child.sibling;\n      }\n      if (!didFindChild) {\n        // Search parent B's child set\n        _child = parentB.child;\n        while (_child) {\n          if (_child === a) {\n            didFindChild = true;\n            a = parentB;\n            b = parentA;\n            break;\n          }\n          if (_child === b) {\n            didFindChild = true;\n            b = parentB;\n            a = parentA;\n            break;\n          }\n          _child = _child.sibling;\n        }\n        if (!didFindChild) {\n          {\n            throw Error( \\\\\"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\\\\\" );\n          }\n        }\n      }\n    }\n    if (!(a.alternate === b)) {\n      {\n        throw Error( \\\\\"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  } // If the root is not a host container, we're in a disconnected tree. I.e.\n  // unmounted.\n  if (!(a.tag === HostRoot)) {\n    {\n      throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n    }\n  }\n  if (a.stateNode.current === a) {\n    // We've determined that A is the current branch.\n    return fiber;\n  } // Otherwise B has to be current branch.\n  return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  } // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText) {\n      return node;\n    } else if (node.child) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node.return || node.return === currentParent) {\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  } // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n  var currentParent = findCurrentFiberUsingSlowPath(parent);\n  if (!currentParent) {\n    return null;\n  } // Next we'll drill down this component to find the first HostComponent/Text.\n  var node = currentParent;\n  while (true) {\n    if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {\n      return node;\n    } else if (node.child && node.tag !== HostPortal) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === currentParent) {\n      return null;\n    }\n    while (!node.sibling) {\n      if (!node.return || node.return === currentParent) {\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  } // Flow needs the return null here, but ESLint complains about it.\n  // eslint-disable-next-line no-unreachable\n  return null;\n}\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since \\`current\\` can be null before being passed in and not\n * null after this function, make sure to assign it back to \\`current\\`:\n *\n * \\`a = accumulateInto(a, b);\\`\n *\n * This API should be sparingly used. Try \\`accumulate\\` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\nfunction accumulateInto(current, next) {\n  if (!(next != null)) {\n    {\n      throw Error( \\\\\"accumulateInto(...): Accumulated items must not be null or undefined.\\\\\" );\n    }\n  }\n  if (current == null) {\n    return next;\n  } // Both are not empty. Warning: Never call x.concat(y) when you are not\n  // certain that x is an Array (x could be a string with concat method).\n  if (Array.isArray(current)) {\n    if (Array.isArray(next)) {\n      current.push.apply(current, next);\n      return current;\n    }\n    current.push(next);\n    return current;\n  }\n  if (Array.isArray(next)) {\n    // A bit too dangerous to mutate \\`next\\`.\n    return [current].concat(next);\n  }\n  return [current, next];\n}\n/**\n * @param {array} arr an \\\\\"accumulation\\\\\" of items which is either an Array or\n * a single item. Useful when paired with the \\`accumulate\\` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as \\`this\\` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n  if (Array.isArray(arr)) {\n    arr.forEach(cb, scope);\n  } else if (arr) {\n    cb.call(scope, arr);\n  }\n}\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\nvar eventQueue = null;\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @private\n */\nvar executeDispatchesAndRelease = function (event) {\n  if (event) {\n    executeDispatchesInOrder(event);\n    if (!event.isPersistent()) {\n      event.constructor.release(event);\n    }\n  }\n};\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n  return executeDispatchesAndRelease(e);\n};\nfunction runEventsInBatch(events) {\n  if (events !== null) {\n    eventQueue = accumulateInto(eventQueue, events);\n  } // Set \\`eventQueue\\` to null before processing it so that we can tell if more\n  // events get enqueued while processing.\n  var processingEventQueue = eventQueue;\n  eventQueue = null;\n  if (!processingEventQueue) {\n    return;\n  }\n  forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n  if (!!eventQueue) {\n    {\n      throw Error( \\\\\"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.\\\\\" );\n    }\n  } // This would be a good time to rethrow if any of the event handlers threw.\n  rethrowCaughtError();\n}\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\nfunction getEventTarget(nativeEvent) {\n  // Fallback to nativeEvent.srcElement for IE9\n  // https://github.com/facebook/react/issues/12506\n  var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963\n  if (target.correspondingUseElement) {\n    target = target.correspondingUseElement;\n  } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n  // @see http://www.quirksmode.org/js/events_properties.html\n  return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as \\`change\\`,\n * \\`reset\\`, \\`load\\`, \\`error\\`, and \\`select\\`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \\\\\"click\\\\\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nfunction isEventSupported(eventNameSuffix) {\n  if (!canUseDOM) {\n    return false;\n  }\n  var eventName = 'on' + eventNameSuffix;\n  var isSupported = eventName in document;\n  if (!isSupported) {\n    var element = document.createElement('div');\n    element.setAttribute(eventName, 'return;');\n    isSupported = typeof element[eventName] === 'function';\n  }\n  return isSupported;\n}\n/**\n * Summary of \\`DOMEventPluginSystem\\` event handling:\n *\n *  - Top-level delegation is used to trap most native browser events. This\n *    may only occur in the main thread and is the responsibility of\n *    ReactDOMEventListener, which is injected and can therefore support\n *    pluggable event sources. This is the only work that occurs in the main\n *    thread.\n *\n *  - We normalize and de-duplicate events to account for browser quirks. This\n *    may be done in the worker thread.\n *\n *  - Forward these native events (with the associated top-level type used to\n *    trap it) to \\`EventPluginRegistry\\`, which in turn will ask plugins if they want\n *    to extract any synthetic events.\n *\n *  - The \\`EventPluginRegistry\\` will then process each event by annotating them with\n *    \\\\\"dispatches\\\\\", a sequence of listeners and IDs that care about that event.\n *\n *  - The \\`EventPluginRegistry\\` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * +------------+    .\n * |    DOM     |    .\n * +------------+    .\n *       |           .\n *       v           .\n * +------------+    .\n * | ReactEvent |    .\n * |  Listener  |    .\n * +------------+    .                         +-----------+\n *       |           .               +--------+|SimpleEvent|\n *       |           .               |         |Plugin     |\n * +-----|------+    .               v         +-----------+\n * |     |      |    .    +--------------+                    +------------+\n * |     +-----------.--->|PluginRegistry|                    |    Event   |\n * |            |    .    |              |     +-----------+  | Propagators|\n * | ReactEvent |    .    |              |     |TapEvent   |  |------------|\n * |  Emitter   |    .    |              |<---+|Plugin     |  |other plugin|\n * |            |    .    |              |     +-----------+  |  utilities |\n * |     +-----------.--->|              |                    +------------+\n * |     |      |    .    +--------------+\n * +-----|------+    .                ^        +-----------+\n *       |           .                |        |Enter/Leave|\n *       +           .                +-------+|Plugin     |\n * +-------------+   .                         +-----------+\n * | application |   .\n * |-------------|   .\n * |             |   .\n * |             |   .\n * +-------------+   .\n *                   .\n *    React Core     .  General Purpose Event Plugin System\n */\nvar CALLBACK_BOOKKEEPING_POOL_SIZE = 10;\nvar callbackBookkeepingPool = [];\nfunction releaseTopLevelCallbackBookKeeping(instance) {\n  instance.topLevelType = null;\n  instance.nativeEvent = null;\n  instance.targetInst = null;\n  instance.ancestors.length = 0;\n  if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {\n    callbackBookkeepingPool.push(instance);\n  }\n} // Used to store ancestor hierarchy in top level callback\nfunction getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {\n  if (callbackBookkeepingPool.length) {\n    var instance = callbackBookkeepingPool.pop();\n    instance.topLevelType = topLevelType;\n    instance.eventSystemFlags = eventSystemFlags;\n    instance.nativeEvent = nativeEvent;\n    instance.targetInst = targetInst;\n    return instance;\n  }\n  return {\n    topLevelType: topLevelType,\n    eventSystemFlags: eventSystemFlags,\n    nativeEvent: nativeEvent,\n    targetInst: targetInst,\n    ancestors: []\n  };\n}\n/**\n * Find the deepest React component completely containing the root of the\n * passed-in instance (for use when entire React trees are nested within each\n * other). If React trees are not nested, returns null.\n */\nfunction findRootContainerNode(inst) {\n  if (inst.tag === HostRoot) {\n    return inst.stateNode.containerInfo;\n  } // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n  // traversal, but caching is difficult to do correctly without using a\n  // mutation observer to listen for all DOM changes.\n  while (inst.return) {\n    inst = inst.return;\n  }\n  if (inst.tag !== HostRoot) {\n    // This can happen if we're in a detached tree.\n    return null;\n  }\n  return inst.stateNode.containerInfo;\n}\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\nfunction extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n  var events = null;\n  for (var i = 0; i < plugins.length; i++) {\n    // Not every plugin in the ordering may be loaded at runtime.\n    var possiblePlugin = plugins[i];\n    if (possiblePlugin) {\n      var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n      if (extractedEvents) {\n        events = accumulateInto(events, extractedEvents);\n      }\n    }\n  }\n  return events;\n}\nfunction runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n  var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n  runEventsInBatch(events);\n}\nfunction handleTopLevel(bookKeeping) {\n  var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.\n  // It's important that we build the array of ancestors before calling any\n  // event handlers, because event handlers can modify the DOM, leading to\n  // inconsistencies with ReactMount's node cache. See #1105.\n  var ancestor = targetInst;\n  do {\n    if (!ancestor) {\n      var ancestors = bookKeeping.ancestors;\n      ancestors.push(ancestor);\n      break;\n    }\n    var root = findRootContainerNode(ancestor);\n    if (!root) {\n      break;\n    }\n    var tag = ancestor.tag;\n    if (tag === HostComponent || tag === HostText) {\n      bookKeeping.ancestors.push(ancestor);\n    }\n    ancestor = getClosestInstanceFromNode(root);\n  } while (ancestor);\n  for (var i = 0; i < bookKeeping.ancestors.length; i++) {\n    targetInst = bookKeeping.ancestors[i];\n    var eventTarget = getEventTarget(bookKeeping.nativeEvent);\n    var topLevelType = bookKeeping.topLevelType;\n    var nativeEvent = bookKeeping.nativeEvent;\n    var eventSystemFlags = bookKeeping.eventSystemFlags; // If this is the first ancestor, we mark it on the system flags\n    if (i === 0) {\n      eventSystemFlags |= IS_FIRST_ANCESTOR;\n    }\n    runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags);\n  }\n}\nfunction dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {\n  var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);\n  try {\n    // Event queue being processed in the same cycle allows\n    // \\`preventDefault\\`.\n    batchedEventUpdates(handleTopLevel, bookKeeping);\n  } finally {\n    releaseTopLevelCallbackBookKeeping(bookKeeping);\n  }\n}\n/**\n * We listen for bubbled touch events on the document object.\n *\n * Firefox v8.01 (and possibly others) exhibited strange behavior when\n * mounting \\`onmousemove\\` events at some node that was not the document\n * element. The symptoms were that if your mouse is not moving over something\n * contained within that mount point (for example on the background) the\n * top-level listeners for \\`onmousemove\\` won't be called. However, if you\n * register the \\`mousemove\\` on the document object, then it will of course\n * catch all \\`mousemove\\`s. This along with iOS quirks, justifies restricting\n * top-level listeners to the document object only, at least for these\n * movement types of events and possibly all events.\n *\n * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n *\n * Also, \\`keyup\\`/\\`keypress\\`/\\`keydown\\` do not bubble to the window on IE, but\n * they bubble to document.\n *\n * @param {string} registrationName Name of listener (e.g. \\`onClick\\`).\n * @param {object} mountAt Container where to mount the listener\n */\nfunction legacyListenToEvent(registrationName, mountAt) {\n  var listenerMap = getListenerMapForElement(mountAt);\n  var dependencies = registrationNameDependencies[registrationName];\n  for (var i = 0; i < dependencies.length; i++) {\n    var dependency = dependencies[i];\n    legacyListenToTopLevelEvent(dependency, mountAt, listenerMap);\n  }\n}\nfunction legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) {\n  if (!listenerMap.has(topLevelType)) {\n    switch (topLevelType) {\n      case TOP_SCROLL:\n        trapCapturedEvent(TOP_SCROLL, mountAt);\n        break;\n      case TOP_FOCUS:\n      case TOP_BLUR:\n        trapCapturedEvent(TOP_FOCUS, mountAt);\n        trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,\n        // but this ensures we mark both as attached rather than just one.\n        listenerMap.set(TOP_BLUR, null);\n        listenerMap.set(TOP_FOCUS, null);\n        break;\n      case TOP_CANCEL:\n      case TOP_CLOSE:\n        if (isEventSupported(getRawEventName(topLevelType))) {\n          trapCapturedEvent(topLevelType, mountAt);\n        }\n        break;\n      case TOP_INVALID:\n      case TOP_SUBMIT:\n      case TOP_RESET:\n        // We listen to them on the target DOM elements.\n        // Some of them bubble so we don't want them to fire twice.\n        break;\n      default:\n        // By default, listen on the top level to all non-media events.\n        // Media events don't bubble so adding the listener wouldn't do anything.\n        var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;\n        if (!isMediaEvent) {\n          trapBubbledEvent(topLevelType, mountAt);\n        }\n        break;\n    }\n    listenerMap.set(topLevelType, null);\n  }\n}\nfunction isListeningToAllDependencies(registrationName, mountAt) {\n  var listenerMap = getListenerMapForElement(mountAt);\n  var dependencies = registrationNameDependencies[registrationName];\n  for (var i = 0; i < dependencies.length; i++) {\n    var dependency = dependencies[i];\n    if (!listenerMap.has(dependency)) {\n      return false;\n    }\n  }\n  return true;\n}\nvar attemptUserBlockingHydration;\nfunction setAttemptUserBlockingHydration(fn) {\n  attemptUserBlockingHydration = fn;\n}\nvar attemptContinuousHydration;\nfunction setAttemptContinuousHydration(fn) {\n  attemptContinuousHydration = fn;\n}\nvar attemptHydrationAtCurrentPriority;\nfunction setAttemptHydrationAtCurrentPriority(fn) {\n  attemptHydrationAtCurrentPriority = fn;\n} // TODO: Upgrade this definition once we're on a newer version of Flow that\nvar hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.\nvar queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.\n// if the last target was dehydrated.\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; // For pointer events there can be one latest event per pointerId.\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.\nvar queuedExplicitHydrationTargets = [];\nfunction hasQueuedDiscreteEvents() {\n  return queuedDiscreteEvents.length > 0;\n}\nvar discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];\nvar continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];\nfunction isReplayableDiscreteEvent(eventType) {\n  return discreteReplayableEvents.indexOf(eventType) > -1;\n}\nfunction trapReplayableEventForDocument(topLevelType, document, listenerMap) {\n  legacyListenToTopLevelEvent(topLevelType, document, listenerMap);\n}\nfunction eagerlyTrapReplayableEvents(container, document) {\n  var listenerMapForDoc = getListenerMapForElement(document); // Discrete\n  discreteReplayableEvents.forEach(function (topLevelType) {\n    trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);\n  }); // Continuous\n  continuousReplayableEvents.forEach(function (topLevelType) {\n    trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);\n  });\n}\nfunction createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n  return {\n    blockedOn: blockedOn,\n    topLevelType: topLevelType,\n    eventSystemFlags: eventSystemFlags | IS_REPLAYED,\n    nativeEvent: nativeEvent,\n    container: container\n  };\n}\nfunction queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n  var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n  queuedDiscreteEvents.push(queuedEvent);\n} // Resets the replaying for this type of continuous event to no event.\nfunction clearIfContinuousEvent(topLevelType, nativeEvent) {\n  switch (topLevelType) {\n    case TOP_FOCUS:\n    case TOP_BLUR:\n      queuedFocus = null;\n      break;\n    case TOP_DRAG_ENTER:\n    case TOP_DRAG_LEAVE:\n      queuedDrag = null;\n      break;\n    case TOP_MOUSE_OVER:\n    case TOP_MOUSE_OUT:\n      queuedMouse = null;\n      break;\n    case TOP_POINTER_OVER:\n    case TOP_POINTER_OUT:\n      {\n        var pointerId = nativeEvent.pointerId;\n        queuedPointers.delete(pointerId);\n        break;\n      }\n    case TOP_GOT_POINTER_CAPTURE:\n    case TOP_LOST_POINTER_CAPTURE:\n      {\n        var _pointerId = nativeEvent.pointerId;\n        queuedPointerCaptures.delete(_pointerId);\n        break;\n      }\n  }\n}\nfunction accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n  if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n    var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n    if (blockedOn !== null) {\n      var _fiber2 = getInstanceFromNode$1(blockedOn);\n      if (_fiber2 !== null) {\n        // Attempt to increase the priority of this target.\n        attemptContinuousHydration(_fiber2);\n      }\n    }\n    return queuedEvent;\n  } // If we have already queued this exact event, then it's because\n  // the different event systems have different DOM event listeners.\n  // We can accumulate the flags and store a single event to be\n  // replayed.\n  existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n  return existingQueuedEvent;\n}\nfunction queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {\n  // These set relatedTarget to null because the replayed event will be treated as if we\n  // moved from outside the window (no target) onto the target once it hydrates.\n  // Instead of mutating we could clone the event.\n  switch (topLevelType) {\n    case TOP_FOCUS:\n      {\n        var focusEvent = nativeEvent;\n        queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);\n        return true;\n      }\n    case TOP_DRAG_ENTER:\n      {\n        var dragEvent = nativeEvent;\n        queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);\n        return true;\n      }\n    case TOP_MOUSE_OVER:\n      {\n        var mouseEvent = nativeEvent;\n        queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);\n        return true;\n      }\n    case TOP_POINTER_OVER:\n      {\n        var pointerEvent = nativeEvent;\n        var pointerId = pointerEvent.pointerId;\n        queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));\n        return true;\n      }\n    case TOP_GOT_POINTER_CAPTURE:\n      {\n        var _pointerEvent = nativeEvent;\n        var _pointerId2 = _pointerEvent.pointerId;\n        queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent));\n        return true;\n      }\n  }\n  return false;\n} // Check if this target is unblocked. Returns true if it's unblocked.\nfunction attemptExplicitHydrationTarget(queuedTarget) {\n  // TODO: This function shares a lot of logic with attemptToDispatchEvent.\n  // Try to unify them. It's a bit tricky since it would require two return\n  // values.\n  var targetInst = getClosestInstanceFromNode(queuedTarget.target);\n  if (targetInst !== null) {\n    var nearestMounted = getNearestMountedFiber(targetInst);\n    if (nearestMounted !== null) {\n      var tag = nearestMounted.tag;\n      if (tag === SuspenseComponent) {\n        var instance = getSuspenseInstanceFromFiber(nearestMounted);\n        if (instance !== null) {\n          // We're blocked on hydrating this boundary.\n          // Increase its priority.\n          queuedTarget.blockedOn = instance;\n          Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {\n            attemptHydrationAtCurrentPriority(nearestMounted);\n          });\n          return;\n        }\n      } else if (tag === HostRoot) {\n        var root = nearestMounted.stateNode;\n        if (root.hydrate) {\n          queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of\n          // a root other than sync.\n          return;\n        }\n      }\n    }\n  }\n  queuedTarget.blockedOn = null;\n}\nfunction attemptReplayContinuousQueuedEvent(queuedEvent) {\n  if (queuedEvent.blockedOn !== null) {\n    return false;\n  }\n  var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent);\n  if (nextBlockedOn !== null) {\n    // We're still blocked. Try again later.\n    var _fiber3 = getInstanceFromNode$1(nextBlockedOn);\n    if (_fiber3 !== null) {\n      attemptContinuousHydration(_fiber3);\n    }\n    queuedEvent.blockedOn = nextBlockedOn;\n    return false;\n  }\n  return true;\n}\nfunction attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {\n  if (attemptReplayContinuousQueuedEvent(queuedEvent)) {\n    map.delete(key);\n  }\n}\nfunction replayUnblockedEvents() {\n  hasScheduledReplayAttempt = false; // First replay discrete events.\n  while (queuedDiscreteEvents.length > 0) {\n    var nextDiscreteEvent = queuedDiscreteEvents[0];\n    if (nextDiscreteEvent.blockedOn !== null) {\n      // We're still blocked.\n      // Increase the priority of this boundary to unblock\n      // the next discrete event.\n      var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);\n      if (_fiber4 !== null) {\n        attemptUserBlockingHydration(_fiber4);\n      }\n      break;\n    }\n    var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent);\n    if (nextBlockedOn !== null) {\n      // We're still blocked. Try again later.\n      nextDiscreteEvent.blockedOn = nextBlockedOn;\n    } else {\n      // We've successfully replayed the first event. Let's try the next one.\n      queuedDiscreteEvents.shift();\n    }\n  } // Next replay any continuous events.\n  if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {\n    queuedFocus = null;\n  }\n  if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {\n    queuedDrag = null;\n  }\n  if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {\n    queuedMouse = null;\n  }\n  queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);\n  queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);\n}\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n  if (queuedEvent.blockedOn === unblocked) {\n    queuedEvent.blockedOn = null;\n    if (!hasScheduledReplayAttempt) {\n      hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are\n      // now unblocked. This first might not actually be unblocked yet.\n      // We could check it early to avoid scheduling an unnecessary callback.\n      Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n    }\n  }\n}\nfunction retryIfBlockedOn(unblocked) {\n  // Mark anything that was blocked on this as no longer blocked\n  // and eligible for a replay.\n  if (queuedDiscreteEvents.length > 0) {\n    scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's\n    // worth it because we expect very few discrete events to queue up and once\n    // we are actually fully unblocked it will be fast to replay them.\n    for (var i = 1; i < queuedDiscreteEvents.length; i++) {\n      var queuedEvent = queuedDiscreteEvents[i];\n      if (queuedEvent.blockedOn === unblocked) {\n        queuedEvent.blockedOn = null;\n      }\n    }\n  }\n  if (queuedFocus !== null) {\n    scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n  }\n  if (queuedDrag !== null) {\n    scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n  }\n  if (queuedMouse !== null) {\n    scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n  }\n  var unblock = function (queuedEvent) {\n    return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n  };\n  queuedPointers.forEach(unblock);\n  queuedPointerCaptures.forEach(unblock);\n  for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {\n    var queuedTarget = queuedExplicitHydrationTargets[_i];\n    if (queuedTarget.blockedOn === unblocked) {\n      queuedTarget.blockedOn = null;\n    }\n  }\n  while (queuedExplicitHydrationTargets.length > 0) {\n    var nextExplicitTarget = queuedExplicitHydrationTargets[0];\n    if (nextExplicitTarget.blockedOn !== null) {\n      // We're still blocked.\n      break;\n    } else {\n      attemptExplicitHydrationTarget(nextExplicitTarget);\n      if (nextExplicitTarget.blockedOn === null) {\n        // We're unblocked.\n        queuedExplicitHydrationTargets.shift();\n      }\n    }\n  }\n}\nfunction addEventBubbleListener(element, eventType, listener) {\n  element.addEventListener(eventType, listener, false);\n}\nfunction addEventCaptureListener(element, eventType, listener) {\n  element.addEventListener(eventType, listener, true);\n}\n// do it in two places, which duplicates logic\n// and increases the bundle size, we do it all\n// here once. If we remove or refactor the\n// SimpleEventPlugin, we should also remove or\n// update the below line.\nvar simpleEventPluginEventTypes = {};\nvar topLevelEventsToDispatchConfig = new Map();\nvar eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use\n// the code required to apply the same logic for event prioritization and that of the\n// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code\n// duplication (for which there would be quite a bit). For the events that are not needed\n// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an\n// array of top level events.\n// Lastly, we ignore prettier so we can keep the formatting sane.\n// prettier-ignore\nvar discreteEventPairsForSimpleEventPlugin = [TOP_BLUR, 'blur', TOP_CANCEL, 'cancel', TOP_CLICK, 'click', TOP_CLOSE, 'close', TOP_CONTEXT_MENU, 'contextMenu', TOP_COPY, 'copy', TOP_CUT, 'cut', TOP_AUX_CLICK, 'auxClick', TOP_DOUBLE_CLICK, 'doubleClick', TOP_DRAG_END, 'dragEnd', TOP_DRAG_START, 'dragStart', TOP_DROP, 'drop', TOP_FOCUS, 'focus', TOP_INPUT, 'input', TOP_INVALID, 'invalid', TOP_KEY_DOWN, 'keyDown', TOP_KEY_PRESS, 'keyPress', TOP_KEY_UP, 'keyUp', TOP_MOUSE_DOWN, 'mouseDown', TOP_MOUSE_UP, 'mouseUp', TOP_PASTE, 'paste', TOP_PAUSE, 'pause', TOP_PLAY, 'play', TOP_POINTER_CANCEL, 'pointerCancel', TOP_POINTER_DOWN, 'pointerDown', TOP_POINTER_UP, 'pointerUp', TOP_RATE_CHANGE, 'rateChange', TOP_RESET, 'reset', TOP_SEEKED, 'seeked', TOP_SUBMIT, 'submit', TOP_TOUCH_CANCEL, 'touchCancel', TOP_TOUCH_END, 'touchEnd', TOP_TOUCH_START, 'touchStart', TOP_VOLUME_CHANGE, 'volumeChange'];\nvar otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE]; // prettier-ignore\nvar userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, 'drag', TOP_DRAG_ENTER, 'dragEnter', TOP_DRAG_EXIT, 'dragExit', TOP_DRAG_LEAVE, 'dragLeave', TOP_DRAG_OVER, 'dragOver', TOP_MOUSE_MOVE, 'mouseMove', TOP_MOUSE_OUT, 'mouseOut', TOP_MOUSE_OVER, 'mouseOver', TOP_POINTER_MOVE, 'pointerMove', TOP_POINTER_OUT, 'pointerOut', TOP_POINTER_OVER, 'pointerOver', TOP_SCROLL, 'scroll', TOP_TOGGLE, 'toggle', TOP_TOUCH_MOVE, 'touchMove', TOP_WHEEL, 'wheel']; // prettier-ignore\nvar continuousPairsForSimpleEventPlugin = [TOP_ABORT, 'abort', TOP_ANIMATION_END, 'animationEnd', TOP_ANIMATION_ITERATION, 'animationIteration', TOP_ANIMATION_START, 'animationStart', TOP_CAN_PLAY, 'canPlay', TOP_CAN_PLAY_THROUGH, 'canPlayThrough', TOP_DURATION_CHANGE, 'durationChange', TOP_EMPTIED, 'emptied', TOP_ENCRYPTED, 'encrypted', TOP_ENDED, 'ended', TOP_ERROR, 'error', TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', TOP_LOAD, 'load', TOP_LOADED_DATA, 'loadedData', TOP_LOADED_METADATA, 'loadedMetadata', TOP_LOAD_START, 'loadStart', TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', TOP_PLAYING, 'playing', TOP_PROGRESS, 'progress', TOP_SEEKING, 'seeking', TOP_STALLED, 'stalled', TOP_SUSPEND, 'suspend', TOP_TIME_UPDATE, 'timeUpdate', TOP_TRANSITION_END, 'transitionEnd', TOP_WAITING, 'waiting'];\n/**\n * Turns\n * ['abort', ...]\n * into\n * eventTypes = {\n *   'abort': {\n *     phasedRegistrationNames: {\n *       bubbled: 'onAbort',\n *       captured: 'onAbortCapture',\n *     },\n *     dependencies: [TOP_ABORT],\n *   },\n *   ...\n * };\n * topLevelEventsToDispatchConfig = new Map([\n *   [TOP_ABORT, { sameConfig }],\n * ]);\n */\nfunction processSimpleEventPluginPairsByPriority(eventTypes, priority) {\n  // As the event types are in pairs of two, we need to iterate\n  // through in twos. The events are in pairs of two to save code\n  // and improve init perf of processing this array, as it will\n  // result in far fewer object allocations and property accesses\n  // if we only use three arrays to process all the categories of\n  // instead of tuples.\n  for (var i = 0; i < eventTypes.length; i += 2) {\n    var topEvent = eventTypes[i];\n    var event = eventTypes[i + 1];\n    var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n    var onEvent = 'on' + capitalizedEvent;\n    var config = {\n      phasedRegistrationNames: {\n        bubbled: onEvent,\n        captured: onEvent + 'Capture'\n      },\n      dependencies: [topEvent],\n      eventPriority: priority\n    };\n    eventPriorities.set(topEvent, priority);\n    topLevelEventsToDispatchConfig.set(topEvent, config);\n    simpleEventPluginEventTypes[event] = config;\n  }\n}\nfunction processTopEventPairsByPriority(eventTypes, priority) {\n  for (var i = 0; i < eventTypes.length; i++) {\n    eventPriorities.set(eventTypes[i], priority);\n  }\n} // SimpleEventPlugin\nprocessSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);\nprocessSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);\nprocessSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent); // Not used by SimpleEventPlugin\nprocessTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent);\nfunction getEventPriorityForPluginSystem(topLevelType) {\n  var priority = eventPriorities.get(topLevelType); // Default to a ContinuousEvent. Note: we might\n  // want to warn if we can't detect the priority\n  // for the event.\n  return priority === undefined ? ContinuousEvent : priority;\n}\n// Intentionally not named imports because Rollup would use dynamic dispatch for\nvar UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n    runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these?\nvar _enabled = true;\nfunction setEnabled(enabled) {\n  _enabled = !!enabled;\n}\nfunction isEnabled() {\n  return _enabled;\n}\nfunction trapBubbledEvent(topLevelType, element) {\n  trapEventForPluginEventSystem(element, topLevelType, false);\n}\nfunction trapCapturedEvent(topLevelType, element) {\n  trapEventForPluginEventSystem(element, topLevelType, true);\n}\nfunction trapEventForPluginEventSystem(container, topLevelType, capture) {\n  var listener;\n  switch (getEventPriorityForPluginSystem(topLevelType)) {\n    case DiscreteEvent:\n      listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n      break;\n    case UserBlockingEvent:\n      listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n      break;\n    case ContinuousEvent:\n    default:\n      listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);\n      break;\n  }\n  var rawEventName = getRawEventName(topLevelType);\n  if (capture) {\n    addEventCaptureListener(container, rawEventName, listener);\n  } else {\n    addEventBubbleListener(container, rawEventName, listener);\n  }\n}\nfunction dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n  flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);\n  discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent);\n}\nfunction dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) {\n  runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent));\n}\nfunction dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n  if (!_enabled) {\n    return;\n  }\n  if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {\n    // If we already have a queue of discrete events, and this is another discrete\n    // event, then we can't dispatch it regardless of its target, since they\n    // need to dispatch in order.\n    queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.\n    topLevelType, eventSystemFlags, container, nativeEvent);\n    return;\n  }\n  var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent);\n  if (blockedOn === null) {\n    // We successfully dispatched this event.\n    clearIfContinuousEvent(topLevelType, nativeEvent);\n    return;\n  }\n  if (isReplayableDiscreteEvent(topLevelType)) {\n    // This this to be replayed later once the target is available.\n    queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);\n    return;\n  }\n  if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) {\n    return;\n  } // We need to clear only if we didn't queue because\n  // queueing is accummulative.\n  clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,\n  // in case the event system needs to trace it.\n  {\n    dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);\n  }\n} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.\nfunction attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {\n  // TODO: Warn if _enabled is false.\n  var nativeEventTarget = getEventTarget(nativeEvent);\n  var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n  if (targetInst !== null) {\n    var nearestMounted = getNearestMountedFiber(targetInst);\n    if (nearestMounted === null) {\n      // This tree has been unmounted already. Dispatch without a target.\n      targetInst = null;\n    } else {\n      var tag = nearestMounted.tag;\n      if (tag === SuspenseComponent) {\n        var instance = getSuspenseInstanceFromFiber(nearestMounted);\n        if (instance !== null) {\n          // Queue the event to be replayed later. Abort dispatching since we\n          // don't want this event dispatched twice through the event system.\n          // TODO: If this is the first discrete event in the queue. Schedule an increased\n          // priority for this boundary.\n          return instance;\n        } // This shouldn't happen, something went wrong but to avoid blocking\n        // the whole system, dispatch the event without a target.\n        // TODO: Warn.\n        targetInst = null;\n      } else if (tag === HostRoot) {\n        var root = nearestMounted.stateNode;\n        if (root.hydrate) {\n          // If this happens during a replay something went wrong and it might block\n          // the whole system.\n          return getContainerFromFiber(nearestMounted);\n        }\n        targetInst = null;\n      } else if (nearestMounted !== targetInst) {\n        // If we get an event (ex: img onload) before committing that\n        // component's mount, ignore it for now (that is, treat it as if it was an\n        // event on a non-React tree). We might also consider queueing events and\n        // dispatching them after the mount.\n        targetInst = null;\n      }\n    }\n  }\n  {\n    dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);\n  } // We're not blocked on anything.\n  return null;\n}\n// List derived from Gecko source code:\n// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js\nvar shorthandToLonghand = {\n  animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n  background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n  backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n  border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n  borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n  borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n  borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n  borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n  borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n  borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n  borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n  borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n  borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n  borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n  borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n  borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n  borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n  columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n  columns: ['columnCount', 'columnWidth'],\n  flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n  flexFlow: ['flexDirection', 'flexWrap'],\n  font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n  fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n  gap: ['columnGap', 'rowGap'],\n  grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n  gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n  gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n  gridColumnGap: ['columnGap'],\n  gridGap: ['columnGap', 'rowGap'],\n  gridRow: ['gridRowEnd', 'gridRowStart'],\n  gridRowGap: ['rowGap'],\n  gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n  listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n  margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n  marker: ['markerEnd', 'markerMid', 'markerStart'],\n  mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n  maskPosition: ['maskPositionX', 'maskPositionY'],\n  outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n  overflow: ['overflowX', 'overflowY'],\n  padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n  placeContent: ['alignContent', 'justifyContent'],\n  placeItems: ['alignItems', 'justifyItems'],\n  placeSelf: ['alignSelf', 'justifySelf'],\n  textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n  textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n  transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n  wordWrap: ['overflowWrap']\n};\n/**\n * CSS properties which accept numbers but are not in units of \\\\\"px\\\\\".\n */\nvar isUnitlessNumber = {\n  animationIterationCount: true,\n  borderImageOutset: true,\n  borderImageSlice: true,\n  borderImageWidth: true,\n  boxFlex: true,\n  boxFlexGroup: true,\n  boxOrdinalGroup: true,\n  columnCount: true,\n  columns: true,\n  flex: true,\n  flexGrow: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  flexOrder: true,\n  gridArea: true,\n  gridRow: true,\n  gridRowEnd: true,\n  gridRowSpan: true,\n  gridRowStart: true,\n  gridColumn: true,\n  gridColumnEnd: true,\n  gridColumnSpan: true,\n  gridColumnStart: true,\n  fontWeight: true,\n  lineClamp: true,\n  lineHeight: true,\n  opacity: true,\n  order: true,\n  orphans: true,\n  tabSize: true,\n  widows: true,\n  zIndex: true,\n  zoom: true,\n  // SVG-related properties\n  fillOpacity: true,\n  floodOpacity: true,\n  stopOpacity: true,\n  strokeDasharray: true,\n  strokeDashoffset: true,\n  strokeMiterlimit: true,\n  strokeOpacity: true,\n  strokeWidth: true\n};\n/**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with \\`prefix\\`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\nfunction prefixKey(prefix, key) {\n  return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n  prefixes.forEach(function (prefix) {\n    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n  });\n});\n/**\n * Convert a value into the proper css writable value. The style name \\`name\\`\n * should be logical (no hyphens), as specified\n * in \\`CSSProperty.isUnitlessNumber\\`.\n *\n * @param {string} name CSS property name such as \\`topMargin\\`.\n * @param {*} value CSS property value such as \\`10px\\`.\n * @return {string} Normalized style value with dimensions applied.\n */\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n  // Note that we've removed escapeTextForBrowser() calls here since the\n  // whole string will be escaped when the attribute is injected into\n  // the markup. If you provide unsafe user data here they can inject\n  // arbitrary CSS which may be problematic (I couldn't repro this):\n  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n  // This is not an XSS hole but instead a potential CSS injection issue\n  // which has lead to a greater discussion about how we're going to\n  // trust URLs moving forward. See #2115901\n  var isEmpty = value == null || typeof value === 'boolean' || value === '';\n  if (isEmpty) {\n    return '';\n  }\n  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n  }\n  return ('' + value).trim();\n}\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^ms-/;\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n *   > hyphenateStyleName('backgroundColor')\n *   < \\\\\"background-color\\\\\"\n *   > hyphenateStyleName('MozTransition')\n *   < \\\\\"-moz-transition\\\\\"\n *   > hyphenateStyleName('msTransition')\n *   < \\\\\"-ms-transition\\\\\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an \\`ms\\` prefix\n * is converted to \\`-ms-\\`.\n */\nfunction hyphenateStyleName(name) {\n  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\nvar warnValidStyle = function () {};\n{\n  // 'msTransform' is correct, but the other prefixes should be capitalized\n  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n  var msPattern$1 = /^-ms-/;\n  var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n  var badStyleValueWithSemicolonPattern = /;\\\\\\\\s*$/;\n  var warnedStyleNames = {};\n  var warnedStyleValues = {};\n  var warnedForNaNValue = false;\n  var warnedForInfinityValue = false;\n  var camelize = function (string) {\n    return string.replace(hyphenPattern, function (_, character) {\n      return character.toUpperCase();\n    });\n  };\n  var warnHyphenatedStyleName = function (name) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n    warnedStyleNames[name] = true;\n    error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests\n    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an \\`-ms\\` prefix\n    // is converted to lowercase \\`ms\\`.\n    camelize(name.replace(msPattern$1, 'ms-')));\n  };\n  var warnBadVendoredStyleName = function (name) {\n    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n      return;\n    }\n    warnedStyleNames[name] = true;\n    error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n  };\n  var warnStyleValueWithSemicolon = function (name, value) {\n    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n      return;\n    }\n    warnedStyleValues[value] = true;\n    error(\\\\\"Style property values shouldn't contain a semicolon. \\\\\" + 'Try \\\\\"%s: %s\\\\\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n  };\n  var warnStyleValueIsNaN = function (name, value) {\n    if (warnedForNaNValue) {\n      return;\n    }\n    warnedForNaNValue = true;\n    error('\\`NaN\\` is an invalid value for the \\`%s\\` css style property.', name);\n  };\n  var warnStyleValueIsInfinity = function (name, value) {\n    if (warnedForInfinityValue) {\n      return;\n    }\n    warnedForInfinityValue = true;\n    error('\\`Infinity\\` is an invalid value for the \\`%s\\` css style property.', name);\n  };\n  warnValidStyle = function (name, value) {\n    if (name.indexOf('-') > -1) {\n      warnHyphenatedStyleName(name);\n    } else if (badVendoredStyleNamePattern.test(name)) {\n      warnBadVendoredStyleName(name);\n    } else if (badStyleValueWithSemicolonPattern.test(value)) {\n      warnStyleValueWithSemicolon(name, value);\n    }\n    if (typeof value === 'number') {\n      if (isNaN(value)) {\n        warnStyleValueIsNaN(name, value);\n      } else if (!isFinite(value)) {\n        warnStyleValueIsInfinity(name, value);\n      }\n    }\n  };\n}\nvar warnValidStyle$1 = warnValidStyle;\n/**\n * Operations for dealing with CSS properties.\n */\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\nfunction createDangerousStringForStyles(styles) {\n  {\n    var serialized = '';\n    var delimiter = '';\n    for (var styleName in styles) {\n      if (!styles.hasOwnProperty(styleName)) {\n        continue;\n      }\n      var styleValue = styles[styleName];\n      if (styleValue != null) {\n        var isCustomProperty = styleName.indexOf('--') === 0;\n        serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n        delimiter = ';';\n      }\n    }\n    return serialized || null;\n  }\n}\n/**\n * Sets the value for multiple styles on a node.  If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\nfunction setValueForStyles(node, styles) {\n  var style = node.style;\n  for (var styleName in styles) {\n    if (!styles.hasOwnProperty(styleName)) {\n      continue;\n    }\n    var isCustomProperty = styleName.indexOf('--') === 0;\n    {\n      if (!isCustomProperty) {\n        warnValidStyle$1(styleName, styles[styleName]);\n      }\n    }\n    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n    if (styleName === 'float') {\n      styleName = 'cssFloat';\n    }\n    if (isCustomProperty) {\n      style.setProperty(styleName, styleValue);\n    } else {\n      style[styleName] = styleValue;\n    }\n  }\n}\nfunction isValueEmpty(value) {\n  return value == null || typeof value === 'boolean' || value === '';\n}\n/**\n * Given {color: 'red', overflow: 'hidden'} returns {\n *   color: 'color',\n *   overflowX: 'overflow',\n *   overflowY: 'overflow',\n * }. This can be read as \\\\\"the overflowY property was set by the overflow\n * shorthand\\\\\". That is, the values are the property that each was derived from.\n */\nfunction expandShorthandMap(styles) {\n  var expanded = {};\n  for (var key in styles) {\n    var longhands = shorthandToLonghand[key] || [key];\n    for (var i = 0; i < longhands.length; i++) {\n      expanded[longhands[i]] = key;\n    }\n  }\n  return expanded;\n}\n/**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n *   {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}\n *   becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n *   {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}\n *   becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n *   {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}\n *   becomes .style.fontVariant = ''\n */\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n  {\n    if (!nextStyles) {\n      return;\n    }\n    var expandedUpdates = expandShorthandMap(styleUpdates);\n    var expandedStyles = expandShorthandMap(nextStyles);\n    var warnedAbout = {};\n    for (var key in expandedUpdates) {\n      var originalKey = expandedUpdates[key];\n      var correctOriginalKey = expandedStyles[key];\n      if (correctOriginalKey && originalKey !== correctOriginalKey) {\n        var warningKey = originalKey + ',' + correctOriginalKey;\n        if (warnedAbout[warningKey]) {\n          continue;\n        }\n        warnedAbout[warningKey] = true;\n        error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \\\\\"avoid this, don't mix shorthand and non-shorthand properties \\\\\" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n      }\n    }\n  }\n}\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\nvar omittedCloseTags = {\n  area: true,\n  base: true,\n  br: true,\n  col: true,\n  embed: true,\n  hr: true,\n  img: true,\n  input: true,\n  keygen: true,\n  link: true,\n  meta: true,\n  param: true,\n  source: true,\n  track: true,\n  wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n};\n// \\`omittedCloseTags\\` except that \\`menuitem\\` should still have its closing tag.\nvar voidElementTags = _assign({\n  menuitem: true\n}, omittedCloseTags);\nvar HTML = '__html';\nvar ReactDebugCurrentFrame$3 = null;\n{\n  ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;\n}\nfunction assertValidProps(tag, props) {\n  if (!props) {\n    return;\n  } // Note the use of \\`==\\` which checks for null or undefined.\n  if (voidElementTags[tag]) {\n    if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n      {\n        throw Error( tag + \\\\\" is a void element tag and must neither have \\`children\\` nor use \\`dangerouslySetInnerHTML\\`.\\\\\" + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );\n      }\n    }\n  }\n  if (props.dangerouslySetInnerHTML != null) {\n    if (!(props.children == null)) {\n      {\n        throw Error( \\\\\"Can only set one of \\`children\\` or \\`props.dangerouslySetInnerHTML\\`.\\\\\" );\n      }\n    }\n    if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {\n      {\n        throw Error( \\\\\"\\`props.dangerouslySetInnerHTML\\` must be in the form \\`{__html: ...}\\`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.\\\\\" );\n      }\n    }\n  }\n  {\n    if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n      error('A component is \\`contentEditable\\` and contains \\`children\\` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');\n    }\n  }\n  if (!(props.style == null || typeof props.style === 'object')) {\n    {\n      throw Error( \\\\\"The \\`style\\` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\\\\\" + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );\n    }\n  }\n}\nfunction isCustomComponent(tagName, props) {\n  if (tagName.indexOf('-') === -1) {\n    return typeof props.is === 'string';\n  }\n  switch (tagName) {\n    // These are reserved SVG and MathML elements.\n    // We don't mind this whitelist too much because we expect it to never grow.\n    // The alternative is to track the namespace in a few places which is convoluted.\n    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n    case 'annotation-xml':\n    case 'color-profile':\n    case 'font-face':\n    case 'font-face-src':\n    case 'font-face-uri':\n    case 'font-face-format':\n    case 'font-face-name':\n    case 'missing-glyph':\n      return false;\n    default:\n      return true;\n  }\n}\n// When adding attributes to the HTML or SVG whitelist, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar possibleStandardNames = {\n  // HTML\n  accept: 'accept',\n  acceptcharset: 'acceptCharset',\n  'accept-charset': 'acceptCharset',\n  accesskey: 'accessKey',\n  action: 'action',\n  allowfullscreen: 'allowFullScreen',\n  alt: 'alt',\n  as: 'as',\n  async: 'async',\n  autocapitalize: 'autoCapitalize',\n  autocomplete: 'autoComplete',\n  autocorrect: 'autoCorrect',\n  autofocus: 'autoFocus',\n  autoplay: 'autoPlay',\n  autosave: 'autoSave',\n  capture: 'capture',\n  cellpadding: 'cellPadding',\n  cellspacing: 'cellSpacing',\n  challenge: 'challenge',\n  charset: 'charSet',\n  checked: 'checked',\n  children: 'children',\n  cite: 'cite',\n  class: 'className',\n  classid: 'classID',\n  classname: 'className',\n  cols: 'cols',\n  colspan: 'colSpan',\n  content: 'content',\n  contenteditable: 'contentEditable',\n  contextmenu: 'contextMenu',\n  controls: 'controls',\n  controlslist: 'controlsList',\n  coords: 'coords',\n  crossorigin: 'crossOrigin',\n  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n  data: 'data',\n  datetime: 'dateTime',\n  default: 'default',\n  defaultchecked: 'defaultChecked',\n  defaultvalue: 'defaultValue',\n  defer: 'defer',\n  dir: 'dir',\n  disabled: 'disabled',\n  disablepictureinpicture: 'disablePictureInPicture',\n  download: 'download',\n  draggable: 'draggable',\n  enctype: 'encType',\n  for: 'htmlFor',\n  form: 'form',\n  formmethod: 'formMethod',\n  formaction: 'formAction',\n  formenctype: 'formEncType',\n  formnovalidate: 'formNoValidate',\n  formtarget: 'formTarget',\n  frameborder: 'frameBorder',\n  headers: 'headers',\n  height: 'height',\n  hidden: 'hidden',\n  high: 'high',\n  href: 'href',\n  hreflang: 'hrefLang',\n  htmlfor: 'htmlFor',\n  httpequiv: 'httpEquiv',\n  'http-equiv': 'httpEquiv',\n  icon: 'icon',\n  id: 'id',\n  innerhtml: 'innerHTML',\n  inputmode: 'inputMode',\n  integrity: 'integrity',\n  is: 'is',\n  itemid: 'itemID',\n  itemprop: 'itemProp',\n  itemref: 'itemRef',\n  itemscope: 'itemScope',\n  itemtype: 'itemType',\n  keyparams: 'keyParams',\n  keytype: 'keyType',\n  kind: 'kind',\n  label: 'label',\n  lang: 'lang',\n  list: 'list',\n  loop: 'loop',\n  low: 'low',\n  manifest: 'manifest',\n  marginwidth: 'marginWidth',\n  marginheight: 'marginHeight',\n  max: 'max',\n  maxlength: 'maxLength',\n  media: 'media',\n  mediagroup: 'mediaGroup',\n  method: 'method',\n  min: 'min',\n  minlength: 'minLength',\n  multiple: 'multiple',\n  muted: 'muted',\n  name: 'name',\n  nomodule: 'noModule',\n  nonce: 'nonce',\n  novalidate: 'noValidate',\n  open: 'open',\n  optimum: 'optimum',\n  pattern: 'pattern',\n  placeholder: 'placeholder',\n  playsinline: 'playsInline',\n  poster: 'poster',\n  preload: 'preload',\n  profile: 'profile',\n  radiogroup: 'radioGroup',\n  readonly: 'readOnly',\n  referrerpolicy: 'referrerPolicy',\n  rel: 'rel',\n  required: 'required',\n  reversed: 'reversed',\n  role: 'role',\n  rows: 'rows',\n  rowspan: 'rowSpan',\n  sandbox: 'sandbox',\n  scope: 'scope',\n  scoped: 'scoped',\n  scrolling: 'scrolling',\n  seamless: 'seamless',\n  selected: 'selected',\n  shape: 'shape',\n  size: 'size',\n  sizes: 'sizes',\n  span: 'span',\n  spellcheck: 'spellCheck',\n  src: 'src',\n  srcdoc: 'srcDoc',\n  srclang: 'srcLang',\n  srcset: 'srcSet',\n  start: 'start',\n  step: 'step',\n  style: 'style',\n  summary: 'summary',\n  tabindex: 'tabIndex',\n  target: 'target',\n  title: 'title',\n  type: 'type',\n  usemap: 'useMap',\n  value: 'value',\n  width: 'width',\n  wmode: 'wmode',\n  wrap: 'wrap',\n  // SVG\n  about: 'about',\n  accentheight: 'accentHeight',\n  'accent-height': 'accentHeight',\n  accumulate: 'accumulate',\n  additive: 'additive',\n  alignmentbaseline: 'alignmentBaseline',\n  'alignment-baseline': 'alignmentBaseline',\n  allowreorder: 'allowReorder',\n  alphabetic: 'alphabetic',\n  amplitude: 'amplitude',\n  arabicform: 'arabicForm',\n  'arabic-form': 'arabicForm',\n  ascent: 'ascent',\n  attributename: 'attributeName',\n  attributetype: 'attributeType',\n  autoreverse: 'autoReverse',\n  azimuth: 'azimuth',\n  basefrequency: 'baseFrequency',\n  baselineshift: 'baselineShift',\n  'baseline-shift': 'baselineShift',\n  baseprofile: 'baseProfile',\n  bbox: 'bbox',\n  begin: 'begin',\n  bias: 'bias',\n  by: 'by',\n  calcmode: 'calcMode',\n  capheight: 'capHeight',\n  'cap-height': 'capHeight',\n  clip: 'clip',\n  clippath: 'clipPath',\n  'clip-path': 'clipPath',\n  clippathunits: 'clipPathUnits',\n  cliprule: 'clipRule',\n  'clip-rule': 'clipRule',\n  color: 'color',\n  colorinterpolation: 'colorInterpolation',\n  'color-interpolation': 'colorInterpolation',\n  colorinterpolationfilters: 'colorInterpolationFilters',\n  'color-interpolation-filters': 'colorInterpolationFilters',\n  colorprofile: 'colorProfile',\n  'color-profile': 'colorProfile',\n  colorrendering: 'colorRendering',\n  'color-rendering': 'colorRendering',\n  contentscripttype: 'contentScriptType',\n  contentstyletype: 'contentStyleType',\n  cursor: 'cursor',\n  cx: 'cx',\n  cy: 'cy',\n  d: 'd',\n  datatype: 'datatype',\n  decelerate: 'decelerate',\n  descent: 'descent',\n  diffuseconstant: 'diffuseConstant',\n  direction: 'direction',\n  display: 'display',\n  divisor: 'divisor',\n  dominantbaseline: 'dominantBaseline',\n  'dominant-baseline': 'dominantBaseline',\n  dur: 'dur',\n  dx: 'dx',\n  dy: 'dy',\n  edgemode: 'edgeMode',\n  elevation: 'elevation',\n  enablebackground: 'enableBackground',\n  'enable-background': 'enableBackground',\n  end: 'end',\n  exponent: 'exponent',\n  externalresourcesrequired: 'externalResourcesRequired',\n  fill: 'fill',\n  fillopacity: 'fillOpacity',\n  'fill-opacity': 'fillOpacity',\n  fillrule: 'fillRule',\n  'fill-rule': 'fillRule',\n  filter: 'filter',\n  filterres: 'filterRes',\n  filterunits: 'filterUnits',\n  floodopacity: 'floodOpacity',\n  'flood-opacity': 'floodOpacity',\n  floodcolor: 'floodColor',\n  'flood-color': 'floodColor',\n  focusable: 'focusable',\n  fontfamily: 'fontFamily',\n  'font-family': 'fontFamily',\n  fontsize: 'fontSize',\n  'font-size': 'fontSize',\n  fontsizeadjust: 'fontSizeAdjust',\n  'font-size-adjust': 'fontSizeAdjust',\n  fontstretch: 'fontStretch',\n  'font-stretch': 'fontStretch',\n  fontstyle: 'fontStyle',\n  'font-style': 'fontStyle',\n  fontvariant: 'fontVariant',\n  'font-variant': 'fontVariant',\n  fontweight: 'fontWeight',\n  'font-weight': 'fontWeight',\n  format: 'format',\n  from: 'from',\n  fx: 'fx',\n  fy: 'fy',\n  g1: 'g1',\n  g2: 'g2',\n  glyphname: 'glyphName',\n  'glyph-name': 'glyphName',\n  glyphorientationhorizontal: 'glyphOrientationHorizontal',\n  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n  glyphorientationvertical: 'glyphOrientationVertical',\n  'glyph-orientation-vertical': 'glyphOrientationVertical',\n  glyphref: 'glyphRef',\n  gradienttransform: 'gradientTransform',\n  gradientunits: 'gradientUnits',\n  hanging: 'hanging',\n  horizadvx: 'horizAdvX',\n  'horiz-adv-x': 'horizAdvX',\n  horizoriginx: 'horizOriginX',\n  'horiz-origin-x': 'horizOriginX',\n  ideographic: 'ideographic',\n  imagerendering: 'imageRendering',\n  'image-rendering': 'imageRendering',\n  in2: 'in2',\n  in: 'in',\n  inlist: 'inlist',\n  intercept: 'intercept',\n  k1: 'k1',\n  k2: 'k2',\n  k3: 'k3',\n  k4: 'k4',\n  k: 'k',\n  kernelmatrix: 'kernelMatrix',\n  kernelunitlength: 'kernelUnitLength',\n  kerning: 'kerning',\n  keypoints: 'keyPoints',\n  keysplines: 'keySplines',\n  keytimes: 'keyTimes',\n  lengthadjust: 'lengthAdjust',\n  letterspacing: 'letterSpacing',\n  'letter-spacing': 'letterSpacing',\n  lightingcolor: 'lightingColor',\n  'lighting-color': 'lightingColor',\n  limitingconeangle: 'limitingConeAngle',\n  local: 'local',\n  markerend: 'markerEnd',\n  'marker-end': 'markerEnd',\n  markerheight: 'markerHeight',\n  markermid: 'markerMid',\n  'marker-mid': 'markerMid',\n  markerstart: 'markerStart',\n  'marker-start': 'markerStart',\n  markerunits: 'markerUnits',\n  markerwidth: 'markerWidth',\n  mask: 'mask',\n  maskcontentunits: 'maskContentUnits',\n  maskunits: 'maskUnits',\n  mathematical: 'mathematical',\n  mode: 'mode',\n  numoctaves: 'numOctaves',\n  offset: 'offset',\n  opacity: 'opacity',\n  operator: 'operator',\n  order: 'order',\n  orient: 'orient',\n  orientation: 'orientation',\n  origin: 'origin',\n  overflow: 'overflow',\n  overlineposition: 'overlinePosition',\n  'overline-position': 'overlinePosition',\n  overlinethickness: 'overlineThickness',\n  'overline-thickness': 'overlineThickness',\n  paintorder: 'paintOrder',\n  'paint-order': 'paintOrder',\n  panose1: 'panose1',\n  'panose-1': 'panose1',\n  pathlength: 'pathLength',\n  patterncontentunits: 'patternContentUnits',\n  patterntransform: 'patternTransform',\n  patternunits: 'patternUnits',\n  pointerevents: 'pointerEvents',\n  'pointer-events': 'pointerEvents',\n  points: 'points',\n  pointsatx: 'pointsAtX',\n  pointsaty: 'pointsAtY',\n  pointsatz: 'pointsAtZ',\n  prefix: 'prefix',\n  preservealpha: 'preserveAlpha',\n  preserveaspectratio: 'preserveAspectRatio',\n  primitiveunits: 'primitiveUnits',\n  property: 'property',\n  r: 'r',\n  radius: 'radius',\n  refx: 'refX',\n  refy: 'refY',\n  renderingintent: 'renderingIntent',\n  'rendering-intent': 'renderingIntent',\n  repeatcount: 'repeatCount',\n  repeatdur: 'repeatDur',\n  requiredextensions: 'requiredExtensions',\n  requiredfeatures: 'requiredFeatures',\n  resource: 'resource',\n  restart: 'restart',\n  result: 'result',\n  results: 'results',\n  rotate: 'rotate',\n  rx: 'rx',\n  ry: 'ry',\n  scale: 'scale',\n  security: 'security',\n  seed: 'seed',\n  shaperendering: 'shapeRendering',\n  'shape-rendering': 'shapeRendering',\n  slope: 'slope',\n  spacing: 'spacing',\n  specularconstant: 'specularConstant',\n  specularexponent: 'specularExponent',\n  speed: 'speed',\n  spreadmethod: 'spreadMethod',\n  startoffset: 'startOffset',\n  stddeviation: 'stdDeviation',\n  stemh: 'stemh',\n  stemv: 'stemv',\n  stitchtiles: 'stitchTiles',\n  stopcolor: 'stopColor',\n  'stop-color': 'stopColor',\n  stopopacity: 'stopOpacity',\n  'stop-opacity': 'stopOpacity',\n  strikethroughposition: 'strikethroughPosition',\n  'strikethrough-position': 'strikethroughPosition',\n  strikethroughthickness: 'strikethroughThickness',\n  'strikethrough-thickness': 'strikethroughThickness',\n  string: 'string',\n  stroke: 'stroke',\n  strokedasharray: 'strokeDasharray',\n  'stroke-dasharray': 'strokeDasharray',\n  strokedashoffset: 'strokeDashoffset',\n  'stroke-dashoffset': 'strokeDashoffset',\n  strokelinecap: 'strokeLinecap',\n  'stroke-linecap': 'strokeLinecap',\n  strokelinejoin: 'strokeLinejoin',\n  'stroke-linejoin': 'strokeLinejoin',\n  strokemiterlimit: 'strokeMiterlimit',\n  'stroke-miterlimit': 'strokeMiterlimit',\n  strokewidth: 'strokeWidth',\n  'stroke-width': 'strokeWidth',\n  strokeopacity: 'strokeOpacity',\n  'stroke-opacity': 'strokeOpacity',\n  suppresscontenteditablewarning: 'suppressContentEditableWarning',\n  suppresshydrationwarning: 'suppressHydrationWarning',\n  surfacescale: 'surfaceScale',\n  systemlanguage: 'systemLanguage',\n  tablevalues: 'tableValues',\n  targetx: 'targetX',\n  targety: 'targetY',\n  textanchor: 'textAnchor',\n  'text-anchor': 'textAnchor',\n  textdecoration: 'textDecoration',\n  'text-decoration': 'textDecoration',\n  textlength: 'textLength',\n  textrendering: 'textRendering',\n  'text-rendering': 'textRendering',\n  to: 'to',\n  transform: 'transform',\n  typeof: 'typeof',\n  u1: 'u1',\n  u2: 'u2',\n  underlineposition: 'underlinePosition',\n  'underline-position': 'underlinePosition',\n  underlinethickness: 'underlineThickness',\n  'underline-thickness': 'underlineThickness',\n  unicode: 'unicode',\n  unicodebidi: 'unicodeBidi',\n  'unicode-bidi': 'unicodeBidi',\n  unicoderange: 'unicodeRange',\n  'unicode-range': 'unicodeRange',\n  unitsperem: 'unitsPerEm',\n  'units-per-em': 'unitsPerEm',\n  unselectable: 'unselectable',\n  valphabetic: 'vAlphabetic',\n  'v-alphabetic': 'vAlphabetic',\n  values: 'values',\n  vectoreffect: 'vectorEffect',\n  'vector-effect': 'vectorEffect',\n  version: 'version',\n  vertadvy: 'vertAdvY',\n  'vert-adv-y': 'vertAdvY',\n  vertoriginx: 'vertOriginX',\n  'vert-origin-x': 'vertOriginX',\n  vertoriginy: 'vertOriginY',\n  'vert-origin-y': 'vertOriginY',\n  vhanging: 'vHanging',\n  'v-hanging': 'vHanging',\n  videographic: 'vIdeographic',\n  'v-ideographic': 'vIdeographic',\n  viewbox: 'viewBox',\n  viewtarget: 'viewTarget',\n  visibility: 'visibility',\n  vmathematical: 'vMathematical',\n  'v-mathematical': 'vMathematical',\n  vocab: 'vocab',\n  widths: 'widths',\n  wordspacing: 'wordSpacing',\n  'word-spacing': 'wordSpacing',\n  writingmode: 'writingMode',\n  'writing-mode': 'writingMode',\n  x1: 'x1',\n  x2: 'x2',\n  x: 'x',\n  xchannelselector: 'xChannelSelector',\n  xheight: 'xHeight',\n  'x-height': 'xHeight',\n  xlinkactuate: 'xlinkActuate',\n  'xlink:actuate': 'xlinkActuate',\n  xlinkarcrole: 'xlinkArcrole',\n  'xlink:arcrole': 'xlinkArcrole',\n  xlinkhref: 'xlinkHref',\n  'xlink:href': 'xlinkHref',\n  xlinkrole: 'xlinkRole',\n  'xlink:role': 'xlinkRole',\n  xlinkshow: 'xlinkShow',\n  'xlink:show': 'xlinkShow',\n  xlinktitle: 'xlinkTitle',\n  'xlink:title': 'xlinkTitle',\n  xlinktype: 'xlinkType',\n  'xlink:type': 'xlinkType',\n  xmlbase: 'xmlBase',\n  'xml:base': 'xmlBase',\n  xmllang: 'xmlLang',\n  'xml:lang': 'xmlLang',\n  xmlns: 'xmlns',\n  'xml:space': 'xmlSpace',\n  xmlnsxlink: 'xmlnsXlink',\n  'xmlns:xlink': 'xmlnsXlink',\n  xmlspace: 'xmlSpace',\n  y1: 'y1',\n  y2: 'y2',\n  y: 'y',\n  ychannelselector: 'yChannelSelector',\n  z: 'z',\n  zoomandpan: 'zoomAndPan'\n};\nvar ariaProperties = {\n  'aria-current': 0,\n  // state\n  'aria-details': 0,\n  'aria-disabled': 0,\n  // state\n  'aria-hidden': 0,\n  // state\n  'aria-invalid': 0,\n  // state\n  'aria-keyshortcuts': 0,\n  'aria-label': 0,\n  'aria-roledescription': 0,\n  // Widget Attributes\n  'aria-autocomplete': 0,\n  'aria-checked': 0,\n  'aria-expanded': 0,\n  'aria-haspopup': 0,\n  'aria-level': 0,\n  'aria-modal': 0,\n  'aria-multiline': 0,\n  'aria-multiselectable': 0,\n  'aria-orientation': 0,\n  'aria-placeholder': 0,\n  'aria-pressed': 0,\n  'aria-readonly': 0,\n  'aria-required': 0,\n  'aria-selected': 0,\n  'aria-sort': 0,\n  'aria-valuemax': 0,\n  'aria-valuemin': 0,\n  'aria-valuenow': 0,\n  'aria-valuetext': 0,\n  // Live Region Attributes\n  'aria-atomic': 0,\n  'aria-busy': 0,\n  'aria-live': 0,\n  'aria-relevant': 0,\n  // Drag-and-Drop Attributes\n  'aria-dropeffect': 0,\n  'aria-grabbed': 0,\n  // Relationship Attributes\n  'aria-activedescendant': 0,\n  'aria-colcount': 0,\n  'aria-colindex': 0,\n  'aria-colspan': 0,\n  'aria-controls': 0,\n  'aria-describedby': 0,\n  'aria-errormessage': 0,\n  'aria-flowto': 0,\n  'aria-labelledby': 0,\n  'aria-owns': 0,\n  'aria-posinset': 0,\n  'aria-rowcount': 0,\n  'aria-rowindex': 0,\n  'aria-rowspan': 0,\n  'aria-setsize': 0\n};\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\nfunction validateProperty(tagName, name) {\n  {\n    if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {\n      return true;\n    }\n    if (rARIACamel.test(name)) {\n      var ariaName = 'aria-' + name.slice(4).toLowerCase();\n      var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n      // DOM properties, then it is an invalid aria-* attribute.\n      if (correctName == null) {\n        error('Invalid ARIA attribute \\`%s\\`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n        warnedProperties[name] = true;\n        return true;\n      } // aria-* attributes should be lowercase; suggest the lowercase version.\n      if (name !== correctName) {\n        error('Invalid ARIA attribute \\`%s\\`. Did you mean \\`%s\\`?', name, correctName);\n        warnedProperties[name] = true;\n        return true;\n      }\n    }\n    if (rARIA.test(name)) {\n      var lowerCasedName = name.toLowerCase();\n      var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n      // DOM properties, then it is an invalid aria-* attribute.\n      if (standardName == null) {\n        warnedProperties[name] = true;\n        return false;\n      } // aria-* attributes should be lowercase; suggest the lowercase version.\n      if (name !== standardName) {\n        error('Unknown ARIA attribute \\`%s\\`. Did you mean \\`%s\\`?', name, standardName);\n        warnedProperties[name] = true;\n        return true;\n      }\n    }\n  }\n  return true;\n}\nfunction warnInvalidARIAProps(type, props) {\n  {\n    var invalidProps = [];\n    for (var key in props) {\n      var isValid = validateProperty(type, key);\n      if (!isValid) {\n        invalidProps.push(key);\n      }\n    }\n    var unknownPropString = invalidProps.map(function (prop) {\n      return '\\`' + prop + '\\`';\n    }).join(', ');\n    if (invalidProps.length === 1) {\n      error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);\n    } else if (invalidProps.length > 1) {\n      error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);\n    }\n  }\n}\nfunction validateProperties(type, props) {\n  if (isCustomComponent(type, props)) {\n    return;\n  }\n  warnInvalidARIAProps(type, props);\n}\nvar didWarnValueNull = false;\nfunction validateProperties$1(type, props) {\n  {\n    if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n      return;\n    }\n    if (props != null && props.value === null && !didWarnValueNull) {\n      didWarnValueNull = true;\n      if (type === 'select' && props.multiple) {\n        error('\\`value\\` prop on \\`%s\\` should not be null. ' + 'Consider using an empty array when \\`multiple\\` is set to \\`true\\` ' + 'to clear the component or \\`undefined\\` for uncontrolled components.', type);\n      } else {\n        error('\\`value\\` prop on \\`%s\\` should not be null. ' + 'Consider using an empty string to clear the component or \\`undefined\\` ' + 'for uncontrolled components.', type);\n      }\n    }\n  }\n}\nvar validateProperty$1 = function () {};\n{\n  var warnedProperties$1 = {};\n  var _hasOwnProperty = Object.prototype.hasOwnProperty;\n  var EVENT_NAME_REGEX = /^on./;\n  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n  validateProperty$1 = function (tagName, name, value, canUseEventSystem) {\n    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n      return true;\n    }\n    var lowerCasedName = name.toLowerCase();\n    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n      error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n      warnedProperties$1[name] = true;\n      return true;\n    } // We can't rely on the event system being injected on the server.\n    if (canUseEventSystem) {\n      if (registrationNameModules.hasOwnProperty(name)) {\n        return true;\n      }\n      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n      if (registrationName != null) {\n        error('Invalid event handler property \\`%s\\`. Did you mean \\`%s\\`?', name, registrationName);\n        warnedProperties$1[name] = true;\n        return true;\n      }\n      if (EVENT_NAME_REGEX.test(name)) {\n        error('Unknown event handler property \\`%s\\`. It will be ignored.', name);\n        warnedProperties$1[name] = true;\n        return true;\n      }\n    } else if (EVENT_NAME_REGEX.test(name)) {\n      // If no event plugins have been injected, we are in a server environment.\n      // So we can't tell if the event name is correct for sure, but we can filter\n      // out known bad ones like \\`onclick\\`. We can't suggest a specific replacement though.\n      if (INVALID_EVENT_NAME_REGEX.test(name)) {\n        error('Invalid event handler property \\`%s\\`. ' + 'React events use the camelCase naming convention, for example \\`onClick\\`.', name);\n      }\n      warnedProperties$1[name] = true;\n      return true;\n    } // Let the ARIA attribute hook validate ARIA attributes\n    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n      return true;\n    }\n    if (lowerCasedName === 'innerhtml') {\n      error('Directly setting property \\`innerHTML\\` is not permitted. ' + 'For more information, lookup documentation on \\`dangerouslySetInnerHTML\\`.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (lowerCasedName === 'aria') {\n      error('The \\`aria\\` attribute is reserved for future use in React. ' + 'Pass individual \\`aria-\\` attributes instead.');\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n      error('Received a \\`%s\\` for a string attribute \\`is\\`. If this is expected, cast ' + 'the value to a string.', typeof value);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (typeof value === 'number' && isNaN(value)) {\n      error('Received NaN for the \\`%s\\` attribute. If this is expected, cast ' + 'the value to a string.', name);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    var propertyInfo = getPropertyInfo(name);\n    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n      var standardName = possibleStandardNames[lowerCasedName];\n      if (standardName !== name) {\n        error('Invalid DOM property \\`%s\\`. Did you mean \\`%s\\`?', name, standardName);\n        warnedProperties$1[name] = true;\n        return true;\n      }\n    } else if (!isReserved && name !== lowerCasedName) {\n      // Unknown attributes should have lowercase casing since that's how they\n      // will be cased anyway with server rendering.\n      error('React does not recognize the \\`%s\\` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase \\`%s\\` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n      if (value) {\n        error('Received \\`%s\\` for a non-boolean attribute \\`%s\\`.' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\\\\\"%s\\\\\" or %s={value.toString()}.', value, name, name, value, name);\n      } else {\n        error('Received \\`%s\\` for a non-boolean attribute \\`%s\\`.' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\\\\\"%s\\\\\" or %s={value.toString()}.' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n      }\n      warnedProperties$1[name] = true;\n      return true;\n    } // Now that we've validated casing, do not validate\n    // data types for reserved props\n    if (isReserved) {\n      return true;\n    } // Warn when a known attribute is a bad type\n    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n      warnedProperties$1[name] = true;\n      return false;\n    } // Warn when passing the strings 'false' or 'true' into a boolean prop\n    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n      error('Received the string \\`%s\\` for the boolean attribute \\`%s\\`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \\\\\"false\\\\\".', name, value);\n      warnedProperties$1[name] = true;\n      return true;\n    }\n    return true;\n  };\n}\nvar warnUnknownProperties = function (type, props, canUseEventSystem) {\n  {\n    var unknownProps = [];\n    for (var key in props) {\n      var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);\n      if (!isValid) {\n        unknownProps.push(key);\n      }\n    }\n    var unknownPropString = unknownProps.map(function (prop) {\n      return '\\`' + prop + '\\`';\n    }).join(', ');\n    if (unknownProps.length === 1) {\n      error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);\n    } else if (unknownProps.length > 1) {\n      error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);\n    }\n  }\n};\nfunction validateProperties$2(type, props, canUseEventSystem) {\n  if (isCustomComponent(type, props)) {\n    return;\n  }\n  warnUnknownProperties(type, props, canUseEventSystem);\n}\nvar didWarnInvalidHydration = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML$1 = '__html';\nvar HTML_NAMESPACE$1 = Namespaces.html;\nvar warnedUnknownTags;\nvar suppressHydrationWarning;\nvar validatePropertiesInDevelopment;\nvar warnForTextDifference;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeMarkupForTextOrAttribute;\nvar normalizeHTML;\n{\n  warnedUnknownTags = {\n    // Chrome is the only major browser not shipping <time>. But as of July\n    // 2017 it intends to ship it due to widespread usage. We intentionally\n    // *don't* warn for <time> even if it's unrecognized by Chrome because\n    // it soon will be, and many apps have been using it anyway.\n    time: true,\n    // There are working polyfills for <dialog>. Let people use it.\n    dialog: true,\n    // Electron ships a custom <webview> tag to display external web content in\n    // an isolated frame and process.\n    // This tag is not present in non Electron environments such as JSDom which\n    // is often used for testing purposes.\n    // @see https://electronjs.org/docs/api/webview-tag\n    webview: true\n  };\n  validatePropertiesInDevelopment = function (type, props) {\n    validateProperties(type, props);\n    validateProperties$1(type, props);\n    validateProperties$2(type, props,\n    /* canUseEventSystem */\n    true);\n  }; // IE 11 parses & normalizes the style attribute as opposed to other\n  // browsers. It adds spaces and sorts the properties in some\n  // non-alphabetical order. Handling that would require sorting CSS\n  // properties in the client & server versions or applying\n  // \\`expectedStyle\\` to a temporary DOM node to read its \\`style\\` attribute\n  // normalized. Since it only affects IE, we're skipping style warnings\n  // in that browser completely in favor of doing all that work.\n  // See https://github.com/facebook/react/issues/11807\n  canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.\n  // It also can turn \\\\\\\\u0000 into \\\\\\\\uFFFD inside attributes.\n  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n  // If we have a mismatch, it might be caused by that.\n  // We will still patch up in this case but not fire the warning.\n  var NORMALIZE_NEWLINES_REGEX = /?/g;\n  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\\\\\\\u0000|\\\\\\\\uFFFD/g;\n  normalizeMarkupForTextOrAttribute = function (markup) {\n    var markupString = typeof markup === 'string' ? markup : '' + markup;\n    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n  };\n  warnForTextDifference = function (serverText, clientText) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n    if (normalizedServerText === normalizedClientText) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Text content did not match. Server: \\\\\"%s\\\\\" Client: \\\\\"%s\\\\\"', normalizedServerText, normalizedClientText);\n  };\n  warnForPropDifference = function (propName, serverValue, clientValue) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n    if (normalizedServerValue === normalizedClientValue) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Prop \\`%s\\` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n  };\n  warnForExtraAttributes = function (attributeNames) {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    var names = [];\n    attributeNames.forEach(function (name) {\n      names.push(name);\n    });\n    error('Extra attributes from the server: %s', names);\n  };\n  warnForInvalidEventListener = function (registrationName, listener) {\n    if (listener === false) {\n      error('Expected \\`%s\\` listener to be a function, instead got \\`false\\`.' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n    } else {\n      error('Expected \\`%s\\` listener to be a function, instead got a value of \\`%s\\` type.', registrationName, typeof listener);\n    }\n  }; // Parse the HTML and read it back to normalize the HTML string so that it\n  // can be used for comparison.\n  normalizeHTML = function (parent, html) {\n    // We could have created a separate document here to avoid\n    // re-initializing custom elements if they exist. But this breaks\n    // how <noscript> is being handled. So we use the same document.\n    // See the discussion in https://github.com/facebook/react/pull/11157.\n    var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n    testElement.innerHTML = html;\n    return testElement.innerHTML;\n  };\n}\nfunction ensureListeningTo(rootContainerElement, registrationName) {\n  var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;\n  var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;\n  legacyListenToEvent(registrationName, doc);\n}\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\nfunction noop() {}\nfunction trapClickOnNonInteractiveElement(node) {\n  // Mobile Safari does not fire properly bubble click events on\n  // non-interactive elements, which means delegated click listeners do not\n  // fire. The workaround for this bug involves attaching an empty click\n  // listener on the target node.\n  // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n  // Just set it using the onclick property so that we don't have to manage any\n  // bookkeeping for it. Not sure if we need to clear it when the listener is\n  // removed.\n  // TODO: Only do this for the relevant Safaris maybe?\n  node.onclick = noop;\n}\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n  for (var propKey in nextProps) {\n    if (!nextProps.hasOwnProperty(propKey)) {\n      continue;\n    }\n    var nextProp = nextProps[propKey];\n    if (propKey === STYLE) {\n      {\n        if (nextProp) {\n          // Freeze the next style object so that we can assume it won't be\n          // mutated. We have already warned for this in the past.\n          Object.freeze(nextProp);\n        }\n      } // Relies on \\`updateStylesByID\\` not mutating \\`styleUpdates\\`.\n      setValueForStyles(domElement, nextProp);\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n      if (nextHtml != null) {\n        setInnerHTML(domElement, nextHtml);\n      }\n    } else if (propKey === CHILDREN) {\n      if (typeof nextProp === 'string') {\n        // Avoid setting initial textContent when the text is empty. In IE11 setting\n        // textContent on a <textarea> will cause the placeholder to not\n        // show within the <textarea> until it has been focused and blurred again.\n        // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n        var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n        if (canSetTextContent) {\n          setTextContent(domElement, nextProp);\n        }\n      } else if (typeof nextProp === 'number') {\n        setTextContent(domElement, '' + nextProp);\n      }\n    } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        if ( typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        ensureListeningTo(rootContainerElement, propKey);\n      }\n    } else if (nextProp != null) {\n      setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n    }\n  }\n}\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n  // TODO: Handle wasCustomComponentTag\n  for (var i = 0; i < updatePayload.length; i += 2) {\n    var propKey = updatePayload[i];\n    var propValue = updatePayload[i + 1];\n    if (propKey === STYLE) {\n      setValueForStyles(domElement, propValue);\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      setInnerHTML(domElement, propValue);\n    } else if (propKey === CHILDREN) {\n      setTextContent(domElement, propValue);\n    } else {\n      setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n    }\n  }\n}\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n  var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML\n  // tags get no namespace.\n  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n  var domElement;\n  var namespaceURI = parentNamespace;\n  if (namespaceURI === HTML_NAMESPACE$1) {\n    namespaceURI = getIntrinsicNamespace(type);\n  }\n  if (namespaceURI === HTML_NAMESPACE$1) {\n    {\n      isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to\n      // allow <SVG> or <mATH>.\n      if (!isCustomComponentTag && type !== type.toLowerCase()) {\n        error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);\n      }\n    }\n    if (type === 'script') {\n      // Create the script via .innerHTML so its \\\\\"parser-inserted\\\\\" flag is\n      // set to true and it does not execute\n      var div = ownerDocument.createElement('div');\n      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line\n      // This is guaranteed to yield a script element.\n      var firstChild = div.firstChild;\n      domElement = div.removeChild(firstChild);\n    } else if (typeof props.is === 'string') {\n      // $FlowIssue \\`createElement\\` should be updated for Web Components\n      domElement = ownerDocument.createElement(type, {\n        is: props.is\n      });\n    } else {\n      // Separate else branch instead of using \\`props.is || undefined\\` above because of a Firefox bug.\n      // See discussion in https://github.com/facebook/react/pull/6896\n      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240\n      domElement = ownerDocument.createElement(type); // Normally attributes are assigned in \\`setInitialDOMProperties\\`, however the \\`multiple\\` and \\`size\\`\n      // attributes on \\`select\\`s needs to be added before \\`option\\`s are inserted.\n      // This prevents:\n      // - a bug where the \\`select\\` does not scroll to the correct option because singular\n      //  \\`select\\` elements automatically pick the first item #13222\n      // - a bug where the \\`select\\` set the first item as selected despite the \\`size\\` attribute #14239\n      // See https://github.com/facebook/react/issues/13222\n      // and https://github.com/facebook/react/issues/14239\n      if (type === 'select') {\n        var node = domElement;\n        if (props.multiple) {\n          node.multiple = true;\n        } else if (props.size) {\n          // Setting a size greater than 1 causes a select to behave like \\`multiple=true\\`, where\n          // it is possible that no option is selected.\n          //\n          // This is only necessary when a select in \\\\\"single selection mode\\\\\".\n          node.size = props.size;\n        }\n      }\n    }\n  } else {\n    domElement = ownerDocument.createElementNS(namespaceURI, type);\n  }\n  {\n    if (namespaceURI === HTML_NAMESPACE$1) {\n      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {\n        warnedUnknownTags[type] = true;\n        error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n      }\n    }\n  }\n  return domElement;\n}\nfunction createTextNode(text, rootContainerElement) {\n  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\nfunction setInitialProperties(domElement, tag, rawProps, rootContainerElement) {\n  var isCustomComponentTag = isCustomComponent(tag, rawProps);\n  {\n    validatePropertiesInDevelopment(tag, rawProps);\n  } // TODO: Make sure that we check isMounted before firing any of these events.\n  var props;\n  switch (tag) {\n    case 'iframe':\n    case 'object':\n    case 'embed':\n      trapBubbledEvent(TOP_LOAD, domElement);\n      props = rawProps;\n      break;\n    case 'video':\n    case 'audio':\n      // Create listener for each media event\n      for (var i = 0; i < mediaEventTypes.length; i++) {\n        trapBubbledEvent(mediaEventTypes[i], domElement);\n      }\n      props = rawProps;\n      break;\n    case 'source':\n      trapBubbledEvent(TOP_ERROR, domElement);\n      props = rawProps;\n      break;\n    case 'img':\n    case 'image':\n    case 'link':\n      trapBubbledEvent(TOP_ERROR, domElement);\n      trapBubbledEvent(TOP_LOAD, domElement);\n      props = rawProps;\n      break;\n    case 'form':\n      trapBubbledEvent(TOP_RESET, domElement);\n      trapBubbledEvent(TOP_SUBMIT, domElement);\n      props = rawProps;\n      break;\n    case 'details':\n      trapBubbledEvent(TOP_TOGGLE, domElement);\n      props = rawProps;\n      break;\n    case 'input':\n      initWrapperState(domElement, rawProps);\n      props = getHostProps(domElement, rawProps);\n      trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'option':\n      validateProps(domElement, rawProps);\n      props = getHostProps$1(domElement, rawProps);\n      break;\n    case 'select':\n      initWrapperState$1(domElement, rawProps);\n      props = getHostProps$2(domElement, rawProps);\n      trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'textarea':\n      initWrapperState$2(domElement, rawProps);\n      props = getHostProps$3(domElement, rawProps);\n      trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    default:\n      props = rawProps;\n  }\n  assertValidProps(tag, props);\n  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n  switch (tag) {\n    case 'input':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper(domElement, rawProps, false);\n      break;\n    case 'textarea':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper$3(domElement);\n      break;\n    case 'option':\n      postMountWrapper$1(domElement, rawProps);\n      break;\n    case 'select':\n      postMountWrapper$2(domElement, rawProps);\n      break;\n    default:\n      if (typeof props.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n} // Calculate the diff between the two objects.\nfunction diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n  {\n    validatePropertiesInDevelopment(tag, nextRawProps);\n  }\n  var updatePayload = null;\n  var lastProps;\n  var nextProps;\n  switch (tag) {\n    case 'input':\n      lastProps = getHostProps(domElement, lastRawProps);\n      nextProps = getHostProps(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'option':\n      lastProps = getHostProps$1(domElement, lastRawProps);\n      nextProps = getHostProps$1(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'select':\n      lastProps = getHostProps$2(domElement, lastRawProps);\n      nextProps = getHostProps$2(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    case 'textarea':\n      lastProps = getHostProps$3(domElement, lastRawProps);\n      nextProps = getHostProps$3(domElement, nextRawProps);\n      updatePayload = [];\n      break;\n    default:\n      lastProps = lastRawProps;\n      nextProps = nextRawProps;\n      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n  assertValidProps(tag, nextProps);\n  var propKey;\n  var styleName;\n  var styleUpdates = null;\n  for (propKey in lastProps) {\n    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n      continue;\n    }\n    if (propKey === STYLE) {\n      var lastStyle = lastProps[propKey];\n      for (styleName in lastStyle) {\n        if (lastStyle.hasOwnProperty(styleName)) {\n          if (!styleUpdates) {\n            styleUpdates = {};\n          }\n          styleUpdates[styleName] = '';\n        }\n      }\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n      // This is a special case. If any listener updates we need to ensure\n      // that the \\\\\"current\\\\\" fiber pointer gets updated so we need a commit\n      // to update this element.\n      if (!updatePayload) {\n        updatePayload = [];\n      }\n    } else {\n      // For all other deleted properties we add it to the queue. We use\n      // the whitelist in the commit phase instead.\n      (updatePayload = updatePayload || []).push(propKey, null);\n    }\n  }\n  for (propKey in nextProps) {\n    var nextProp = nextProps[propKey];\n    var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n      continue;\n    }\n    if (propKey === STYLE) {\n      {\n        if (nextProp) {\n          // Freeze the next style object so that we can assume it won't be\n          // mutated. We have already warned for this in the past.\n          Object.freeze(nextProp);\n        }\n      }\n      if (lastProp) {\n        // Unset styles on \\`lastProp\\` but not on \\`nextProp\\`.\n        for (styleName in lastProp) {\n          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n            if (!styleUpdates) {\n              styleUpdates = {};\n            }\n            styleUpdates[styleName] = '';\n          }\n        } // Update styles that changed since \\`lastProp\\`.\n        for (styleName in nextProp) {\n          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n            if (!styleUpdates) {\n              styleUpdates = {};\n            }\n            styleUpdates[styleName] = nextProp[styleName];\n          }\n        }\n      } else {\n        // Relies on \\`updateStylesByID\\` not mutating \\`styleUpdates\\`.\n        if (!styleUpdates) {\n          if (!updatePayload) {\n            updatePayload = [];\n          }\n          updatePayload.push(propKey, styleUpdates);\n        }\n        styleUpdates = nextProp;\n      }\n    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n      var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n      var lastHtml = lastProp ? lastProp[HTML$1] : undefined;\n      if (nextHtml != null) {\n        if (lastHtml !== nextHtml) {\n          (updatePayload = updatePayload || []).push(propKey, nextHtml);\n        }\n      }\n    } else if (propKey === CHILDREN) {\n      if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {\n        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n      }\n    } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameModules.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        // We eagerly listen to this even though we haven't committed yet.\n        if ( typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        ensureListeningTo(rootContainerElement, propKey);\n      }\n      if (!updatePayload && lastProp !== nextProp) {\n        // This is a special case. If any listener updates we need to ensure\n        // that the \\\\\"current\\\\\" props pointer gets updated so we need a commit\n        // to update this element.\n        updatePayload = [];\n      }\n    } else {\n      // For any other property we always add it to the queue and then we\n      // filter it out using the whitelist during the commit.\n      (updatePayload = updatePayload || []).push(propKey, nextProp);\n    }\n  }\n  if (styleUpdates) {\n    {\n      validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);\n    }\n    (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n  }\n  return updatePayload;\n} // Apply the diff.\nfunction updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n  // Update checked *before* name.\n  // In the middle of an update, it is possible to have multiple checked.\n  // When a checked radio tries to change name, browser makes another radio's checked false.\n  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n    updateChecked(domElement, nextRawProps);\n  }\n  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n  var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.\n  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props\n  // changed.\n  switch (tag) {\n    case 'input':\n      // Update the wrapper around inputs *after* updating props. This has to\n      // happen after \\`updateDOMProperties\\`. Otherwise HTML5 input validations\n      // raise warnings and prevent the new value from being assigned.\n      updateWrapper(domElement, nextRawProps);\n      break;\n    case 'textarea':\n      updateWrapper$1(domElement, nextRawProps);\n      break;\n    case 'select':\n      // <select> value update needs to occur after <option> children\n      // reconciliation\n      postUpdateWrapper(domElement, nextRawProps);\n      break;\n  }\n}\nfunction getPossibleStandardName(propName) {\n  {\n    var lowerCasedName = propName.toLowerCase();\n    if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n      return null;\n    }\n    return possibleStandardNames[lowerCasedName] || null;\n  }\n}\nfunction diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {\n  var isCustomComponentTag;\n  var extraAttributeNames;\n  {\n    suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;\n    isCustomComponentTag = isCustomComponent(tag, rawProps);\n    validatePropertiesInDevelopment(tag, rawProps);\n  } // TODO: Make sure that we check isMounted before firing any of these events.\n  switch (tag) {\n    case 'iframe':\n    case 'object':\n    case 'embed':\n      trapBubbledEvent(TOP_LOAD, domElement);\n      break;\n    case 'video':\n    case 'audio':\n      // Create listener for each media event\n      for (var i = 0; i < mediaEventTypes.length; i++) {\n        trapBubbledEvent(mediaEventTypes[i], domElement);\n      }\n      break;\n    case 'source':\n      trapBubbledEvent(TOP_ERROR, domElement);\n      break;\n    case 'img':\n    case 'image':\n    case 'link':\n      trapBubbledEvent(TOP_ERROR, domElement);\n      trapBubbledEvent(TOP_LOAD, domElement);\n      break;\n    case 'form':\n      trapBubbledEvent(TOP_RESET, domElement);\n      trapBubbledEvent(TOP_SUBMIT, domElement);\n      break;\n    case 'details':\n      trapBubbledEvent(TOP_TOGGLE, domElement);\n      break;\n    case 'input':\n      initWrapperState(domElement, rawProps);\n      trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'option':\n      validateProps(domElement, rawProps);\n      break;\n    case 'select':\n      initWrapperState$1(domElement, rawProps);\n      trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n    case 'textarea':\n      initWrapperState$2(domElement, rawProps);\n      trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening\n      // to onChange. Even if there is no listener.\n      ensureListeningTo(rootContainerElement, 'onChange');\n      break;\n  }\n  assertValidProps(tag, rawProps);\n  {\n    extraAttributeNames = new Set();\n    var attributes = domElement.attributes;\n    for (var _i = 0; _i < attributes.length; _i++) {\n      var name = attributes[_i].name.toLowerCase();\n      switch (name) {\n        // Built-in SSR attribute is whitelisted\n        case 'data-reactroot':\n          break;\n        // Controlled attributes are not validated\n        // TODO: Only ignore them on controlled tags.\n        case 'value':\n          break;\n        case 'checked':\n          break;\n        case 'selected':\n          break;\n        default:\n          // Intentionally use the original name.\n          // See discussion in https://github.com/facebook/react/pull/10676.\n          extraAttributeNames.add(attributes[_i].name);\n      }\n    }\n  }\n  var updatePayload = null;\n  for (var propKey in rawProps) {\n    if (!rawProps.hasOwnProperty(propKey)) {\n      continue;\n    }\n    var nextProp = rawProps[propKey];\n    if (propKey === CHILDREN) {\n      // For text content children we compare against textContent. This\n      // might match additional HTML that is hidden when we read it using\n      // textContent. E.g. \\\\\"foo\\\\\" will match \\\\\"f<span>oo</span>\\\\\" but that still\n      // satisfies our requirement. Our requirement is not to produce perfect\n      // HTML and attributes. Ideally we should preserve structure but it's\n      // ok not to if the visible content is still enough to indicate what\n      // even listeners these nodes might be wired up to.\n      // TODO: Warn if there is more than a single textNode as a child.\n      // TODO: Should we use domElement.firstChild.nodeValue to compare?\n      if (typeof nextProp === 'string') {\n        if (domElement.textContent !== nextProp) {\n          if ( !suppressHydrationWarning) {\n            warnForTextDifference(domElement.textContent, nextProp);\n          }\n          updatePayload = [CHILDREN, nextProp];\n        }\n      } else if (typeof nextProp === 'number') {\n        if (domElement.textContent !== '' + nextProp) {\n          if ( !suppressHydrationWarning) {\n            warnForTextDifference(domElement.textContent, nextProp);\n          }\n          updatePayload = [CHILDREN, '' + nextProp];\n        }\n      }\n    } else if (registrationNameModules.hasOwnProperty(propKey)) {\n      if (nextProp != null) {\n        if ( typeof nextProp !== 'function') {\n          warnForInvalidEventListener(propKey, nextProp);\n        }\n        ensureListeningTo(rootContainerElement, propKey);\n      }\n    } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)\n    typeof isCustomComponentTag === 'boolean') {\n      // Validate that the properties correspond to their expected values.\n      var serverValue = void 0;\n      var propertyInfo = getPropertyInfo(propKey);\n      if (suppressHydrationWarning) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated\n      // TODO: Only ignore them on controlled tags.\n      propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n        var serverHTML = domElement.innerHTML;\n        var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n        var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');\n        if (expectedHTML !== serverHTML) {\n          warnForPropDifference(propKey, serverHTML, expectedHTML);\n        }\n      } else if (propKey === STYLE) {\n        // $FlowFixMe - Should be inferred as not undefined.\n        extraAttributeNames.delete(propKey);\n        if (canDiffStyleForHydrationWarning) {\n          var expectedStyle = createDangerousStringForStyles(nextProp);\n          serverValue = domElement.getAttribute('style');\n          if (expectedStyle !== serverValue) {\n            warnForPropDifference(propKey, serverValue, expectedStyle);\n          }\n        }\n      } else if (isCustomComponentTag) {\n        // $FlowFixMe - Should be inferred as not undefined.\n        extraAttributeNames.delete(propKey.toLowerCase());\n        serverValue = getValueForAttribute(domElement, propKey, nextProp);\n        if (nextProp !== serverValue) {\n          warnForPropDifference(propKey, serverValue, nextProp);\n        }\n      } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {\n        var isMismatchDueToBadCasing = false;\n        if (propertyInfo !== null) {\n          // $FlowFixMe - Should be inferred as not undefined.\n          extraAttributeNames.delete(propertyInfo.attributeName);\n          serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);\n        } else {\n          var ownNamespace = parentNamespace;\n          if (ownNamespace === HTML_NAMESPACE$1) {\n            ownNamespace = getIntrinsicNamespace(tag);\n          }\n          if (ownNamespace === HTML_NAMESPACE$1) {\n            // $FlowFixMe - Should be inferred as not undefined.\n            extraAttributeNames.delete(propKey.toLowerCase());\n          } else {\n            var standardName = getPossibleStandardName(propKey);\n            if (standardName !== null && standardName !== propKey) {\n              // If an SVG prop is supplied with bad casing, it will\n              // be successfully parsed from HTML, but will produce a mismatch\n              // (and would be incorrectly rendered on the client).\n              // However, we already warn about bad casing elsewhere.\n              // So we'll skip the misleading extra mismatch warning in this case.\n              isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.\n              extraAttributeNames.delete(standardName);\n            } // $FlowFixMe - Should be inferred as not undefined.\n            extraAttributeNames.delete(propKey);\n          }\n          serverValue = getValueForAttribute(domElement, propKey, nextProp);\n        }\n        if (nextProp !== serverValue && !isMismatchDueToBadCasing) {\n          warnForPropDifference(propKey, serverValue, nextProp);\n        }\n      }\n    }\n  }\n  {\n    // $FlowFixMe - Should be inferred as not undefined.\n    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {\n      // $FlowFixMe - Should be inferred as not undefined.\n      warnForExtraAttributes(extraAttributeNames);\n    }\n  }\n  switch (tag) {\n    case 'input':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper(domElement, rawProps, true);\n      break;\n    case 'textarea':\n      // TODO: Make sure we check if this is still unmounted or do any clean\n      // up necessary since we never stop tracking anymore.\n      track(domElement);\n      postMountWrapper$3(domElement);\n      break;\n    case 'select':\n    case 'option':\n      // For input and textarea we current always set the value property at\n      // post mount to force it to diverge from attributes. However, for\n      // option and select we don't quite do the same thing and select\n      // is not resilient to the DOM state changing so we don't do that here.\n      // TODO: Consider not doing this for input and textarea.\n      break;\n    default:\n      if (typeof rawProps.onClick === 'function') {\n        // TODO: This cast may not be sound for SVG, MathML or custom elements.\n        trapClickOnNonInteractiveElement(domElement);\n      }\n      break;\n  }\n  return updatePayload;\n}\nfunction diffHydratedText(textNode, text) {\n  var isDifferent = textNode.nodeValue !== text;\n  return isDifferent;\n}\nfunction warnForUnmatchedText(textNode, text) {\n  {\n    warnForTextDifference(textNode.nodeValue, text);\n  }\n}\nfunction warnForDeletedHydratableElement(parentNode, child) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n  }\n}\nfunction warnForDeletedHydratableText(parentNode, child) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Did not expect server HTML to contain the text node \\\\\"%s\\\\\" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());\n  }\n}\nfunction warnForInsertedHydratedElement(parentNode, tag, props) {\n  {\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());\n  }\n}\nfunction warnForInsertedHydratedText(parentNode, text) {\n  {\n    if (text === '') {\n      // We expect to insert empty text nodes since they're not represented in\n      // the HTML.\n      // TODO: Remove this special case if we can just avoid inserting empty\n      // text nodes.\n      return;\n    }\n    if (didWarnInvalidHydration) {\n      return;\n    }\n    didWarnInvalidHydration = true;\n    error('Expected server HTML to contain a matching text node for \\\\\"%s\\\\\" in <%s>.', text, parentNode.nodeName.toLowerCase());\n  }\n}\nfunction restoreControlledState$3(domElement, tag, props) {\n  switch (tag) {\n    case 'input':\n      restoreControlledState(domElement, props);\n      return;\n    case 'textarea':\n      restoreControlledState$2(domElement, props);\n      return;\n    case 'select':\n      restoreControlledState$1(domElement, props);\n      return;\n  }\n}\nfunction getActiveElement(doc) {\n  doc = doc || (typeof document !== 'undefined' ? document : undefined);\n  if (typeof doc === 'undefined') {\n    return null;\n  }\n  try {\n    return doc.activeElement || doc.body;\n  } catch (e) {\n    return doc.body;\n  }\n}\n/**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n */\nfunction getLeafNode(node) {\n  while (node && node.firstChild) {\n    node = node.firstChild;\n  }\n  return node;\n}\n/**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n */\nfunction getSiblingNode(node) {\n  while (node) {\n    if (node.nextSibling) {\n      return node.nextSibling;\n    }\n    node = node.parentNode;\n  }\n}\n/**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n */\nfunction getNodeForCharacterOffset(root, offset) {\n  var node = getLeafNode(root);\n  var nodeStart = 0;\n  var nodeEnd = 0;\n  while (node) {\n    if (node.nodeType === TEXT_NODE) {\n      nodeEnd = nodeStart + node.textContent.length;\n      if (nodeStart <= offset && nodeEnd >= offset) {\n        return {\n          node: node,\n          offset: offset - nodeStart\n        };\n      }\n      nodeStart = nodeEnd;\n    }\n    node = getLeafNode(getSiblingNode(node));\n  }\n}\n/**\n * @param {DOMElement} outerNode\n * @return {?object}\n */\nfunction getOffsets(outerNode) {\n  var ownerDocument = outerNode.ownerDocument;\n  var win = ownerDocument && ownerDocument.defaultView || window;\n  var selection = win.getSelection && win.getSelection();\n  if (!selection || selection.rangeCount === 0) {\n    return null;\n  }\n  var anchorNode = selection.anchorNode,\n      anchorOffset = selection.anchorOffset,\n      focusNode = selection.focusNode,\n      focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be \\\\\"anonymous divs\\\\\", e.g. the\n  // up/down buttons on an <input type=\\\\\"number\\\\\">. Anonymous divs do not seem to\n  // expose properties, triggering a \\\\\"Permission denied error\\\\\" if any of its\n  // properties are accessed. The only seemingly possible way to avoid erroring\n  // is to access a property that typically works for non-anonymous divs and\n  // catch any error that may otherwise arise. See\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n  try {\n    /* eslint-disable no-unused-expressions */\n    anchorNode.nodeType;\n    focusNode.nodeType;\n    /* eslint-enable no-unused-expressions */\n  } catch (e) {\n    return null;\n  }\n  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n/**\n * Returns {start, end} where \\`start\\` is the character/codepoint index of\n * (anchorNode, anchorOffset) within the textContent of \\`outerNode\\`, and\n * \\`end\\` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n */\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n  var length = 0;\n  var start = -1;\n  var end = -1;\n  var indexWithinAnchor = 0;\n  var indexWithinFocus = 0;\n  var node = outerNode;\n  var parentNode = null;\n  outer: while (true) {\n    var next = null;\n    while (true) {\n      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n        start = length + anchorOffset;\n      }\n      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n        end = length + focusOffset;\n      }\n      if (node.nodeType === TEXT_NODE) {\n        length += node.nodeValue.length;\n      }\n      if ((next = node.firstChild) === null) {\n        break;\n      } // Moving from \\`node\\` to its first child \\`next\\`.\n      parentNode = node;\n      node = next;\n    }\n    while (true) {\n      if (node === outerNode) {\n        // If \\`outerNode\\` has children, this is always the second time visiting\n        // it. If it has no children, this is still the first loop, and the only\n        // valid selection is anchorNode and focusNode both equal to this node\n        // and both offsets 0, in which case we will have handled above.\n        break outer;\n      }\n      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n        start = length;\n      }\n      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n        end = length;\n      }\n      if ((next = node.nextSibling) !== null) {\n        break;\n      }\n      node = parentNode;\n      parentNode = node.parentNode;\n    } // Moving from \\`node\\` to its next sibling \\`next\\`.\n    node = next;\n  }\n  if (start === -1 || end === -1) {\n    // This should never happen. (Would happen if the anchor/focus nodes aren't\n    // actually inside the passed-in node.)\n    return null;\n  }\n  return {\n    start: start,\n    end: end\n  };\n}\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the \\`extend\\` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n */\nfunction setOffsets(node, offsets) {\n  var doc = node.ownerDocument || document;\n  var win = doc && doc.defaultView || window; // Edge fails with \\\\\"Object expected\\\\\" in some scenarios.\n  // (For instance: TinyMCE editor used in a list component that supports pasting to add more,\n  // fails when pasting 100+ items)\n  if (!win.getSelection) {\n    return;\n  }\n  var selection = win.getSelection();\n  var length = node.textContent.length;\n  var start = Math.min(offsets.start, length);\n  var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.\n  // Flip backward selections, so we can set with a single range.\n  if (!selection.extend && start > end) {\n    var temp = end;\n    end = start;\n    start = temp;\n  }\n  var startMarker = getNodeForCharacterOffset(node, start);\n  var endMarker = getNodeForCharacterOffset(node, end);\n  if (startMarker && endMarker) {\n    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n      return;\n    }\n    var range = doc.createRange();\n    range.setStart(startMarker.node, startMarker.offset);\n    selection.removeAllRanges();\n    if (start > end) {\n      selection.addRange(range);\n      selection.extend(endMarker.node, endMarker.offset);\n    } else {\n      range.setEnd(endMarker.node, endMarker.offset);\n      selection.addRange(range);\n    }\n  }\n}\nfunction isTextNode(node) {\n  return node && node.nodeType === TEXT_NODE;\n}\nfunction containsNode(outerNode, innerNode) {\n  if (!outerNode || !innerNode) {\n    return false;\n  } else if (outerNode === innerNode) {\n    return true;\n  } else if (isTextNode(outerNode)) {\n    return false;\n  } else if (isTextNode(innerNode)) {\n    return containsNode(outerNode, innerNode.parentNode);\n  } else if ('contains' in outerNode) {\n    return outerNode.contains(innerNode);\n  } else if (outerNode.compareDocumentPosition) {\n    return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n  } else {\n    return false;\n  }\n}\nfunction isInDocument(node) {\n  return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);\n}\nfunction isSameOriginFrame(iframe) {\n  try {\n    // Accessing the contentDocument of a HTMLIframeElement can cause the browser\n    // to throw, e.g. if it has a cross-origin src attribute.\n    // Safari will show an error in the console when the access results in \\\\\"Blocked a frame with origin\\\\\". e.g:\n    // iframe.contentDocument.defaultView;\n    // A safety way is to access one of the cross origin properties: Window or Location\n    // Which might result in \\\\\"SecurityError\\\\\" DOM Exception and it is compatible to Safari.\n    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl\n    return typeof iframe.contentWindow.location.href === 'string';\n  } catch (err) {\n    return false;\n  }\n}\nfunction getActiveElementDeep() {\n  var win = window;\n  var element = getActiveElement();\n  while (element instanceof win.HTMLIFrameElement) {\n    if (isSameOriginFrame(element)) {\n      win = element.contentWindow;\n    } else {\n      return element;\n    }\n    element = getActiveElement(win.document);\n  }\n  return element;\n}\n/**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n */\n/**\n * @hasSelectionCapabilities: we get the element types that support selection\n * from https://html.spec.whatwg.org/#do-not-apply, looking at \\`selectionStart\\`\n * and \\`selectionEnd\\` rows.\n */\nfunction hasSelectionCapabilities(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\nfunction getSelectionInformation() {\n  var focusedElem = getActiveElementDeep();\n  return {\n    // Used by Flare\n    activeElementDetached: null,\n    focusedElem: focusedElem,\n    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null\n  };\n}\n/**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n */\nfunction restoreSelection(priorSelectionInformation) {\n  var curFocusedElem = getActiveElementDeep();\n  var priorFocusedElem = priorSelectionInformation.focusedElem;\n  var priorSelectionRange = priorSelectionInformation.selectionRange;\n  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n    if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {\n      setSelection(priorFocusedElem, priorSelectionRange);\n    } // Focusing a node can change the scroll position, which is undesirable\n    var ancestors = [];\n    var ancestor = priorFocusedElem;\n    while (ancestor = ancestor.parentNode) {\n      if (ancestor.nodeType === ELEMENT_NODE) {\n        ancestors.push({\n          element: ancestor,\n          left: ancestor.scrollLeft,\n          top: ancestor.scrollTop\n        });\n      }\n    }\n    if (typeof priorFocusedElem.focus === 'function') {\n      priorFocusedElem.focus();\n    }\n    for (var i = 0; i < ancestors.length; i++) {\n      var info = ancestors[i];\n      info.element.scrollLeft = info.left;\n      info.element.scrollTop = info.top;\n    }\n  }\n}\n/**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n */\nfunction getSelection(input) {\n  var selection;\n  if ('selectionStart' in input) {\n    // Modern browser with input or textarea.\n    selection = {\n      start: input.selectionStart,\n      end: input.selectionEnd\n    };\n  } else {\n    // Content editable or old IE textarea.\n    selection = getOffsets(input);\n  }\n  return selection || {\n    start: 0,\n    end: 0\n  };\n}\n/**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input     Set selection bounds of this input or textarea\n * -@offsets   Object of same form that is returned from get*\n */\nfunction setSelection(input, offsets) {\n  var start = offsets.start,\n      end = offsets.end;\n  if (end === undefined) {\n    end = start;\n  }\n  if ('selectionStart' in input) {\n    input.selectionStart = start;\n    input.selectionEnd = Math.min(end, input.value.length);\n  } else {\n    setOffsets(input, offsets);\n  }\n}\nvar validateDOMNesting = function () {};\nvar updatedAncestorInfo = function () {};\n{\n  // This validation code was written based on the HTML5 parsing spec:\n  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n  //\n  // Note: this does not catch all invalid nesting, nor does it try to (as it's\n  // not clear what practical benefit doing so provides); instead, we warn only\n  // for cases where the parser will give a parse tree differing from what React\n  // intended. For example, <b><div></div></b> is invalid but we don't warn\n  // because it still parses correctly; we do warn for other cases like nested\n  // <p> tags where the beginning of the second element implicitly closes the\n  // first, causing a confusing mess.\n  // https://html.spec.whatwg.org/multipage/syntax.html#special\n  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope\n  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point\n  // TODO: Distinguish by namespace here -- for <title>, including it here\n  // errs on the side of fewer warnings\n  'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope\n  var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags\n  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n  var emptyAncestorInfo = {\n    current: null,\n    formTag: null,\n    aTagInScope: null,\n    buttonTagInScope: null,\n    nobrTagInScope: null,\n    pTagInButtonScope: null,\n    listItemTagAutoclosing: null,\n    dlItemTagAutoclosing: null\n  };\n  updatedAncestorInfo = function (oldInfo, tag) {\n    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n    var info = {\n      tag: tag\n    };\n    if (inScopeTags.indexOf(tag) !== -1) {\n      ancestorInfo.aTagInScope = null;\n      ancestorInfo.buttonTagInScope = null;\n      ancestorInfo.nobrTagInScope = null;\n    }\n    if (buttonScopeTags.indexOf(tag) !== -1) {\n      ancestorInfo.pTagInButtonScope = null;\n    } // See rules for 'li', 'dd', 'dt' start tags in\n    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n      ancestorInfo.listItemTagAutoclosing = null;\n      ancestorInfo.dlItemTagAutoclosing = null;\n    }\n    ancestorInfo.current = info;\n    if (tag === 'form') {\n      ancestorInfo.formTag = info;\n    }\n    if (tag === 'a') {\n      ancestorInfo.aTagInScope = info;\n    }\n    if (tag === 'button') {\n      ancestorInfo.buttonTagInScope = info;\n    }\n    if (tag === 'nobr') {\n      ancestorInfo.nobrTagInScope = info;\n    }\n    if (tag === 'p') {\n      ancestorInfo.pTagInButtonScope = info;\n    }\n    if (tag === 'li') {\n      ancestorInfo.listItemTagAutoclosing = info;\n    }\n    if (tag === 'dd' || tag === 'dt') {\n      ancestorInfo.dlItemTagAutoclosing = info;\n    }\n    return ancestorInfo;\n  };\n  /**\n   * Returns whether\n   */\n  var isTagValidWithParent = function (tag, parentTag) {\n    // First, let's check if we're in an unusual parsing mode...\n    switch (parentTag) {\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect\n      case 'select':\n        return tag === 'option' || tag === 'optgroup' || tag === '#text';\n      case 'optgroup':\n        return tag === 'option' || tag === '#text';\n      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>\n      // but\n      case 'option':\n        return tag === '#text';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption\n      // No special behavior since these rules fall back to \\\\\"in body\\\\\" mode for\n      // all except special table nodes which cause bad parsing behavior anyway.\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr\n      case 'tr':\n        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody\n      case 'tbody':\n      case 'thead':\n      case 'tfoot':\n        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup\n      case 'colgroup':\n        return tag === 'col' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable\n      case 'table':\n        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead\n      case 'head':\n        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element\n      case 'html':\n        return tag === 'head' || tag === 'body' || tag === 'frameset';\n      case 'frameset':\n        return tag === 'frame';\n      case '#document':\n        return tag === 'html';\n    } // Probably in the \\\\\"in body\\\\\" parsing mode, so we outlaw only tag combos\n    // where the parsing rules cause implicit opens or closes to be added.\n    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n    switch (tag) {\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n      case 'rp':\n      case 'rt':\n        return impliedEndTags.indexOf(parentTag) === -1;\n      case 'body':\n      case 'caption':\n      case 'col':\n      case 'colgroup':\n      case 'frameset':\n      case 'frame':\n      case 'head':\n      case 'html':\n      case 'tbody':\n      case 'td':\n      case 'tfoot':\n      case 'th':\n      case 'thead':\n      case 'tr':\n        // These tags are only valid with a few parents that have special child\n        // parsing rules -- if we're down here, then none of those matched and\n        // so we allow it only if we don't know what the parent is, as all other\n        // cases are invalid.\n        return parentTag == null;\n    }\n    return true;\n  };\n  /**\n   * Returns whether\n   */\n  var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n    switch (tag) {\n      case 'address':\n      case 'article':\n      case 'aside':\n      case 'blockquote':\n      case 'center':\n      case 'details':\n      case 'dialog':\n      case 'dir':\n      case 'div':\n      case 'dl':\n      case 'fieldset':\n      case 'figcaption':\n      case 'figure':\n      case 'footer':\n      case 'header':\n      case 'hgroup':\n      case 'main':\n      case 'menu':\n      case 'nav':\n      case 'ol':\n      case 'p':\n      case 'section':\n      case 'summary':\n      case 'ul':\n      case 'pre':\n      case 'listing':\n      case 'table':\n      case 'hr':\n      case 'xmp':\n      case 'h1':\n      case 'h2':\n      case 'h3':\n      case 'h4':\n      case 'h5':\n      case 'h6':\n        return ancestorInfo.pTagInButtonScope;\n      case 'form':\n        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n      case 'li':\n        return ancestorInfo.listItemTagAutoclosing;\n      case 'dd':\n      case 'dt':\n        return ancestorInfo.dlItemTagAutoclosing;\n      case 'button':\n        return ancestorInfo.buttonTagInScope;\n      case 'a':\n        // Spec says something about storing a list of markers, but it sounds\n        // equivalent to this check.\n        return ancestorInfo.aTagInScope;\n      case 'nobr':\n        return ancestorInfo.nobrTagInScope;\n    }\n    return null;\n  };\n  var didWarn$1 = {};\n  validateDOMNesting = function (childTag, childText, ancestorInfo) {\n    ancestorInfo = ancestorInfo || emptyAncestorInfo;\n    var parentInfo = ancestorInfo.current;\n    var parentTag = parentInfo && parentInfo.tag;\n    if (childText != null) {\n      if (childTag != null) {\n        error('validateDOMNesting: when childText is passed, childTag should be null');\n      }\n      childTag = '#text';\n    }\n    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n    var invalidParentOrAncestor = invalidParent || invalidAncestor;\n    if (!invalidParentOrAncestor) {\n      return;\n    }\n    var ancestorTag = invalidParentOrAncestor.tag;\n    var addendum = getCurrentFiberStackInDev();\n    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;\n    if (didWarn$1[warnKey]) {\n      return;\n    }\n    didWarn$1[warnKey] = true;\n    var tagDisplayName = childTag;\n    var whitespaceInfo = '';\n    if (childTag === '#text') {\n      if (/\\\\\\\\S/.test(childText)) {\n        tagDisplayName = 'Text nodes';\n      } else {\n        tagDisplayName = 'Whitespace text nodes';\n        whitespaceInfo = \\\\\" Make sure you don't have any extra whitespace between tags on \\\\\" + 'each line of your source code.';\n      }\n    } else {\n      tagDisplayName = '<' + childTag + '>';\n    }\n    if (invalidParent) {\n      var info = '';\n      if (ancestorTag === 'table' && childTag === 'tr') {\n        info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';\n      }\n      error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);\n    } else {\n      error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);\n    }\n  };\n}\nvar SUPPRESS_HYDRATION_WARNING$1;\n{\n  SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\n}\nvar SUSPENSE_START_DATA = '$';\nvar SUSPENSE_END_DATA = '/$';\nvar SUSPENSE_PENDING_START_DATA = '$?';\nvar SUSPENSE_FALLBACK_START_DATA = '$!';\nvar STYLE$1 = 'style';\nvar eventsEnabled = null;\nvar selectionInformation = null;\nfunction shouldAutoFocusHostComponent(type, props) {\n  switch (type) {\n    case 'button':\n    case 'input':\n    case 'select':\n    case 'textarea':\n      return !!props.autoFocus;\n  }\n  return false;\n}\nfunction getRootHostContext(rootContainerInstance) {\n  var type;\n  var namespace;\n  var nodeType = rootContainerInstance.nodeType;\n  switch (nodeType) {\n    case DOCUMENT_NODE:\n    case DOCUMENT_FRAGMENT_NODE:\n      {\n        type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n        var root = rootContainerInstance.documentElement;\n        namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n        break;\n      }\n    default:\n      {\n        var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n        var ownNamespace = container.namespaceURI || null;\n        type = container.tagName;\n        namespace = getChildNamespace(ownNamespace, type);\n        break;\n      }\n  }\n  {\n    var validatedTag = type.toLowerCase();\n    var ancestorInfo = updatedAncestorInfo(null, validatedTag);\n    return {\n      namespace: namespace,\n      ancestorInfo: ancestorInfo\n    };\n  }\n}\nfunction getChildHostContext(parentHostContext, type, rootContainerInstance) {\n  {\n    var parentHostContextDev = parentHostContext;\n    var namespace = getChildNamespace(parentHostContextDev.namespace, type);\n    var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);\n    return {\n      namespace: namespace,\n      ancestorInfo: ancestorInfo\n    };\n  }\n}\nfunction getPublicInstance(instance) {\n  return instance;\n}\nfunction prepareForCommit(containerInfo) {\n  eventsEnabled = isEnabled();\n  selectionInformation = getSelectionInformation();\n  setEnabled(false);\n}\nfunction resetAfterCommit(containerInfo) {\n  restoreSelection(selectionInformation);\n  setEnabled(eventsEnabled);\n  eventsEnabled = null;\n  selectionInformation = null;\n}\nfunction createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n  var parentNamespace;\n  {\n    // TODO: take namespace into account when validating.\n    var hostContextDev = hostContext;\n    validateDOMNesting(type, null, hostContextDev.ancestorInfo);\n    if (typeof props.children === 'string' || typeof props.children === 'number') {\n      var string = '' + props.children;\n      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n      validateDOMNesting(null, string, ownAncestorInfo);\n    }\n    parentNamespace = hostContextDev.namespace;\n  }\n  var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n  precacheFiberNode(internalInstanceHandle, domElement);\n  updateFiberProps(domElement, props);\n  return domElement;\n}\nfunction appendInitialChild(parentInstance, child) {\n  parentInstance.appendChild(child);\n}\nfunction finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {\n  setInitialProperties(domElement, type, props, rootContainerInstance);\n  return shouldAutoFocusHostComponent(type, props);\n}\nfunction prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n  {\n    var hostContextDev = hostContext;\n    if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n      var string = '' + newProps.children;\n      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n      validateDOMNesting(null, string, ownAncestorInfo);\n    }\n  }\n  return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);\n}\nfunction shouldSetTextContent(type, props) {\n  return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;\n}\nfunction shouldDeprioritizeSubtree(type, props) {\n  return !!props.hidden;\n}\nfunction createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {\n  {\n    var hostContextDev = hostContext;\n    validateDOMNesting(null, text, hostContextDev.ancestorInfo);\n  }\n  var textNode = createTextNode(text, rootContainerInstance);\n  precacheFiberNode(internalInstanceHandle, textNode);\n  return textNode;\n}\n// if a component just imports ReactDOM (e.g. for findDOMNode).\n// Some environments might not have setTimeout or clearTimeout.\nvar scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;\nvar cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;\nvar noTimeout = -1; // -------------------\nfunction commitMount(domElement, type, newProps, internalInstanceHandle) {\n  // Despite the naming that might imply otherwise, this method only\n  // fires if there is an \\`Update\\` effect scheduled during mounting.\n  // This happens if \\`finalizeInitialChildren\\` returns \\`true\\` (which it\n  // does to implement the \\`autoFocus\\` attribute on the client). But\n  // there are also other cases when this might happen (such as patching\n  // up text content during hydration mismatch). So we'll check this again.\n  if (shouldAutoFocusHostComponent(type, newProps)) {\n    domElement.focus();\n  }\n}\nfunction commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n  // Update the props handle so that we know which props are the ones with\n  // with current event handlers.\n  updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.\n  updateProperties(domElement, updatePayload, type, oldProps, newProps);\n}\nfunction resetTextContent(domElement) {\n  setTextContent(domElement, '');\n}\nfunction commitTextUpdate(textInstance, oldText, newText) {\n  textInstance.nodeValue = newText;\n}\nfunction appendChild(parentInstance, child) {\n  parentInstance.appendChild(child);\n}\nfunction appendChildToContainer(container, child) {\n  var parentNode;\n  if (container.nodeType === COMMENT_NODE) {\n    parentNode = container.parentNode;\n    parentNode.insertBefore(child, container);\n  } else {\n    parentNode = container;\n    parentNode.appendChild(child);\n  } // This container might be used for a portal.\n  // If something inside a portal is clicked, that click should bubble\n  // through the React tree. However, on Mobile Safari the click would\n  // never bubble through the *DOM* tree unless an ancestor with onclick\n  // event exists. So we wouldn't see it and dispatch it.\n  // This is why we ensure that non React root containers have inline onclick\n  // defined.\n  // https://github.com/facebook/react/issues/11918\n  var reactRootContainer = container._reactRootContainer;\n  if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {\n    // TODO: This cast may not be sound for SVG, MathML or custom elements.\n    trapClickOnNonInteractiveElement(parentNode);\n  }\n}\nfunction insertBefore(parentInstance, child, beforeChild) {\n  parentInstance.insertBefore(child, beforeChild);\n}\nfunction insertInContainerBefore(container, child, beforeChild) {\n  if (container.nodeType === COMMENT_NODE) {\n    container.parentNode.insertBefore(child, beforeChild);\n  } else {\n    container.insertBefore(child, beforeChild);\n  }\n}\nfunction removeChild(parentInstance, child) {\n  parentInstance.removeChild(child);\n}\nfunction removeChildFromContainer(container, child) {\n  if (container.nodeType === COMMENT_NODE) {\n    container.parentNode.removeChild(child);\n  } else {\n    container.removeChild(child);\n  }\n}\nfunction hideInstance(instance) {\n  // pass host context to this method?\n  instance = instance;\n  var style = instance.style;\n  if (typeof style.setProperty === 'function') {\n    style.setProperty('display', 'none', 'important');\n  } else {\n    style.display = 'none';\n  }\n}\nfunction hideTextInstance(textInstance) {\n  textInstance.nodeValue = '';\n}\nfunction unhideInstance(instance, props) {\n  instance = instance;\n  var styleProp = props[STYLE$1];\n  var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;\n  instance.style.display = dangerousStyleValue('display', display);\n}\nfunction unhideTextInstance(textInstance, text) {\n  textInstance.nodeValue = text;\n} // -------------------\nfunction canHydrateInstance(instance, type, props) {\n  if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n    return null;\n  } // This has now been refined to an element node.\n  return instance;\n}\nfunction canHydrateTextInstance(instance, text) {\n  if (text === '' || instance.nodeType !== TEXT_NODE) {\n    // Empty strings are not parsed by HTML so there won't be a correct match here.\n    return null;\n  } // This has now been refined to a text node.\n  return instance;\n}\nfunction isSuspenseInstancePending(instance) {\n  return instance.data === SUSPENSE_PENDING_START_DATA;\n}\nfunction isSuspenseInstanceFallback(instance) {\n  return instance.data === SUSPENSE_FALLBACK_START_DATA;\n}\nfunction getNextHydratable(node) {\n  // Skip non-hydratable nodes.\n  for (; node != null; node = node.nextSibling) {\n    var nodeType = node.nodeType;\n    if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {\n      break;\n    }\n  }\n  return node;\n}\nfunction getNextHydratableSibling(instance) {\n  return getNextHydratable(instance.nextSibling);\n}\nfunction getFirstHydratableChild(parentInstance) {\n  return getNextHydratable(parentInstance.firstChild);\n}\nfunction hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n  precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events\n  // get attached.\n  updateFiberProps(instance, props);\n  var parentNamespace;\n  {\n    var hostContextDev = hostContext;\n    parentNamespace = hostContextDev.namespace;\n  }\n  return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);\n}\nfunction hydrateTextInstance(textInstance, text, internalInstanceHandle) {\n  precacheFiberNode(internalInstanceHandle, textInstance);\n  return diffHydratedText(textInstance, text);\n}\nfunction getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {\n  var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.\n  // There might be nested nodes so we need to keep track of how\n  // deep we are and only break out when we're back on top.\n  var depth = 0;\n  while (node) {\n    if (node.nodeType === COMMENT_NODE) {\n      var data = node.data;\n      if (data === SUSPENSE_END_DATA) {\n        if (depth === 0) {\n          return getNextHydratableSibling(node);\n        } else {\n          depth--;\n        }\n      } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n        depth++;\n      }\n    }\n    node = node.nextSibling;\n  } // TODO: Warn, we didn't find the end comment boundary.\n  return null;\n} // Returns the SuspenseInstance if this node is a direct child of a\n// SuspenseInstance. I.e. if its previous sibling is a Comment with\n// SUSPENSE_x_START_DATA. Otherwise, null.\nfunction getParentSuspenseInstance(targetInstance) {\n  var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.\n  // There might be nested nodes so we need to keep track of how\n  // deep we are and only break out when we're back on top.\n  var depth = 0;\n  while (node) {\n    if (node.nodeType === COMMENT_NODE) {\n      var data = node.data;\n      if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n        if (depth === 0) {\n          return node;\n        } else {\n          depth--;\n        }\n      } else if (data === SUSPENSE_END_DATA) {\n        depth++;\n      }\n    }\n    node = node.previousSibling;\n  }\n  return null;\n}\nfunction commitHydratedContainer(container) {\n  // Retry if any event replaying was blocked on this.\n  retryIfBlockedOn(container);\n}\nfunction commitHydratedSuspenseInstance(suspenseInstance) {\n  // Retry if any event replaying was blocked on this.\n  retryIfBlockedOn(suspenseInstance);\n}\nfunction didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {\n  {\n    warnForUnmatchedText(textInstance, text);\n  }\n}\nfunction didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    warnForUnmatchedText(textInstance, text);\n  }\n}\nfunction didNotHydrateContainerInstance(parentContainer, instance) {\n  {\n    if (instance.nodeType === ELEMENT_NODE) {\n      warnForDeletedHydratableElement(parentContainer, instance);\n    } else if (instance.nodeType === COMMENT_NODE) ; else {\n      warnForDeletedHydratableText(parentContainer, instance);\n    }\n  }\n}\nfunction didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    if (instance.nodeType === ELEMENT_NODE) {\n      warnForDeletedHydratableElement(parentInstance, instance);\n    } else if (instance.nodeType === COMMENT_NODE) ; else {\n      warnForDeletedHydratableText(parentInstance, instance);\n    }\n  }\n}\nfunction didNotFindHydratableContainerInstance(parentContainer, type, props) {\n  {\n    warnForInsertedHydratedElement(parentContainer, type);\n  }\n}\nfunction didNotFindHydratableContainerTextInstance(parentContainer, text) {\n  {\n    warnForInsertedHydratedText(parentContainer, text);\n  }\n}\nfunction didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    warnForInsertedHydratedElement(parentInstance, type);\n  }\n}\nfunction didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n    warnForInsertedHydratedText(parentInstance, text);\n  }\n}\nfunction didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {\n  if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;\n}\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactInternalInstance$' + randomKey;\nvar internalEventHandlersKey = '__reactEventHandlers$' + randomKey;\nvar internalContainerInstanceKey = '__reactContainere$' + randomKey;\nfunction precacheFiberNode(hostInst, node) {\n  node[internalInstanceKey] = hostInst;\n}\nfunction markContainerAsRoot(hostRoot, node) {\n  node[internalContainerInstanceKey] = hostRoot;\n}\nfunction unmarkContainerAsRoot(node) {\n  node[internalContainerInstanceKey] = null;\n}\nfunction isContainerMarkedAsRoot(node) {\n  return !!node[internalContainerInstanceKey];\n} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.\n// If the target node is part of a hydrated or not yet rendered subtree, then\n// this may also return a SuspenseComponent or HostRoot to indicate that.\n// Conceptually the HostRoot fiber is a child of the Container node. So if you\n// pass the Container node as the targetNode, you will not actually get the\n// HostRoot back. To get to the HostRoot, you need to pass a child of it.\n// The same thing applies to Suspense boundaries.\nfunction getClosestInstanceFromNode(targetNode) {\n  var targetInst = targetNode[internalInstanceKey];\n  if (targetInst) {\n    // Don't return HostRoot or SuspenseComponent here.\n    return targetInst;\n  } // If the direct event target isn't a React owned DOM node, we need to look\n  // to see if one of its parents is a React owned DOM node.\n  var parentNode = targetNode.parentNode;\n  while (parentNode) {\n    // We'll check if this is a container root that could include\n    // React nodes in the future. We need to check this first because\n    // if we're a child of a dehydrated container, we need to first\n    // find that inner container before moving on to finding the parent\n    // instance. Note that we don't check this field on  the targetNode\n    // itself because the fibers are conceptually between the container\n    // node and the first child. It isn't surrounding the container node.\n    // If it's not a container, we check if it's an instance.\n    targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];\n    if (targetInst) {\n      // Since this wasn't the direct target of the event, we might have\n      // stepped past dehydrated DOM nodes to get here. However they could\n      // also have been non-React nodes. We need to answer which one.\n      // If we the instance doesn't have any children, then there can't be\n      // a nested suspense boundary within it. So we can use this as a fast\n      // bailout. Most of the time, when people add non-React children to\n      // the tree, it is using a ref to a child-less DOM node.\n      // Normally we'd only need to check one of the fibers because if it\n      // has ever gone from having children to deleting them or vice versa\n      // it would have deleted the dehydrated boundary nested inside already.\n      // However, since the HostRoot starts out with an alternate it might\n      // have one on the alternate so we need to check in case this was a\n      // root.\n      var alternate = targetInst.alternate;\n      if (targetInst.child !== null || alternate !== null && alternate.child !== null) {\n        // Next we need to figure out if the node that skipped past is\n        // nested within a dehydrated boundary and if so, which one.\n        var suspenseInstance = getParentSuspenseInstance(targetNode);\n        while (suspenseInstance !== null) {\n          // We found a suspense instance. That means that we haven't\n          // hydrated it yet. Even though we leave the comments in the\n          // DOM after hydrating, and there are boundaries in the DOM\n          // that could already be hydrated, we wouldn't have found them\n          // through this pass since if the target is hydrated it would\n          // have had an internalInstanceKey on it.\n          // Let's get the fiber associated with the SuspenseComponent\n          // as the deepest instance.\n          var targetSuspenseInst = suspenseInstance[internalInstanceKey];\n          if (targetSuspenseInst) {\n            return targetSuspenseInst;\n          } // If we don't find a Fiber on the comment, it might be because\n          // we haven't gotten to hydrate it yet. There might still be a\n          // parent boundary that hasn't above this one so we need to find\n          // the outer most that is known.\n          suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent\n          // host component also hasn't hydrated yet. We can return it\n          // below since it will bail out on the isMounted check later.\n        }\n      }\n      return targetInst;\n    }\n    targetNode = parentNode;\n    parentNode = targetNode.parentNode;\n  }\n  return null;\n}\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\nfunction getInstanceFromNode$1(node) {\n  var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];\n  if (inst) {\n    if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {\n      return inst;\n    } else {\n      return null;\n    }\n  }\n  return null;\n}\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\nfunction getNodeFromInstance$1(inst) {\n  if (inst.tag === HostComponent || inst.tag === HostText) {\n    // In Fiber this, is just the state node right now. We assume it will be\n    // a host component or host text.\n    return inst.stateNode;\n  } // Without this first invariant, passing a non-DOM-component triggers the next\n  // invariant for a missing parent, which is super confusing.\n  {\n    {\n      throw Error( \\\\\"getNodeFromInstance: Invalid argument.\\\\\" );\n    }\n  }\n}\nfunction getFiberCurrentPropsFromNode$1(node) {\n  return node[internalEventHandlersKey] || null;\n}\nfunction updateFiberProps(node, props) {\n  node[internalEventHandlersKey] = props;\n}\nfunction getParent(inst) {\n  do {\n    inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.\n    // That is depending on if we want nested subtrees (layers) to bubble\n    // events to their parent. We could also go through parentNode on the\n    // host node but that wouldn't work for React Native and doesn't let us\n    // do the portal feature.\n  } while (inst && inst.tag !== HostComponent);\n  if (inst) {\n    return inst;\n  }\n  return null;\n}\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\nfunction getLowestCommonAncestor(instA, instB) {\n  var depthA = 0;\n  for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n    depthA++;\n  }\n  var depthB = 0;\n  for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n    depthB++;\n  } // If A is deeper, crawl up.\n  while (depthA - depthB > 0) {\n    instA = getParent(instA);\n    depthA--;\n  } // If B is deeper, crawl up.\n  while (depthB - depthA > 0) {\n    instB = getParent(instB);\n    depthB--;\n  } // Walk in lockstep until we find a match.\n  var depth = depthA;\n  while (depth--) {\n    if (instA === instB || instA === instB.alternate) {\n      return instA;\n    }\n    instA = getParent(instA);\n    instB = getParent(instB);\n  }\n  return null;\n}\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\nfunction traverseTwoPhase(inst, fn, arg) {\n  var path = [];\n  while (inst) {\n    path.push(inst);\n    inst = getParent(inst);\n  }\n  var i;\n  for (i = path.length; i-- > 0;) {\n    fn(path[i], 'captured', arg);\n  }\n  for (i = 0; i < path.length; i++) {\n    fn(path[i], 'bubbled', arg);\n  }\n}\n/**\n * Traverses the ID hierarchy and invokes the supplied \\`cb\\` on any IDs that\n * should would receive a \\`mouseEnter\\` or \\`mouseLeave\\` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \\\\\"entered\\\\\" or \\\\\"left\\\\\" that element.\n */\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\n  var common = from && to ? getLowestCommonAncestor(from, to) : null;\n  var pathFrom = [];\n  while (true) {\n    if (!from) {\n      break;\n    }\n    if (from === common) {\n      break;\n    }\n    var alternate = from.alternate;\n    if (alternate !== null && alternate === common) {\n      break;\n    }\n    pathFrom.push(from);\n    from = getParent(from);\n  }\n  var pathTo = [];\n  while (true) {\n    if (!to) {\n      break;\n    }\n    if (to === common) {\n      break;\n    }\n    var _alternate = to.alternate;\n    if (_alternate !== null && _alternate === common) {\n      break;\n    }\n    pathTo.push(to);\n    to = getParent(to);\n  }\n  for (var i = 0; i < pathFrom.length; i++) {\n    fn(pathFrom[i], 'bubbled', argFrom);\n  }\n  for (var _i = pathTo.length; _i-- > 0;) {\n    fn(pathTo[_i], 'captured', argTo);\n  }\n}\nfunction isInteractive(tag) {\n  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\nfunction shouldPreventMouseEvent(name, type, props) {\n  switch (name) {\n    case 'onClick':\n    case 'onClickCapture':\n    case 'onDoubleClick':\n    case 'onDoubleClickCapture':\n    case 'onMouseDown':\n    case 'onMouseDownCapture':\n    case 'onMouseMove':\n    case 'onMouseMoveCapture':\n    case 'onMouseUp':\n    case 'onMouseUpCapture':\n    case 'onMouseEnter':\n      return !!(props.disabled && isInteractive(type));\n    default:\n      return false;\n  }\n}\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. \\`onClick\\`).\n * @return {?function} The stored callback.\n */\nfunction getListener(inst, registrationName) {\n  var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n  // live here; needs to be moved to a better place soon\n  var stateNode = inst.stateNode;\n  if (!stateNode) {\n    // Work in progress (ex: onload events in incremental mode).\n    return null;\n  }\n  var props = getFiberCurrentPropsFromNode(stateNode);\n  if (!props) {\n    // Work in progress.\n    return null;\n  }\n  listener = props[registrationName];\n  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n    return null;\n  }\n  if (!(!listener || typeof listener === 'function')) {\n    {\n      throw Error( \\\\\"Expected \\`\\\\\" + registrationName + \\\\\"\\` listener to be a function, instead got a value of \\`\\\\\" + typeof listener + \\\\\"\\` type.\\\\\" );\n    }\n  }\n  return listener;\n}\n/**\n * Some event types have a notion of different registration names for different\n * \\\\\"phases\\\\\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n  var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n  return getListener(inst, registrationName);\n}\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \\\\\"dispatch ready event objects\\\\\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n/**\n * Tags a \\`SyntheticEvent\\` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \\\\\"dispatch\\\\\" object that pairs the event with the listener.\n */\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n  {\n    if (!inst) {\n      error('Dispatching inst must not be null');\n    }\n  }\n  var listener = listenerAtPhase(inst, event, phase);\n  if (listener) {\n    event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n    event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n  }\n}\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory.  We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n  if (event && event.dispatchConfig.phasedRegistrationNames) {\n    traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n  }\n}\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as \\`accumulateDirectDispatchesSingle\\` but without\n * requiring that the \\`dispatchMarker\\` be the same as the dispatched ID.\n */\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n  if (inst && event && event.dispatchConfig.registrationName) {\n    var registrationName = event.dispatchConfig.registrationName;\n    var listener = getListener(inst, registrationName);\n    if (listener) {\n      event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n      event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n    }\n  }\n}\n/**\n * Accumulates dispatches on an \\`SyntheticEvent\\`, but only for the\n * \\`dispatchMarker\\`.\n * @param {SyntheticEvent} event\n */\nfunction accumulateDirectDispatchesSingle(event) {\n  if (event && event.dispatchConfig.registrationName) {\n    accumulateDispatches(event._targetInst, null, event);\n  }\n}\nfunction accumulateTwoPhaseDispatches(events) {\n  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n  traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\nfunction accumulateDirectDispatches(events) {\n  forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n/**\n * These variables store information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar root = null;\nvar startText = null;\nvar fallbackText = null;\nfunction initialize(nativeEventTarget) {\n  root = nativeEventTarget;\n  startText = getText();\n  return true;\n}\nfunction reset() {\n  root = null;\n  startText = null;\n  fallbackText = null;\n}\nfunction getData() {\n  if (fallbackText) {\n    return fallbackText;\n  }\n  var start;\n  var startValue = startText;\n  var startLength = startValue.length;\n  var end;\n  var endValue = getText();\n  var endLength = endValue.length;\n  for (start = 0; start < startLength; start++) {\n    if (startValue[start] !== endValue[start]) {\n      break;\n    }\n  }\n  var minEnd = startLength - start;\n  for (end = 1; end <= minEnd; end++) {\n    if (startValue[startLength - end] !== endValue[endLength - end]) {\n      break;\n    }\n  }\n  var sliceTail = end > 1 ? 1 - end : undefined;\n  fallbackText = endValue.slice(start, sliceTail);\n  return fallbackText;\n}\nfunction getText() {\n  if ('value' in root) {\n    return root.value;\n  }\n  return root.textContent;\n}\nvar EVENT_POOL_SIZE = 10;\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n  type: null,\n  target: null,\n  // currentTarget is set when dispatching; no use in copying it here\n  currentTarget: function () {\n    return null;\n  },\n  eventPhase: null,\n  bubbles: null,\n  cancelable: null,\n  timeStamp: function (event) {\n    return event.timeStamp || Date.now();\n  },\n  defaultPrevented: null,\n  isTrusted: null\n};\nfunction functionThatReturnsTrue() {\n  return true;\n}\nfunction functionThatReturnsFalse() {\n  return false;\n}\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check \\`isPersistent\\` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke \\`persist\\`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n  {\n    // these have a getter/setter for warnings\n    delete this.nativeEvent;\n    delete this.preventDefault;\n    delete this.stopPropagation;\n    delete this.isDefaultPrevented;\n    delete this.isPropagationStopped;\n  }\n  this.dispatchConfig = dispatchConfig;\n  this._targetInst = targetInst;\n  this.nativeEvent = nativeEvent;\n  var Interface = this.constructor.Interface;\n  for (var propName in Interface) {\n    if (!Interface.hasOwnProperty(propName)) {\n      continue;\n    }\n    {\n      delete this[propName]; // this has a getter/setter for warnings\n    }\n    var normalize = Interface[propName];\n    if (normalize) {\n      this[propName] = normalize(nativeEvent);\n    } else {\n      if (propName === 'target') {\n        this.target = nativeEventTarget;\n      } else {\n        this[propName] = nativeEvent[propName];\n      }\n    }\n  }\n  var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n  if (defaultPrevented) {\n    this.isDefaultPrevented = functionThatReturnsTrue;\n  } else {\n    this.isDefaultPrevented = functionThatReturnsFalse;\n  }\n  this.isPropagationStopped = functionThatReturnsFalse;\n  return this;\n}\n_assign(SyntheticEvent.prototype, {\n  preventDefault: function () {\n    this.defaultPrevented = true;\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n    if (event.preventDefault) {\n      event.preventDefault();\n    } else if (typeof event.returnValue !== 'unknown') {\n      event.returnValue = false;\n    }\n    this.isDefaultPrevented = functionThatReturnsTrue;\n  },\n  stopPropagation: function () {\n    var event = this.nativeEvent;\n    if (!event) {\n      return;\n    }\n    if (event.stopPropagation) {\n      event.stopPropagation();\n    } else if (typeof event.cancelBubble !== 'unknown') {\n      // The ChangeEventPlugin registers a \\\\\"propertychange\\\\\" event for\n      // IE. This event does not support bubbling or cancelling, and\n      // any references to cancelBubble throw \\\\\"Member not found\\\\\".  A\n      // typeof check of \\\\\"unknown\\\\\" circumvents this issue (and is also\n      // IE specific).\n      event.cancelBubble = true;\n    }\n    this.isPropagationStopped = functionThatReturnsTrue;\n  },\n  /**\n   * We release all dispatched \\`SyntheticEvent\\`s after each event loop, adding\n   * them back into the pool. This allows a way to hold onto a reference that\n   * won't be added back into the pool.\n   */\n  persist: function () {\n    this.isPersistent = functionThatReturnsTrue;\n  },\n  /**\n   * Checks if this event should be released back into the pool.\n   *\n   * @return {boolean} True if this should not be released, false otherwise.\n   */\n  isPersistent: functionThatReturnsFalse,\n  /**\n   * \\`PooledClass\\` looks for \\`destructor\\` on each instance it releases.\n   */\n  destructor: function () {\n    var Interface = this.constructor.Interface;\n    for (var propName in Interface) {\n      {\n        Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n      }\n    }\n    this.dispatchConfig = null;\n    this._targetInst = null;\n    this.nativeEvent = null;\n    this.isDefaultPrevented = functionThatReturnsFalse;\n    this.isPropagationStopped = functionThatReturnsFalse;\n    this._dispatchListeners = null;\n    this._dispatchInstances = null;\n    {\n      Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n      Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));\n      Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));\n      Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));\n      Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));\n    }\n  }\n});\nSyntheticEvent.Interface = EventInterface;\n/**\n * Helper to reduce boilerplate when creating subclasses.\n */\nSyntheticEvent.extend = function (Interface) {\n  var Super = this;\n  var E = function () {};\n  E.prototype = Super.prototype;\n  var prototype = new E();\n  function Class() {\n    return Super.apply(this, arguments);\n  }\n  _assign(prototype, Class.prototype);\n  Class.prototype = prototype;\n  Class.prototype.constructor = Class;\n  Class.Interface = _assign({}, Super.Interface, Interface);\n  Class.extend = Super.extend;\n  addEventPoolingTo(Class);\n  return Class;\n};\naddEventPoolingTo(SyntheticEvent);\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n  var isFunction = typeof getVal === 'function';\n  return {\n    configurable: true,\n    set: set,\n    get: get\n  };\n  function set(val) {\n    var action = isFunction ? 'setting the method' : 'setting the property';\n    warn(action, 'This is effectively a no-op');\n    return val;\n  }\n  function get() {\n    var action = isFunction ? 'accessing the method' : 'accessing the property';\n    var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n    warn(action, result);\n    return getVal;\n  }\n  function warn(action, result) {\n    {\n      error(\\\\\"This synthetic event is reused for performance reasons. If you're seeing this, \\\\\" + \\\\\"you're %s \\`%s\\` on a released/nullified synthetic event. %s. \\\\\" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);\n    }\n  }\n}\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n  var EventConstructor = this;\n  if (EventConstructor.eventPool.length) {\n    var instance = EventConstructor.eventPool.pop();\n    EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n    return instance;\n  }\n  return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\nfunction releasePooledEvent(event) {\n  var EventConstructor = this;\n  if (!(event instanceof EventConstructor)) {\n    {\n      throw Error( \\\\\"Trying to release an event instance into a pool of a different type.\\\\\" );\n    }\n  }\n  event.destructor();\n  if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n    EventConstructor.eventPool.push(event);\n  }\n}\nfunction addEventPoolingTo(EventConstructor) {\n  EventConstructor.eventPool = [];\n  EventConstructor.getPooled = getPooledEvent;\n  EventConstructor.release = releasePooledEvent;\n}\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\nvar SyntheticCompositionEvent = SyntheticEvent.extend({\n  data: null\n});\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n *      /#events-inputevents\n */\nvar SyntheticInputEvent = SyntheticEvent.extend({\n  data: null\n});\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\nvar documentMode = null;\nif (canUseDOM && 'documentMode' in document) {\n  documentMode = document.documentMode;\n} // Webkit offers a very useful \\`textInput\\` event that can be used to\n// directly represent \\`beforeInput\\`. The IE \\`textinput\\` event is not as\n// useful, so we don't use it.\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\\\\\\\u3000) are not recorded correctly.\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.\nvar eventTypes = {\n  beforeInput: {\n    phasedRegistrationNames: {\n      bubbled: 'onBeforeInput',\n      captured: 'onBeforeInputCapture'\n    },\n    dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]\n  },\n  compositionEnd: {\n    phasedRegistrationNames: {\n      bubbled: 'onCompositionEnd',\n      captured: 'onCompositionEndCapture'\n    },\n    dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n  },\n  compositionStart: {\n    phasedRegistrationNames: {\n      bubbled: 'onCompositionStart',\n      captured: 'onCompositionStartCapture'\n    },\n    dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n  },\n  compositionUpdate: {\n    phasedRegistrationNames: {\n      bubbled: 'onCompositionUpdate',\n      captured: 'onCompositionUpdateCapture'\n    },\n    dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]\n  }\n}; // Track whether we've ever handled a keypress on the space key.\nvar hasSpaceKeypress = false;\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires \\`keypress\\` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\nfunction isKeypressCommand(nativeEvent) {\n  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n  !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\nfunction getCompositionEventType(topLevelType) {\n  switch (topLevelType) {\n    case TOP_COMPOSITION_START:\n      return eventTypes.compositionStart;\n    case TOP_COMPOSITION_END:\n      return eventTypes.compositionEnd;\n    case TOP_COMPOSITION_UPDATE:\n      return eventTypes.compositionUpdate;\n  }\n}\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\n  return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;\n}\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\n  switch (topLevelType) {\n    case TOP_KEY_UP:\n      // Command keys insert or clear IME input.\n      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n    case TOP_KEY_DOWN:\n      // Expect IME keyCode on each keydown. If we get any other\n      // code we must have exited earlier.\n      return nativeEvent.keyCode !== START_KEYCODE;\n    case TOP_KEY_PRESS:\n    case TOP_MOUSE_DOWN:\n    case TOP_BLUR:\n      // Events are not possible without cancelling IME.\n      return true;\n    default:\n      return false;\n  }\n}\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the \\`data\\` property populated in the \\`detail\\` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\nfunction getDataFromCustomEvent(nativeEvent) {\n  var detail = nativeEvent.detail;\n  if (typeof detail === 'object' && 'data' in detail) {\n    return detail.data;\n  }\n  return null;\n}\n/**\n * Check if a composition event was triggered by Korean IME.\n * Our fallback mode does not work well with IE's Korean IME,\n * so just use native composition events when Korean IME is used.\n * Although CompositionEvent.locale property is deprecated,\n * it is available in IE, where our fallback mode is enabled.\n *\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isUsingKoreanIME(nativeEvent) {\n  return nativeEvent.locale === 'ko';\n} // Track the current IME composition status, if any.\nvar isComposing = false;\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var eventType;\n  var fallbackData;\n  if (canUseCompositionEvent) {\n    eventType = getCompositionEventType(topLevelType);\n  } else if (!isComposing) {\n    if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n      eventType = eventTypes.compositionStart;\n    }\n  } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n    eventType = eventTypes.compositionEnd;\n  }\n  if (!eventType) {\n    return null;\n  }\n  if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\n    // The current composition is stored statically and must not be\n    // overwritten while composition continues.\n    if (!isComposing && eventType === eventTypes.compositionStart) {\n      isComposing = initialize(nativeEventTarget);\n    } else if (eventType === eventTypes.compositionEnd) {\n      if (isComposing) {\n        fallbackData = getData();\n      }\n    }\n  }\n  var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\n  if (fallbackData) {\n    // Inject data generated from fallback path into the synthetic event.\n    // This matches the property of native CompositionEventInterface.\n    event.data = fallbackData;\n  } else {\n    var customData = getDataFromCustomEvent(nativeEvent);\n    if (customData !== null) {\n      event.data = customData;\n    }\n  }\n  accumulateTwoPhaseDispatches(event);\n  return event;\n}\n/**\n * @param {TopLevelType} topLevelType Number from \\`TopLevelType\\`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The string corresponding to this \\`beforeInput\\` event.\n */\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\n  switch (topLevelType) {\n    case TOP_COMPOSITION_END:\n      return getDataFromCustomEvent(nativeEvent);\n    case TOP_KEY_PRESS:\n      /**\n       * If native \\`textInput\\` events are available, our goal is to make\n       * use of them. However, there is a special case: the spacebar key.\n       * In Webkit, preventing default on a spacebar \\`textInput\\` event\n       * cancels character insertion, but it *also* causes the browser\n       * to fall back to its default spacebar behavior of scrolling the\n       * page.\n       *\n       * Tracking at:\n       * https://code.google.com/p/chromium/issues/detail?id=355103\n       *\n       * To avoid this issue, use the keypress event as if no \\`textInput\\`\n       * event is available.\n       */\n      var which = nativeEvent.which;\n      if (which !== SPACEBAR_CODE) {\n        return null;\n      }\n      hasSpaceKeypress = true;\n      return SPACEBAR_CHAR;\n    case TOP_TEXT_INPUT:\n      // Record the characters to be added to the DOM.\n      var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled\n      // it at the keypress level and bail immediately. Android Chrome\n      // doesn't give us keycodes, so we need to ignore it.\n      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n        return null;\n      }\n      return chars;\n    default:\n      // For other native event types, do nothing.\n      return null;\n  }\n}\n/**\n * For browsers that do not provide the \\`textInput\\` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\n * @param {number} topLevelType Number from \\`TopLevelEventTypes\\`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The fallback string for this \\`beforeInput\\` event.\n */\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\n  // If we are currently composing (IME) and using a fallback to do so,\n  // try to extract the composed characters from the fallback object.\n  // If composition event is available, we extract a string only at\n  // compositionevent, otherwise extract it at fallback events.\n  if (isComposing) {\n    if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n      var chars = getData();\n      reset();\n      isComposing = false;\n      return chars;\n    }\n    return null;\n  }\n  switch (topLevelType) {\n    case TOP_PASTE:\n      // If a paste event occurs after a keypress, throw out the input\n      // chars. Paste events should not lead to BeforeInput events.\n      return null;\n    case TOP_KEY_PRESS:\n      /**\n       * As of v27, Firefox may fire keypress events even when no character\n       * will be inserted. A few possibilities:\n       *\n       * - \\`which\\` is \\`0\\`. Arrow keys, Esc key, etc.\n       *\n       * - \\`which\\` is the pressed key code, but no char is available.\n       *   Ex: 'AltGr + d\\` in Polish. There is no modified character for\n       *   this key combination and no character is inserted into the\n       *   document, but FF fires the keypress for char code \\`100\\` anyway.\n       *   No \\`input\\` event will occur.\n       *\n       * - \\`which\\` is the pressed key code, but a command combination is\n       *   being used. Ex: \\`Cmd+C\\`. No character is inserted, and no\n       *   \\`input\\` event will occur.\n       */\n      if (!isKeypressCommand(nativeEvent)) {\n        // IE fires the \\`keypress\\` event when a user types an emoji via\n        // Touch keyboard of Windows.  In such a case, the \\`char\\` property\n        // holds an emoji character like \\`\\\\\\\\uD83D\\\\\\\\uDE0A\\`.  Because its length\n        // is 2, the property \\`which\\` does not represent an emoji correctly.\n        // In such a case, we directly return the \\`char\\` property instead of\n        // using \\`which\\`.\n        if (nativeEvent.char && nativeEvent.char.length > 1) {\n          return nativeEvent.char;\n        } else if (nativeEvent.which) {\n          return String.fromCharCode(nativeEvent.which);\n        }\n      }\n      return null;\n    case TOP_COMPOSITION_END:\n      return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n    default:\n      return null;\n  }\n}\n/**\n * Extract a SyntheticInputEvent for \\`beforeInput\\`, based on either native\n * \\`textInput\\` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\nfunction extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n  var chars;\n  if (canUseTextInputEvent) {\n    chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n  } else {\n    chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n  } // If no characters are being inserted, no BeforeInput event should\n  // be fired.\n  if (!chars) {\n    return null;\n  }\n  var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\n  event.data = chars;\n  accumulateTwoPhaseDispatches(event);\n  return event;\n}\n/**\n * Create an \\`onBeforeInput\\` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native \\`textInput\\` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * \\`onKeyPress\\` and \\`onCompositionEnd\\`, but before \\`onInput\\`.\n *\n * \\`beforeInput\\` is spec'd but not implemented in any browsers, and\n * the \\`input\\` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, \\`textInput\\` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting \\`composition\\` events, thus\n * allowing us to share composition fallback code for both \\`beforeInput\\` and\n * \\`composition\\` event types.\n */\nvar BeforeInputEventPlugin = {\n  eventTypes: eventTypes,\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n    var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n    var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n    if (composition === null) {\n      return beforeInput;\n    }\n    if (beforeInput === null) {\n      return composition;\n    }\n    return [composition, beforeInput];\n  }\n};\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n  color: true,\n  date: true,\n  datetime: true,\n  'datetime-local': true,\n  email: true,\n  month: true,\n  number: true,\n  password: true,\n  range: true,\n  search: true,\n  tel: true,\n  text: true,\n  time: true,\n  url: true,\n  week: true\n};\nfunction isTextInputElement(elem) {\n  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n  if (nodeName === 'input') {\n    return !!supportedInputTypes[elem.type];\n  }\n  if (nodeName === 'textarea') {\n    return true;\n  }\n  return false;\n}\nvar eventTypes$1 = {\n  change: {\n    phasedRegistrationNames: {\n      bubbled: 'onChange',\n      captured: 'onChangeCapture'\n    },\n    dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]\n  }\n};\nfunction createAndAccumulateChangeEvent(inst, nativeEvent, target) {\n  var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);\n  event.type = 'change'; // Flag this event loop as needing state restore.\n  enqueueStateRestore(target);\n  accumulateTwoPhaseDispatches(event);\n  return event;\n}\n/**\n * For IE shims\n */\nvar activeElement = null;\nvar activeElementInst = null;\n/**\n * SECTION: handle \\`change\\` event\n */\nfunction shouldUseChangeEvent(elem) {\n  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\nfunction manualDispatchChangeEvent(nativeEvent) {\n  var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the\n  // other events and have it go through ReactBrowserEventEmitter. Since it\n  // doesn't, we manually listen for the events and so we have to enqueue and\n  // process the abstract event manually.\n  //\n  // Batching is necessary here in order to ensure that all event handlers run\n  // before the next rerender (including event handlers attached to ancestor\n  // elements instead of directly on the input). Without this, controlled\n  // components don't work properly in conjunction with event bubbling because\n  // the component is rerendered and the value reverted before all the event\n  // handlers can run. See https://github.com/facebook/react/issues/708.\n  batchedUpdates(runEventInBatch, event);\n}\nfunction runEventInBatch(event) {\n  runEventsInBatch(event);\n}\nfunction getInstIfValueChanged(targetInst) {\n  var targetNode = getNodeFromInstance$1(targetInst);\n  if (updateValueIfChanged(targetNode)) {\n    return targetInst;\n  }\n}\nfunction getTargetInstForChangeEvent(topLevelType, targetInst) {\n  if (topLevelType === TOP_CHANGE) {\n    return targetInst;\n  }\n}\n/**\n * SECTION: handle \\`input\\` event\n */\nvar isInputEventSupported = false;\nif (canUseDOM) {\n  // IE9 claims to support the input event but fails to trigger it when\n  // deleting text, so we ignore its input events.\n  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);\n}\n/**\n * (For IE <=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n */\nfunction startWatchingForValueChange(target, targetInst) {\n  activeElement = target;\n  activeElementInst = targetInst;\n  activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n/**\n * (For IE <=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n */\nfunction stopWatchingForValueChange() {\n  if (!activeElement) {\n    return;\n  }\n  activeElement.detachEvent('onpropertychange', handlePropertyChange);\n  activeElement = null;\n  activeElementInst = null;\n}\n/**\n * (For IE <=9) Handles a propertychange event, sending a \\`change\\` event if\n * the value of the active element has changed.\n */\nfunction handlePropertyChange(nativeEvent) {\n  if (nativeEvent.propertyName !== 'value') {\n    return;\n  }\n  if (getInstIfValueChanged(activeElementInst)) {\n    manualDispatchChangeEvent(nativeEvent);\n  }\n}\nfunction handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {\n  if (topLevelType === TOP_FOCUS) {\n    // In IE9, propertychange fires for most input events but is buggy and\n    // doesn't fire when text is deleted, but conveniently, selectionchange\n    // appears to fire in all of the remaining cases so we catch those and\n    // forward the event if the value has changed\n    // In either case, we don't want to call the event handler if the value\n    // is changed from JS so we redefine a setter for \\`.value\\` that updates\n    // our activeElementValue variable, allowing us to ignore those changes\n    //\n    // stopWatching() should be a noop here but we call it just in case we\n    // missed a blur event somehow.\n    stopWatchingForValueChange();\n    startWatchingForValueChange(target, targetInst);\n  } else if (topLevelType === TOP_BLUR) {\n    stopWatchingForValueChange();\n  }\n} // For IE8 and IE9.\nfunction getTargetInstForInputEventPolyfill(topLevelType, targetInst) {\n  if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {\n    // On the selectionchange event, the target is just document which isn't\n    // helpful for us so just check activeElement instead.\n    //\n    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n    // propertychange on the first input event after setting \\`value\\` from a\n    // script and fires only keydown, keypress, keyup. Catching keyup usually\n    // gets it and catching keydown lets us fire an event for the first\n    // keystroke if user does a key repeat (it'll be a little delayed: right\n    // before the second keystroke). Other input methods (e.g., paste) seem to\n    // fire selectionchange normally.\n    return getInstIfValueChanged(activeElementInst);\n  }\n}\n/**\n * SECTION: handle \\`click\\` event\n */\nfunction shouldUseClickEvent(elem) {\n  // Use the \\`click\\` event to detect changes to checkbox and radio inputs.\n  // This approach works across all browsers, whereas \\`change\\` does not fire\n  // until \\`blur\\` in IE8.\n  var nodeName = elem.nodeName;\n  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\nfunction getTargetInstForClickEvent(topLevelType, targetInst) {\n  if (topLevelType === TOP_CLICK) {\n    return getInstIfValueChanged(targetInst);\n  }\n}\nfunction getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {\n  if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {\n    return getInstIfValueChanged(targetInst);\n  }\n}\nfunction handleControlledInputBlur(node) {\n  var state = node._wrapperState;\n  if (!state || !state.controlled || node.type !== 'number') {\n    return;\n  }\n  {\n    // If controlled, assign the value attribute to the current value on blur\n    setDefaultValue(node, 'number', node.value);\n  }\n}\n/**\n * This plugin creates an \\`onChange\\` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see \\`isTextInputElement\\`)\n * - textarea\n * - select\n */\nvar ChangeEventPlugin = {\n  eventTypes: eventTypes$1,\n  _isInputEventSupported: isInputEventSupported,\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n    var getTargetInstFunc, handleEventFunc;\n    if (shouldUseChangeEvent(targetNode)) {\n      getTargetInstFunc = getTargetInstForChangeEvent;\n    } else if (isTextInputElement(targetNode)) {\n      if (isInputEventSupported) {\n        getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n      } else {\n        getTargetInstFunc = getTargetInstForInputEventPolyfill;\n        handleEventFunc = handleEventsForInputEventPolyfill;\n      }\n    } else if (shouldUseClickEvent(targetNode)) {\n      getTargetInstFunc = getTargetInstForClickEvent;\n    }\n    if (getTargetInstFunc) {\n      var inst = getTargetInstFunc(topLevelType, targetInst);\n      if (inst) {\n        var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);\n        return event;\n      }\n    }\n    if (handleEventFunc) {\n      handleEventFunc(topLevelType, targetNode, targetInst);\n    } // When blurring, set the value attribute for number inputs\n    if (topLevelType === TOP_BLUR) {\n      handleControlledInputBlur(targetNode);\n    }\n  }\n};\nvar SyntheticUIEvent = SyntheticEvent.extend({\n  view: null,\n  detail: null\n});\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\nvar modifierKeyToProp = {\n  Alt: 'altKey',\n  Control: 'ctrlKey',\n  Meta: 'metaKey',\n  Shift: 'shiftKey'\n}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support\n// getModifierState. If getModifierState is not supported, we map it to a set of\n// modifier keys exposed by the event. In this case, Lock-keys are not supported.\nfunction modifierStateGetter(keyArg) {\n  var syntheticEvent = this;\n  var nativeEvent = syntheticEvent.nativeEvent;\n  if (nativeEvent.getModifierState) {\n    return nativeEvent.getModifierState(keyArg);\n  }\n  var keyProp = modifierKeyToProp[keyArg];\n  return keyProp ? !!nativeEvent[keyProp] : false;\n}\nfunction getEventModifierState(nativeEvent) {\n  return modifierStateGetter;\n}\nvar previousScreenX = 0;\nvar previousScreenY = 0; // Use flags to signal movementX/Y has already been set\nvar isMovementXSet = false;\nvar isMovementYSet = false;\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar SyntheticMouseEvent = SyntheticUIEvent.extend({\n  screenX: null,\n  screenY: null,\n  clientX: null,\n  clientY: null,\n  pageX: null,\n  pageY: null,\n  ctrlKey: null,\n  shiftKey: null,\n  altKey: null,\n  metaKey: null,\n  getModifierState: getEventModifierState,\n  button: null,\n  buttons: null,\n  relatedTarget: function (event) {\n    return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);\n  },\n  movementX: function (event) {\n    if ('movementX' in event) {\n      return event.movementX;\n    }\n    var screenX = previousScreenX;\n    previousScreenX = event.screenX;\n    if (!isMovementXSet) {\n      isMovementXSet = true;\n      return 0;\n    }\n    return event.type === 'mousemove' ? event.screenX - screenX : 0;\n  },\n  movementY: function (event) {\n    if ('movementY' in event) {\n      return event.movementY;\n    }\n    var screenY = previousScreenY;\n    previousScreenY = event.screenY;\n    if (!isMovementYSet) {\n      isMovementYSet = true;\n      return 0;\n    }\n    return event.type === 'mousemove' ? event.screenY - screenY : 0;\n  }\n});\n/**\n * @interface PointerEvent\n * @see http://www.w3.org/TR/pointerevents/\n */\nvar SyntheticPointerEvent = SyntheticMouseEvent.extend({\n  pointerId: null,\n  width: null,\n  height: null,\n  pressure: null,\n  tangentialPressure: null,\n  tiltX: null,\n  tiltY: null,\n  twist: null,\n  pointerType: null,\n  isPrimary: null\n});\nvar eventTypes$2 = {\n  mouseEnter: {\n    registrationName: 'onMouseEnter',\n    dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]\n  },\n  mouseLeave: {\n    registrationName: 'onMouseLeave',\n    dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]\n  },\n  pointerEnter: {\n    registrationName: 'onPointerEnter',\n    dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]\n  },\n  pointerLeave: {\n    registrationName: 'onPointerLeave',\n    dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]\n  }\n};\nvar EnterLeaveEventPlugin = {\n  eventTypes: eventTypes$2,\n  /**\n   * For almost every interaction we care about, there will be both a top-level\n   * \\`mouseover\\` and \\`mouseout\\` event that occurs. Only use \\`mouseout\\` so that\n   * we do not extract duplicate events. However, moving the mouse into the\n   * browser from outside will not fire a \\`mouseout\\` event. In this case, we use\n   * the \\`mouseover\\` top-level event.\n   */\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n    var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;\n    var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;\n    if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {\n      // If this is an over event with a target, then we've already dispatched\n      // the event in the out event of the other target. If this is replayed,\n      // then it's because we couldn't dispatch against this target previously\n      // so we have to do it now instead.\n      return null;\n    }\n    if (!isOutEvent && !isOverEvent) {\n      // Must not be a mouse or pointer in or out - ignoring.\n      return null;\n    }\n    var win;\n    if (nativeEventTarget.window === nativeEventTarget) {\n      // \\`nativeEventTarget\\` is probably a window object.\n      win = nativeEventTarget;\n    } else {\n      // TODO: Figure out why \\`ownerDocument\\` is sometimes undefined in IE8.\n      var doc = nativeEventTarget.ownerDocument;\n      if (doc) {\n        win = doc.defaultView || doc.parentWindow;\n      } else {\n        win = window;\n      }\n    }\n    var from;\n    var to;\n    if (isOutEvent) {\n      from = targetInst;\n      var related = nativeEvent.relatedTarget || nativeEvent.toElement;\n      to = related ? getClosestInstanceFromNode(related) : null;\n      if (to !== null) {\n        var nearestMounted = getNearestMountedFiber(to);\n        if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {\n          to = null;\n        }\n      }\n    } else {\n      // Moving to a node from outside the window.\n      from = null;\n      to = targetInst;\n    }\n    if (from === to) {\n      // Nothing pertains to our managed components.\n      return null;\n    }\n    var eventInterface, leaveEventType, enterEventType, eventTypePrefix;\n    if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {\n      eventInterface = SyntheticMouseEvent;\n      leaveEventType = eventTypes$2.mouseLeave;\n      enterEventType = eventTypes$2.mouseEnter;\n      eventTypePrefix = 'mouse';\n    } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {\n      eventInterface = SyntheticPointerEvent;\n      leaveEventType = eventTypes$2.pointerLeave;\n      enterEventType = eventTypes$2.pointerEnter;\n      eventTypePrefix = 'pointer';\n    }\n    var fromNode = from == null ? win : getNodeFromInstance$1(from);\n    var toNode = to == null ? win : getNodeFromInstance$1(to);\n    var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);\n    leave.type = eventTypePrefix + 'leave';\n    leave.target = fromNode;\n    leave.relatedTarget = toNode;\n    var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);\n    enter.type = eventTypePrefix + 'enter';\n    enter.target = toNode;\n    enter.relatedTarget = fromNode;\n    accumulateEnterLeaveDispatches(leave, enter, from, to); // If we are not processing the first ancestor, then we\n    // should not process the same nativeEvent again, as we\n    // will have already processed it in the first ancestor.\n    if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) {\n      return [leave];\n    }\n    return [leave, enter];\n  }\n};\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n  ;\n}\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\nvar hasOwnProperty$2 = Object.prototype.hasOwnProperty;\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n  if (objectIs(objA, objB)) {\n    return true;\n  }\n  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n    return false;\n  }\n  var keysA = Object.keys(objA);\n  var keysB = Object.keys(objB);\n  if (keysA.length !== keysB.length) {\n    return false;\n  } // Test for A's keys different from B.\n  for (var i = 0; i < keysA.length; i++) {\n    if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n  return true;\n}\nvar skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;\nvar eventTypes$3 = {\n  select: {\n    phasedRegistrationNames: {\n      bubbled: 'onSelect',\n      captured: 'onSelectCapture'\n    },\n    dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]\n  }\n};\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n/**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n *\n * @param {DOMElement} node\n * @return {object}\n */\nfunction getSelection$1(node) {\n  if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n    return {\n      start: node.selectionStart,\n      end: node.selectionEnd\n    };\n  } else {\n    var win = node.ownerDocument && node.ownerDocument.defaultView || window;\n    var selection = win.getSelection();\n    return {\n      anchorNode: selection.anchorNode,\n      anchorOffset: selection.anchorOffset,\n      focusNode: selection.focusNode,\n      focusOffset: selection.focusOffset\n    };\n  }\n}\n/**\n * Get document associated with the event target.\n *\n * @param {object} nativeEventTarget\n * @return {Document}\n */\nfunction getEventTargetDocument(eventTarget) {\n  return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;\n}\n/**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @param {object} nativeEventTarget\n * @return {?SyntheticEvent}\n */\nfunction constructSelectEvent(nativeEvent, nativeEventTarget) {\n  // Ensure we have the right element, and that the user is not dragging a\n  // selection (this matches native \\`select\\` event behavior). In HTML5, select\n  // fires only on input and textarea thus if there's no focused element we\n  // won't dispatch.\n  var doc = getEventTargetDocument(nativeEventTarget);\n  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {\n    return null;\n  } // Only fire when selection has actually changed.\n  var currentSelection = getSelection$1(activeElement$1);\n  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n    lastSelection = currentSelection;\n    var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);\n    syntheticEvent.type = 'select';\n    syntheticEvent.target = activeElement$1;\n    accumulateTwoPhaseDispatches(syntheticEvent);\n    return syntheticEvent;\n  }\n  return null;\n}\n/**\n * This plugin creates an \\`onSelect\\` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see \\`isTextInputElement\\`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n */\nvar SelectEventPlugin = {\n  eventTypes: eventTypes$3,\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, container) {\n    var containerOrDoc = container || getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do\n    // not extract events. See #3639.\n    if (!containerOrDoc || !isListeningToAllDependencies('onSelect', containerOrDoc)) {\n      return null;\n    }\n    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;\n    switch (topLevelType) {\n      // Track the input node that has focus.\n      case TOP_FOCUS:\n        if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n          activeElement$1 = targetNode;\n          activeElementInst$1 = targetInst;\n          lastSelection = null;\n        }\n        break;\n      case TOP_BLUR:\n        activeElement$1 = null;\n        activeElementInst$1 = null;\n        lastSelection = null;\n        break;\n      // Don't fire the event while the user is dragging. This matches the\n      // semantics of the native select event.\n      case TOP_MOUSE_DOWN:\n        mouseDown = true;\n        break;\n      case TOP_CONTEXT_MENU:\n      case TOP_MOUSE_UP:\n      case TOP_DRAG_END:\n        mouseDown = false;\n        return constructSelectEvent(nativeEvent, nativeEventTarget);\n      // Chrome and IE fire non-standard event when selection is changed (and\n      // sometimes when it hasn't). IE's event fires out of order with respect\n      // to key and input events on deletion, so we discard it.\n      //\n      // Firefox doesn't support selectionchange, so check selection status\n      // after each key entry. The selection changes after keydown and before\n      // keyup, but we check on keydown as well in the case of holding down a\n      // key, when multiple keydown events are fired but only one keyup is.\n      // This is also our approach for IE handling, for the reason above.\n      case TOP_SELECTION_CHANGE:\n        if (skipSelectionChangeEvent) {\n          break;\n        }\n      // falls through\n      case TOP_KEY_DOWN:\n      case TOP_KEY_UP:\n        return constructSelectEvent(nativeEvent, nativeEventTarget);\n    }\n    return null;\n  }\n};\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\nvar SyntheticAnimationEvent = SyntheticEvent.extend({\n  animationName: null,\n  elapsedTime: null,\n  pseudoElement: null\n});\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\nvar SyntheticClipboardEvent = SyntheticEvent.extend({\n  clipboardData: function (event) {\n    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n  }\n});\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar SyntheticFocusEvent = SyntheticUIEvent.extend({\n  relatedTarget: null\n});\n/**\n * \\`charCode\\` represents the actual \\\\\"character code\\\\\" and is safe to use with\n * \\`String.fromCharCode\\`. As such, only keys that correspond to printable\n * characters produce a valid \\`charCode\\`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a \\`charCode\\`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized \\`charCode\\` property.\n */\nfunction getEventCharCode(nativeEvent) {\n  var charCode;\n  var keyCode = nativeEvent.keyCode;\n  if ('charCode' in nativeEvent) {\n    charCode = nativeEvent.charCode; // FF does not set \\`charCode\\` for the Enter-key, check against \\`keyCode\\`.\n    if (charCode === 0 && keyCode === 13) {\n      charCode = 13;\n    }\n  } else {\n    // IE8 does not implement \\`charCode\\`, but \\`keyCode\\` has the correct value.\n    charCode = keyCode;\n  } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)\n  // report Enter as charCode 10 when ctrl is pressed.\n  if (charCode === 10) {\n    charCode = 13;\n  } // Some non-printable keys are reported in \\`charCode\\`/\\`keyCode\\`, discard them.\n  // Must not discard the (non-)printable Enter-key.\n  if (charCode >= 32 || charCode === 13) {\n    return charCode;\n  }\n  return 0;\n}\n/**\n * Normalization of deprecated HTML5 \\`key\\` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\nvar normalizeKey = {\n  Esc: 'Escape',\n  Spacebar: ' ',\n  Left: 'ArrowLeft',\n  Up: 'ArrowUp',\n  Right: 'ArrowRight',\n  Down: 'ArrowDown',\n  Del: 'Delete',\n  Win: 'OS',\n  Menu: 'ContextMenu',\n  Apps: 'ContextMenu',\n  Scroll: 'ScrollLock',\n  MozPrintableKey: 'Unidentified'\n};\n/**\n * Translation from legacy \\`keyCode\\` to HTML5 \\`key\\`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\nvar translateToKey = {\n  '8': 'Backspace',\n  '9': 'Tab',\n  '12': 'Clear',\n  '13': 'Enter',\n  '16': 'Shift',\n  '17': 'Control',\n  '18': 'Alt',\n  '19': 'Pause',\n  '20': 'CapsLock',\n  '27': 'Escape',\n  '32': ' ',\n  '33': 'PageUp',\n  '34': 'PageDown',\n  '35': 'End',\n  '36': 'Home',\n  '37': 'ArrowLeft',\n  '38': 'ArrowUp',\n  '39': 'ArrowRight',\n  '40': 'ArrowDown',\n  '45': 'Insert',\n  '46': 'Delete',\n  '112': 'F1',\n  '113': 'F2',\n  '114': 'F3',\n  '115': 'F4',\n  '116': 'F5',\n  '117': 'F6',\n  '118': 'F7',\n  '119': 'F8',\n  '120': 'F9',\n  '121': 'F10',\n  '122': 'F11',\n  '123': 'F12',\n  '144': 'NumLock',\n  '145': 'ScrollLock',\n  '224': 'Meta'\n};\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized \\`key\\` property.\n */\nfunction getEventKey(nativeEvent) {\n  if (nativeEvent.key) {\n    // Normalize inconsistent values reported by browsers due to\n    // implementations of a working draft specification.\n    // FireFox implements \\`key\\` but returns \\`MozPrintableKey\\` for all\n    // printable characters (normalized to \\`Unidentified\\`), ignore it.\n    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n    if (key !== 'Unidentified') {\n      return key;\n    }\n  } // Browser does not implement \\`key\\`, polyfill as much of it as we can.\n  if (nativeEvent.type === 'keypress') {\n    var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can\n    // thus be captured by \\`keypress\\`, no other non-printable key should.\n    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n  }\n  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n    // While user keyboard layout determines the actual meaning of each\n    // \\`keyCode\\` value, almost all function keys have a universal value.\n    return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n  }\n  return '';\n}\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar SyntheticKeyboardEvent = SyntheticUIEvent.extend({\n  key: getEventKey,\n  location: null,\n  ctrlKey: null,\n  shiftKey: null,\n  altKey: null,\n  metaKey: null,\n  repeat: null,\n  locale: null,\n  getModifierState: getEventModifierState,\n  // Legacy Interface\n  charCode: function (event) {\n    // \\`charCode\\` is the result of a KeyPress event and represents the value of\n    // the actual printable character.\n    // KeyPress is deprecated, but its replacement is not yet final and not\n    // implemented in any major browser. Only KeyPress has charCode.\n    if (event.type === 'keypress') {\n      return getEventCharCode(event);\n    }\n    return 0;\n  },\n  keyCode: function (event) {\n    // \\`keyCode\\` is the result of a KeyDown/Up event and represents the value of\n    // physical keyboard key.\n    // The actual meaning of the value depends on the users' keyboard layout\n    // which cannot be detected. Assuming that it is a US keyboard layout\n    // provides a surprisingly accurate mapping for US and European users.\n    // Due to this, it is left to the user to implement at this time.\n    if (event.type === 'keydown' || event.type === 'keyup') {\n      return event.keyCode;\n    }\n    return 0;\n  },\n  which: function (event) {\n    // \\`which\\` is an alias for either \\`keyCode\\` or \\`charCode\\` depending on the\n    // type of the event.\n    if (event.type === 'keypress') {\n      return getEventCharCode(event);\n    }\n    if (event.type === 'keydown' || event.type === 'keyup') {\n      return event.keyCode;\n    }\n    return 0;\n  }\n});\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar SyntheticDragEvent = SyntheticMouseEvent.extend({\n  dataTransfer: null\n});\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\nvar SyntheticTouchEvent = SyntheticUIEvent.extend({\n  touches: null,\n  targetTouches: null,\n  changedTouches: null,\n  altKey: null,\n  metaKey: null,\n  ctrlKey: null,\n  shiftKey: null,\n  getModifierState: getEventModifierState\n});\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\nvar SyntheticTransitionEvent = SyntheticEvent.extend({\n  propertyName: null,\n  elapsedTime: null,\n  pseudoElement: null\n});\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar SyntheticWheelEvent = SyntheticMouseEvent.extend({\n  deltaX: function (event) {\n    return 'deltaX' in event ? event.deltaX : // Fallback to \\`wheelDeltaX\\` for Webkit and normalize (right is positive).\n    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n  },\n  deltaY: function (event) {\n    return 'deltaY' in event ? event.deltaY : // Fallback to \\`wheelDeltaY\\` for Webkit and normalize (down is positive).\n    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to \\`wheelDelta\\` for IE<9 and normalize (down is positive).\n    'wheelDelta' in event ? -event.wheelDelta : 0;\n  },\n  deltaZ: null,\n  // Browsers without \\\\\"deltaMode\\\\\" is reporting in raw wheel delta where one\n  // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n  deltaMode: null\n});\nvar knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];\nvar SimpleEventPlugin = {\n  // simpleEventPluginEventTypes gets populated from\n  // the DOMEventProperties module.\n  eventTypes: simpleEventPluginEventTypes,\n  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n    var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType);\n    if (!dispatchConfig) {\n      return null;\n    }\n    var EventConstructor;\n    switch (topLevelType) {\n      case TOP_KEY_PRESS:\n        // Firefox creates a keypress event for function keys too. This removes\n        // the unwanted keypress events. Enter is however both printable and\n        // non-printable. One would expect Tab to be as well (but it isn't).\n        if (getEventCharCode(nativeEvent) === 0) {\n          return null;\n        }\n      /* falls through */\n      case TOP_KEY_DOWN:\n      case TOP_KEY_UP:\n        EventConstructor = SyntheticKeyboardEvent;\n        break;\n      case TOP_BLUR:\n      case TOP_FOCUS:\n        EventConstructor = SyntheticFocusEvent;\n        break;\n      case TOP_CLICK:\n        // Firefox creates a click event on right mouse clicks. This removes the\n        // unwanted click events.\n        if (nativeEvent.button === 2) {\n          return null;\n        }\n      /* falls through */\n      case TOP_AUX_CLICK:\n      case TOP_DOUBLE_CLICK:\n      case TOP_MOUSE_DOWN:\n      case TOP_MOUSE_MOVE:\n      case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events\n      /* falls through */\n      case TOP_MOUSE_OUT:\n      case TOP_MOUSE_OVER:\n      case TOP_CONTEXT_MENU:\n        EventConstructor = SyntheticMouseEvent;\n        break;\n      case TOP_DRAG:\n      case TOP_DRAG_END:\n      case TOP_DRAG_ENTER:\n      case TOP_DRAG_EXIT:\n      case TOP_DRAG_LEAVE:\n      case TOP_DRAG_OVER:\n      case TOP_DRAG_START:\n      case TOP_DROP:\n        EventConstructor = SyntheticDragEvent;\n        break;\n      case TOP_TOUCH_CANCEL:\n      case TOP_TOUCH_END:\n      case TOP_TOUCH_MOVE:\n      case TOP_TOUCH_START:\n        EventConstructor = SyntheticTouchEvent;\n        break;\n      case TOP_ANIMATION_END:\n      case TOP_ANIMATION_ITERATION:\n      case TOP_ANIMATION_START:\n        EventConstructor = SyntheticAnimationEvent;\n        break;\n      case TOP_TRANSITION_END:\n        EventConstructor = SyntheticTransitionEvent;\n        break;\n      case TOP_SCROLL:\n        EventConstructor = SyntheticUIEvent;\n        break;\n      case TOP_WHEEL:\n        EventConstructor = SyntheticWheelEvent;\n        break;\n      case TOP_COPY:\n      case TOP_CUT:\n      case TOP_PASTE:\n        EventConstructor = SyntheticClipboardEvent;\n        break;\n      case TOP_GOT_POINTER_CAPTURE:\n      case TOP_LOST_POINTER_CAPTURE:\n      case TOP_POINTER_CANCEL:\n      case TOP_POINTER_DOWN:\n      case TOP_POINTER_MOVE:\n      case TOP_POINTER_OUT:\n      case TOP_POINTER_OVER:\n      case TOP_POINTER_UP:\n        EventConstructor = SyntheticPointerEvent;\n        break;\n      default:\n        {\n          if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {\n            error('SimpleEventPlugin: Unhandled event type, \\`%s\\`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);\n          }\n        } // HTML Events\n        // @see http://www.w3.org/TR/html5/index.html#events-0\n        EventConstructor = SyntheticEvent;\n        break;\n    }\n    var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);\n    accumulateTwoPhaseDispatches(event);\n    return event;\n  }\n};\n/**\n * Specifies a deterministic ordering of \\`EventPlugin\\`s. A convenient way to\n * reason about plugins, without having to package every one of them. This\n * is better than having plugins be ordered in the same order that they\n * are injected because that ordering would be influenced by the packaging order.\n * \\`ResponderEventPlugin\\` must occur before \\`SimpleEventPlugin\\` so that\n * preventing default on events is convenient in \\`SimpleEventPlugin\\` handlers.\n */\nvar DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];\n/**\n * Inject modules for resolving DOM hierarchy and plugin ordering.\n */\ninjectEventPluginOrder(DOMEventPluginOrder);\nsetComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);\n/**\n * Some important event plugins included by default (without having to require\n * them).\n */\ninjectEventPluginsByName({\n  SimpleEventPlugin: SimpleEventPlugin,\n  EnterLeaveEventPlugin: EnterLeaveEventPlugin,\n  ChangeEventPlugin: ChangeEventPlugin,\n  SelectEventPlugin: SelectEventPlugin,\n  BeforeInputEventPlugin: BeforeInputEventPlugin\n});\n// Prefix measurements so that it's possible to filter them.\n// Longer prefixes are hard to read in DevTools.\nvar reactEmoji = \\\\\"\\\\\\\\u269B\\\\\";\nvar warningEmoji = \\\\\"\\\\\\\\u26D4\\\\\";\nvar supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.\n// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?\nvar currentFiber = null; // If we're in the middle of user code, which fiber and method is it?\n// Reusing \\`currentFiber\\` would be confusing for this because user code fiber\n// can change during commit phase too, but we don't need to unwind it (since\n// lifecycles in the commit phase don't resemble a tree).\nvar currentPhase = null;\nvar currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,\n// so we will keep track of it, and include it in the report.\n// Track commits caused by cascading updates.\nvar isCommitting = false;\nvar hasScheduledUpdateInCurrentCommit = false;\nvar hasScheduledUpdateInCurrentPhase = false;\nvar commitCountInCurrentWorkLoop = 0;\nvar effectCountInCurrentCommit = 0;\n// to avoid stretch the commit phase with measurement overhead.\nvar labelsInCurrentCommit = new Set();\nvar formatMarkName = function (markName) {\n  return reactEmoji + \\\\\" \\\\\" + markName;\n};\nvar formatLabel = function (label, warning) {\n  var prefix = warning ? warningEmoji + \\\\\" \\\\\" : reactEmoji + \\\\\" \\\\\";\n  var suffix = warning ? \\\\\" Warning: \\\\\" + warning : '';\n  return \\\\\"\\\\\" + prefix + label + suffix;\n};\nvar beginMark = function (markName) {\n  performance.mark(formatMarkName(markName));\n};\nvar clearMark = function (markName) {\n  performance.clearMarks(formatMarkName(markName));\n};\nvar endMark = function (label, markName, warning) {\n  var formattedMarkName = formatMarkName(markName);\n  var formattedLabel = formatLabel(label, warning);\n  try {\n    performance.measure(formattedLabel, formattedMarkName);\n  } catch (err) {} // If previous mark was missing for some reason, this will throw.\n  // This could only happen if React crashed in an unexpected place earlier.\n  // Don't pile on with more errors.\n  // Clear marks immediately to avoid growing buffer.\n  performance.clearMarks(formattedMarkName);\n  performance.clearMeasures(formattedLabel);\n};\nvar getFiberMarkName = function (label, debugID) {\n  return label + \\\\\" (#\\\\\" + debugID + \\\\\")\\\\\";\n};\nvar getFiberLabel = function (componentName, isMounted, phase) {\n  if (phase === null) {\n    // These are composite component total time measurements.\n    return componentName + \\\\\" [\\\\\" + (isMounted ? 'update' : 'mount') + \\\\\"]\\\\\";\n  } else {\n    // Composite component methods.\n    return componentName + \\\\\".\\\\\" + phase;\n  }\n};\nvar beginFiberMark = function (fiber, phase) {\n  var componentName = getComponentName(fiber.type) || 'Unknown';\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  if (isCommitting && labelsInCurrentCommit.has(label)) {\n    // During the commit phase, we don't show duplicate labels because\n    // there is a fixed overhead for every measurement, and we don't\n    // want to stretch the commit phase beyond necessary.\n    return false;\n  }\n  labelsInCurrentCommit.add(label);\n  var markName = getFiberMarkName(label, debugID);\n  beginMark(markName);\n  return true;\n};\nvar clearFiberMark = function (fiber, phase) {\n  var componentName = getComponentName(fiber.type) || 'Unknown';\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  var markName = getFiberMarkName(label, debugID);\n  clearMark(markName);\n};\nvar endFiberMark = function (fiber, phase, warning) {\n  var componentName = getComponentName(fiber.type) || 'Unknown';\n  var debugID = fiber._debugID;\n  var isMounted = fiber.alternate !== null;\n  var label = getFiberLabel(componentName, isMounted, phase);\n  var markName = getFiberMarkName(label, debugID);\n  endMark(label, markName, warning);\n};\nvar shouldIgnoreFiber = function (fiber) {\n  // Host components should be skipped in the timeline.\n  // We could check typeof fiber.type, but does this work with RN?\n  switch (fiber.tag) {\n    case HostRoot:\n    case HostComponent:\n    case HostText:\n    case HostPortal:\n    case Fragment:\n    case ContextProvider:\n    case ContextConsumer:\n    case Mode:\n      return true;\n    default:\n      return false;\n  }\n};\nvar clearPendingPhaseMeasurement = function () {\n  if (currentPhase !== null && currentPhaseFiber !== null) {\n    clearFiberMark(currentPhaseFiber, currentPhase);\n  }\n  currentPhaseFiber = null;\n  currentPhase = null;\n  hasScheduledUpdateInCurrentPhase = false;\n};\nvar pauseTimers = function () {\n  // Stops all currently active measurements so that they can be resumed\n  // if we continue in a later deferred loop from the same unit of work.\n  var fiber = currentFiber;\n  while (fiber) {\n    if (fiber._debugIsCurrentlyTiming) {\n      endFiberMark(fiber, null, null);\n    }\n    fiber = fiber.return;\n  }\n};\nvar resumeTimersRecursively = function (fiber) {\n  if (fiber.return !== null) {\n    resumeTimersRecursively(fiber.return);\n  }\n  if (fiber._debugIsCurrentlyTiming) {\n    beginFiberMark(fiber, null);\n  }\n};\nvar resumeTimers = function () {\n  // Resumes all measurements that were active during the last deferred loop.\n  if (currentFiber !== null) {\n    resumeTimersRecursively(currentFiber);\n  }\n};\nfunction recordEffect() {\n  {\n    effectCountInCurrentCommit++;\n  }\n}\nfunction recordScheduleUpdate() {\n  {\n    if (isCommitting) {\n      hasScheduledUpdateInCurrentCommit = true;\n    }\n    if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {\n      hasScheduledUpdateInCurrentPhase = true;\n    }\n  }\n}\nfunction startWorkTimer(fiber) {\n  {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    } // If we pause, this is the fiber to unwind from.\n    currentFiber = fiber;\n    if (!beginFiberMark(fiber, null)) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = true;\n  }\n}\nfunction cancelWorkTimer(fiber) {\n  {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    } // Remember we shouldn't complete measurement for this fiber.\n    // Otherwise flamechart will be deep even for small updates.\n    fiber._debugIsCurrentlyTiming = false;\n    clearFiberMark(fiber, null);\n  }\n}\nfunction stopWorkTimer(fiber) {\n  {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    } // If we pause, its parent is the fiber to unwind from.\n    currentFiber = fiber.return;\n    if (!fiber._debugIsCurrentlyTiming) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = false;\n    endFiberMark(fiber, null, null);\n  }\n}\nfunction stopFailedWorkTimer(fiber) {\n  {\n    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {\n      return;\n    } // If we pause, its parent is the fiber to unwind from.\n    currentFiber = fiber.return;\n    if (!fiber._debugIsCurrentlyTiming) {\n      return;\n    }\n    fiber._debugIsCurrentlyTiming = false;\n    var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';\n    endFiberMark(fiber, null, warning);\n  }\n}\nfunction startPhaseTimer(fiber, phase) {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    clearPendingPhaseMeasurement();\n    if (!beginFiberMark(fiber, phase)) {\n      return;\n    }\n    currentPhaseFiber = fiber;\n    currentPhase = phase;\n  }\n}\nfunction stopPhaseTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    if (currentPhase !== null && currentPhaseFiber !== null) {\n      var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;\n      endFiberMark(currentPhaseFiber, currentPhase, warning);\n    }\n    currentPhase = null;\n    currentPhaseFiber = null;\n  }\n}\nfunction startWorkLoopTimer(nextUnitOfWork) {\n  {\n    currentFiber = nextUnitOfWork;\n    if (!supportsUserTiming) {\n      return;\n    }\n    commitCountInCurrentWorkLoop = 0; // This is top level call.\n    // Any other measurements are performed within.\n    beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.\n    resumeTimers();\n  }\n}\nfunction stopWorkLoopTimer(interruptedBy, didCompleteRoot) {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var warning = null;\n    if (interruptedBy !== null) {\n      if (interruptedBy.tag === HostRoot) {\n        warning = 'A top-level update interrupted the previous render';\n      } else {\n        var componentName = getComponentName(interruptedBy.type) || 'Unknown';\n        warning = \\\\\"An update to \\\\\" + componentName + \\\\\" interrupted the previous render\\\\\";\n      }\n    } else if (commitCountInCurrentWorkLoop > 1) {\n      warning = 'There were cascading updates';\n    }\n    commitCountInCurrentWorkLoop = 0;\n    var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.\n    pauseTimers();\n    endMark(label, '(React Tree Reconciliation)', warning);\n  }\n}\nfunction startCommitTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    isCommitting = true;\n    hasScheduledUpdateInCurrentCommit = false;\n    labelsInCurrentCommit.clear();\n    beginMark('(Committing Changes)');\n  }\n}\nfunction stopCommitTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var warning = null;\n    if (hasScheduledUpdateInCurrentCommit) {\n      warning = 'Lifecycle hook scheduled a cascading update';\n    } else if (commitCountInCurrentWorkLoop > 0) {\n      warning = 'Caused by a cascading update in earlier commit';\n    }\n    hasScheduledUpdateInCurrentCommit = false;\n    commitCountInCurrentWorkLoop++;\n    isCommitting = false;\n    labelsInCurrentCommit.clear();\n    endMark('(Committing Changes)', '(Committing Changes)', warning);\n  }\n}\nfunction startCommitSnapshotEffectsTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark('(Committing Snapshot Effects)');\n  }\n}\nfunction stopCommitSnapshotEffectsTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark(\\\\\"(Committing Snapshot Effects: \\\\\" + count + \\\\\" Total)\\\\\", '(Committing Snapshot Effects)', null);\n  }\n}\nfunction startCommitHostEffectsTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark('(Committing Host Effects)');\n  }\n}\nfunction stopCommitHostEffectsTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark(\\\\\"(Committing Host Effects: \\\\\" + count + \\\\\" Total)\\\\\", '(Committing Host Effects)', null);\n  }\n}\nfunction startCommitLifeCyclesTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    effectCountInCurrentCommit = 0;\n    beginMark('(Calling Lifecycle Methods)');\n  }\n}\nfunction stopCommitLifeCyclesTimer() {\n  {\n    if (!supportsUserTiming) {\n      return;\n    }\n    var count = effectCountInCurrentCommit;\n    effectCountInCurrentCommit = 0;\n    endMark(\\\\\"(Calling Lifecycle Methods: \\\\\" + count + \\\\\" Total)\\\\\", '(Calling Lifecycle Methods)', null);\n  }\n}\nvar valueStack = [];\nvar fiberStack;\n{\n  fiberStack = [];\n}\nvar index = -1;\nfunction createCursor(defaultValue) {\n  return {\n    current: defaultValue\n  };\n}\nfunction pop(cursor, fiber) {\n  if (index < 0) {\n    {\n      error('Unexpected pop.');\n    }\n    return;\n  }\n  {\n    if (fiber !== fiberStack[index]) {\n      error('Unexpected Fiber popped.');\n    }\n  }\n  cursor.current = valueStack[index];\n  valueStack[index] = null;\n  {\n    fiberStack[index] = null;\n  }\n  index--;\n}\nfunction push(cursor, value, fiber) {\n  index++;\n  valueStack[index] = cursor.current;\n  {\n    fiberStack[index] = fiber;\n  }\n  cursor.current = value;\n}\nvar warnedAboutMissingGetChildContext;\n{\n  warnedAboutMissingGetChildContext = {};\n}\nvar emptyContextObject = {};\n{\n  Object.freeze(emptyContextObject);\n} // A cursor to the current merged context object on the stack.\nvar contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.\nvar didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.\n// We use this to get access to the parent context after we have already\n// pushed the next context provider, and now need to merge their contexts.\nvar previousContext = emptyContextObject;\nfunction getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {\n  {\n    if (didPushOwnContextIfProvider && isContextProvider(Component)) {\n      // If the fiber is a context provider itself, when we read its context\n      // we may have already pushed its own child context on the stack. A context\n      // provider should not \\\\\"see\\\\\" its own child context. Therefore we read the\n      // previous (parent) context instead for a context provider.\n      return previousContext;\n    }\n    return contextStackCursor.current;\n  }\n}\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n  {\n    var instance = workInProgress.stateNode;\n    instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n    instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n  }\n}\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n  {\n    var type = workInProgress.type;\n    var contextTypes = type.contextTypes;\n    if (!contextTypes) {\n      return emptyContextObject;\n    } // Avoid recreating masked context unless unmasked context has changed.\n    // Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n    // This may trigger infinite loops if componentWillReceiveProps calls setState.\n    var instance = workInProgress.stateNode;\n    if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n      return instance.__reactInternalMemoizedMaskedChildContext;\n    }\n    var context = {};\n    for (var key in contextTypes) {\n      context[key] = unmaskedContext[key];\n    }\n    {\n      var name = getComponentName(type) || 'Unknown';\n      checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);\n    } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n    // Context is created before the class component is instantiated so check for instance.\n    if (instance) {\n      cacheContext(workInProgress, unmaskedContext, context);\n    }\n    return context;\n  }\n}\nfunction hasContextChanged() {\n  {\n    return didPerformWorkStackCursor.current;\n  }\n}\nfunction isContextProvider(type) {\n  {\n    var childContextTypes = type.childContextTypes;\n    return childContextTypes !== null && childContextTypes !== undefined;\n  }\n}\nfunction popContext(fiber) {\n  {\n    pop(didPerformWorkStackCursor, fiber);\n    pop(contextStackCursor, fiber);\n  }\n}\nfunction popTopLevelContextObject(fiber) {\n  {\n    pop(didPerformWorkStackCursor, fiber);\n    pop(contextStackCursor, fiber);\n  }\n}\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n  {\n    if (!(contextStackCursor.current === emptyContextObject)) {\n      {\n        throw Error( \\\\\"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    push(contextStackCursor, context, fiber);\n    push(didPerformWorkStackCursor, didChange, fiber);\n  }\n}\nfunction processChildContext(fiber, type, parentContext) {\n  {\n    var instance = fiber.stateNode;\n    var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n    // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n    if (typeof instance.getChildContext !== 'function') {\n      {\n        var componentName = getComponentName(type) || 'Unknown';\n        if (!warnedAboutMissingGetChildContext[componentName]) {\n          warnedAboutMissingGetChildContext[componentName] = true;\n          error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);\n        }\n      }\n      return parentContext;\n    }\n    var childContext;\n    startPhaseTimer(fiber, 'getChildContext');\n    childContext = instance.getChildContext();\n    stopPhaseTimer();\n    for (var contextKey in childContext) {\n      if (!(contextKey in childContextTypes)) {\n        {\n          throw Error( (getComponentName(type) || 'Unknown') + \\\\\".getChildContext(): key \\\\\\\\\\\\\"\\\\\" + contextKey + \\\\\"\\\\\\\\\\\\\" is not defined in childContextTypes.\\\\\" );\n        }\n      }\n    }\n    {\n      var name = getComponentName(type) || 'Unknown';\n      checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when\n      // somebody calls unstable_renderSubtreeIntoContainer() and we process\n      // context from the parent component instance. The stack will be missing\n      // because it's outside of the reconciliation, and so the pointer has not\n      // been set. This is rare and doesn't matter. We'll also remove that API.\n      getCurrentFiberStackInDev);\n    }\n    return _assign({}, parentContext, {}, childContext);\n  }\n}\nfunction pushContextProvider(workInProgress) {\n  {\n    var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.\n    // If the instance does not exist yet, we will push null at first,\n    // and replace it on the stack later when invalidating the context.\n    var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.\n    // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n    previousContext = contextStackCursor.current;\n    push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n    push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n    return true;\n  }\n}\nfunction invalidateContextProvider(workInProgress, type, didChange) {\n  {\n    var instance = workInProgress.stateNode;\n    if (!instance) {\n      {\n        throw Error( \\\\\"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    if (didChange) {\n      // Merge parent and own context.\n      // Skip this if we're not updating due to sCU.\n      // This avoids unnecessarily recomputing memoized values.\n      var mergedContext = processChildContext(workInProgress, type, previousContext);\n      instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.\n      // It is important to unwind the context in the reverse order.\n      pop(didPerformWorkStackCursor, workInProgress);\n      pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.\n      push(contextStackCursor, mergedContext, workInProgress);\n      push(didPerformWorkStackCursor, didChange, workInProgress);\n    } else {\n      pop(didPerformWorkStackCursor, workInProgress);\n      push(didPerformWorkStackCursor, didChange, workInProgress);\n    }\n  }\n}\nfunction findCurrentUnmaskedContext(fiber) {\n  {\n    // Currently this is only used with renderSubtreeIntoContainer; not sure if it\n    // makes sense elsewhere\n    if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {\n      {\n        throw Error( \\\\\"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    var node = fiber;\n    do {\n      switch (node.tag) {\n        case HostRoot:\n          return node.stateNode.context;\n        case ClassComponent:\n          {\n            var Component = node.type;\n            if (isContextProvider(Component)) {\n              return node.stateNode.__reactInternalMemoizedMergedChildContext;\n            }\n            break;\n          }\n      }\n      node = node.return;\n    } while (node !== null);\n    {\n      {\n        throw Error( \\\\\"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n  }\n}\nvar LegacyRoot = 0;\nvar BlockingRoot = 1;\nvar ConcurrentRoot = 2;\nvar Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,\n    Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,\n    Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,\n    Scheduler_shouldYield = Scheduler.unstable_shouldYield,\n    Scheduler_requestPaint = Scheduler.unstable_requestPaint,\n    Scheduler_now = Scheduler.unstable_now,\n    Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n    Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n    Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n    Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,\n    Scheduler_LowPriority = Scheduler.unstable_LowPriority,\n    Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;\n{\n  // Provide explicit error message when production+profiling bundle of e.g.\n  // react-dom is used with production (non-profiling) bundle of\n  // scheduler/tracing\n  if (!(tracing$1.__interactionsRef != null && tracing$1.__interactionsRef.current != null)) {\n    {\n      throw Error( \\\\\"It is not supported to run the profiling version of a renderer (for example, \\`react-dom/profiling\\`) without also replacing the \\`scheduler/tracing\\` module with \\`scheduler/tracing-profiling\\`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling\\\\\" );\n    }\n  }\n}\nvar fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use\n// ascending numbers so we can compare them like numbers. They start at 90 to\n// avoid clashing with Scheduler's priorities.\nvar ImmediatePriority = 99;\nvar UserBlockingPriority$1 = 98;\nvar NormalPriority = 97;\nvar LowPriority = 96;\nvar IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.\nvar NoPriority = 90;\nvar shouldYield = Scheduler_shouldYield;\nvar requestPaint = // Fall back gracefully if we're running an older version of Scheduler.\nScheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};\nvar syncQueue = null;\nvar immediateQueueCallbackNode = null;\nvar isFlushingSyncQueue = false;\nvar initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's \\`now\\` directly.\n// This will be the case for modern browsers that support \\`performance.now\\`. In\n// older browsers, Scheduler falls back to \\`Date.now\\`, which returns a Unix\n// timestamp. In that case, subtract the module initialization time to simulate\n// the behavior of performance.now and keep our times small enough to fit\n// within 32 bits.\n// TODO: Consider lifting this into Scheduler.\nvar now = initialTimeMs < 10000 ? Scheduler_now : function () {\n  return Scheduler_now() - initialTimeMs;\n};\nfunction getCurrentPriorityLevel() {\n  switch (Scheduler_getCurrentPriorityLevel()) {\n    case Scheduler_ImmediatePriority:\n      return ImmediatePriority;\n    case Scheduler_UserBlockingPriority:\n      return UserBlockingPriority$1;\n    case Scheduler_NormalPriority:\n      return NormalPriority;\n    case Scheduler_LowPriority:\n      return LowPriority;\n    case Scheduler_IdlePriority:\n      return IdlePriority;\n    default:\n      {\n        {\n          throw Error( \\\\\"Unknown priority level.\\\\\" );\n        }\n      }\n  }\n}\nfunction reactPriorityToSchedulerPriority(reactPriorityLevel) {\n  switch (reactPriorityLevel) {\n    case ImmediatePriority:\n      return Scheduler_ImmediatePriority;\n    case UserBlockingPriority$1:\n      return Scheduler_UserBlockingPriority;\n    case NormalPriority:\n      return Scheduler_NormalPriority;\n    case LowPriority:\n      return Scheduler_LowPriority;\n    case IdlePriority:\n      return Scheduler_IdlePriority;\n    default:\n      {\n        {\n          throw Error( \\\\\"Unknown priority level.\\\\\" );\n        }\n      }\n  }\n}\nfunction runWithPriority$1(reactPriorityLevel, fn) {\n  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n  return Scheduler_runWithPriority(priorityLevel, fn);\n}\nfunction scheduleCallback(reactPriorityLevel, callback, options) {\n  var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n  return Scheduler_scheduleCallback(priorityLevel, callback, options);\n}\nfunction scheduleSyncCallback(callback) {\n  // Push this callback into an internal queue. We'll flush these either in\n  // the next tick, or earlier if something calls \\`flushSyncCallbackQueue\\`.\n  if (syncQueue === null) {\n    syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.\n    immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);\n  } else {\n    // Push onto existing queue. Don't need to schedule a callback because\n    // we already scheduled one when we created the queue.\n    syncQueue.push(callback);\n  }\n  return fakeCallbackNode;\n}\nfunction cancelCallback(callbackNode) {\n  if (callbackNode !== fakeCallbackNode) {\n    Scheduler_cancelCallback(callbackNode);\n  }\n}\nfunction flushSyncCallbackQueue() {\n  if (immediateQueueCallbackNode !== null) {\n    var node = immediateQueueCallbackNode;\n    immediateQueueCallbackNode = null;\n    Scheduler_cancelCallback(node);\n  }\n  flushSyncCallbackQueueImpl();\n}\nfunction flushSyncCallbackQueueImpl() {\n  if (!isFlushingSyncQueue && syncQueue !== null) {\n    // Prevent re-entrancy.\n    isFlushingSyncQueue = true;\n    var i = 0;\n    try {\n      var _isSync = true;\n      var queue = syncQueue;\n      runWithPriority$1(ImmediatePriority, function () {\n        for (; i < queue.length; i++) {\n          var callback = queue[i];\n          do {\n            callback = callback(_isSync);\n          } while (callback !== null);\n        }\n      });\n      syncQueue = null;\n    } catch (error) {\n      // If something throws, leave the remaining callbacks on the queue.\n      if (syncQueue !== null) {\n        syncQueue = syncQueue.slice(i + 1);\n      } // Resume flushing in the next tick\n      Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);\n      throw error;\n    } finally {\n      isFlushingSyncQueue = false;\n    }\n  }\n}\nvar NoMode = 0;\nvar StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root\n// tag instead\nvar BlockingMode = 2;\nvar ConcurrentMode = 4;\nvar ProfileMode = 8;\n// Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n// Math.pow(2, 30) - 1\n// 0b111111111111111111111111111111\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\nvar NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that\n// Never work can be committed in an inconsistent state without tearing the UI.\n// The main example is offscreen content, like a hidden subtree. So one possible\n// name is Offscreen. However, it also includes dehydrated Suspense boundaries,\n// which are inconsistent in the sense that they haven't finished yet, but\n// aren't visibly inconsistent because the server rendered HTML matches what the\n// hydrated tree would look like.\nvar Never = 1; // Idle is slightly higher priority than Never. It must completely finish in\n// order to be consistent.\nvar Idle = 2; // Continuous Hydration is slightly higher than Idle and is used to increase\n// priority of hover targets.\nvar ContinuousHydration = 3;\nvar Sync = MAX_SIGNED_31_BIT_INT;\nvar Batched = Sync - 1;\nvar UNIT_SIZE = 10;\nvar MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.\nfunction msToExpirationTime(ms) {\n  // Always subtract from the offset so that we don't clash with the magic number for NoWork.\n  return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);\n}\nfunction expirationTimeToMs(expirationTime) {\n  return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;\n}\nfunction ceiling(num, precision) {\n  return ((num / precision | 0) + 1) * precision;\n}\nfunction computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {\n  return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);\n} // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update\n// the names to reflect.\nvar LOW_PRIORITY_EXPIRATION = 5000;\nvar LOW_PRIORITY_BATCH_SIZE = 250;\nfunction computeAsyncExpiration(currentTime) {\n  return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);\n}\nfunction computeSuspenseExpiration(currentTime, timeoutMs) {\n  // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?\n  return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);\n} // We intentionally set a higher expiration time for interactive updates in\n// dev than in production.\n//\n// If the main thread is being blocked so long that you hit the expiration,\n// it's a problem that could be solved with better scheduling.\n//\n// People will be more likely to notice this and fix it with the long\n// expiration time in development.\n//\n// In production we opt for better UX at the risk of masking scheduling\n// problems, by expiring fast.\nvar HIGH_PRIORITY_EXPIRATION =  500 ;\nvar HIGH_PRIORITY_BATCH_SIZE = 100;\nfunction computeInteractiveExpiration(currentTime) {\n  return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);\n}\nfunction inferPriorityFromExpirationTime(currentTime, expirationTime) {\n  if (expirationTime === Sync) {\n    return ImmediatePriority;\n  }\n  if (expirationTime === Never || expirationTime === Idle) {\n    return IdlePriority;\n  }\n  var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);\n  if (msUntil <= 0) {\n    return ImmediatePriority;\n  }\n  if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {\n    return UserBlockingPriority$1;\n  }\n  if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {\n    return NormalPriority;\n  } // TODO: Handle LowPriority\n  // Assume anything lower has idle priority\n  return IdlePriority;\n}\nvar ReactStrictModeWarnings = {\n  recordUnsafeLifecycleWarnings: function (fiber, instance) {},\n  flushPendingUnsafeLifecycleWarnings: function () {},\n  recordLegacyContextWarning: function (fiber, instance) {},\n  flushLegacyContextWarning: function () {},\n  discardPendingWarnings: function () {}\n};\n{\n  var findStrictRoot = function (fiber) {\n    var maybeStrictRoot = null;\n    var node = fiber;\n    while (node !== null) {\n      if (node.mode & StrictMode) {\n        maybeStrictRoot = node;\n      }\n      node = node.return;\n    }\n    return maybeStrictRoot;\n  };\n  var setToSortedString = function (set) {\n    var array = [];\n    set.forEach(function (value) {\n      array.push(value);\n    });\n    return array.sort().join(', ');\n  };\n  var pendingComponentWillMountWarnings = [];\n  var pendingUNSAFE_ComponentWillMountWarnings = [];\n  var pendingComponentWillReceivePropsWarnings = [];\n  var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n  var pendingComponentWillUpdateWarnings = [];\n  var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.\n  var didWarnAboutUnsafeLifecycles = new Set();\n  ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {\n    // Dedup strategy: Warn once per component.\n    if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {\n      return;\n    }\n    if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.\n    instance.componentWillMount.__suppressDeprecationWarning !== true) {\n      pendingComponentWillMountWarnings.push(fiber);\n    }\n    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {\n      pendingUNSAFE_ComponentWillMountWarnings.push(fiber);\n    }\n    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n      pendingComponentWillReceivePropsWarnings.push(fiber);\n    }\n    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n      pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);\n    }\n    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n      pendingComponentWillUpdateWarnings.push(fiber);\n    }\n    if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {\n      pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);\n    }\n  };\n  ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {\n    // We do an initial pass to gather component names\n    var componentWillMountUniqueNames = new Set();\n    if (pendingComponentWillMountWarnings.length > 0) {\n      pendingComponentWillMountWarnings.forEach(function (fiber) {\n        componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingComponentWillMountWarnings = [];\n    }\n    var UNSAFE_componentWillMountUniqueNames = new Set();\n    if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {\n      pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {\n        UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingUNSAFE_ComponentWillMountWarnings = [];\n    }\n    var componentWillReceivePropsUniqueNames = new Set();\n    if (pendingComponentWillReceivePropsWarnings.length > 0) {\n      pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {\n        componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingComponentWillReceivePropsWarnings = [];\n    }\n    var UNSAFE_componentWillReceivePropsUniqueNames = new Set();\n    if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {\n      pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {\n        UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n    }\n    var componentWillUpdateUniqueNames = new Set();\n    if (pendingComponentWillUpdateWarnings.length > 0) {\n      pendingComponentWillUpdateWarnings.forEach(function (fiber) {\n        componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingComponentWillUpdateWarnings = [];\n    }\n    var UNSAFE_componentWillUpdateUniqueNames = new Set();\n    if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {\n      pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {\n        UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutUnsafeLifecycles.add(fiber.type);\n      });\n      pendingUNSAFE_ComponentWillUpdateWarnings = [];\n    } // Finally, we flush all the warnings\n    // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'\n    if (UNSAFE_componentWillMountUniqueNames.size > 0) {\n      var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);\n      error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.' + 'Please update the following components: %s', sortedNames);\n    }\n    if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {\n      var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);\n      error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + \\\\\"* If you're updating state whenever props change, \\\\\" + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state' + 'Please update the following components: %s', _sortedNames);\n    }\n    if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {\n      var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);\n      error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + 'Please update the following components: %s', _sortedNames2);\n    }\n    if (componentWillMountUniqueNames.size > 0) {\n      var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);\n      warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '\\`npx react-codemod rename-unsafe-lifecycles\\` in your project source folder.' + 'Please update the following components: %s', _sortedNames3);\n    }\n    if (componentWillReceivePropsUniqueNames.size > 0) {\n      var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);\n      warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + \\\\\"* If you're updating state whenever props change, refactor your \\\\\" + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '\\`npx react-codemod rename-unsafe-lifecycles\\` in your project source folder.' + 'Please update the following components: %s', _sortedNames4);\n    }\n    if (componentWillUpdateUniqueNames.size > 0) {\n      var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);\n      warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.' + '* Move data fetching code or side effects to componentDidUpdate.' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '\\`npx react-codemod rename-unsafe-lifecycles\\` in your project source folder.' + 'Please update the following components: %s', _sortedNames5);\n    }\n  };\n  var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.\n  var didWarnAboutLegacyContext = new Set();\n  ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {\n    var strictRoot = findStrictRoot(fiber);\n    if (strictRoot === null) {\n      error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n      return;\n    } // Dedup strategy: Warn once per component.\n    if (didWarnAboutLegacyContext.has(fiber.type)) {\n      return;\n    }\n    var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);\n    if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {\n      if (warningsForRoot === undefined) {\n        warningsForRoot = [];\n        pendingLegacyContextWarning.set(strictRoot, warningsForRoot);\n      }\n      warningsForRoot.push(fiber);\n    }\n  };\n  ReactStrictModeWarnings.flushLegacyContextWarning = function () {\n    pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {\n      if (fiberArray.length === 0) {\n        return;\n      }\n      var firstFiber = fiberArray[0];\n      var uniqueNames = new Set();\n      fiberArray.forEach(function (fiber) {\n        uniqueNames.add(getComponentName(fiber.type) || 'Component');\n        didWarnAboutLegacyContext.add(fiber.type);\n      });\n      var sortedNames = setToSortedString(uniqueNames);\n      var firstComponentStack = getStackByFiberInDevAndProd(firstFiber);\n      error('Legacy context API has been detected within a strict-mode tree.' + 'The old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + 'Please update the following components: %s' + 'Learn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, firstComponentStack);\n    });\n  };\n  ReactStrictModeWarnings.discardPendingWarnings = function () {\n    pendingComponentWillMountWarnings = [];\n    pendingUNSAFE_ComponentWillMountWarnings = [];\n    pendingComponentWillReceivePropsWarnings = [];\n    pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n    pendingComponentWillUpdateWarnings = [];\n    pendingUNSAFE_ComponentWillUpdateWarnings = [];\n    pendingLegacyContextWarning = new Map();\n  };\n}\nvar resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.\nvar failedBoundaries = null;\nvar setRefreshHandler = function (handler) {\n  {\n    resolveFamily = handler;\n  }\n};\nfunction resolveFunctionForHotReloading(type) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return type;\n    }\n    var family = resolveFamily(type);\n    if (family === undefined) {\n      return type;\n    } // Use the latest known implementation.\n    return family.current;\n  }\n}\nfunction resolveClassForHotReloading(type) {\n  // No implementation differences.\n  return resolveFunctionForHotReloading(type);\n}\nfunction resolveForwardRefForHotReloading(type) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return type;\n    }\n    var family = resolveFamily(type);\n    if (family === undefined) {\n      // Check if we're dealing with a real forwardRef. Don't want to crash early.\n      if (type !== null && type !== undefined && typeof type.render === 'function') {\n        // ForwardRef is special because its resolved .type is an object,\n        // but it's possible that we only have its inner render function in the map.\n        // If that inner render function is different, we'll build a new forwardRef type.\n        var currentRender = resolveFunctionForHotReloading(type.render);\n        if (type.render !== currentRender) {\n          var syntheticType = {\n            $$typeof: REACT_FORWARD_REF_TYPE,\n            render: currentRender\n          };\n          if (type.displayName !== undefined) {\n            syntheticType.displayName = type.displayName;\n          }\n          return syntheticType;\n        }\n      }\n      return type;\n    } // Use the latest known implementation.\n    return family.current;\n  }\n}\nfunction isCompatibleFamilyForHotReloading(fiber, element) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return false;\n    }\n    var prevType = fiber.elementType;\n    var nextType = element.type; // If we got here, we know types aren't === equal.\n    var needsCompareFamilies = false;\n    var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;\n    switch (fiber.tag) {\n      case ClassComponent:\n        {\n          if (typeof nextType === 'function') {\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      case FunctionComponent:\n        {\n          if (typeof nextType === 'function') {\n            needsCompareFamilies = true;\n          } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n            // We don't know the inner type yet.\n            // We're going to assume that the lazy inner type is stable,\n            // and so it is sufficient to avoid reconciling it away.\n            // We're not going to unwrap or actually use the new lazy type.\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      case ForwardRef:\n        {\n          if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {\n            needsCompareFamilies = true;\n          } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      case MemoComponent:\n      case SimpleMemoComponent:\n        {\n          if ($$typeofNextType === REACT_MEMO_TYPE) {\n            // TODO: if it was but can no longer be simple,\n            // we shouldn't set this.\n            needsCompareFamilies = true;\n          } else if ($$typeofNextType === REACT_LAZY_TYPE) {\n            needsCompareFamilies = true;\n          }\n          break;\n        }\n      default:\n        return false;\n    } // Check if both types have a family and it's the same one.\n    if (needsCompareFamilies) {\n      // Note: memo() and forwardRef() we'll compare outer rather than inner type.\n      // This means both of them need to be registered to preserve state.\n      // If we unwrapped and compared the inner types for wrappers instead,\n      // then we would risk falsely saying two separate memo(Foo)\n      // calls are equivalent because they wrap the same Foo function.\n      var prevFamily = resolveFamily(prevType);\n      if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\nfunction markFailedErrorBoundaryForHotReloading(fiber) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return;\n    }\n    if (typeof WeakSet !== 'function') {\n      return;\n    }\n    if (failedBoundaries === null) {\n      failedBoundaries = new WeakSet();\n    }\n    failedBoundaries.add(fiber);\n  }\n}\nvar scheduleRefresh = function (root, update) {\n  {\n    if (resolveFamily === null) {\n      // Hot reloading is disabled.\n      return;\n    }\n    var staleFamilies = update.staleFamilies,\n        updatedFamilies = update.updatedFamilies;\n    flushPassiveEffects();\n    flushSync(function () {\n      scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);\n    });\n  }\n};\nvar scheduleRoot = function (root, element) {\n  {\n    if (root.context !== emptyContextObject) {\n      // Super edge case: root has a legacy _renderSubtree context\n      // but we don't know the parentComponent so we can't pass it.\n      // Just ignore. We'll delete this with _renderSubtree code path later.\n      return;\n    }\n    flushPassiveEffects();\n    syncUpdates(function () {\n      updateContainer(element, root, null, null);\n    });\n  }\n};\nfunction scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {\n  {\n    var alternate = fiber.alternate,\n        child = fiber.child,\n        sibling = fiber.sibling,\n        tag = fiber.tag,\n        type = fiber.type;\n    var candidateType = null;\n    switch (tag) {\n      case FunctionComponent:\n      case SimpleMemoComponent:\n      case ClassComponent:\n        candidateType = type;\n        break;\n      case ForwardRef:\n        candidateType = type.render;\n        break;\n    }\n    if (resolveFamily === null) {\n      throw new Error('Expected resolveFamily to be set during hot reload.');\n    }\n    var needsRender = false;\n    var needsRemount = false;\n    if (candidateType !== null) {\n      var family = resolveFamily(candidateType);\n      if (family !== undefined) {\n        if (staleFamilies.has(family)) {\n          needsRemount = true;\n        } else if (updatedFamilies.has(family)) {\n          if (tag === ClassComponent) {\n            needsRemount = true;\n          } else {\n            needsRender = true;\n          }\n        }\n      }\n    }\n    if (failedBoundaries !== null) {\n      if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {\n        needsRemount = true;\n      }\n    }\n    if (needsRemount) {\n      fiber._debugNeedsRemount = true;\n    }\n    if (needsRemount || needsRender) {\n      scheduleWork(fiber, Sync);\n    }\n    if (child !== null && !needsRemount) {\n      scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);\n    }\n    if (sibling !== null) {\n      scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);\n    }\n  }\n}\nvar findHostInstancesForRefresh = function (root, families) {\n  {\n    var hostInstances = new Set();\n    var types = new Set(families.map(function (family) {\n      return family.current;\n    }));\n    findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);\n    return hostInstances;\n  }\n};\nfunction findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {\n  {\n    var child = fiber.child,\n        sibling = fiber.sibling,\n        tag = fiber.tag,\n        type = fiber.type;\n    var candidateType = null;\n    switch (tag) {\n      case FunctionComponent:\n      case SimpleMemoComponent:\n      case ClassComponent:\n        candidateType = type;\n        break;\n      case ForwardRef:\n        candidateType = type.render;\n        break;\n    }\n    var didMatch = false;\n    if (candidateType !== null) {\n      if (types.has(candidateType)) {\n        didMatch = true;\n      }\n    }\n    if (didMatch) {\n      // We have a match. This only drills down to the closest host components.\n      // There's no need to search deeper because for the purpose of giving\n      // visual feedback, \\\\\"flashing\\\\\" outermost parent rectangles is sufficient.\n      findHostInstancesForFiberShallowly(fiber, hostInstances);\n    } else {\n      // If there's no match, maybe there will be one further down in the child tree.\n      if (child !== null) {\n        findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);\n      }\n    }\n    if (sibling !== null) {\n      findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);\n    }\n  }\n}\nfunction findHostInstancesForFiberShallowly(fiber, hostInstances) {\n  {\n    var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);\n    if (foundHostInstances) {\n      return;\n    } // If we didn't find any host children, fallback to closest host parent.\n    var node = fiber;\n    while (true) {\n      switch (node.tag) {\n        case HostComponent:\n          hostInstances.add(node.stateNode);\n          return;\n        case HostPortal:\n          hostInstances.add(node.stateNode.containerInfo);\n          return;\n        case HostRoot:\n          hostInstances.add(node.stateNode.containerInfo);\n          return;\n      }\n      if (node.return === null) {\n        throw new Error('Expected to reach root first.');\n      }\n      node = node.return;\n    }\n  }\n}\nfunction findChildHostInstancesForFiberShallowly(fiber, hostInstances) {\n  {\n    var node = fiber;\n    var foundHostInstances = false;\n    while (true) {\n      if (node.tag === HostComponent) {\n        // We got a match.\n        foundHostInstances = true;\n        hostInstances.add(node.stateNode); // There may still be more, so keep searching.\n      } else if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n      if (node === fiber) {\n        return foundHostInstances;\n      }\n      while (node.sibling === null) {\n        if (node.return === null || node.return === fiber) {\n          return foundHostInstances;\n        }\n        node = node.return;\n      }\n      node.sibling.return = node.return;\n      node = node.sibling;\n    }\n  }\n  return false;\n}\nfunction resolveDefaultProps(Component, baseProps) {\n  if (Component && Component.defaultProps) {\n    // Resolve default props. Taken from ReactElement\n    var props = _assign({}, baseProps);\n    var defaultProps = Component.defaultProps;\n    for (var propName in defaultProps) {\n      if (props[propName] === undefined) {\n        props[propName] = defaultProps[propName];\n      }\n    }\n    return props;\n  }\n  return baseProps;\n}\nfunction readLazyComponentType(lazyComponent) {\n  initializeLazyComponentType(lazyComponent);\n  if (lazyComponent._status !== Resolved) {\n    throw lazyComponent._result;\n  }\n  return lazyComponent._result;\n}\nvar valueCursor = createCursor(null);\nvar rendererSigil;\n{\n  // Use this to detect multiple renderers using the same context\n  rendererSigil = {};\n}\nvar currentlyRenderingFiber = null;\nvar lastContextDependency = null;\nvar lastContextWithAllBitsObserved = null;\nvar isDisallowedContextReadInDEV = false;\nfunction resetContextDependencies() {\n  // This is called right before React yields execution, to ensure \\`readContext\\`\n  // cannot be called outside the render phase.\n  currentlyRenderingFiber = null;\n  lastContextDependency = null;\n  lastContextWithAllBitsObserved = null;\n  {\n    isDisallowedContextReadInDEV = false;\n  }\n}\nfunction enterDisallowedContextReadInDEV() {\n  {\n    isDisallowedContextReadInDEV = true;\n  }\n}\nfunction exitDisallowedContextReadInDEV() {\n  {\n    isDisallowedContextReadInDEV = false;\n  }\n}\nfunction pushProvider(providerFiber, nextValue) {\n  var context = providerFiber.type._context;\n  {\n    push(valueCursor, context._currentValue, providerFiber);\n    context._currentValue = nextValue;\n    {\n      if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {\n        error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n      }\n      context._currentRenderer = rendererSigil;\n    }\n  }\n}\nfunction popProvider(providerFiber) {\n  var currentValue = valueCursor.current;\n  pop(valueCursor, providerFiber);\n  var context = providerFiber.type._context;\n  {\n    context._currentValue = currentValue;\n  }\n}\nfunction calculateChangedBits(context, newValue, oldValue) {\n  if (objectIs(oldValue, newValue)) {\n    // No change\n    return 0;\n  } else {\n    var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n    {\n      if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {\n        error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n      }\n    }\n    return changedBits | 0;\n  }\n}\nfunction scheduleWorkOnParentPath(parent, renderExpirationTime) {\n  // Update the child expiration time of all the ancestors, including\n  // the alternates.\n  var node = parent;\n  while (node !== null) {\n    var alternate = node.alternate;\n    if (node.childExpirationTime < renderExpirationTime) {\n      node.childExpirationTime = renderExpirationTime;\n      if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {\n        alternate.childExpirationTime = renderExpirationTime;\n      }\n    } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {\n      alternate.childExpirationTime = renderExpirationTime;\n    } else {\n      // Neither alternate was updated, which means the rest of the\n      // ancestor path already has sufficient priority.\n      break;\n    }\n    node = node.return;\n  }\n}\nfunction propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {\n  var fiber = workInProgress.child;\n  if (fiber !== null) {\n    // Set the return pointer of the child to the work-in-progress fiber.\n    fiber.return = workInProgress;\n  }\n  while (fiber !== null) {\n    var nextFiber = void 0; // Visit this fiber.\n    var list = fiber.dependencies;\n    if (list !== null) {\n      nextFiber = fiber.child;\n      var dependency = list.firstContext;\n      while (dependency !== null) {\n        // Check if the context matches.\n        if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {\n          // Match! Schedule an update on this fiber.\n          if (fiber.tag === ClassComponent) {\n            // Schedule a force update on the work-in-progress.\n            var update = createUpdate(renderExpirationTime, null);\n            update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the\n            // update to the current fiber, too, which means it will persist even if\n            // this render is thrown away. Since it's a race condition, not sure it's\n            // worth fixing.\n            enqueueUpdate(fiber, update);\n          }\n          if (fiber.expirationTime < renderExpirationTime) {\n            fiber.expirationTime = renderExpirationTime;\n          }\n          var alternate = fiber.alternate;\n          if (alternate !== null && alternate.expirationTime < renderExpirationTime) {\n            alternate.expirationTime = renderExpirationTime;\n          }\n          scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.\n          if (list.expirationTime < renderExpirationTime) {\n            list.expirationTime = renderExpirationTime;\n          } // Since we already found a match, we can stop traversing the\n          // dependency list.\n          break;\n        }\n        dependency = dependency.next;\n      }\n    } else if (fiber.tag === ContextProvider) {\n      // Don't scan deeper if this is a matching provider\n      nextFiber = fiber.type === workInProgress.type ? null : fiber.child;\n    } else {\n      // Traverse down.\n      nextFiber = fiber.child;\n    }\n    if (nextFiber !== null) {\n      // Set the return pointer of the child to the work-in-progress fiber.\n      nextFiber.return = fiber;\n    } else {\n      // No child. Traverse to next sibling.\n      nextFiber = fiber;\n      while (nextFiber !== null) {\n        if (nextFiber === workInProgress) {\n          // We're back to the root of this subtree. Exit.\n          nextFiber = null;\n          break;\n        }\n        var sibling = nextFiber.sibling;\n        if (sibling !== null) {\n          // Set the return pointer of the sibling to the work-in-progress fiber.\n          sibling.return = nextFiber.return;\n          nextFiber = sibling;\n          break;\n        } // No more siblings. Traverse up.\n        nextFiber = nextFiber.return;\n      }\n    }\n    fiber = nextFiber;\n  }\n}\nfunction prepareToReadContext(workInProgress, renderExpirationTime) {\n  currentlyRenderingFiber = workInProgress;\n  lastContextDependency = null;\n  lastContextWithAllBitsObserved = null;\n  var dependencies = workInProgress.dependencies;\n  if (dependencies !== null) {\n    var firstContext = dependencies.firstContext;\n    if (firstContext !== null) {\n      if (dependencies.expirationTime >= renderExpirationTime) {\n        // Context list has a pending update. Mark that this fiber performed work.\n        markWorkInProgressReceivedUpdate();\n      } // Reset the work-in-progress list\n      dependencies.firstContext = null;\n    }\n  }\n}\nfunction readContext(context, observedBits) {\n  {\n    // This warning would fire if you read context inside a Hook like useMemo.\n    // Unlike the class check below, it's not enforced in production for perf.\n    if (isDisallowedContextReadInDEV) {\n      error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n    }\n  }\n  if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {\n    var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.\n    if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {\n      // Observe all updates.\n      lastContextWithAllBitsObserved = context;\n      resolvedObservedBits = MAX_SIGNED_31_BIT_INT;\n    } else {\n      resolvedObservedBits = observedBits;\n    }\n    var contextItem = {\n      context: context,\n      observedBits: resolvedObservedBits,\n      next: null\n    };\n    if (lastContextDependency === null) {\n      if (!(currentlyRenderingFiber !== null)) {\n        {\n          throw Error( \\\\\"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().\\\\\" );\n        }\n      } // This is the first dependency for this component. Create a new list.\n      lastContextDependency = contextItem;\n      currentlyRenderingFiber.dependencies = {\n        expirationTime: NoWork,\n        firstContext: contextItem,\n        responders: null\n      };\n    } else {\n      // Append a new context item.\n      lastContextDependency = lastContextDependency.next = contextItem;\n    }\n  }\n  return  context._currentValue ;\n}\nvar UpdateState = 0;\nvar ReplaceState = 1;\nvar ForceUpdate = 2;\nvar CaptureUpdate = 3; // Global state that is reset at the beginning of calling \\`processUpdateQueue\\`.\n// It should only be read right after calling \\`processUpdateQueue\\`, via\n// \\`checkHasForceUpdateAfterProcessing\\`.\nvar hasForceUpdate = false;\nvar didWarnUpdateInsideUpdate;\nvar currentlyProcessingQueue;\n{\n  didWarnUpdateInsideUpdate = false;\n  currentlyProcessingQueue = null;\n}\nfunction initializeUpdateQueue(fiber) {\n  var queue = {\n    baseState: fiber.memoizedState,\n    baseQueue: null,\n    shared: {\n      pending: null\n    },\n    effects: null\n  };\n  fiber.updateQueue = queue;\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n  // Clone the update queue from current. Unless it's already a clone.\n  var queue = workInProgress.updateQueue;\n  var currentQueue = current.updateQueue;\n  if (queue === currentQueue) {\n    var clone = {\n      baseState: currentQueue.baseState,\n      baseQueue: currentQueue.baseQueue,\n      shared: currentQueue.shared,\n      effects: currentQueue.effects\n    };\n    workInProgress.updateQueue = clone;\n  }\n}\nfunction createUpdate(expirationTime, suspenseConfig) {\n  var update = {\n    expirationTime: expirationTime,\n    suspenseConfig: suspenseConfig,\n    tag: UpdateState,\n    payload: null,\n    callback: null,\n    next: null\n  };\n  update.next = update;\n  {\n    update.priority = getCurrentPriorityLevel();\n  }\n  return update;\n}\nfunction enqueueUpdate(fiber, update) {\n  var updateQueue = fiber.updateQueue;\n  if (updateQueue === null) {\n    // Only occurs if the fiber has been unmounted.\n    return;\n  }\n  var sharedQueue = updateQueue.shared;\n  var pending = sharedQueue.pending;\n  if (pending === null) {\n    // This is the first update. Create a circular list.\n    update.next = update;\n  } else {\n    update.next = pending.next;\n    pending.next = update;\n  }\n  sharedQueue.pending = update;\n  {\n    if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {\n      error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');\n      didWarnUpdateInsideUpdate = true;\n    }\n  }\n}\nfunction enqueueCapturedUpdate(workInProgress, update) {\n  var current = workInProgress.alternate;\n  if (current !== null) {\n    // Ensure the work-in-progress queue is a clone\n    cloneUpdateQueue(current, workInProgress);\n  } // Captured updates go only on the work-in-progress queue.\n  var queue = workInProgress.updateQueue; // Append the update to the end of the list.\n  var last = queue.baseQueue;\n  if (last === null) {\n    queue.baseQueue = update.next = update;\n    update.next = update;\n  } else {\n    update.next = last.next;\n    last.next = update;\n  }\n}\nfunction getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {\n  switch (update.tag) {\n    case ReplaceState:\n      {\n        var payload = update.payload;\n        if (typeof payload === 'function') {\n          // Updater function\n          {\n            enterDisallowedContextReadInDEV();\n            if ( workInProgress.mode & StrictMode) {\n              payload.call(instance, prevState, nextProps);\n            }\n          }\n          var nextState = payload.call(instance, prevState, nextProps);\n          {\n            exitDisallowedContextReadInDEV();\n          }\n          return nextState;\n        } // State object\n        return payload;\n      }\n    case CaptureUpdate:\n      {\n        workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;\n      }\n    // Intentional fallthrough\n    case UpdateState:\n      {\n        var _payload = update.payload;\n        var partialState;\n        if (typeof _payload === 'function') {\n          // Updater function\n          {\n            enterDisallowedContextReadInDEV();\n            if ( workInProgress.mode & StrictMode) {\n              _payload.call(instance, prevState, nextProps);\n            }\n          }\n          partialState = _payload.call(instance, prevState, nextProps);\n          {\n            exitDisallowedContextReadInDEV();\n          }\n        } else {\n          // Partial state object\n          partialState = _payload;\n        }\n        if (partialState === null || partialState === undefined) {\n          // Null and undefined are treated as no-ops.\n          return prevState;\n        } // Merge the partial state and the previous state.\n        return _assign({}, prevState, partialState);\n      }\n    case ForceUpdate:\n      {\n        hasForceUpdate = true;\n        return prevState;\n      }\n  }\n  return prevState;\n}\nfunction processUpdateQueue(workInProgress, props, instance, renderExpirationTime) {\n  // This is always non-null on a ClassComponent or HostRoot\n  var queue = workInProgress.updateQueue;\n  hasForceUpdate = false;\n  {\n    currentlyProcessingQueue = queue.shared;\n  } // The last rebase update that is NOT part of the base state.\n  var baseQueue = queue.baseQueue; // The last pending update that hasn't been processed yet.\n  var pendingQueue = queue.shared.pending;\n  if (pendingQueue !== null) {\n    // We have new updates that haven't been processed yet.\n    // We'll add them to the base queue.\n    if (baseQueue !== null) {\n      // Merge the pending queue and the base queue.\n      var baseFirst = baseQueue.next;\n      var pendingFirst = pendingQueue.next;\n      baseQueue.next = pendingFirst;\n      pendingQueue.next = baseFirst;\n    }\n    baseQueue = pendingQueue;\n    queue.shared.pending = null; // TODO: Pass \\`current\\` as argument\n    var current = workInProgress.alternate;\n    if (current !== null) {\n      var currentQueue = current.updateQueue;\n      if (currentQueue !== null) {\n        currentQueue.baseQueue = pendingQueue;\n      }\n    }\n  } // These values may change as we process the queue.\n  if (baseQueue !== null) {\n    var first = baseQueue.next; // Iterate through the list of updates to compute the result.\n    var newState = queue.baseState;\n    var newExpirationTime = NoWork;\n    var newBaseState = null;\n    var newBaseQueueFirst = null;\n    var newBaseQueueLast = null;\n    if (first !== null) {\n      var update = first;\n      do {\n        var updateExpirationTime = update.expirationTime;\n        if (updateExpirationTime < renderExpirationTime) {\n          // Priority is insufficient. Skip this update. If this is the first\n          // skipped update, the previous update/state is the new base\n          // update/state.\n          var clone = {\n            expirationTime: update.expirationTime,\n            suspenseConfig: update.suspenseConfig,\n            tag: update.tag,\n            payload: update.payload,\n            callback: update.callback,\n            next: null\n          };\n          if (newBaseQueueLast === null) {\n            newBaseQueueFirst = newBaseQueueLast = clone;\n            newBaseState = newState;\n          } else {\n            newBaseQueueLast = newBaseQueueLast.next = clone;\n          } // Update the remaining priority in the queue.\n          if (updateExpirationTime > newExpirationTime) {\n            newExpirationTime = updateExpirationTime;\n          }\n        } else {\n          // This update does have sufficient priority.\n          if (newBaseQueueLast !== null) {\n            var _clone = {\n              expirationTime: Sync,\n              // This update is going to be committed so we never want uncommit it.\n              suspenseConfig: update.suspenseConfig,\n              tag: update.tag,\n              payload: update.payload,\n              callback: update.callback,\n              next: null\n            };\n            newBaseQueueLast = newBaseQueueLast.next = _clone;\n          } // Mark the event time of this update as relevant to this render pass.\n          // TODO: This should ideally use the true event time of this update rather than\n          // its priority which is a derived and not reverseable value.\n          // TODO: We should skip this update if it was already committed but currently\n          // we have no way of detecting the difference between a committed and suspended\n          // update here.\n          markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.\n          newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);\n          var callback = update.callback;\n          if (callback !== null) {\n            workInProgress.effectTag |= Callback;\n            var effects = queue.effects;\n            if (effects === null) {\n              queue.effects = [update];\n            } else {\n              effects.push(update);\n            }\n          }\n        }\n        update = update.next;\n        if (update === null || update === first) {\n          pendingQueue = queue.shared.pending;\n          if (pendingQueue === null) {\n            break;\n          } else {\n            // An update was scheduled from inside a reducer. Add the new\n            // pending updates to the end of the list and keep processing.\n            update = baseQueue.next = pendingQueue.next;\n            pendingQueue.next = first;\n            queue.baseQueue = baseQueue = pendingQueue;\n            queue.shared.pending = null;\n          }\n        }\n      } while (true);\n    }\n    if (newBaseQueueLast === null) {\n      newBaseState = newState;\n    } else {\n      newBaseQueueLast.next = newBaseQueueFirst;\n    }\n    queue.baseState = newBaseState;\n    queue.baseQueue = newBaseQueueLast; // Set the remaining expiration time to be whatever is remaining in the queue.\n    // This should be fine because the only two other things that contribute to\n    // expiration time are props and context. We're already in the middle of the\n    // begin phase by the time we start processing the queue, so we've already\n    // dealt with the props. Context in components that specify\n    // shouldComponentUpdate is tricky; but we'll have to account for\n    // that regardless.\n    markUnprocessedUpdateTime(newExpirationTime);\n    workInProgress.expirationTime = newExpirationTime;\n    workInProgress.memoizedState = newState;\n  }\n  {\n    currentlyProcessingQueue = null;\n  }\n}\nfunction callCallback(callback, context) {\n  if (!(typeof callback === 'function')) {\n    {\n      throw Error( \\\\\"Invalid argument passed as callback. Expected a function. Instead received: \\\\\" + callback );\n    }\n  }\n  callback.call(context);\n}\nfunction resetHasForceUpdateBeforeProcessing() {\n  hasForceUpdate = false;\n}\nfunction checkHasForceUpdateAfterProcessing() {\n  return hasForceUpdate;\n}\nfunction commitUpdateQueue(finishedWork, finishedQueue, instance) {\n  // Commit the effects\n  var effects = finishedQueue.effects;\n  finishedQueue.effects = null;\n  if (effects !== null) {\n    for (var i = 0; i < effects.length; i++) {\n      var effect = effects[i];\n      var callback = effect.callback;\n      if (callback !== null) {\n        effect.callback = null;\n        callCallback(callback, instance);\n      }\n    }\n  }\n}\nvar ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;\nfunction requestCurrentSuspenseConfig() {\n  return ReactCurrentBatchConfig.suspense;\n}\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray; // React.Component uses a shared frozen object by default.\n// We'll use it to determine whether we need to initialize legacy refs.\nvar emptyRefsObject = new React.Component().refs;\nvar didWarnAboutStateAssignmentForComponent;\nvar didWarnAboutUninitializedState;\nvar didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\nvar didWarnAboutLegacyLifecyclesAndDerivedState;\nvar didWarnAboutUndefinedDerivedState;\nvar warnOnUndefinedDerivedState;\nvar warnOnInvalidCallback;\nvar didWarnAboutDirectlyAssigningPropsToState;\nvar didWarnAboutContextTypeAndContextTypes;\nvar didWarnAboutInvalidateContextType;\n{\n  didWarnAboutStateAssignmentForComponent = new Set();\n  didWarnAboutUninitializedState = new Set();\n  didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();\n  didWarnAboutLegacyLifecyclesAndDerivedState = new Set();\n  didWarnAboutDirectlyAssigningPropsToState = new Set();\n  didWarnAboutUndefinedDerivedState = new Set();\n  didWarnAboutContextTypeAndContextTypes = new Set();\n  didWarnAboutInvalidateContextType = new Set();\n  var didWarnOnInvalidCallback = new Set();\n  warnOnInvalidCallback = function (callback, callerName) {\n    if (callback === null || typeof callback === 'function') {\n      return;\n    }\n    var key = callerName + \\\\\"_\\\\\" + callback;\n    if (!didWarnOnInvalidCallback.has(key)) {\n      didWarnOnInvalidCallback.add(key);\n      error('%s(...): Expected the last optional \\`callback\\` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n    }\n  };\n  warnOnUndefinedDerivedState = function (type, partialState) {\n    if (partialState === undefined) {\n      var componentName = getComponentName(type) || 'Component';\n      if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n        didWarnAboutUndefinedDerivedState.add(componentName);\n        error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n      }\n    }\n  }; // This is so gross but it's at least non-critical and can be removed if\n  // it causes problems. This is meant to give a nicer error message for\n  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n  // ...)) which otherwise throws a \\\\\"_processChildContext is not a function\\\\\"\n  // exception.\n  Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n    enumerable: false,\n    value: function () {\n      {\n        {\n          throw Error( \\\\\"_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).\\\\\" );\n        }\n      }\n    }\n  });\n  Object.freeze(fakeInternalInstance);\n}\nfunction applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {\n  var prevState = workInProgress.memoizedState;\n  {\n    if ( workInProgress.mode & StrictMode) {\n      // Invoke the function an extra time to help detect side-effects.\n      getDerivedStateFromProps(nextProps, prevState);\n    }\n  }\n  var partialState = getDerivedStateFromProps(nextProps, prevState);\n  {\n    warnOnUndefinedDerivedState(ctor, partialState);\n  } // Merge the partial state and the previous state.\n  var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);\n  workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the\n  // base state.\n  if (workInProgress.expirationTime === NoWork) {\n    // Queue is always non-null for classes\n    var updateQueue = workInProgress.updateQueue;\n    updateQueue.baseState = memoizedState;\n  }\n}\nvar classComponentUpdater = {\n  isMounted: isMounted,\n  enqueueSetState: function (inst, payload, callback) {\n    var fiber = get(inst);\n    var currentTime = requestCurrentTimeForUpdate();\n    var suspenseConfig = requestCurrentSuspenseConfig();\n    var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n    var update = createUpdate(expirationTime, suspenseConfig);\n    update.payload = payload;\n    if (callback !== undefined && callback !== null) {\n      {\n        warnOnInvalidCallback(callback, 'setState');\n      }\n      update.callback = callback;\n    }\n    enqueueUpdate(fiber, update);\n    scheduleWork(fiber, expirationTime);\n  },\n  enqueueReplaceState: function (inst, payload, callback) {\n    var fiber = get(inst);\n    var currentTime = requestCurrentTimeForUpdate();\n    var suspenseConfig = requestCurrentSuspenseConfig();\n    var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n    var update = createUpdate(expirationTime, suspenseConfig);\n    update.tag = ReplaceState;\n    update.payload = payload;\n    if (callback !== undefined && callback !== null) {\n      {\n        warnOnInvalidCallback(callback, 'replaceState');\n      }\n      update.callback = callback;\n    }\n    enqueueUpdate(fiber, update);\n    scheduleWork(fiber, expirationTime);\n  },\n  enqueueForceUpdate: function (inst, callback) {\n    var fiber = get(inst);\n    var currentTime = requestCurrentTimeForUpdate();\n    var suspenseConfig = requestCurrentSuspenseConfig();\n    var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n    var update = createUpdate(expirationTime, suspenseConfig);\n    update.tag = ForceUpdate;\n    if (callback !== undefined && callback !== null) {\n      {\n        warnOnInvalidCallback(callback, 'forceUpdate');\n      }\n      update.callback = callback;\n    }\n    enqueueUpdate(fiber, update);\n    scheduleWork(fiber, expirationTime);\n  }\n};\nfunction checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {\n  var instance = workInProgress.stateNode;\n  if (typeof instance.shouldComponentUpdate === 'function') {\n    {\n      if ( workInProgress.mode & StrictMode) {\n        // Invoke the function an extra time to help detect side-effects.\n        instance.shouldComponentUpdate(newProps, newState, nextContext);\n      }\n    }\n    startPhaseTimer(workInProgress, 'shouldComponentUpdate');\n    var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n    stopPhaseTimer();\n    {\n      if (shouldUpdate === undefined) {\n        error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');\n      }\n    }\n    return shouldUpdate;\n  }\n  if (ctor.prototype && ctor.prototype.isPureReactComponent) {\n    return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);\n  }\n  return true;\n}\nfunction checkClassInstance(workInProgress, ctor, newProps) {\n  var instance = workInProgress.stateNode;\n  {\n    var name = getComponentName(ctor) || 'Component';\n    var renderPresent = instance.render;\n    if (!renderPresent) {\n      if (ctor.prototype && typeof ctor.prototype.render === 'function') {\n        error('%s(...): No \\`render\\` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n      } else {\n        error('%s(...): No \\`render\\` method found on the returned component ' + 'instance: you may have forgotten to define \\`render\\`.', name);\n      }\n    }\n    if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {\n      error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);\n    }\n    if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {\n      error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);\n    }\n    if (instance.propTypes) {\n      error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n    }\n    if (instance.contextType) {\n      error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);\n    }\n    {\n      if (instance.contextTypes) {\n        error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n      }\n      if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {\n        didWarnAboutContextTypeAndContextTypes.add(ctor);\n        error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);\n      }\n    }\n    if (typeof instance.componentShouldUpdate === 'function') {\n      error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);\n    }\n    if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n      error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');\n    }\n    if (typeof instance.componentDidUnmount === 'function') {\n      error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n    }\n    if (typeof instance.componentDidReceiveProps === 'function') {\n      error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n    }\n    if (typeof instance.componentWillRecieveProps === 'function') {\n      error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n    }\n    if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {\n      error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);\n    }\n    var hasMutatedProps = instance.props !== newProps;\n    if (instance.props !== undefined && hasMutatedProps) {\n      error('%s(...): When calling super() in \\`%s\\`, make sure to pass ' + \\\\\"up the same props that your component's constructor was passed.\\\\\", name, name);\n    }\n    if (instance.defaultProps) {\n      error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {\n      didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);\n      error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));\n    }\n    if (typeof instance.getDerivedStateFromProps === 'function') {\n      error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n    }\n    if (typeof instance.getDerivedStateFromError === 'function') {\n      error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n    }\n    if (typeof ctor.getSnapshotBeforeUpdate === 'function') {\n      error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);\n    }\n    var _state = instance.state;\n    if (_state && (typeof _state !== 'object' || isArray(_state))) {\n      error('%s.state: must be set to an object or null', name);\n    }\n    if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {\n      error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);\n    }\n  }\n}\nfunction adoptClassInstance(workInProgress, instance) {\n  instance.updater = classComponentUpdater;\n  workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates\n  set(instance, workInProgress);\n  {\n    instance._reactInternalInstance = fakeInternalInstance;\n  }\n}\nfunction constructClassInstance(workInProgress, ctor, props) {\n  var isLegacyContextConsumer = false;\n  var unmaskedContext = emptyContextObject;\n  var context = emptyContextObject;\n  var contextType = ctor.contextType;\n  {\n    if ('contextType' in ctor) {\n      var isValid = // Allow null for conditional declaration\n      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>\n      if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {\n        didWarnAboutInvalidateContextType.add(ctor);\n        var addendum = '';\n        if (contextType === undefined) {\n          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n        } else if (typeof contextType !== 'object') {\n          addendum = ' However, it is set to a ' + typeof contextType + '.';\n        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {\n          addendum = ' Did you accidentally pass the Context.Provider instead?';\n        } else if (contextType._context !== undefined) {\n          // <Context.Consumer>\n          addendum = ' Did you accidentally pass the Context.Consumer instead?';\n        } else {\n          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n        }\n        error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);\n      }\n    }\n  }\n  if (typeof contextType === 'object' && contextType !== null) {\n    context = readContext(contextType);\n  } else {\n    unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    var contextTypes = ctor.contextTypes;\n    isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;\n    context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;\n  } // Instantiate twice to help detect side-effects.\n  {\n    if ( workInProgress.mode & StrictMode) {\n      new ctor(props, context); // eslint-disable-line no-new\n    }\n  }\n  var instance = new ctor(props, context);\n  var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;\n  adoptClassInstance(workInProgress, instance);\n  {\n    if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {\n      var componentName = getComponentName(ctor) || 'Component';\n      if (!didWarnAboutUninitializedState.has(componentName)) {\n        didWarnAboutUninitializedState.add(componentName);\n        error('\\`%s\\` uses \\`getDerivedStateFromProps\\` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to \\`this.state\\` in the constructor of \\`%s\\`. ' + 'This ensures that \\`getDerivedStateFromProps\\` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);\n      }\n    } // If new component APIs are defined, \\\\\"unsafe\\\\\" lifecycles won't be called.\n    // Warn about these lifecycles if they are present.\n    // Don't warn about react-lifecycles-compat polyfilled methods though.\n    if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {\n      var foundWillMountName = null;\n      var foundWillReceivePropsName = null;\n      var foundWillUpdateName = null;\n      if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {\n        foundWillMountName = 'componentWillMount';\n      } else if (typeof instance.UNSAFE_componentWillMount === 'function') {\n        foundWillMountName = 'UNSAFE_componentWillMount';\n      }\n      if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n        foundWillReceivePropsName = 'componentWillReceiveProps';\n      } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n        foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n      }\n      if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n        foundWillUpdateName = 'componentWillUpdate';\n      } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n        foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n      }\n      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n        var _componentName = getComponentName(ctor) || 'Component';\n        var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n        if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n          didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n          error('Unsafe legacy lifecycles will not be called for components using new component APIs.' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s' + 'The above lifecycles should be removed. Learn more about this warning here:' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \\\\\"  \\\\\" + foundWillMountName : '', foundWillReceivePropsName !== null ? \\\\\"  \\\\\" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \\\\\"  \\\\\" + foundWillUpdateName : '');\n        }\n      }\n    }\n  } // Cache unmasked context so we can avoid recreating masked context unless necessary.\n  // ReactFiberContext usually updates this cache but can't for newly-created instances.\n  if (isLegacyContextConsumer) {\n    cacheContext(workInProgress, unmaskedContext, context);\n  }\n  return instance;\n}\nfunction callComponentWillMount(workInProgress, instance) {\n  startPhaseTimer(workInProgress, 'componentWillMount');\n  var oldState = instance.state;\n  if (typeof instance.componentWillMount === 'function') {\n    instance.componentWillMount();\n  }\n  if (typeof instance.UNSAFE_componentWillMount === 'function') {\n    instance.UNSAFE_componentWillMount();\n  }\n  stopPhaseTimer();\n  if (oldState !== instance.state) {\n    {\n      error('%s.componentWillMount(): Assigning directly to this.state is ' + \\\\\"deprecated (except inside a component's \\\\\" + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');\n    }\n    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n  }\n}\nfunction callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {\n  var oldState = instance.state;\n  startPhaseTimer(workInProgress, 'componentWillReceiveProps');\n  if (typeof instance.componentWillReceiveProps === 'function') {\n    instance.componentWillReceiveProps(newProps, nextContext);\n  }\n  if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n  }\n  stopPhaseTimer();\n  if (instance.state !== oldState) {\n    {\n      var componentName = getComponentName(workInProgress.type) || 'Component';\n      if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {\n        didWarnAboutStateAssignmentForComponent.add(componentName);\n        error('%s.componentWillReceiveProps(): Assigning directly to ' + \\\\\"this.state is deprecated (except inside a component's \\\\\" + 'constructor). Use setState instead.', componentName);\n      }\n    }\n    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n  }\n} // Invokes the mount life-cycles on a previously never rendered instance.\nfunction mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {\n  {\n    checkClassInstance(workInProgress, ctor, newProps);\n  }\n  var instance = workInProgress.stateNode;\n  instance.props = newProps;\n  instance.state = workInProgress.memoizedState;\n  instance.refs = emptyRefsObject;\n  initializeUpdateQueue(workInProgress);\n  var contextType = ctor.contextType;\n  if (typeof contextType === 'object' && contextType !== null) {\n    instance.context = readContext(contextType);\n  } else {\n    var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    instance.context = getMaskedContext(workInProgress, unmaskedContext);\n  }\n  {\n    if (instance.state === newProps) {\n      var componentName = getComponentName(ctor) || 'Component';\n      if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n        didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n        error('%s: It is not recommended to assign props directly to state ' + \\\\\"because updates to props won't be reflected in state. \\\\\" + 'In most cases, it is better to use props directly.', componentName);\n      }\n    }\n    if (workInProgress.mode & StrictMode) {\n      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);\n    }\n    {\n      ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);\n    }\n  }\n  processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n  instance.state = workInProgress.memoizedState;\n  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n  if (typeof getDerivedStateFromProps === 'function') {\n    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n    instance.state = workInProgress.memoizedState;\n  } // In order to support react-lifecycles-compat polyfilled components,\n  // Unsafe lifecycles should not be invoked for components using the new APIs.\n  if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n    callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's\n    // process them now.\n    processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n    instance.state = workInProgress.memoizedState;\n  }\n  if (typeof instance.componentDidMount === 'function') {\n    workInProgress.effectTag |= Update;\n  }\n}\nfunction resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {\n  var instance = workInProgress.stateNode;\n  var oldProps = workInProgress.memoizedProps;\n  instance.props = oldProps;\n  var oldContext = instance.context;\n  var contextType = ctor.contextType;\n  var nextContext = emptyContextObject;\n  if (typeof contextType === 'object' && contextType !== null) {\n    nextContext = readContext(contextType);\n  } else {\n    var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);\n  }\n  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n  // ever the previously attempted to render - not the \\\\\"current\\\\\". However,\n  // during componentDidUpdate we pass the \\\\\"current\\\\\" props.\n  // In order to support react-lifecycles-compat polyfilled components,\n  // Unsafe lifecycles should not be invoked for components using the new APIs.\n  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n    if (oldProps !== newProps || oldContext !== nextContext) {\n      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n    }\n  }\n  resetHasForceUpdateBeforeProcessing();\n  var oldState = workInProgress.memoizedState;\n  var newState = instance.state = oldState;\n  processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n  newState = workInProgress.memoizedState;\n  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.effectTag |= Update;\n    }\n    return false;\n  }\n  if (typeof getDerivedStateFromProps === 'function') {\n    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n    newState = workInProgress.memoizedState;\n  }\n  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n  if (shouldUpdate) {\n    // In order to support react-lifecycles-compat polyfilled components,\n    // Unsafe lifecycles should not be invoked for components using the new APIs.\n    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n      startPhaseTimer(workInProgress, 'componentWillMount');\n      if (typeof instance.componentWillMount === 'function') {\n        instance.componentWillMount();\n      }\n      if (typeof instance.UNSAFE_componentWillMount === 'function') {\n        instance.UNSAFE_componentWillMount();\n      }\n      stopPhaseTimer();\n    }\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.effectTag |= Update;\n    }\n  } else {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidMount === 'function') {\n      workInProgress.effectTag |= Update;\n    } // If shouldComponentUpdate returned false, we should still update the\n    // memoized state to indicate that this work can be reused.\n    workInProgress.memoizedProps = newProps;\n    workInProgress.memoizedState = newState;\n  } // Update the existing instance's state, props, and context pointers even\n  // if shouldComponentUpdate returns false.\n  instance.props = newProps;\n  instance.state = newState;\n  instance.context = nextContext;\n  return shouldUpdate;\n} // Invokes the update life-cycles and returns false if it shouldn't rerender.\nfunction updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {\n  var instance = workInProgress.stateNode;\n  cloneUpdateQueue(current, workInProgress);\n  var oldProps = workInProgress.memoizedProps;\n  instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);\n  var oldContext = instance.context;\n  var contextType = ctor.contextType;\n  var nextContext = emptyContextObject;\n  if (typeof contextType === 'object' && contextType !== null) {\n    nextContext = readContext(contextType);\n  } else {\n    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);\n  }\n  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what\n  // ever the previously attempted to render - not the \\\\\"current\\\\\". However,\n  // during componentDidUpdate we pass the \\\\\"current\\\\\" props.\n  // In order to support react-lifecycles-compat polyfilled components,\n  // Unsafe lifecycles should not be invoked for components using the new APIs.\n  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n    if (oldProps !== newProps || oldContext !== nextContext) {\n      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n    }\n  }\n  resetHasForceUpdateBeforeProcessing();\n  var oldState = workInProgress.memoizedState;\n  var newState = instance.state = oldState;\n  processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);\n  newState = workInProgress.memoizedState;\n  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidUpdate === 'function') {\n      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.effectTag |= Update;\n      }\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.effectTag |= Snapshot;\n      }\n    }\n    return false;\n  }\n  if (typeof getDerivedStateFromProps === 'function') {\n    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n    newState = workInProgress.memoizedState;\n  }\n  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n  if (shouldUpdate) {\n    // In order to support react-lifecycles-compat polyfilled components,\n    // Unsafe lifecycles should not be invoked for components using the new APIs.\n    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {\n      startPhaseTimer(workInProgress, 'componentWillUpdate');\n      if (typeof instance.componentWillUpdate === 'function') {\n        instance.componentWillUpdate(newProps, newState, nextContext);\n      }\n      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);\n      }\n      stopPhaseTimer();\n    }\n    if (typeof instance.componentDidUpdate === 'function') {\n      workInProgress.effectTag |= Update;\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n      workInProgress.effectTag |= Snapshot;\n    }\n  } else {\n    // If an update was already in progress, we should schedule an Update\n    // effect even though we're bailing out, so that cWU/cDU are called.\n    if (typeof instance.componentDidUpdate === 'function') {\n      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.effectTag |= Update;\n      }\n    }\n    if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n        workInProgress.effectTag |= Snapshot;\n      }\n    } // If shouldComponentUpdate returned false, we should still update the\n    // memoized props/state to indicate that this work can be reused.\n    workInProgress.memoizedProps = newProps;\n    workInProgress.memoizedState = newState;\n  } // Update the existing instance's state, props, and context pointers even\n  // if shouldComponentUpdate returns false.\n  instance.props = newProps;\n  instance.state = newState;\n  instance.context = nextContext;\n  return shouldUpdate;\n}\nvar didWarnAboutMaps;\nvar didWarnAboutGenerators;\nvar didWarnAboutStringRefs;\nvar ownerHasKeyUseWarning;\nvar ownerHasFunctionTypeWarning;\nvar warnForMissingKey = function (child) {};\n{\n  didWarnAboutMaps = false;\n  didWarnAboutGenerators = false;\n  didWarnAboutStringRefs = {};\n  /**\n   * Warn if there's no key explicitly set on dynamic arrays of children or\n   * object keys are not valid. This allows us to keep track of children between\n   * updates.\n   */\n  ownerHasKeyUseWarning = {};\n  ownerHasFunctionTypeWarning = {};\n  warnForMissingKey = function (child) {\n    if (child === null || typeof child !== 'object') {\n      return;\n    }\n    if (!child._store || child._store.validated || child.key != null) {\n      return;\n    }\n    if (!(typeof child._store === 'object')) {\n      {\n        throw Error( \\\\\"React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    child._store.validated = true;\n    var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '\\\\\"key\\\\\" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();\n    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n      return;\n    }\n    ownerHasKeyUseWarning[currentComponentErrorInfo] = true;\n    error('Each child in a list should have a unique ' + '\\\\\"key\\\\\" prop. See https://fb.me/react-warning-keys for ' + 'more information.');\n  };\n}\nvar isArray$1 = Array.isArray;\nfunction coerceRef(returnFiber, current, element) {\n  var mixedRef = element.ref;\n  if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {\n    {\n      // TODO: Clean this up once we turn on the string ref warning for\n      // everyone, because the strict mode case will no longer be relevant\n      if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs\n      // because these cannot be automatically converted to an arrow function\n      // using a codemod. Therefore, we don't have to warn about string refs again.\n      !(element._owner && element._self && element._owner.stateNode !== element._self)) {\n        var componentName = getComponentName(returnFiber.type) || 'Component';\n        if (!didWarnAboutStringRefs[componentName]) {\n          {\n            error('A string ref, \\\\\"%s\\\\\", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));\n          }\n          didWarnAboutStringRefs[componentName] = true;\n        }\n      }\n    }\n    if (element._owner) {\n      var owner = element._owner;\n      var inst;\n      if (owner) {\n        var ownerFiber = owner;\n        if (!(ownerFiber.tag === ClassComponent)) {\n          {\n            throw Error( \\\\\"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref\\\\\" );\n          }\n        }\n        inst = ownerFiber.stateNode;\n      }\n      if (!inst) {\n        {\n          throw Error( \\\\\"Missing owner for string ref \\\\\" + mixedRef + \\\\\". This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n        }\n      }\n      var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref\n      if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {\n        return current.ref;\n      }\n      var ref = function (value) {\n        var refs = inst.refs;\n        if (refs === emptyRefsObject) {\n          // This is a lazy pooled frozen object, so we need to initialize.\n          refs = inst.refs = {};\n        }\n        if (value === null) {\n          delete refs[stringRef];\n        } else {\n          refs[stringRef] = value;\n        }\n      };\n      ref._stringRef = stringRef;\n      return ref;\n    } else {\n      if (!(typeof mixedRef === 'string')) {\n        {\n          throw Error( \\\\\"Expected ref to be a function, a string, an object returned by React.createRef(), or null.\\\\\" );\n        }\n      }\n      if (!element._owner) {\n        {\n          throw Error( \\\\\"Element ref was specified as a string (\\\\\" + mixedRef + \\\\\") but no owner was set. This could happen for one of the following reasons:1. You may be adding a ref to a function component2. You may be adding a ref to a component that was not created inside a component's render method3. You have multiple copies of React loadedSee https://fb.me/react-refs-must-have-owner for more information.\\\\\" );\n        }\n      }\n    }\n  }\n  return mixedRef;\n}\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n  if (returnFiber.type !== 'textarea') {\n    var addendum = '';\n    {\n      addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();\n    }\n    {\n      {\n        throw Error( \\\\\"Objects are not valid as a React child (found: \\\\\" + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + \\\\\").\\\\\" + addendum );\n      }\n    }\n  }\n}\nfunction warnOnFunctionType() {\n  {\n    var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();\n    if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {\n      return;\n    }\n    ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;\n    error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');\n  }\n} // This wrapper function exists because I expect to clone the code in each path\n// to be able to optimize each path individually by branching early. This needs\n// a compiler or we can do it manually. Helpers that don't need this branching\n// live outside of this function.\nfunction ChildReconciler(shouldTrackSideEffects) {\n  function deleteChild(returnFiber, childToDelete) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return;\n    } // Deletions are added in reversed order so we add it to the front.\n    // At this point, the return fiber's effect list is empty except for\n    // deletions, so we can just append the deletion to the list. The remaining\n    // effects aren't added until the complete phase. Once we implement\n    // resuming, this may not be true.\n    var last = returnFiber.lastEffect;\n    if (last !== null) {\n      last.nextEffect = childToDelete;\n      returnFiber.lastEffect = childToDelete;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n    }\n    childToDelete.nextEffect = null;\n    childToDelete.effectTag = Deletion;\n  }\n  function deleteRemainingChildren(returnFiber, currentFirstChild) {\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return null;\n    } // TODO: For the shouldClone case, this could be micro-optimized a bit by\n    // assuming that after the first child we've already added everything.\n    var childToDelete = currentFirstChild;\n    while (childToDelete !== null) {\n      deleteChild(returnFiber, childToDelete);\n      childToDelete = childToDelete.sibling;\n    }\n    return null;\n  }\n  function mapRemainingChildren(returnFiber, currentFirstChild) {\n    // Add the remaining children to a temporary map so that we can find them by\n    // keys quickly. Implicit (null) keys get added to this set with their index\n    // instead.\n    var existingChildren = new Map();\n    var existingChild = currentFirstChild;\n    while (existingChild !== null) {\n      if (existingChild.key !== null) {\n        existingChildren.set(existingChild.key, existingChild);\n      } else {\n        existingChildren.set(existingChild.index, existingChild);\n      }\n      existingChild = existingChild.sibling;\n    }\n    return existingChildren;\n  }\n  function useFiber(fiber, pendingProps) {\n    // We currently set sibling to null and index to 0 here because it is easy\n    // to forget to do before returning it. E.g. for the single child case.\n    var clone = createWorkInProgress(fiber, pendingProps);\n    clone.index = 0;\n    clone.sibling = null;\n    return clone;\n  }\n  function placeChild(newFiber, lastPlacedIndex, newIndex) {\n    newFiber.index = newIndex;\n    if (!shouldTrackSideEffects) {\n      // Noop.\n      return lastPlacedIndex;\n    }\n    var current = newFiber.alternate;\n    if (current !== null) {\n      var oldIndex = current.index;\n      if (oldIndex < lastPlacedIndex) {\n        // This is a move.\n        newFiber.effectTag = Placement;\n        return lastPlacedIndex;\n      } else {\n        // This item can stay in place.\n        return oldIndex;\n      }\n    } else {\n      // This is an insertion.\n      newFiber.effectTag = Placement;\n      return lastPlacedIndex;\n    }\n  }\n  function placeSingleChild(newFiber) {\n    // This is simpler for the single child case. We only need to do a\n    // placement for inserting new children.\n    if (shouldTrackSideEffects && newFiber.alternate === null) {\n      newFiber.effectTag = Placement;\n    }\n    return newFiber;\n  }\n  function updateTextNode(returnFiber, current, textContent, expirationTime) {\n    if (current === null || current.tag !== HostText) {\n      // Insert\n      var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n      created.return = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, textContent);\n      existing.return = returnFiber;\n      return existing;\n    }\n  }\n  function updateElement(returnFiber, current, element, expirationTime) {\n    if (current !== null) {\n      if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n       isCompatibleFamilyForHotReloading(current, element) )) {\n        // Move based on index\n        var existing = useFiber(current, element.props);\n        existing.ref = coerceRef(returnFiber, current, element);\n        existing.return = returnFiber;\n        {\n          existing._debugSource = element._source;\n          existing._debugOwner = element._owner;\n        }\n        return existing;\n      }\n    } // Insert\n    var created = createFiberFromElement(element, returnFiber.mode, expirationTime);\n    created.ref = coerceRef(returnFiber, current, element);\n    created.return = returnFiber;\n    return created;\n  }\n  function updatePortal(returnFiber, current, portal, expirationTime) {\n    if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n      // Insert\n      var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n      created.return = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, portal.children || []);\n      existing.return = returnFiber;\n      return existing;\n    }\n  }\n  function updateFragment(returnFiber, current, fragment, expirationTime, key) {\n    if (current === null || current.tag !== Fragment) {\n      // Insert\n      var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);\n      created.return = returnFiber;\n      return created;\n    } else {\n      // Update\n      var existing = useFiber(current, fragment);\n      existing.return = returnFiber;\n      return existing;\n    }\n  }\n  function createChild(returnFiber, newChild, expirationTime) {\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);\n      created.return = returnFiber;\n      return created;\n    }\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);\n            _created.ref = coerceRef(returnFiber, null, newChild);\n            _created.return = returnFiber;\n            return _created;\n          }\n        case REACT_PORTAL_TYPE:\n          {\n            var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);\n            _created2.return = returnFiber;\n            return _created2;\n          }\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);\n        _created3.return = returnFiber;\n        return _created3;\n      }\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n    return null;\n  }\n  function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n    // Update the fiber if the keys match, otherwise return null.\n    var key = oldFiber !== null ? oldFiber.key : null;\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys. If the previous node is implicitly keyed\n      // we can continue to replace it without aborting even if it is not a text\n      // node.\n      if (key !== null) {\n        return null;\n      }\n      return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);\n    }\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            if (newChild.key === key) {\n              if (newChild.type === REACT_FRAGMENT_TYPE) {\n                return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);\n              }\n              return updateElement(returnFiber, oldFiber, newChild, expirationTime);\n            } else {\n              return null;\n            }\n          }\n        case REACT_PORTAL_TYPE:\n          {\n            if (newChild.key === key) {\n              return updatePortal(returnFiber, oldFiber, newChild, expirationTime);\n            } else {\n              return null;\n            }\n          }\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        if (key !== null) {\n          return null;\n        }\n        return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);\n      }\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n    return null;\n  }\n  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      // Text nodes don't have keys, so we neither have to check the old nor\n      // new node for the key. If both are text nodes, they match.\n      var matchedFiber = existingChildren.get(newIdx) || null;\n      return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);\n    }\n    if (typeof newChild === 'object' && newChild !== null) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          {\n            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            if (newChild.type === REACT_FRAGMENT_TYPE) {\n              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);\n            }\n            return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);\n          }\n        case REACT_PORTAL_TYPE:\n          {\n            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n            return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);\n          }\n      }\n      if (isArray$1(newChild) || getIteratorFn(newChild)) {\n        var _matchedFiber3 = existingChildren.get(newIdx) || null;\n        return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);\n      }\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n    return null;\n  }\n  /**\n   * Warns if there is a duplicate or missing key\n   */\n  function warnOnInvalidKey(child, knownKeys) {\n    {\n      if (typeof child !== 'object' || child === null) {\n        return knownKeys;\n      }\n      switch (child.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n        case REACT_PORTAL_TYPE:\n          warnForMissingKey(child);\n          var key = child.key;\n          if (typeof key !== 'string') {\n            break;\n          }\n          if (knownKeys === null) {\n            knownKeys = new Set();\n            knownKeys.add(key);\n            break;\n          }\n          if (!knownKeys.has(key)) {\n            knownKeys.add(key);\n            break;\n          }\n          error('Encountered two children with the same key, \\`%s\\`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n          break;\n      }\n    }\n    return knownKeys;\n  }\n  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {\n    // This algorithm can't optimize by searching from both ends since we\n    // don't have backpointers on fibers. I'm trying to see how far we can get\n    // with that model. If it ends up not being worth the tradeoffs, we can\n    // add it later.\n    // Even with a two ended optimization, we'd want to optimize for the case\n    // where there are few changes and brute force the comparison instead of\n    // going for the Map. It'd like to explore hitting that path first in\n    // forward-only mode and only go for the Map once we notice that we need\n    // lots of look ahead. This doesn't handle reversal as well as two ended\n    // search but that's unusual. Besides, for the two ended optimization to\n    // work on Iterables, we'd need to copy the whole set.\n    // In this first iteration, we'll just live with hitting the bad case\n    // (adding everything to a Map) in for every insert/move.\n    // If you change this code, also update reconcileChildrenIterator() which\n    // uses the same algorithm.\n    {\n      // First, validate keys.\n      var knownKeys = null;\n      for (var i = 0; i < newChildren.length; i++) {\n        var child = newChildren[i];\n        knownKeys = warnOnInvalidKey(child, knownKeys);\n      }\n    }\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (oldFiber === null) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n    if (newIdx === newChildren.length) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; newIdx < newChildren.length; newIdx++) {\n        var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);\n        if (_newFiber === null) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber;\n        } else {\n          previousNewFiber.sibling = _newFiber;\n        }\n        previousNewFiber = _newFiber;\n      }\n      return resultingFirstChild;\n    } // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n    for (; newIdx < newChildren.length; newIdx++) {\n      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);\n      if (_newFiber2 !== null) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber2.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber2;\n        } else {\n          previousNewFiber.sibling = _newFiber2;\n        }\n        previousNewFiber = _newFiber2;\n      }\n    }\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function (child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n    return resultingFirstChild;\n  }\n  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {\n    // This is the same implementation as reconcileChildrenArray(),\n    // but using the iterator instead.\n    var iteratorFn = getIteratorFn(newChildrenIterable);\n    if (!(typeof iteratorFn === 'function')) {\n      {\n        throw Error( \\\\\"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n      }\n    }\n    {\n      // We don't support rendering Generators because it's a mutation.\n      // See https://github.com/facebook/react/issues/12995\n      if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag\n      newChildrenIterable[Symbol.toStringTag] === 'Generator') {\n        if (!didWarnAboutGenerators) {\n          error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with \\`Array.from()\\` or the ' + '\\`[...spread]\\` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');\n        }\n        didWarnAboutGenerators = true;\n      } // Warn about using Maps as children\n      if (newChildrenIterable.entries === iteratorFn) {\n        if (!didWarnAboutMaps) {\n          error('Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.');\n        }\n        didWarnAboutMaps = true;\n      } // First, validate keys.\n      // We'll get a different iterator later for the main pass.\n      var _newChildren = iteratorFn.call(newChildrenIterable);\n      if (_newChildren) {\n        var knownKeys = null;\n        var _step = _newChildren.next();\n        for (; !_step.done; _step = _newChildren.next()) {\n          var child = _step.value;\n          knownKeys = warnOnInvalidKey(child, knownKeys);\n        }\n      }\n    }\n    var newChildren = iteratorFn.call(newChildrenIterable);\n    if (!(newChildren != null)) {\n      {\n        throw Error( \\\\\"An iterable object provided no iterator.\\\\\" );\n      }\n    }\n    var resultingFirstChild = null;\n    var previousNewFiber = null;\n    var oldFiber = currentFirstChild;\n    var lastPlacedIndex = 0;\n    var newIdx = 0;\n    var nextOldFiber = null;\n    var step = newChildren.next();\n    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n      if (oldFiber.index > newIdx) {\n        nextOldFiber = oldFiber;\n        oldFiber = null;\n      } else {\n        nextOldFiber = oldFiber.sibling;\n      }\n      var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);\n      if (newFiber === null) {\n        // TODO: This breaks on empty slots like null children. That's\n        // unfortunate because it triggers the slow path all the time. We need\n        // a better way to communicate whether this was a miss or null,\n        // boolean, undefined, etc.\n        if (oldFiber === null) {\n          oldFiber = nextOldFiber;\n        }\n        break;\n      }\n      if (shouldTrackSideEffects) {\n        if (oldFiber && newFiber.alternate === null) {\n          // We matched the slot, but we didn't reuse the existing fiber, so we\n          // need to delete the existing child.\n          deleteChild(returnFiber, oldFiber);\n        }\n      }\n      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n      if (previousNewFiber === null) {\n        // TODO: Move out of the loop. This only happens for the first run.\n        resultingFirstChild = newFiber;\n      } else {\n        // TODO: Defer siblings if we're not at the right index for this slot.\n        // I.e. if we had null values before, then we want to defer this\n        // for each null value. However, we also don't want to call updateSlot\n        // with the previous one.\n        previousNewFiber.sibling = newFiber;\n      }\n      previousNewFiber = newFiber;\n      oldFiber = nextOldFiber;\n    }\n    if (step.done) {\n      // We've reached the end of the new children. We can delete the rest.\n      deleteRemainingChildren(returnFiber, oldFiber);\n      return resultingFirstChild;\n    }\n    if (oldFiber === null) {\n      // If we don't have any more existing children we can choose a fast path\n      // since the rest will all be insertions.\n      for (; !step.done; newIdx++, step = newChildren.next()) {\n        var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n        if (_newFiber3 === null) {\n          continue;\n        }\n        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          // TODO: Move out of the loop. This only happens for the first run.\n          resultingFirstChild = _newFiber3;\n        } else {\n          previousNewFiber.sibling = _newFiber3;\n        }\n        previousNewFiber = _newFiber3;\n      }\n      return resultingFirstChild;\n    } // Add all children to a key map for quick lookups.\n    var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.\n    for (; !step.done; newIdx++, step = newChildren.next()) {\n      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);\n      if (_newFiber4 !== null) {\n        if (shouldTrackSideEffects) {\n          if (_newFiber4.alternate !== null) {\n            // The new fiber is a work in progress, but if there exists a\n            // current, that means that we reused the fiber. We need to delete\n            // it from the child list so that we don't add it to the deletion\n            // list.\n            existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n          }\n        }\n        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n        if (previousNewFiber === null) {\n          resultingFirstChild = _newFiber4;\n        } else {\n          previousNewFiber.sibling = _newFiber4;\n        }\n        previousNewFiber = _newFiber4;\n      }\n    }\n    if (shouldTrackSideEffects) {\n      // Any existing children that weren't consumed above were deleted. We need\n      // to add them to the deletion list.\n      existingChildren.forEach(function (child) {\n        return deleteChild(returnFiber, child);\n      });\n    }\n    return resultingFirstChild;\n  }\n  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {\n    // There's no need to check for keys on text nodes since we don't have a\n    // way to define them.\n    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n      // We already have an existing node so let's just update it and delete\n      // the rest.\n      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n      var existing = useFiber(currentFirstChild, textContent);\n      existing.return = returnFiber;\n      return existing;\n    } // The existing first child is not a text node so we need to create one\n    // and delete the existing ones.\n    deleteRemainingChildren(returnFiber, currentFirstChild);\n    var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);\n    created.return = returnFiber;\n    return created;\n  }\n  function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {\n    var key = element.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        switch (child.tag) {\n          case Fragment:\n            {\n              if (element.type === REACT_FRAGMENT_TYPE) {\n                deleteRemainingChildren(returnFiber, child.sibling);\n                var existing = useFiber(child, element.props.children);\n                existing.return = returnFiber;\n                {\n                  existing._debugSource = element._source;\n                  existing._debugOwner = element._owner;\n                }\n                return existing;\n              }\n              break;\n            }\n          case Block:\n          // We intentionally fallthrough here if enableBlocksAPI is not on.\n          // eslint-disable-next-lined no-fallthrough\n          default:\n            {\n              if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n               isCompatibleFamilyForHotReloading(child, element) )) {\n                deleteRemainingChildren(returnFiber, child.sibling);\n                var _existing3 = useFiber(child, element.props);\n                _existing3.ref = coerceRef(returnFiber, child, element);\n                _existing3.return = returnFiber;\n                {\n                  _existing3._debugSource = element._source;\n                  _existing3._debugOwner = element._owner;\n                }\n                return _existing3;\n              }\n              break;\n            }\n        } // Didn't match.\n        deleteRemainingChildren(returnFiber, child);\n        break;\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n    if (element.type === REACT_FRAGMENT_TYPE) {\n      var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);\n      created.return = returnFiber;\n      return created;\n    } else {\n      var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);\n      _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n      _created4.return = returnFiber;\n      return _created4;\n    }\n  }\n  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {\n    var key = portal.key;\n    var child = currentFirstChild;\n    while (child !== null) {\n      // TODO: If key === null and child.key === null, then this only applies to\n      // the first item in the list.\n      if (child.key === key) {\n        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n          deleteRemainingChildren(returnFiber, child.sibling);\n          var existing = useFiber(child, portal.children || []);\n          existing.return = returnFiber;\n          return existing;\n        } else {\n          deleteRemainingChildren(returnFiber, child);\n          break;\n        }\n      } else {\n        deleteChild(returnFiber, child);\n      }\n      child = child.sibling;\n    }\n    var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);\n    created.return = returnFiber;\n    return created;\n  } // This API will tag the children with the side-effect of the reconciliation\n  // itself. They will be added to the side-effect list as we pass through the\n  // children and the parent.\n  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n    // This function is not recursive.\n    // If the top level item is an array, we treat it as a set of children,\n    // not as a fragment. Nested arrays on the other hand will be treated as\n    // fragment nodes. Recursion happens at the normal flow.\n    // Handle top level unkeyed fragments as if they were arrays.\n    // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n    // We treat the ambiguous cases above the same.\n    var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n    if (isUnkeyedTopLevelFragment) {\n      newChild = newChild.props.children;\n    } // Handle object types\n    var isObject = typeof newChild === 'object' && newChild !== null;\n    if (isObject) {\n      switch (newChild.$$typeof) {\n        case REACT_ELEMENT_TYPE:\n          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n        case REACT_PORTAL_TYPE:\n          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n      }\n    }\n    if (typeof newChild === 'string' || typeof newChild === 'number') {\n      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n    }\n    if (isArray$1(newChild)) {\n      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n    }\n    if (getIteratorFn(newChild)) {\n      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n    }\n    if (isObject) {\n      throwOnInvalidObjectType(returnFiber, newChild);\n    }\n    {\n      if (typeof newChild === 'function') {\n        warnOnFunctionType();\n      }\n    }\n    if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n      // If the new child is undefined, and the return fiber is a composite\n      // component, throw an error. If Fiber return types are disabled,\n      // we already threw above.\n      switch (returnFiber.tag) {\n        case ClassComponent:\n          {\n            {\n              var instance = returnFiber.stateNode;\n              if (instance.render._isMockFunction) {\n                // We allow auto-mocks to proceed as if they're returning null.\n                break;\n              }\n            }\n          }\n        // Intentionally fall through to the next case, which handles both\n        // functions and classes\n        // eslint-disable-next-lined no-fallthrough\n        case FunctionComponent:\n          {\n            var Component = returnFiber.type;\n            {\n              {\n                throw Error( (Component.displayName || Component.name || 'Component') + \\\\\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\\\\\" );\n              }\n            }\n          }\n      }\n    } // Remaining cases are all treated as empty.\n    return deleteRemainingChildren(returnFiber, currentFirstChild);\n  }\n  return reconcileChildFibers;\n}\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\nfunction cloneChildFibers(current, workInProgress) {\n  if (!(current === null || workInProgress.child === current.child)) {\n    {\n      throw Error( \\\\\"Resuming work not yet implemented.\\\\\" );\n    }\n  }\n  if (workInProgress.child === null) {\n    return;\n  }\n  var currentChild = workInProgress.child;\n  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);\n  workInProgress.child = newChild;\n  newChild.return = workInProgress;\n  while (currentChild.sibling !== null) {\n    currentChild = currentChild.sibling;\n    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);\n    newChild.return = workInProgress;\n  }\n  newChild.sibling = null;\n} // Reset a workInProgress child set to prepare it for a second pass.\nfunction resetChildFibers(workInProgress, renderExpirationTime) {\n  var child = workInProgress.child;\n  while (child !== null) {\n    resetWorkInProgress(child, renderExpirationTime);\n    child = child.sibling;\n  }\n}\nvar NO_CONTEXT = {};\nvar contextStackCursor$1 = createCursor(NO_CONTEXT);\nvar contextFiberStackCursor = createCursor(NO_CONTEXT);\nvar rootInstanceStackCursor = createCursor(NO_CONTEXT);\nfunction requiredContext(c) {\n  if (!(c !== NO_CONTEXT)) {\n    {\n      throw Error( \\\\\"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  return c;\n}\nfunction getRootHostContainer() {\n  var rootInstance = requiredContext(rootInstanceStackCursor.current);\n  return rootInstance;\n}\nfunction pushHostContainer(fiber, nextRootInstance) {\n  // Push current root instance onto the stack;\n  // This allows us to reset root when portals are popped.\n  push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.\n  // This enables us to pop only Fibers that provide unique contexts.\n  push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.\n  // However, we can't just call getRootHostContext() and push it because\n  // we'd have a different number of entries on the stack depending on\n  // whether getRootHostContext() throws somewhere in renderer code or not.\n  // So we push an empty value first. This lets us safely unwind on errors.\n  push(contextStackCursor$1, NO_CONTEXT, fiber);\n  var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.\n  pop(contextStackCursor$1, fiber);\n  push(contextStackCursor$1, nextRootContext, fiber);\n}\nfunction popHostContainer(fiber) {\n  pop(contextStackCursor$1, fiber);\n  pop(contextFiberStackCursor, fiber);\n  pop(rootInstanceStackCursor, fiber);\n}\nfunction getHostContext() {\n  var context = requiredContext(contextStackCursor$1.current);\n  return context;\n}\nfunction pushHostContext(fiber) {\n  var rootInstance = requiredContext(rootInstanceStackCursor.current);\n  var context = requiredContext(contextStackCursor$1.current);\n  var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.\n  if (context === nextContext) {\n    return;\n  } // Track the context and the Fiber that provided it.\n  // This enables us to pop only Fibers that provide unique contexts.\n  push(contextFiberStackCursor, fiber, fiber);\n  push(contextStackCursor$1, nextContext, fiber);\n}\nfunction popHostContext(fiber) {\n  // Do not pop unless this Fiber provided the current context.\n  // pushHostContext() only pushes Fibers that provide unique contexts.\n  if (contextFiberStackCursor.current !== fiber) {\n    return;\n  }\n  pop(contextStackCursor$1, fiber);\n  pop(contextFiberStackCursor, fiber);\n}\nvar DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is\n// inherited deeply down the subtree. The upper bits only affect\n// this immediate suspense boundary and gets reset each new\n// boundary or suspense list.\nvar SubtreeSuspenseContextMask = 1; // Subtree Flags:\n// InvisibleParentSuspenseContext indicates that one of our parent Suspense\n// boundaries is not currently showing visible main content.\n// Either because it is already showing a fallback or is not mounted at all.\n// We can use this to determine if it is desirable to trigger a fallback at\n// the parent. If not, then we might need to trigger undesirable boundaries\n// and/or suspend the commit to avoid hiding the parent content.\nvar InvisibleParentSuspenseContext = 1; // Shallow Flags:\n// ForceSuspenseFallback can be used by SuspenseList to force newly added\n// items into their fallback state during one of the render passes.\nvar ForceSuspenseFallback = 2;\nvar suspenseStackCursor = createCursor(DefaultSuspenseContext);\nfunction hasSuspenseContext(parentContext, flag) {\n  return (parentContext & flag) !== 0;\n}\nfunction setDefaultShallowSuspenseContext(parentContext) {\n  return parentContext & SubtreeSuspenseContextMask;\n}\nfunction setShallowSuspenseContext(parentContext, shallowContext) {\n  return parentContext & SubtreeSuspenseContextMask | shallowContext;\n}\nfunction addSubtreeSuspenseContext(parentContext, subtreeContext) {\n  return parentContext | subtreeContext;\n}\nfunction pushSuspenseContext(fiber, newContext) {\n  push(suspenseStackCursor, newContext, fiber);\n}\nfunction popSuspenseContext(fiber) {\n  pop(suspenseStackCursor, fiber);\n}\nfunction shouldCaptureSuspense(workInProgress, hasInvisibleParent) {\n  // If it was the primary children that just suspended, capture and render the\n  // fallback. Otherwise, don't capture and bubble to the next boundary.\n  var nextState = workInProgress.memoizedState;\n  if (nextState !== null) {\n    if (nextState.dehydrated !== null) {\n      // A dehydrated boundary always captures.\n      return true;\n    }\n    return false;\n  }\n  var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.\n  if (props.fallback === undefined) {\n    return false;\n  } // Regular boundaries always capture.\n  if (props.unstable_avoidThisFallback !== true) {\n    return true;\n  } // If it's a boundary we should avoid, then we prefer to bubble up to the\n  // parent boundary if it is currently invisible.\n  if (hasInvisibleParent) {\n    return false;\n  } // If the parent is not able to handle it, we must handle it.\n  return true;\n}\nfunction findFirstSuspended(row) {\n  var node = row;\n  while (node !== null) {\n    if (node.tag === SuspenseComponent) {\n      var state = node.memoizedState;\n      if (state !== null) {\n        var dehydrated = state.dehydrated;\n        if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {\n          return node;\n        }\n      }\n    } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't\n    // keep track of whether it suspended or not.\n    node.memoizedProps.revealOrder !== undefined) {\n      var didSuspend = (node.effectTag & DidCapture) !== NoEffect;\n      if (didSuspend) {\n        return node;\n      }\n    } else if (node.child !== null) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === row) {\n      return null;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === row) {\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n  return null;\n}\nfunction createDeprecatedResponderListener(responder, props) {\n  var eventResponderListener = {\n    responder: responder,\n    props: props\n  };\n  {\n    Object.freeze(eventResponderListener);\n  }\n  return eventResponderListener;\n}\nvar HasEffect =\n/* */\n1; // Represents the phase in which the effect (not the clean-up) fires.\nvar Layout =\n/*    */\n2;\nvar Passive$1 =\n/*   */\n4;\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,\n    ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar didWarnAboutMismatchedHooksForComponent;\n{\n  didWarnAboutMismatchedHooksForComponent = new Set();\n}\n// These are set right before calling the component.\nvar renderExpirationTime = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from\n// the work-in-progress hook.\nvar currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The\n// current hook list is the list that belongs to the current fiber. The\n// work-in-progress hook list is a new list that will be added to the\n// work-in-progress fiber.\nvar currentHook = null;\nvar workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This\n// does not get reset if we do another render pass; only when we're completely\n// finished evaluating this component. This is an optimization so we know\n// whether we need to clear render phase updates after a throw.\nvar didScheduleRenderPhaseUpdate = false;\nvar RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook\nvar currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.\n// The list stores the order of hooks used during the initial render (mount).\n// Subsequent renders (updates) reference this list.\nvar hookTypesDev = null;\nvar hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore\n// the dependencies for Hooks that need them (e.g. useEffect or useMemo).\n// When true, such Hooks will always be \\\\\"remounted\\\\\". Only used during hot reload.\nvar ignorePreviousDependencies = false;\nfunction mountHookTypesDev() {\n  {\n    var hookName = currentHookNameInDev;\n    if (hookTypesDev === null) {\n      hookTypesDev = [hookName];\n    } else {\n      hookTypesDev.push(hookName);\n    }\n  }\n}\nfunction updateHookTypesDev() {\n  {\n    var hookName = currentHookNameInDev;\n    if (hookTypesDev !== null) {\n      hookTypesUpdateIndexDev++;\n      if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {\n        warnOnHookMismatchInDev(hookName);\n      }\n    }\n  }\n}\nfunction checkDepsAreArrayDev(deps) {\n  {\n    if (deps !== undefined && deps !== null && !Array.isArray(deps)) {\n      // Verify deps, but only on mount to avoid extra checks.\n      // It's unlikely their type would change as usually you define them inline.\n      error('%s received a final argument that is not an array (instead, received \\`%s\\`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);\n    }\n  }\n}\nfunction warnOnHookMismatchInDev(currentHookName) {\n  {\n    var componentName = getComponentName(currentlyRenderingFiber$1.type);\n    if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {\n      didWarnAboutMismatchedHooksForComponent.add(componentName);\n      if (hookTypesDev !== null) {\n        var table = '';\n        var secondColumnStart = 30;\n        for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {\n          var oldHookName = hookTypesDev[i];\n          var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;\n          var row = i + 1 + \\\\\". \\\\\" + oldHookName; // Extra space so second column lines up\n          // lol @ IE not supporting String#repeat\n          while (row.length < secondColumnStart) {\n            row += ' ';\n          }\n          row += newHookName + '';\n          table += row;\n        }\n        error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks' + '   Previous render            Next render' + '   ------------------------------------------------------' + '%s' + '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', componentName, table);\n      }\n    }\n  }\n}\nfunction throwInvalidHookError() {\n  {\n    {\n      throw Error( \\\\\"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:1. You might have mismatching versions of React and the renderer (such as React DOM)2. You might be breaking the Rules of Hooks3. You might have more than one copy of React in the same appSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.\\\\\" );\n    }\n  }\n}\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n  {\n    if (ignorePreviousDependencies) {\n      // Only true when this component is being hot reloaded.\n      return false;\n    }\n  }\n  if (prevDeps === null) {\n    {\n      error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n    }\n    return false;\n  }\n  {\n    // Don't bother comparing lengths in prod because these arrays should be\n    // passed inline.\n    if (nextDeps.length !== prevDeps.length) {\n      error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.' + 'Previous: %s' + 'Incoming: %s', currentHookNameInDev, \\\\\"[\\\\\" + prevDeps.join(', ') + \\\\\"]\\\\\", \\\\\"[\\\\\" + nextDeps.join(', ') + \\\\\"]\\\\\");\n    }\n  }\n  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {\n    if (objectIs(nextDeps[i], prevDeps[i])) {\n      continue;\n    }\n    return false;\n  }\n  return true;\n}\nfunction renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderExpirationTime) {\n  renderExpirationTime = nextRenderExpirationTime;\n  currentlyRenderingFiber$1 = workInProgress;\n  {\n    hookTypesDev = current !== null ? current._debugHookTypes : null;\n    hookTypesUpdateIndexDev = -1; // Used for hot reloading:\n    ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;\n  }\n  workInProgress.memoizedState = null;\n  workInProgress.updateQueue = null;\n  workInProgress.expirationTime = NoWork; // The following should have already been reset\n  // currentHook = null;\n  // workInProgressHook = null;\n  // didScheduleRenderPhaseUpdate = false;\n  // TODO Warn if no hooks are used at all during mount, then some are used during update.\n  // Currently we will identify the update render as a mount because memoizedState === null.\n  // This is tricky because it's valid for certain types of components (e.g. React.lazy)\n  // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used.\n  // Non-stateful hooks (e.g. context) don't get added to memoizedState,\n  // so memoizedState would be null during updates and mounts.\n  {\n    if (current !== null && current.memoizedState !== null) {\n      ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV;\n    } else if (hookTypesDev !== null) {\n      // This dispatcher handles an edge case where a component is updating,\n      // but no stateful hooks have been used.\n      // We want to match the production code behavior (which will use HooksDispatcherOnMount),\n      // but with the extra DEV validation to ensure hooks ordering hasn't changed.\n      // This dispatcher does that.\n      ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV;\n    } else {\n      ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV;\n    }\n  }\n  var children = Component(props, secondArg); // Check if there was a render phase update\n  if (workInProgress.expirationTime === renderExpirationTime) {\n    // Keep rendering in a loop for as long as render phase updates continue to\n    // be scheduled. Use a counter to prevent infinite loops.\n    var numberOfReRenders = 0;\n    do {\n      workInProgress.expirationTime = NoWork;\n      if (!(numberOfReRenders < RE_RENDER_LIMIT)) {\n        {\n          throw Error( \\\\\"Too many re-renders. React limits the number of renders to prevent an infinite loop.\\\\\" );\n        }\n      }\n      numberOfReRenders += 1;\n      {\n        // Even when hot reloading, allow dependencies to stabilize\n        // after first render to prevent infinite render phase updates.\n        ignorePreviousDependencies = false;\n      } // Start over from the beginning of the list\n      currentHook = null;\n      workInProgressHook = null;\n      workInProgress.updateQueue = null;\n      {\n        // Also validate hook order for cascading updates.\n        hookTypesUpdateIndexDev = -1;\n      }\n      ReactCurrentDispatcher.current =  HooksDispatcherOnRerenderInDEV ;\n      children = Component(props, secondArg);\n    } while (workInProgress.expirationTime === renderExpirationTime);\n  } // We can assume the previous dispatcher is always this one, since we set it\n  // at the beginning of the render phase and there's no re-entrancy.\n  ReactCurrentDispatcher.current = ContextOnlyDispatcher;\n  {\n    workInProgress._debugHookTypes = hookTypesDev;\n  } // This check uses currentHook so that it works the same in DEV and prod bundles.\n  // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.\n  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;\n  renderExpirationTime = NoWork;\n  currentlyRenderingFiber$1 = null;\n  currentHook = null;\n  workInProgressHook = null;\n  {\n    currentHookNameInDev = null;\n    hookTypesDev = null;\n    hookTypesUpdateIndexDev = -1;\n  }\n  didScheduleRenderPhaseUpdate = false;\n  if (!!didRenderTooFewHooks) {\n    {\n      throw Error( \\\\\"Rendered fewer hooks than expected. This may be caused by an accidental early return statement.\\\\\" );\n    }\n  }\n  return children;\n}\nfunction bailoutHooks(current, workInProgress, expirationTime) {\n  workInProgress.updateQueue = current.updateQueue;\n  workInProgress.effectTag &= ~(Passive | Update);\n  if (current.expirationTime <= expirationTime) {\n    current.expirationTime = NoWork;\n  }\n}\nfunction resetHooksAfterThrow() {\n  // We can assume the previous dispatcher is always this one, since we set it\n  // at the beginning of the render phase and there's no re-entrancy.\n  ReactCurrentDispatcher.current = ContextOnlyDispatcher;\n  if (didScheduleRenderPhaseUpdate) {\n    // There were render phase updates. These are only valid for this render\n    // phase, which we are now aborting. Remove the updates from the queues so\n    // they do not persist to the next render. Do not remove updates from hooks\n    // that weren't processed.\n    //\n    // Only reset the updates from the queue if it has a clone. If it does\n    // not have a clone, that means it wasn't processed, and the updates were\n    // scheduled before we entered the render phase.\n    var hook = currentlyRenderingFiber$1.memoizedState;\n    while (hook !== null) {\n      var queue = hook.queue;\n      if (queue !== null) {\n        queue.pending = null;\n      }\n      hook = hook.next;\n    }\n  }\n  renderExpirationTime = NoWork;\n  currentlyRenderingFiber$1 = null;\n  currentHook = null;\n  workInProgressHook = null;\n  {\n    hookTypesDev = null;\n    hookTypesUpdateIndexDev = -1;\n    currentHookNameInDev = null;\n  }\n  didScheduleRenderPhaseUpdate = false;\n}\nfunction mountWorkInProgressHook() {\n  var hook = {\n    memoizedState: null,\n    baseState: null,\n    baseQueue: null,\n    queue: null,\n    next: null\n  };\n  if (workInProgressHook === null) {\n    // This is the first hook in the list\n    currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;\n  } else {\n    // Append to the end of the list\n    workInProgressHook = workInProgressHook.next = hook;\n  }\n  return workInProgressHook;\n}\nfunction updateWorkInProgressHook() {\n  // This function is used both for updates and for re-renders triggered by a\n  // render phase update. It assumes there is either a current hook we can\n  // clone, or a work-in-progress hook from a previous render pass that we can\n  // use as a base. When we reach the end of the base list, we must switch to\n  // the dispatcher used for mounts.\n  var nextCurrentHook;\n  if (currentHook === null) {\n    var current = currentlyRenderingFiber$1.alternate;\n    if (current !== null) {\n      nextCurrentHook = current.memoizedState;\n    } else {\n      nextCurrentHook = null;\n    }\n  } else {\n    nextCurrentHook = currentHook.next;\n  }\n  var nextWorkInProgressHook;\n  if (workInProgressHook === null) {\n    nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;\n  } else {\n    nextWorkInProgressHook = workInProgressHook.next;\n  }\n  if (nextWorkInProgressHook !== null) {\n    // There's already a work-in-progress. Reuse it.\n    workInProgressHook = nextWorkInProgressHook;\n    nextWorkInProgressHook = workInProgressHook.next;\n    currentHook = nextCurrentHook;\n  } else {\n    // Clone from the current hook.\n    if (!(nextCurrentHook !== null)) {\n      {\n        throw Error( \\\\\"Rendered more hooks than during the previous render.\\\\\" );\n      }\n    }\n    currentHook = nextCurrentHook;\n    var newHook = {\n      memoizedState: currentHook.memoizedState,\n      baseState: currentHook.baseState,\n      baseQueue: currentHook.baseQueue,\n      queue: currentHook.queue,\n      next: null\n    };\n    if (workInProgressHook === null) {\n      // This is the first hook in the list.\n      currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;\n    } else {\n      // Append to the end of the list.\n      workInProgressHook = workInProgressHook.next = newHook;\n    }\n  }\n  return workInProgressHook;\n}\nfunction createFunctionComponentUpdateQueue() {\n  return {\n    lastEffect: null\n  };\n}\nfunction basicStateReducer(state, action) {\n  // $FlowFixMe: Flow doesn't like mixed types\n  return typeof action === 'function' ? action(state) : action;\n}\nfunction mountReducer(reducer, initialArg, init) {\n  var hook = mountWorkInProgressHook();\n  var initialState;\n  if (init !== undefined) {\n    initialState = init(initialArg);\n  } else {\n    initialState = initialArg;\n  }\n  hook.memoizedState = hook.baseState = initialState;\n  var queue = hook.queue = {\n    pending: null,\n    dispatch: null,\n    lastRenderedReducer: reducer,\n    lastRenderedState: initialState\n  };\n  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n  return [hook.memoizedState, dispatch];\n}\nfunction updateReducer(reducer, initialArg, init) {\n  var hook = updateWorkInProgressHook();\n  var queue = hook.queue;\n  if (!(queue !== null)) {\n    {\n      throw Error( \\\\\"Should have a queue. This is likely a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  queue.lastRenderedReducer = reducer;\n  var current = currentHook; // The last rebase update that is NOT part of the base state.\n  var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet.\n  var pendingQueue = queue.pending;\n  if (pendingQueue !== null) {\n    // We have new updates that haven't been processed yet.\n    // We'll add them to the base queue.\n    if (baseQueue !== null) {\n      // Merge the pending queue and the base queue.\n      var baseFirst = baseQueue.next;\n      var pendingFirst = pendingQueue.next;\n      baseQueue.next = pendingFirst;\n      pendingQueue.next = baseFirst;\n    }\n    current.baseQueue = baseQueue = pendingQueue;\n    queue.pending = null;\n  }\n  if (baseQueue !== null) {\n    // We have a queue to process.\n    var first = baseQueue.next;\n    var newState = current.baseState;\n    var newBaseState = null;\n    var newBaseQueueFirst = null;\n    var newBaseQueueLast = null;\n    var update = first;\n    do {\n      var updateExpirationTime = update.expirationTime;\n      if (updateExpirationTime < renderExpirationTime) {\n        // Priority is insufficient. Skip this update. If this is the first\n        // skipped update, the previous update/state is the new base\n        // update/state.\n        var clone = {\n          expirationTime: update.expirationTime,\n          suspenseConfig: update.suspenseConfig,\n          action: update.action,\n          eagerReducer: update.eagerReducer,\n          eagerState: update.eagerState,\n          next: null\n        };\n        if (newBaseQueueLast === null) {\n          newBaseQueueFirst = newBaseQueueLast = clone;\n          newBaseState = newState;\n        } else {\n          newBaseQueueLast = newBaseQueueLast.next = clone;\n        } // Update the remaining priority in the queue.\n        if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) {\n          currentlyRenderingFiber$1.expirationTime = updateExpirationTime;\n          markUnprocessedUpdateTime(updateExpirationTime);\n        }\n      } else {\n        // This update does have sufficient priority.\n        if (newBaseQueueLast !== null) {\n          var _clone = {\n            expirationTime: Sync,\n            // This update is going to be committed so we never want uncommit it.\n            suspenseConfig: update.suspenseConfig,\n            action: update.action,\n            eagerReducer: update.eagerReducer,\n            eagerState: update.eagerState,\n            next: null\n          };\n          newBaseQueueLast = newBaseQueueLast.next = _clone;\n        } // Mark the event time of this update as relevant to this render pass.\n        // TODO: This should ideally use the true event time of this update rather than\n        // its priority which is a derived and not reverseable value.\n        // TODO: We should skip this update if it was already committed but currently\n        // we have no way of detecting the difference between a committed and suspended\n        // update here.\n        markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update.\n        if (update.eagerReducer === reducer) {\n          // If this update was processed eagerly, and its reducer matches the\n          // current reducer, we can use the eagerly computed state.\n          newState = update.eagerState;\n        } else {\n          var action = update.action;\n          newState = reducer(newState, action);\n        }\n      }\n      update = update.next;\n    } while (update !== null && update !== first);\n    if (newBaseQueueLast === null) {\n      newBaseState = newState;\n    } else {\n      newBaseQueueLast.next = newBaseQueueFirst;\n    } // Mark that the fiber performed work, but only if the new state is\n    // different from the current state.\n    if (!objectIs(newState, hook.memoizedState)) {\n      markWorkInProgressReceivedUpdate();\n    }\n    hook.memoizedState = newState;\n    hook.baseState = newBaseState;\n    hook.baseQueue = newBaseQueueLast;\n    queue.lastRenderedState = newState;\n  }\n  var dispatch = queue.dispatch;\n  return [hook.memoizedState, dispatch];\n}\nfunction rerenderReducer(reducer, initialArg, init) {\n  var hook = updateWorkInProgressHook();\n  var queue = hook.queue;\n  if (!(queue !== null)) {\n    {\n      throw Error( \\\\\"Should have a queue. This is likely a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous\n  // work-in-progress hook.\n  var dispatch = queue.dispatch;\n  var lastRenderPhaseUpdate = queue.pending;\n  var newState = hook.memoizedState;\n  if (lastRenderPhaseUpdate !== null) {\n    // The queue doesn't persist past this render pass.\n    queue.pending = null;\n    var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n    var update = firstRenderPhaseUpdate;\n    do {\n      // Process this render phase update. We don't have to check the\n      // priority because it will always be the same as the current\n      // render's.\n      var action = update.action;\n      newState = reducer(newState, action);\n      update = update.next;\n    } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is\n    // different from the current state.\n    if (!objectIs(newState, hook.memoizedState)) {\n      markWorkInProgressReceivedUpdate();\n    }\n    hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to\n    // the base state unless the queue is empty.\n    // TODO: Not sure if this is the desired semantics, but it's what we\n    // do for gDSFP. I can't remember why.\n    if (hook.baseQueue === null) {\n      hook.baseState = newState;\n    }\n    queue.lastRenderedState = newState;\n  }\n  return [newState, dispatch];\n}\nfunction mountState(initialState) {\n  var hook = mountWorkInProgressHook();\n  if (typeof initialState === 'function') {\n    // $FlowFixMe: Flow doesn't like mixed types\n    initialState = initialState();\n  }\n  hook.memoizedState = hook.baseState = initialState;\n  var queue = hook.queue = {\n    pending: null,\n    dispatch: null,\n    lastRenderedReducer: basicStateReducer,\n    lastRenderedState: initialState\n  };\n  var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n  return [hook.memoizedState, dispatch];\n}\nfunction updateState(initialState) {\n  return updateReducer(basicStateReducer);\n}\nfunction rerenderState(initialState) {\n  return rerenderReducer(basicStateReducer);\n}\nfunction pushEffect(tag, create, destroy, deps) {\n  var effect = {\n    tag: tag,\n    create: create,\n    destroy: destroy,\n    deps: deps,\n    // Circular\n    next: null\n  };\n  var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n  if (componentUpdateQueue === null) {\n    componentUpdateQueue = createFunctionComponentUpdateQueue();\n    currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n    componentUpdateQueue.lastEffect = effect.next = effect;\n  } else {\n    var lastEffect = componentUpdateQueue.lastEffect;\n    if (lastEffect === null) {\n      componentUpdateQueue.lastEffect = effect.next = effect;\n    } else {\n      var firstEffect = lastEffect.next;\n      lastEffect.next = effect;\n      effect.next = firstEffect;\n      componentUpdateQueue.lastEffect = effect;\n    }\n  }\n  return effect;\n}\nfunction mountRef(initialValue) {\n  var hook = mountWorkInProgressHook();\n  var ref = {\n    current: initialValue\n  };\n  {\n    Object.seal(ref);\n  }\n  hook.memoizedState = ref;\n  return ref;\n}\nfunction updateRef(initialValue) {\n  var hook = updateWorkInProgressHook();\n  return hook.memoizedState;\n}\nfunction mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {\n  var hook = mountWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  currentlyRenderingFiber$1.effectTag |= fiberEffectTag;\n  hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, undefined, nextDeps);\n}\nfunction updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {\n  var hook = updateWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var destroy = undefined;\n  if (currentHook !== null) {\n    var prevEffect = currentHook.memoizedState;\n    destroy = prevEffect.destroy;\n    if (nextDeps !== null) {\n      var prevDeps = prevEffect.deps;\n      if (areHookInputsEqual(nextDeps, prevDeps)) {\n        pushEffect(hookEffectTag, create, destroy, nextDeps);\n        return;\n      }\n    }\n  }\n  currentlyRenderingFiber$1.effectTag |= fiberEffectTag;\n  hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);\n}\nfunction mountEffect(create, deps) {\n  {\n    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n    if ('undefined' !== typeof jest) {\n      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n    }\n  }\n  return mountEffectImpl(Update | Passive, Passive$1, create, deps);\n}\nfunction updateEffect(create, deps) {\n  {\n    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n    if ('undefined' !== typeof jest) {\n      warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n    }\n  }\n  return updateEffectImpl(Update | Passive, Passive$1, create, deps);\n}\nfunction mountLayoutEffect(create, deps) {\n  return mountEffectImpl(Update, Layout, create, deps);\n}\nfunction updateLayoutEffect(create, deps) {\n  return updateEffectImpl(Update, Layout, create, deps);\n}\nfunction imperativeHandleEffect(create, ref) {\n  if (typeof ref === 'function') {\n    var refCallback = ref;\n    var _inst = create();\n    refCallback(_inst);\n    return function () {\n      refCallback(null);\n    };\n  } else if (ref !== null && ref !== undefined) {\n    var refObject = ref;\n    {\n      if (!refObject.hasOwnProperty('current')) {\n        error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');\n      }\n    }\n    var _inst2 = create();\n    refObject.current = _inst2;\n    return function () {\n      refObject.current = null;\n    };\n  }\n}\nfunction mountImperativeHandle(ref, create, deps) {\n  {\n    if (typeof create !== 'function') {\n      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n    }\n  } // TODO: If deps are provided, should we skip comparing the ref itself?\n  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n  return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\nfunction updateImperativeHandle(ref, create, deps) {\n  {\n    if (typeof create !== 'function') {\n      error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n    }\n  } // TODO: If deps are provided, should we skip comparing the ref itself?\n  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n  return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\nfunction mountDebugValue(value, formatterFn) {// This hook is normally a no-op.\n  // The react-debug-hooks package injects its own implementation\n  // so that e.g. DevTools can display custom hook values.\n}\nvar updateDebugValue = mountDebugValue;\nfunction mountCallback(callback, deps) {\n  var hook = mountWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  hook.memoizedState = [callback, nextDeps];\n  return callback;\n}\nfunction updateCallback(callback, deps) {\n  var hook = updateWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var prevState = hook.memoizedState;\n  if (prevState !== null) {\n    if (nextDeps !== null) {\n      var prevDeps = prevState[1];\n      if (areHookInputsEqual(nextDeps, prevDeps)) {\n        return prevState[0];\n      }\n    }\n  }\n  hook.memoizedState = [callback, nextDeps];\n  return callback;\n}\nfunction mountMemo(nextCreate, deps) {\n  var hook = mountWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var nextValue = nextCreate();\n  hook.memoizedState = [nextValue, nextDeps];\n  return nextValue;\n}\nfunction updateMemo(nextCreate, deps) {\n  var hook = updateWorkInProgressHook();\n  var nextDeps = deps === undefined ? null : deps;\n  var prevState = hook.memoizedState;\n  if (prevState !== null) {\n    // Assume these are defined. If they're not, areHookInputsEqual will warn.\n    if (nextDeps !== null) {\n      var prevDeps = prevState[1];\n      if (areHookInputsEqual(nextDeps, prevDeps)) {\n        return prevState[0];\n      }\n    }\n  }\n  var nextValue = nextCreate();\n  hook.memoizedState = [nextValue, nextDeps];\n  return nextValue;\n}\nfunction mountDeferredValue(value, config) {\n  var _mountState = mountState(value),\n      prevValue = _mountState[0],\n      setValue = _mountState[1];\n  mountEffect(function () {\n    var previousConfig = ReactCurrentBatchConfig$1.suspense;\n    ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n    try {\n      setValue(value);\n    } finally {\n      ReactCurrentBatchConfig$1.suspense = previousConfig;\n    }\n  }, [value, config]);\n  return prevValue;\n}\nfunction updateDeferredValue(value, config) {\n  var _updateState = updateState(),\n      prevValue = _updateState[0],\n      setValue = _updateState[1];\n  updateEffect(function () {\n    var previousConfig = ReactCurrentBatchConfig$1.suspense;\n    ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n    try {\n      setValue(value);\n    } finally {\n      ReactCurrentBatchConfig$1.suspense = previousConfig;\n    }\n  }, [value, config]);\n  return prevValue;\n}\nfunction rerenderDeferredValue(value, config) {\n  var _rerenderState = rerenderState(),\n      prevValue = _rerenderState[0],\n      setValue = _rerenderState[1];\n  updateEffect(function () {\n    var previousConfig = ReactCurrentBatchConfig$1.suspense;\n    ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n    try {\n      setValue(value);\n    } finally {\n      ReactCurrentBatchConfig$1.suspense = previousConfig;\n    }\n  }, [value, config]);\n  return prevValue;\n}\nfunction startTransition(setPending, config, callback) {\n  var priorityLevel = getCurrentPriorityLevel();\n  runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function () {\n    setPending(true);\n  });\n  runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function () {\n    var previousConfig = ReactCurrentBatchConfig$1.suspense;\n    ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;\n    try {\n      setPending(false);\n      callback();\n    } finally {\n      ReactCurrentBatchConfig$1.suspense = previousConfig;\n    }\n  });\n}\nfunction mountTransition(config) {\n  var _mountState2 = mountState(false),\n      isPending = _mountState2[0],\n      setPending = _mountState2[1];\n  var start = mountCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n  return [start, isPending];\n}\nfunction updateTransition(config) {\n  var _updateState2 = updateState(),\n      isPending = _updateState2[0],\n      setPending = _updateState2[1];\n  var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n  return [start, isPending];\n}\nfunction rerenderTransition(config) {\n  var _rerenderState2 = rerenderState(),\n      isPending = _rerenderState2[0],\n      setPending = _rerenderState2[1];\n  var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);\n  return [start, isPending];\n}\nfunction dispatchAction(fiber, queue, action) {\n  {\n    if (typeof arguments[3] === 'function') {\n      error(\\\\\"State updates from the useState() and useReducer() Hooks don't support the \\\\\" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n    }\n  }\n  var currentTime = requestCurrentTimeForUpdate();\n  var suspenseConfig = requestCurrentSuspenseConfig();\n  var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);\n  var update = {\n    expirationTime: expirationTime,\n    suspenseConfig: suspenseConfig,\n    action: action,\n    eagerReducer: null,\n    eagerState: null,\n    next: null\n  };\n  {\n    update.priority = getCurrentPriorityLevel();\n  } // Append the update to the end of the list.\n  var pending = queue.pending;\n  if (pending === null) {\n    // This is the first update. Create a circular list.\n    update.next = update;\n  } else {\n    update.next = pending.next;\n    pending.next = update;\n  }\n  queue.pending = update;\n  var alternate = fiber.alternate;\n  if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {\n    // This is a render phase update. Stash it in a lazily-created map of\n    // queue -> linked list of updates. After this render pass, we'll restart\n    // and apply the stashed updates on top of the work-in-progress hook.\n    didScheduleRenderPhaseUpdate = true;\n    update.expirationTime = renderExpirationTime;\n    currentlyRenderingFiber$1.expirationTime = renderExpirationTime;\n  } else {\n    if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {\n      // The queue is currently empty, which means we can eagerly compute the\n      // next state before entering the render phase. If the new state is the\n      // same as the current state, we may be able to bail out entirely.\n      var lastRenderedReducer = queue.lastRenderedReducer;\n      if (lastRenderedReducer !== null) {\n        var prevDispatcher;\n        {\n          prevDispatcher = ReactCurrentDispatcher.current;\n          ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n        }\n        try {\n          var currentState = queue.lastRenderedState;\n          var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute\n          // it, on the update object. If the reducer hasn't changed by the\n          // time we enter the render phase, then the eager state can be used\n          // without calling the reducer again.\n          update.eagerReducer = lastRenderedReducer;\n          update.eagerState = eagerState;\n          if (objectIs(eagerState, currentState)) {\n            // Fast path. We can bail out without scheduling React to re-render.\n            // It's still possible that we'll need to rebase this update later,\n            // if the component re-renders for a different reason and by that\n            // time the reducer has changed.\n            return;\n          }\n        } catch (error) {// Suppress the error. It will throw again in the render phase.\n        } finally {\n          {\n            ReactCurrentDispatcher.current = prevDispatcher;\n          }\n        }\n      }\n    }\n    {\n      // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n      if ('undefined' !== typeof jest) {\n        warnIfNotScopedWithMatchingAct(fiber);\n        warnIfNotCurrentlyActingUpdatesInDev(fiber);\n      }\n    }\n    scheduleWork(fiber, expirationTime);\n  }\n}\nvar ContextOnlyDispatcher = {\n  readContext: readContext,\n  useCallback: throwInvalidHookError,\n  useContext: throwInvalidHookError,\n  useEffect: throwInvalidHookError,\n  useImperativeHandle: throwInvalidHookError,\n  useLayoutEffect: throwInvalidHookError,\n  useMemo: throwInvalidHookError,\n  useReducer: throwInvalidHookError,\n  useRef: throwInvalidHookError,\n  useState: throwInvalidHookError,\n  useDebugValue: throwInvalidHookError,\n  useResponder: throwInvalidHookError,\n  useDeferredValue: throwInvalidHookError,\n  useTransition: throwInvalidHookError\n};\nvar HooksDispatcherOnMountInDEV = null;\nvar HooksDispatcherOnMountWithHookTypesInDEV = null;\nvar HooksDispatcherOnUpdateInDEV = null;\nvar HooksDispatcherOnRerenderInDEV = null;\nvar InvalidNestedHooksDispatcherOnMountInDEV = null;\nvar InvalidNestedHooksDispatcherOnUpdateInDEV = null;\nvar InvalidNestedHooksDispatcherOnRerenderInDEV = null;\n{\n  var warnInvalidContextAccess = function () {\n    error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n  };\n  var warnInvalidHookAccess = function () {\n    error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');\n  };\n  HooksDispatcherOnMountInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      mountHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      return mountLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      mountHookTypesDev();\n      checkDepsAreArrayDev(deps);\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      mountHookTypesDev();\n      return mountRef(initialValue);\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      mountHookTypesDev();\n      return mountDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      mountHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      mountHookTypesDev();\n      return mountDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      mountHookTypesDev();\n      return mountTransition(config);\n    }\n  };\n  HooksDispatcherOnMountWithHookTypesInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      updateHookTypesDev();\n      return mountCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      updateHookTypesDev();\n      return mountEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      updateHookTypesDev();\n      return mountImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      updateHookTypesDev();\n      return mountLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      updateHookTypesDev();\n      return mountRef(initialValue);\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      updateHookTypesDev();\n      return mountDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      updateHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      updateHookTypesDev();\n      return mountDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      updateHookTypesDev();\n      return mountTransition(config);\n    }\n  };\n  HooksDispatcherOnUpdateInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      updateHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      updateHookTypesDev();\n      return updateDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      updateHookTypesDev();\n      return updateTransition(config);\n    }\n  };\n  HooksDispatcherOnRerenderInDEV = {\n    readContext: function (context, observedBits) {\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n      try {\n        return rerenderReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n      try {\n        return rerenderState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      updateHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      updateHookTypesDev();\n      return rerenderDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      updateHookTypesDev();\n      return rerenderTransition(config);\n    }\n  };\n  InvalidNestedHooksDispatcherOnMountInDEV = {\n    readContext: function (context, observedBits) {\n      warnInvalidContextAccess();\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountRef(initialValue);\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;\n      try {\n        return mountState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      warnInvalidHookAccess();\n      mountHookTypesDev();\n      return mountTransition(config);\n    }\n  };\n  InvalidNestedHooksDispatcherOnUpdateInDEV = {\n    readContext: function (context, observedBits) {\n      warnInvalidContextAccess();\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateTransition(config);\n    }\n  };\n  InvalidNestedHooksDispatcherOnRerenderInDEV = {\n    readContext: function (context, observedBits) {\n      warnInvalidContextAccess();\n      return readContext(context, observedBits);\n    },\n    useCallback: function (callback, deps) {\n      currentHookNameInDev = 'useCallback';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateCallback(callback, deps);\n    },\n    useContext: function (context, observedBits) {\n      currentHookNameInDev = 'useContext';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return readContext(context, observedBits);\n    },\n    useEffect: function (create, deps) {\n      currentHookNameInDev = 'useEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateEffect(create, deps);\n    },\n    useImperativeHandle: function (ref, create, deps) {\n      currentHookNameInDev = 'useImperativeHandle';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateImperativeHandle(ref, create, deps);\n    },\n    useLayoutEffect: function (create, deps) {\n      currentHookNameInDev = 'useLayoutEffect';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateLayoutEffect(create, deps);\n    },\n    useMemo: function (create, deps) {\n      currentHookNameInDev = 'useMemo';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return updateMemo(create, deps);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useReducer: function (reducer, initialArg, init) {\n      currentHookNameInDev = 'useReducer';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return rerenderReducer(reducer, initialArg, init);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useRef: function (initialValue) {\n      currentHookNameInDev = 'useRef';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateRef();\n    },\n    useState: function (initialState) {\n      currentHookNameInDev = 'useState';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      var prevDispatcher = ReactCurrentDispatcher.current;\n      ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n      try {\n        return rerenderState(initialState);\n      } finally {\n        ReactCurrentDispatcher.current = prevDispatcher;\n      }\n    },\n    useDebugValue: function (value, formatterFn) {\n      currentHookNameInDev = 'useDebugValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return updateDebugValue();\n    },\n    useResponder: function (responder, props) {\n      currentHookNameInDev = 'useResponder';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return createDeprecatedResponderListener(responder, props);\n    },\n    useDeferredValue: function (value, config) {\n      currentHookNameInDev = 'useDeferredValue';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return rerenderDeferredValue(value, config);\n    },\n    useTransition: function (config) {\n      currentHookNameInDev = 'useTransition';\n      warnInvalidHookAccess();\n      updateHookTypesDev();\n      return rerenderTransition(config);\n    }\n  };\n}\nvar now$1 = Scheduler.unstable_now;\nvar commitTime = 0;\nvar profilerStartTime = -1;\nfunction getCommitTime() {\n  return commitTime;\n}\nfunction recordCommitTime() {\n  commitTime = now$1();\n}\nfunction startProfilerTimer(fiber) {\n  profilerStartTime = now$1();\n  if (fiber.actualStartTime < 0) {\n    fiber.actualStartTime = now$1();\n  }\n}\nfunction stopProfilerTimerIfRunning(fiber) {\n  profilerStartTime = -1;\n}\nfunction stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {\n  if (profilerStartTime >= 0) {\n    var elapsedTime = now$1() - profilerStartTime;\n    fiber.actualDuration += elapsedTime;\n    if (overrideBaseTime) {\n      fiber.selfBaseDuration = elapsedTime;\n    }\n    profilerStartTime = -1;\n  }\n}\n// This may have been an insertion or a hydration.\nvar hydrationParentFiber = null;\nvar nextHydratableInstance = null;\nvar isHydrating = false;\nfunction enterHydrationState(fiber) {\n  var parentInstance = fiber.stateNode.containerInfo;\n  nextHydratableInstance = getFirstHydratableChild(parentInstance);\n  hydrationParentFiber = fiber;\n  isHydrating = true;\n  return true;\n}\nfunction deleteHydratableInstance(returnFiber, instance) {\n  {\n    switch (returnFiber.tag) {\n      case HostRoot:\n        didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);\n        break;\n      case HostComponent:\n        didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);\n        break;\n    }\n  }\n  var childToDelete = createFiberFromHostInstanceForDeletion();\n  childToDelete.stateNode = instance;\n  childToDelete.return = returnFiber;\n  childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,\n  // these children are not part of the reconciliation list of children.\n  // Even if we abort and rereconcile the children, that will try to hydrate\n  // again and the nodes are still in the host tree so these will be\n  // recreated.\n  if (returnFiber.lastEffect !== null) {\n    returnFiber.lastEffect.nextEffect = childToDelete;\n    returnFiber.lastEffect = childToDelete;\n  } else {\n    returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n  }\n}\nfunction insertNonHydratedInstance(returnFiber, fiber) {\n  fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;\n  {\n    switch (returnFiber.tag) {\n      case HostRoot:\n        {\n          var parentContainer = returnFiber.stateNode.containerInfo;\n          switch (fiber.tag) {\n            case HostComponent:\n              var type = fiber.type;\n              var props = fiber.pendingProps;\n              didNotFindHydratableContainerInstance(parentContainer, type);\n              break;\n            case HostText:\n              var text = fiber.pendingProps;\n              didNotFindHydratableContainerTextInstance(parentContainer, text);\n              break;\n          }\n          break;\n        }\n      case HostComponent:\n        {\n          var parentType = returnFiber.type;\n          var parentProps = returnFiber.memoizedProps;\n          var parentInstance = returnFiber.stateNode;\n          switch (fiber.tag) {\n            case HostComponent:\n              var _type = fiber.type;\n              var _props = fiber.pendingProps;\n              didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);\n              break;\n            case HostText:\n              var _text = fiber.pendingProps;\n              didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);\n              break;\n            case SuspenseComponent:\n              didNotFindHydratableSuspenseInstance(parentType, parentProps);\n              break;\n          }\n          break;\n        }\n      default:\n        return;\n    }\n  }\n}\nfunction tryHydrate(fiber, nextInstance) {\n  switch (fiber.tag) {\n    case HostComponent:\n      {\n        var type = fiber.type;\n        var props = fiber.pendingProps;\n        var instance = canHydrateInstance(nextInstance, type);\n        if (instance !== null) {\n          fiber.stateNode = instance;\n          return true;\n        }\n        return false;\n      }\n    case HostText:\n      {\n        var text = fiber.pendingProps;\n        var textInstance = canHydrateTextInstance(nextInstance, text);\n        if (textInstance !== null) {\n          fiber.stateNode = textInstance;\n          return true;\n        }\n        return false;\n      }\n    case SuspenseComponent:\n      {\n        return false;\n      }\n    default:\n      return false;\n  }\n}\nfunction tryToClaimNextHydratableInstance(fiber) {\n  if (!isHydrating) {\n    return;\n  }\n  var nextInstance = nextHydratableInstance;\n  if (!nextInstance) {\n    // Nothing to hydrate. Make it an insertion.\n    insertNonHydratedInstance(hydrationParentFiber, fiber);\n    isHydrating = false;\n    hydrationParentFiber = fiber;\n    return;\n  }\n  var firstAttemptedInstance = nextInstance;\n  if (!tryHydrate(fiber, nextInstance)) {\n    // If we can't hydrate this instance let's try the next one.\n    // We use this as a heuristic. It's based on intuition and not data so it\n    // might be flawed or unnecessary.\n    nextInstance = getNextHydratableSibling(firstAttemptedInstance);\n    if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n      // Nothing to hydrate. Make it an insertion.\n      insertNonHydratedInstance(hydrationParentFiber, fiber);\n      isHydrating = false;\n      hydrationParentFiber = fiber;\n      return;\n    } // We matched the next one, we'll now assume that the first one was\n    // superfluous and we'll delete it. Since we can't eagerly delete it\n    // we'll have to schedule a deletion. To do that, this node needs a dummy\n    // fiber associated with it.\n    deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);\n  }\n  hydrationParentFiber = fiber;\n  nextHydratableInstance = getFirstHydratableChild(nextInstance);\n}\nfunction prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n  var instance = fiber.stateNode;\n  var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.\n  fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n  // is a new ref we mark this as an update.\n  if (updatePayload !== null) {\n    return true;\n  }\n  return false;\n}\nfunction prepareToHydrateHostTextInstance(fiber) {\n  var textInstance = fiber.stateNode;\n  var textContent = fiber.memoizedProps;\n  var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n  {\n    if (shouldUpdate) {\n      // We assume that prepareToHydrateHostTextInstance is called in a context where the\n      // hydration parent is the parent host component of this host text.\n      var returnFiber = hydrationParentFiber;\n      if (returnFiber !== null) {\n        switch (returnFiber.tag) {\n          case HostRoot:\n            {\n              var parentContainer = returnFiber.stateNode.containerInfo;\n              didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);\n              break;\n            }\n          case HostComponent:\n            {\n              var parentType = returnFiber.type;\n              var parentProps = returnFiber.memoizedProps;\n              var parentInstance = returnFiber.stateNode;\n              didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);\n              break;\n            }\n        }\n      }\n    }\n  }\n  return shouldUpdate;\n}\nfunction skipPastDehydratedSuspenseInstance(fiber) {\n  var suspenseState = fiber.memoizedState;\n  var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n  if (!suspenseInstance) {\n    {\n      throw Error( \\\\\"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);\n}\nfunction popToNextHostParent(fiber) {\n  var parent = fiber.return;\n  while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {\n    parent = parent.return;\n  }\n  hydrationParentFiber = parent;\n}\nfunction popHydrationState(fiber) {\n  if (fiber !== hydrationParentFiber) {\n    // We're deeper than the current hydration context, inside an inserted\n    // tree.\n    return false;\n  }\n  if (!isHydrating) {\n    // If we're not currently hydrating but we're in a hydration context, then\n    // we were an insertion and now need to pop up reenter hydration of our\n    // siblings.\n    popToNextHostParent(fiber);\n    isHydrating = true;\n    return false;\n  }\n  var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.\n  // We only do this deeper than head and body since they tend to have random\n  // other nodes in them. We also ignore components with pure text content in\n  // side of them.\n  // TODO: Better heuristic.\n  if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {\n    var nextInstance = nextHydratableInstance;\n    while (nextInstance) {\n      deleteHydratableInstance(fiber, nextInstance);\n      nextInstance = getNextHydratableSibling(nextInstance);\n    }\n  }\n  popToNextHostParent(fiber);\n  if (fiber.tag === SuspenseComponent) {\n    nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);\n  } else {\n    nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n  }\n  return true;\n}\nfunction resetHydrationState() {\n  hydrationParentFiber = null;\n  nextHydratableInstance = null;\n  isHydrating = false;\n}\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar didReceiveUpdate = false;\nvar didWarnAboutBadClass;\nvar didWarnAboutModulePatternComponent;\nvar didWarnAboutContextTypeOnFunctionComponent;\nvar didWarnAboutGetDerivedStateOnFunctionComponent;\nvar didWarnAboutFunctionRefs;\nvar didWarnAboutReassigningProps;\nvar didWarnAboutRevealOrder;\nvar didWarnAboutTailOptions;\n{\n  didWarnAboutBadClass = {};\n  didWarnAboutModulePatternComponent = {};\n  didWarnAboutContextTypeOnFunctionComponent = {};\n  didWarnAboutGetDerivedStateOnFunctionComponent = {};\n  didWarnAboutFunctionRefs = {};\n  didWarnAboutReassigningProps = false;\n  didWarnAboutRevealOrder = {};\n  didWarnAboutTailOptions = {};\n}\nfunction reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime) {\n  if (current === null) {\n    // If this is a fresh new component that hasn't been rendered yet, we\n    // won't update its child set by applying minimal side-effects. Instead,\n    // we will add them all to the child before it gets rendered. That means\n    // we can optimize this reconciliation pass by not tracking side-effects.\n    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n  } else {\n    // If the current child is the same as the work in progress, it means that\n    // we haven't yet started any work on these children. Therefore, we use\n    // the clone algorithm to create a copy of all the current children.\n    // If we had any progressed work already, that is invalid at this point so\n    // let's throw it out.\n    workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);\n  }\n}\nfunction forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime) {\n  // This function is fork of reconcileChildren. It's used in cases where we\n  // want to reconcile without matching against the existing set. This has the\n  // effect of all current children being unmounted; even if the type and key\n  // are the same, the old child is unmounted and a new child is created.\n  //\n  // To do this, we're going to go through the reconcile algorithm twice. In\n  // the first pass, we schedule a deletion for all the current children by\n  // passing null.\n  workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we\n  // pass null in place of where we usually pass the current child set. This has\n  // the effect of remounting all children regardless of whether their\n  // identities match.\n  workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n}\nfunction updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) {\n  // TODO: current can be non-null here even if the component\n  // hasn't yet mounted. This happens after the first render suspends.\n  // We'll need to figure out if this is fine or can cause issues.\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var innerPropTypes = Component.propTypes;\n      if (innerPropTypes) {\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(Component), getCurrentFiberStackInDev);\n      }\n    }\n  }\n  var render = Component.render;\n  var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent\n  var nextChildren;\n  prepareToReadContext(workInProgress, renderExpirationTime);\n  {\n    ReactCurrentOwner$1.current = workInProgress;\n    setIsRendering(true);\n    nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);\n    if ( workInProgress.mode & StrictMode) {\n      // Only double-render components with Hooks\n      if (workInProgress.memoizedState !== null) {\n        nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);\n      }\n    }\n    setIsRendering(false);\n  }\n  if (current !== null && !didReceiveUpdate) {\n    bailoutHooks(current, workInProgress, renderExpirationTime);\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n  } // React DevTools reads this flag.\n  workInProgress.effectTag |= PerformedWork;\n  reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {\n  if (current === null) {\n    var type = Component.type;\n    if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.\n    Component.defaultProps === undefined) {\n      var resolvedType = type;\n      {\n        resolvedType = resolveFunctionForHotReloading(type);\n      } // If this is a plain function component without default props,\n      // and with only the default shallow comparison, we upgrade it\n      // to a SimpleMemoComponent to allow fast path updates.\n      workInProgress.tag = SimpleMemoComponent;\n      workInProgress.type = resolvedType;\n      {\n        validateFunctionComponentInDev(workInProgress, type);\n      }\n      return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);\n    }\n    {\n      var innerPropTypes = type.propTypes;\n      if (innerPropTypes) {\n        // Inner memo component props aren't currently validated in createElement.\n        // We could move it there, but we'd still need this for lazy code path.\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(type), getCurrentFiberStackInDev);\n      }\n    }\n    var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);\n    child.ref = workInProgress.ref;\n    child.return = workInProgress;\n    workInProgress.child = child;\n    return child;\n  }\n  {\n    var _type = Component.type;\n    var _innerPropTypes = _type.propTypes;\n    if (_innerPropTypes) {\n      // Inner memo component props aren't currently validated in createElement.\n      // We could move it there, but we'd still need this for lazy code path.\n      checkPropTypes(_innerPropTypes, nextProps, // Resolved props\n      'prop', getComponentName(_type), getCurrentFiberStackInDev);\n    }\n  }\n  var currentChild = current.child; // This is always exactly one child\n  if (updateExpirationTime < renderExpirationTime) {\n    // This will be the props with resolved defaultProps,\n    // unlike current.memoizedProps which will be the unresolved ones.\n    var prevProps = currentChild.memoizedProps; // Default to shallow comparison\n    var compare = Component.compare;\n    compare = compare !== null ? compare : shallowEqual;\n    if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {\n      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n    }\n  } // React DevTools reads this flag.\n  workInProgress.effectTag |= PerformedWork;\n  var newChild = createWorkInProgress(currentChild, nextProps);\n  newChild.ref = workInProgress.ref;\n  newChild.return = workInProgress;\n  workInProgress.child = newChild;\n  return newChild;\n}\nfunction updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {\n  // TODO: current can be non-null here even if the component\n  // hasn't yet mounted. This happens when the inner render suspends.\n  // We'll need to figure out if this is fine or can cause issues.\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var outerMemoType = workInProgress.elementType;\n      if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {\n        // We warn when you define propTypes on lazy()\n        // so let's just skip over it to find memo() outer wrapper.\n        // Inner props for memo are validated later.\n        outerMemoType = refineResolvedLazyComponent(outerMemoType);\n      }\n      var outerPropTypes = outerMemoType && outerMemoType.propTypes;\n      if (outerPropTypes) {\n        checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)\n        'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);\n      } // Inner propTypes will be validated in the function component path.\n    }\n  }\n  if (current !== null) {\n    var prevProps = current.memoizedProps;\n    if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload.\n     workInProgress.type === current.type )) {\n      didReceiveUpdate = false;\n      if (updateExpirationTime < renderExpirationTime) {\n        // The pending update priority was cleared at the beginning of\n        // beginWork. We're about to bail out, but there might be additional\n        // updates at a lower priority. Usually, the priority level of the\n        // remaining updates is accumlated during the evaluation of the\n        // component (i.e. when processing the update queue). But since since\n        // we're bailing out early *without* evaluating the component, we need\n        // to account for it here, too. Reset to the value of the current fiber.\n        // NOTE: This only applies to SimpleMemoComponent, not MemoComponent,\n        // because a MemoComponent fiber does not have hooks or an update queue;\n        // rather, it wraps around an inner component, which may or may not\n        // contains hooks.\n        // TODO: Move the reset at in beginWork out of the common path so that\n        // this is no longer necessary.\n        workInProgress.expirationTime = current.expirationTime;\n        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n      }\n    }\n  }\n  return updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime);\n}\nfunction updateFragment(current, workInProgress, renderExpirationTime) {\n  var nextChildren = workInProgress.pendingProps;\n  reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction updateMode(current, workInProgress, renderExpirationTime) {\n  var nextChildren = workInProgress.pendingProps.children;\n  reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction updateProfiler(current, workInProgress, renderExpirationTime) {\n  {\n    workInProgress.effectTag |= Update;\n  }\n  var nextProps = workInProgress.pendingProps;\n  var nextChildren = nextProps.children;\n  reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction markRef(current, workInProgress) {\n  var ref = workInProgress.ref;\n  if (current === null && ref !== null || current !== null && current.ref !== ref) {\n    // Schedule a Ref effect\n    workInProgress.effectTag |= Ref;\n  }\n}\nfunction updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var innerPropTypes = Component.propTypes;\n      if (innerPropTypes) {\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(Component), getCurrentFiberStackInDev);\n      }\n    }\n  }\n  var context;\n  {\n    var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);\n    context = getMaskedContext(workInProgress, unmaskedContext);\n  }\n  var nextChildren;\n  prepareToReadContext(workInProgress, renderExpirationTime);\n  {\n    ReactCurrentOwner$1.current = workInProgress;\n    setIsRendering(true);\n    nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);\n    if ( workInProgress.mode & StrictMode) {\n      // Only double-render components with Hooks\n      if (workInProgress.memoizedState !== null) {\n        nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);\n      }\n    }\n    setIsRendering(false);\n  }\n  if (current !== null && !didReceiveUpdate) {\n    bailoutHooks(current, workInProgress, renderExpirationTime);\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n  } // React DevTools reads this flag.\n  workInProgress.effectTag |= PerformedWork;\n  reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {\n  {\n    if (workInProgress.type !== workInProgress.elementType) {\n      // Lazy component props can't be validated in createElement\n      // because they're only guaranteed to be resolved here.\n      var innerPropTypes = Component.propTypes;\n      if (innerPropTypes) {\n        checkPropTypes(innerPropTypes, nextProps, // Resolved props\n        'prop', getComponentName(Component), getCurrentFiberStackInDev);\n      }\n    }\n  } // Push context providers early to prevent context stack mismatches.\n  // During mounting we don't know the child context yet as the instance doesn't exist.\n  // We will invalidate the child context in finishClassComponent() right after rendering.\n  var hasContext;\n  if (isContextProvider(Component)) {\n    hasContext = true;\n    pushContextProvider(workInProgress);\n  } else {\n    hasContext = false;\n  }\n  prepareToReadContext(workInProgress, renderExpirationTime);\n  var instance = workInProgress.stateNode;\n  var shouldUpdate;\n  if (instance === null) {\n    if (current !== null) {\n      // A class component without an instance only mounts if it suspended\n      // inside a non-concurrent tree, in an inconsistent state. We want to\n      // treat it like a new mount, even though an empty version of it already\n      // committed. Disconnect the alternate pointers.\n      current.alternate = null;\n      workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n      workInProgress.effectTag |= Placement;\n    } // In the initial pass we might need to construct the instance.\n    constructClassInstance(workInProgress, Component, nextProps);\n    mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n    shouldUpdate = true;\n  } else if (current === null) {\n    // In a resume, we'll already have an instance we can reuse.\n    shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n  } else {\n    shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderExpirationTime);\n  }\n  var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);\n  {\n    var inst = workInProgress.stateNode;\n    if (inst.props !== nextProps) {\n      if (!didWarnAboutReassigningProps) {\n        error('It looks like %s is reassigning its own \\`this.props\\` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');\n      }\n      didWarnAboutReassigningProps = true;\n    }\n  }\n  return nextUnitOfWork;\n}\nfunction finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {\n  // Refs should update even if shouldComponentUpdate returns false\n  markRef(current, workInProgress);\n  var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;\n  if (!shouldUpdate && !didCaptureError) {\n    // Context providers should defer to sCU for rendering\n    if (hasContext) {\n      invalidateContextProvider(workInProgress, Component, false);\n    }\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n  }\n  var instance = workInProgress.stateNode; // Rerender\n  ReactCurrentOwner$1.current = workInProgress;\n  var nextChildren;\n  if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {\n    // If we captured an error, but getDerivedStateFromError is not defined,\n    // unmount all the children. componentDidCatch will schedule an update to\n    // re-render a fallback. This is temporary until we migrate everyone to\n    // the new API.\n    // TODO: Warn in a future release.\n    nextChildren = null;\n    {\n      stopProfilerTimerIfRunning();\n    }\n  } else {\n    {\n      setIsRendering(true);\n      nextChildren = instance.render();\n      if ( workInProgress.mode & StrictMode) {\n        instance.render();\n      }\n      setIsRendering(false);\n    }\n  } // React DevTools reads this flag.\n  workInProgress.effectTag |= PerformedWork;\n  if (current !== null && didCaptureError) {\n    // If we're recovering from an error, reconcile without reusing any of\n    // the existing children. Conceptually, the normal children and the children\n    // that are shown on error are two different sets, so we shouldn't reuse\n    // normal children even if their identities match.\n    forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime);\n  } else {\n    reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  } // Memoize state using the values we just used to render.\n  // TODO: Restructure so we never read values from the instance.\n  workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.\n  if (hasContext) {\n    invalidateContextProvider(workInProgress, Component, true);\n  }\n  return workInProgress.child;\n}\nfunction pushHostRootContext(workInProgress) {\n  var root = workInProgress.stateNode;\n  if (root.pendingContext) {\n    pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n  } else if (root.context) {\n    // Should always be set\n    pushTopLevelContextObject(workInProgress, root.context, false);\n  }\n  pushHostContainer(workInProgress, root.containerInfo);\n}\nfunction updateHostRoot(current, workInProgress, renderExpirationTime) {\n  pushHostRootContext(workInProgress);\n  var updateQueue = workInProgress.updateQueue;\n  if (!(current !== null && updateQueue !== null)) {\n    {\n      throw Error( \\\\\"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n  var nextProps = workInProgress.pendingProps;\n  var prevState = workInProgress.memoizedState;\n  var prevChildren = prevState !== null ? prevState.element : null;\n  cloneUpdateQueue(current, workInProgress);\n  processUpdateQueue(workInProgress, nextProps, null, renderExpirationTime);\n  var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property\n  // being called \\\\\"element\\\\\".\n  var nextChildren = nextState.element;\n  if (nextChildren === prevChildren) {\n    // If the state is the same as before, that's a bailout because we had\n    // no work that expires at this time.\n    resetHydrationState();\n    return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n  }\n  var root = workInProgress.stateNode;\n  if (root.hydrate && enterHydrationState(workInProgress)) {\n    // If we don't have any current children this might be the first pass.\n    // We always try to hydrate. If this isn't a hydration pass there won't\n    // be any children to hydrate which is effectively the same thing as\n    // not hydrating.\n    var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n    workInProgress.child = child;\n    var node = child;\n    while (node) {\n      // Mark each child as hydrating. This is a fast path to know whether this\n      // tree is part of a hydrating tree. This is used to determine if a child\n      // node has fully mounted yet, and for scheduling event replaying.\n      // Conceptually this is similar to Placement in that a new subtree is\n      // inserted into the React tree here. It just happens to not need DOM\n      // mutations because it already exists.\n      node.effectTag = node.effectTag & ~Placement | Hydrating;\n      node = node.sibling;\n    }\n  } else {\n    // Otherwise reset hydration state in case we aborted and resumed another\n    // root.\n    reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n    resetHydrationState();\n  }\n  return workInProgress.child;\n}\nfunction updateHostComponent(current, workInProgress, renderExpirationTime) {\n  pushHostContext(workInProgress);\n  if (current === null) {\n    tryToClaimNextHydratableInstance(workInProgress);\n  }\n  var type = workInProgress.type;\n  var nextProps = workInProgress.pendingProps;\n  var prevProps = current !== null ? current.memoizedProps : null;\n  var nextChildren = nextProps.children;\n  var isDirectTextChild = shouldSetTextContent(type, nextProps);\n  if (isDirectTextChild) {\n    // We special case a direct text child of a host node. This is a common\n    // case. We won't handle it as a reified child. We will instead handle\n    // this in the host environment that also has access to this prop. That\n    // avoids allocating another HostText fiber and traversing it.\n    nextChildren = null;\n  } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {\n    // If we're switching from a direct text child to a normal child, or to\n    // empty, we need to schedule the text content to be reset.\n    workInProgress.effectTag |= ContentReset;\n  }\n  markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden.\n  if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {\n    {\n      markSpawnedWork(Never);\n    } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n    workInProgress.expirationTime = workInProgress.childExpirationTime = Never;\n    return null;\n  }\n  reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction updateHostText(current, workInProgress) {\n  if (current === null) {\n    tryToClaimNextHydratableInstance(workInProgress);\n  } // Nothing to do here. This is terminal. We'll do the completion step\n  // immediately after.\n  return null;\n}\nfunction mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {\n  if (_current !== null) {\n    // A lazy component only mounts if it suspended inside a non-\n    // concurrent tree, in an inconsistent state. We want to treat it like\n    // a new mount, even though an empty version of it already committed.\n    // Disconnect the alternate pointers.\n    _current.alternate = null;\n    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n    workInProgress.effectTag |= Placement;\n  }\n  var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet.\n  // Cancel and resume right after we know the tag.\n  cancelWorkTimer(workInProgress);\n  var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type.\n  workInProgress.type = Component;\n  var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);\n  startWorkTimer(workInProgress);\n  var resolvedProps = resolveDefaultProps(Component, props);\n  var child;\n  switch (resolvedTag) {\n    case FunctionComponent:\n      {\n        {\n          validateFunctionComponentInDev(workInProgress, Component);\n          workInProgress.type = Component = resolveFunctionForHotReloading(Component);\n        }\n        child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n        return child;\n      }\n    case ClassComponent:\n      {\n        {\n          workInProgress.type = Component = resolveClassForHotReloading(Component);\n        }\n        child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n        return child;\n      }\n    case ForwardRef:\n      {\n        {\n          workInProgress.type = Component = resolveForwardRefForHotReloading(Component);\n        }\n        child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);\n        return child;\n      }\n    case MemoComponent:\n      {\n        {\n          if (workInProgress.type !== workInProgress.elementType) {\n            var outerPropTypes = Component.propTypes;\n            if (outerPropTypes) {\n              checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only\n              'prop', getComponentName(Component), getCurrentFiberStackInDev);\n            }\n          }\n        }\n        child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too\n        updateExpirationTime, renderExpirationTime);\n        return child;\n      }\n  }\n  var hint = '';\n  {\n    if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {\n      hint = ' Did you wrap a component in React.lazy() more than once?';\n    }\n  } // This message intentionally doesn't mention ForwardRef or MemoComponent\n  // because the fact that it's a separate type of work is an\n  // implementation detail.\n  {\n    {\n      throw Error( \\\\\"Element type is invalid. Received a promise that resolves to: \\\\\" + Component + \\\\\". Lazy element type must resolve to a class or function.\\\\\" + hint );\n    }\n  }\n}\nfunction mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {\n  if (_current !== null) {\n    // An incomplete component only mounts if it suspended inside a non-\n    // concurrent tree, in an inconsistent state. We want to treat it like\n    // a new mount, even though an empty version of it already committed.\n    // Disconnect the alternate pointers.\n    _current.alternate = null;\n    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n    workInProgress.effectTag |= Placement;\n  } // Promote the fiber to a class and try rendering again.\n  workInProgress.tag = ClassComponent; // The rest of this function is a fork of \\`updateClassComponent\\`\n  // Push context providers early to prevent context stack mismatches.\n  // During mounting we don't know the child context yet as the instance doesn't exist.\n  // We will invalidate the child context in finishClassComponent() right after rendering.\n  var hasContext;\n  if (isContextProvider(Component)) {\n    hasContext = true;\n    pushContextProvider(workInProgress);\n  } else {\n    hasContext = false;\n  }\n  prepareToReadContext(workInProgress, renderExpirationTime);\n  constructClassInstance(workInProgress, Component, nextProps);\n  mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);\n  return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);\n}\nfunction mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {\n  if (_current !== null) {\n    // An indeterminate component only mounts if it suspended inside a non-\n    // concurrent tree, in an inconsistent state. We want to treat it like\n    // a new mount, even though an empty version of it already committed.\n    // Disconnect the alternate pointers.\n    _current.alternate = null;\n    workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect\n    workInProgress.effectTag |= Placement;\n  }\n  var props = workInProgress.pendingProps;\n  var context;\n  {\n    var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);\n    context = getMaskedContext(workInProgress, unmaskedContext);\n  }\n  prepareToReadContext(workInProgress, renderExpirationTime);\n  var value;\n  {\n    if (Component.prototype && typeof Component.prototype.render === 'function') {\n      var componentName = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutBadClass[componentName]) {\n        error(\\\\\"The <%s /> component appears to have a render method, but doesn't extend React.Component. \\\\\" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n        didWarnAboutBadClass[componentName] = true;\n      }\n    }\n    if (workInProgress.mode & StrictMode) {\n      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);\n    }\n    setIsRendering(true);\n    ReactCurrentOwner$1.current = workInProgress;\n    value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);\n    setIsRendering(false);\n  } // React DevTools reads this flag.\n  workInProgress.effectTag |= PerformedWork;\n  if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n    {\n      var _componentName = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutModulePatternComponent[_componentName]) {\n        error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \\\\\"If you can't use a class try assigning the prototype on the function as a workaround. \\\\\" + \\\\\"\\`%s.prototype = React.Component.prototype\\`. Don't use an arrow function since it \\\\\" + 'cannot be called with \\`new\\` by React.', _componentName, _componentName, _componentName);\n        didWarnAboutModulePatternComponent[_componentName] = true;\n      }\n    } // Proceed under the assumption that this is a class instance\n    workInProgress.tag = ClassComponent; // Throw out any hooks that were used.\n    workInProgress.memoizedState = null;\n    workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.\n    // During mounting we don't know the child context yet as the instance doesn't exist.\n    // We will invalidate the child context in finishClassComponent() right after rendering.\n    var hasContext = false;\n    if (isContextProvider(Component)) {\n      hasContext = true;\n      pushContextProvider(workInProgress);\n    } else {\n      hasContext = false;\n    }\n    workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;\n    initializeUpdateQueue(workInProgress);\n    var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n    if (typeof getDerivedStateFromProps === 'function') {\n      applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);\n    }\n    adoptClassInstance(workInProgress, value);\n    mountClassInstance(workInProgress, Component, props, renderExpirationTime);\n    return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);\n  } else {\n    // Proceed under the assumption that this is a function component\n    workInProgress.tag = FunctionComponent;\n    {\n      if ( workInProgress.mode & StrictMode) {\n        // Only double-render components with Hooks\n        if (workInProgress.memoizedState !== null) {\n          value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);\n        }\n      }\n    }\n    reconcileChildren(null, workInProgress, value, renderExpirationTime);\n    {\n      validateFunctionComponentInDev(workInProgress, Component);\n    }\n    return workInProgress.child;\n  }\n}\nfunction validateFunctionComponentInDev(workInProgress, Component) {\n  {\n    if (Component) {\n      if (Component.childContextTypes) {\n        error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');\n      }\n    }\n    if (workInProgress.ref !== null) {\n      var info = '';\n      var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n      if (ownerName) {\n        info += 'Check the render method of \\`' + ownerName + '\\`.';\n      }\n      var warningKey = ownerName || workInProgress._debugID || '';\n      var debugSource = workInProgress._debugSource;\n      if (debugSource) {\n        warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n      }\n      if (!didWarnAboutFunctionRefs[warningKey]) {\n        didWarnAboutFunctionRefs[warningKey] = true;\n        error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);\n      }\n    }\n    if (typeof Component.getDerivedStateFromProps === 'function') {\n      var _componentName2 = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {\n        error('%s: Function components do not support getDerivedStateFromProps.', _componentName2);\n        didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;\n      }\n    }\n    if (typeof Component.contextType === 'object' && Component.contextType !== null) {\n      var _componentName3 = getComponentName(Component) || 'Unknown';\n      if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {\n        error('%s: Function components do not support contextType.', _componentName3);\n        didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;\n      }\n    }\n  }\n}\nvar SUSPENDED_MARKER = {\n  dehydrated: null,\n  retryTime: NoWork\n};\nfunction shouldRemainOnFallback(suspenseContext, current, workInProgress) {\n  // If the context is telling us that we should show a fallback, and we're not\n  // already showing content, then we should show the fallback instead.\n  return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current === null || current.memoizedState !== null);\n}\nfunction updateSuspenseComponent(current, workInProgress, renderExpirationTime) {\n  var mode = workInProgress.mode;\n  var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.\n  {\n    if (shouldSuspend(workInProgress)) {\n      workInProgress.effectTag |= DidCapture;\n    }\n  }\n  var suspenseContext = suspenseStackCursor.current;\n  var nextDidTimeout = false;\n  var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;\n  if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {\n    // Something in this boundary's subtree already suspended. Switch to\n    // rendering the fallback children.\n    nextDidTimeout = true;\n    workInProgress.effectTag &= ~DidCapture;\n  } else {\n    // Attempting the main content\n    if (current === null || current.memoizedState !== null) {\n      // This is a new mount or this boundary is already showing a fallback state.\n      // Mark this subtree context as having at least one invisible parent that could\n      // handle the fallback state.\n      // Boundaries without fallbacks or should be avoided are not considered since\n      // they cannot handle preferred fallback states.\n      if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {\n        suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);\n      }\n    }\n  }\n  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n  pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to\n  // showing the fallback children in place of the \\\\\"primary\\\\\" children.\n  // However, we don't want to delete the primary children because then their\n  // state will be lost (both the React state and the host state, e.g.\n  // uncontrolled form inputs). Instead we keep them mounted and hide them.\n  // Both the fallback children AND the primary children are rendered at the\n  // same time. Once the primary children are un-suspended, we can delete\n  // the fallback children — don't need to preserve their state.\n  //\n  // The two sets of children are siblings in the host environment, but\n  // semantically, for purposes of reconciliation, they are two separate sets.\n  // So we store them using two fragment fibers.\n  //\n  // However, we want to avoid allocating extra fibers for every placeholder.\n  // They're only necessary when the children time out, because that's the\n  // only time when both sets are mounted.\n  //\n  // So, the extra fragment fibers are only used if the children time out.\n  // Otherwise, we render the primary children directly. This requires some\n  // custom reconciliation logic to preserve the state of the primary\n  // children. It's essentially a very basic form of re-parenting.\n  if (current === null) {\n    // If we're currently hydrating, try to hydrate this boundary.\n    // But only if this has a fallback.\n    if (nextProps.fallback !== undefined) {\n      tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.\n    } // This is the initial mount. This branch is pretty simple because there's\n    // no previous state that needs to be preserved.\n    if (nextDidTimeout) {\n      // Mount separate fragments for primary and fallback children.\n      var nextFallbackChildren = nextProps.fallback;\n      var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);\n      primaryChildFragment.return = workInProgress;\n      if ((workInProgress.mode & BlockingMode) === NoMode) {\n        // Outside of blocking mode, we commit the effects from the\n        // partially completed, timed-out tree, too.\n        var progressedState = workInProgress.memoizedState;\n        var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;\n        primaryChildFragment.child = progressedPrimaryChild;\n        var progressedChild = progressedPrimaryChild;\n        while (progressedChild !== null) {\n          progressedChild.return = primaryChildFragment;\n          progressedChild = progressedChild.sibling;\n        }\n      }\n      var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);\n      fallbackChildFragment.return = workInProgress;\n      primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the\n      // fallback children.\n      workInProgress.memoizedState = SUSPENDED_MARKER;\n      workInProgress.child = primaryChildFragment;\n      return fallbackChildFragment;\n    } else {\n      // Mount the primary children without an intermediate fragment fiber.\n      var nextPrimaryChildren = nextProps.children;\n      workInProgress.memoizedState = null;\n      return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);\n    }\n  } else {\n    // This is an update. This branch is more complicated because we need to\n    // ensure the state of the primary children is preserved.\n    var prevState = current.memoizedState;\n    if (prevState !== null) {\n      // wrapped in a fragment fiber.\n      var currentPrimaryChildFragment = current.child;\n      var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n      if (nextDidTimeout) {\n        // Still timed out. Reuse the current primary children by cloning\n        // its fragment. We're going to skip over these entirely.\n        var _nextFallbackChildren2 = nextProps.fallback;\n        var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps);\n        _primaryChildFragment2.return = workInProgress;\n        if ((workInProgress.mode & BlockingMode) === NoMode) {\n          // Outside of blocking mode, we commit the effects from the\n          // partially completed, timed-out tree, too.\n          var _progressedState = workInProgress.memoizedState;\n          var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;\n          if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {\n            _primaryChildFragment2.child = _progressedPrimaryChild;\n            var _progressedChild2 = _progressedPrimaryChild;\n            while (_progressedChild2 !== null) {\n              _progressedChild2.return = _primaryChildFragment2;\n              _progressedChild2 = _progressedChild2.sibling;\n            }\n          }\n        } // Because primaryChildFragment is a new fiber that we're inserting as the\n        // parent of a new tree, we need to set its treeBaseDuration.\n        if ( workInProgress.mode & ProfileMode) {\n          // treeBaseDuration is the sum of all the child tree base durations.\n          var _treeBaseDuration = 0;\n          var _hiddenChild = _primaryChildFragment2.child;\n          while (_hiddenChild !== null) {\n            _treeBaseDuration += _hiddenChild.treeBaseDuration;\n            _hiddenChild = _hiddenChild.sibling;\n          }\n          _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;\n        } // Clone the fallback child fragment, too. These we'll continue\n        // working on.\n        var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2);\n        _fallbackChildFragment2.return = workInProgress;\n        _primaryChildFragment2.sibling = _fallbackChildFragment2;\n        _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the\n        // fallback children.\n        workInProgress.memoizedState = SUSPENDED_MARKER;\n        workInProgress.child = _primaryChildFragment2;\n        return _fallbackChildFragment2;\n      } else {\n        // No longer suspended. Switch back to showing the primary children,\n        // and remove the intermediate fragment fiber.\n        var _nextPrimaryChildren = nextProps.children;\n        var currentPrimaryChild = currentPrimaryChildFragment.child;\n        var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback\n        // children. Wait until the complete phase, after we've confirmed the\n        // fallback is no longer needed.\n        // TODO: Would it be better to store the fallback fragment on\n        // the stateNode?\n        // Continue rendering the children, like we normally do.\n        workInProgress.memoizedState = null;\n        return workInProgress.child = primaryChild;\n      }\n    } else {\n      // The current tree has not already timed out. That means the primary\n      // children are not wrapped in a fragment fiber.\n      var _currentPrimaryChild = current.child;\n      if (nextDidTimeout) {\n        // Timed out. Wrap the children in a fragment fiber to keep them\n        // separate from the fallback children.\n        var _nextFallbackChildren3 = nextProps.fallback;\n        var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't\n        // going to render this fragment.\n        null, mode, NoWork, null);\n        _primaryChildFragment3.return = workInProgress;\n        _primaryChildFragment3.child = _currentPrimaryChild;\n        if (_currentPrimaryChild !== null) {\n          _currentPrimaryChild.return = _primaryChildFragment3;\n        } // Even though we're creating a new fiber, there are no new children,\n        // because we're reusing an already mounted tree. So we don't need to\n        // schedule a placement.\n        // primaryChildFragment.effectTag |= Placement;\n        if ((workInProgress.mode & BlockingMode) === NoMode) {\n          // Outside of blocking mode, we commit the effects from the\n          // partially completed, timed-out tree, too.\n          var _progressedState2 = workInProgress.memoizedState;\n          var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;\n          _primaryChildFragment3.child = _progressedPrimaryChild2;\n          var _progressedChild3 = _progressedPrimaryChild2;\n          while (_progressedChild3 !== null) {\n            _progressedChild3.return = _primaryChildFragment3;\n            _progressedChild3 = _progressedChild3.sibling;\n          }\n        } // Because primaryChildFragment is a new fiber that we're inserting as the\n        // parent of a new tree, we need to set its treeBaseDuration.\n        if ( workInProgress.mode & ProfileMode) {\n          // treeBaseDuration is the sum of all the child tree base durations.\n          var _treeBaseDuration2 = 0;\n          var _hiddenChild2 = _primaryChildFragment3.child;\n          while (_hiddenChild2 !== null) {\n            _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;\n            _hiddenChild2 = _hiddenChild2.sibling;\n          }\n          _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;\n        } // Create a fragment from the fallback children, too.\n        var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);\n        _fallbackChildFragment3.return = workInProgress;\n        _primaryChildFragment3.sibling = _fallbackChildFragment3;\n        _fallbackChildFragment3.effectTag |= Placement;\n        _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the\n        // fallback children.\n        workInProgress.memoizedState = SUSPENDED_MARKER;\n        workInProgress.child = _primaryChildFragment3;\n        return _fallbackChildFragment3;\n      } else {\n        // Still haven't timed out. Continue rendering the children, like we\n        // normally do.\n        workInProgress.memoizedState = null;\n        var _nextPrimaryChildren2 = nextProps.children;\n        return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);\n      }\n    }\n  }\n}\nfunction scheduleWorkOnFiber(fiber, renderExpirationTime) {\n  if (fiber.expirationTime < renderExpirationTime) {\n    fiber.expirationTime = renderExpirationTime;\n  }\n  var alternate = fiber.alternate;\n  if (alternate !== null && alternate.expirationTime < renderExpirationTime) {\n    alternate.expirationTime = renderExpirationTime;\n  }\n  scheduleWorkOnParentPath(fiber.return, renderExpirationTime);\n}\nfunction propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {\n  // Mark any Suspense boundaries with fallbacks as having work to do.\n  // If they were previously forced into fallbacks, they may now be able\n  // to unblock.\n  var node = firstChild;\n  while (node !== null) {\n    if (node.tag === SuspenseComponent) {\n      var state = node.memoizedState;\n      if (state !== null) {\n        scheduleWorkOnFiber(node, renderExpirationTime);\n      }\n    } else if (node.tag === SuspenseListComponent) {\n      // If the tail is hidden there might not be an Suspense boundaries\n      // to schedule work on. In this case we have to schedule it on the\n      // list itself.\n      // We don't have to traverse to the children of the list since\n      // the list will propagate the change when it rerenders.\n      scheduleWorkOnFiber(node, renderExpirationTime);\n    } else if (node.child !== null) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === workInProgress) {\n      return;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === workInProgress) {\n        return;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n}\nfunction findLastContentRow(firstChild) {\n  // This is going to find the last row among these children that is already\n  // showing content on the screen, as opposed to being in fallback state or\n  // new. If a row has multiple Suspense boundaries, any of them being in the\n  // fallback state, counts as the whole row being in a fallback state.\n  // Note that the \\\\\"rows\\\\\" will be workInProgress, but any nested children\n  // will still be current since we haven't rendered them yet. The mounted\n  // order may not be the same as the new order. We use the new order.\n  var row = firstChild;\n  var lastContentRow = null;\n  while (row !== null) {\n    var currentRow = row.alternate; // New rows can't be content rows.\n    if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n      lastContentRow = row;\n    }\n    row = row.sibling;\n  }\n  return lastContentRow;\n}\nfunction validateRevealOrder(revealOrder) {\n  {\n    if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {\n      didWarnAboutRevealOrder[revealOrder] = true;\n      if (typeof revealOrder === 'string') {\n        switch (revealOrder.toLowerCase()) {\n          case 'together':\n          case 'forwards':\n          case 'backwards':\n            {\n              error('\\\\\"%s\\\\\" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase \\\\\"%s\\\\\" instead.', revealOrder, revealOrder.toLowerCase());\n              break;\n            }\n          case 'forward':\n          case 'backward':\n            {\n              error('\\\\\"%s\\\\\" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use \\\\\"%ss\\\\\" instead.', revealOrder, revealOrder.toLowerCase());\n              break;\n            }\n          default:\n            error('\\\\\"%s\\\\\" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean \\\\\"together\\\\\", \\\\\"forwards\\\\\" or \\\\\"backwards\\\\\"?', revealOrder);\n            break;\n        }\n      } else {\n        error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean \\\\\"together\\\\\", \\\\\"forwards\\\\\" or \\\\\"backwards\\\\\"?', revealOrder);\n      }\n    }\n  }\n}\nfunction validateTailOptions(tailMode, revealOrder) {\n  {\n    if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {\n      if (tailMode !== 'collapsed' && tailMode !== 'hidden') {\n        didWarnAboutTailOptions[tailMode] = true;\n        error('\\\\\"%s\\\\\" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean \\\\\"collapsed\\\\\" or \\\\\"hidden\\\\\"?', tailMode);\n      } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {\n        didWarnAboutTailOptions[tailMode] = true;\n        error('<SuspenseList tail=\\\\\"%s\\\\\" /> is only valid if revealOrder is ' + '\\\\\"forwards\\\\\" or \\\\\"backwards\\\\\". ' + 'Did you mean to specify revealOrder=\\\\\"forwards\\\\\"?', tailMode);\n      }\n    }\n  }\n}\nfunction validateSuspenseListNestedChild(childSlot, index) {\n  {\n    var isArray = Array.isArray(childSlot);\n    var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';\n    if (isArray || isIterable) {\n      var type = isArray ? 'array' : 'iterable';\n      error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);\n      return false;\n    }\n  }\n  return true;\n}\nfunction validateSuspenseListChildren(children, revealOrder) {\n  {\n    if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {\n      if (Array.isArray(children)) {\n        for (var i = 0; i < children.length; i++) {\n          if (!validateSuspenseListNestedChild(children[i], i)) {\n            return;\n          }\n        }\n      } else {\n        var iteratorFn = getIteratorFn(children);\n        if (typeof iteratorFn === 'function') {\n          var childrenIterator = iteratorFn.call(children);\n          if (childrenIterator) {\n            var step = childrenIterator.next();\n            var _i = 0;\n            for (; !step.done; step = childrenIterator.next()) {\n              if (!validateSuspenseListNestedChild(step.value, _i)) {\n                return;\n              }\n              _i++;\n            }\n          }\n        } else {\n          error('A single row was passed to a <SuspenseList revealOrder=\\\\\"%s\\\\\" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);\n        }\n      }\n    }\n  }\n}\nfunction initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {\n  var renderState = workInProgress.memoizedState;\n  if (renderState === null) {\n    workInProgress.memoizedState = {\n      isBackwards: isBackwards,\n      rendering: null,\n      renderingStartTime: 0,\n      last: lastContentRow,\n      tail: tail,\n      tailExpiration: 0,\n      tailMode: tailMode,\n      lastEffect: lastEffectBeforeRendering\n    };\n  } else {\n    // We can reuse the existing object from previous renders.\n    renderState.isBackwards = isBackwards;\n    renderState.rendering = null;\n    renderState.renderingStartTime = 0;\n    renderState.last = lastContentRow;\n    renderState.tail = tail;\n    renderState.tailExpiration = 0;\n    renderState.tailMode = tailMode;\n    renderState.lastEffect = lastEffectBeforeRendering;\n  }\n} // This can end up rendering this component multiple passes.\n// The first pass splits the children fibers into two sets. A head and tail.\n// We first render the head. If anything is in fallback state, we do another\n// pass through beginWork to rerender all children (including the tail) with\n// the force suspend context. If the first render didn't have anything in\n// in fallback state. Then we render each row in the tail one-by-one.\n// That happens in the completeWork phase without going back to beginWork.\nfunction updateSuspenseListComponent(current, workInProgress, renderExpirationTime) {\n  var nextProps = workInProgress.pendingProps;\n  var revealOrder = nextProps.revealOrder;\n  var tailMode = nextProps.tail;\n  var newChildren = nextProps.children;\n  validateRevealOrder(revealOrder);\n  validateTailOptions(tailMode, revealOrder);\n  validateSuspenseListChildren(newChildren, revealOrder);\n  reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n  var suspenseContext = suspenseStackCursor.current;\n  var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n  if (shouldForceFallback) {\n    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n    workInProgress.effectTag |= DidCapture;\n  } else {\n    var didSuspendBefore = current !== null && (current.effectTag & DidCapture) !== NoEffect;\n    if (didSuspendBefore) {\n      // If we previously forced a fallback, we need to schedule work\n      // on any nested boundaries to let them know to try to render\n      // again. This is the same as context updating.\n      propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);\n    }\n    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n  }\n  pushSuspenseContext(workInProgress, suspenseContext);\n  if ((workInProgress.mode & BlockingMode) === NoMode) {\n    // Outside of blocking mode, SuspenseList doesn't work so we just\n    // use make it a noop by treating it as the default revealOrder.\n    workInProgress.memoizedState = null;\n  } else {\n    switch (revealOrder) {\n      case 'forwards':\n        {\n          var lastContentRow = findLastContentRow(workInProgress.child);\n          var tail;\n          if (lastContentRow === null) {\n            // The whole list is part of the tail.\n            // TODO: We could fast path by just rendering the tail now.\n            tail = workInProgress.child;\n            workInProgress.child = null;\n          } else {\n            // Disconnect the tail rows after the content row.\n            // We're going to render them separately later.\n            tail = lastContentRow.sibling;\n            lastContentRow.sibling = null;\n          }\n          initSuspenseListRenderState(workInProgress, false, // isBackwards\n          tail, lastContentRow, tailMode, workInProgress.lastEffect);\n          break;\n        }\n      case 'backwards':\n        {\n          // We're going to find the first row that has existing content.\n          // At the same time we're going to reverse the list of everything\n          // we pass in the meantime. That's going to be our tail in reverse\n          // order.\n          var _tail = null;\n          var row = workInProgress.child;\n          workInProgress.child = null;\n          while (row !== null) {\n            var currentRow = row.alternate; // New rows can't be content rows.\n            if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n              // This is the beginning of the main content.\n              workInProgress.child = row;\n              break;\n            }\n            var nextRow = row.sibling;\n            row.sibling = _tail;\n            _tail = row;\n            row = nextRow;\n          } // TODO: If workInProgress.child is null, we can continue on the tail immediately.\n          initSuspenseListRenderState(workInProgress, true, // isBackwards\n          _tail, null, // last\n          tailMode, workInProgress.lastEffect);\n          break;\n        }\n      case 'together':\n        {\n          initSuspenseListRenderState(workInProgress, false, // isBackwards\n          null, // tail\n          null, // last\n          undefined, workInProgress.lastEffect);\n          break;\n        }\n      default:\n        {\n          // The default reveal order is the same as not having\n          // a boundary.\n          workInProgress.memoizedState = null;\n        }\n    }\n  }\n  return workInProgress.child;\n}\nfunction updatePortalComponent(current, workInProgress, renderExpirationTime) {\n  pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n  var nextChildren = workInProgress.pendingProps;\n  if (current === null) {\n    // Portals are special because we don't append the children during mount\n    // but at commit. Therefore we need to track insertions which the normal\n    // flow doesn't do during mount. This doesn't happen at the root because\n    // the root always starts with a \\\\\"current\\\\\" with a null child.\n    // TODO: Consider unifying this with how the root works.\n    workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);\n  } else {\n    reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);\n  }\n  return workInProgress.child;\n}\nfunction updateContextProvider(current, workInProgress, renderExpirationTime) {\n  var providerType = workInProgress.type;\n  var context = providerType._context;\n  var newProps = workInProgress.pendingProps;\n  var oldProps = workInProgress.memoizedProps;\n  var newValue = newProps.value;\n  {\n    var providerPropTypes = workInProgress.type.propTypes;\n    if (providerPropTypes) {\n      checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);\n    }\n  }\n  pushProvider(workInProgress, newValue);\n  if (oldProps !== null) {\n    var oldValue = oldProps.value;\n    var changedBits = calculateChangedBits(context, newValue, oldValue);\n    if (changedBits === 0) {\n      // No change. Bailout early if children are the same.\n      if (oldProps.children === newProps.children && !hasContextChanged()) {\n        return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n      }\n    } else {\n      // The context value changed. Search for matching consumers and schedule\n      // them to update.\n      propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);\n    }\n  }\n  var newChildren = newProps.children;\n  reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nvar hasWarnedAboutUsingContextAsConsumer = false;\nfunction updateContextConsumer(current, workInProgress, renderExpirationTime) {\n  var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In\n  // DEV mode, we create a separate object for Context.Consumer that acts\n  // like a proxy to Context. This proxy object adds unnecessary code in PROD\n  // so we use the old behaviour (Context.Consumer references Context) to\n  // reduce size and overhead. The separate object references context via\n  // a property called \\\\\"_context\\\\\", which also gives us the ability to check\n  // in DEV mode if this property exists or not and warn if it does not.\n  {\n    if (context._context === undefined) {\n      // This may be because it's a Context (rather than a Consumer).\n      // Or it may be because it's older React where they're the same thing.\n      // We only want to warn if we're sure it's a new React.\n      if (context !== context.Consumer) {\n        if (!hasWarnedAboutUsingContextAsConsumer) {\n          hasWarnedAboutUsingContextAsConsumer = true;\n          error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n        }\n      }\n    } else {\n      context = context._context;\n    }\n  }\n  var newProps = workInProgress.pendingProps;\n  var render = newProps.children;\n  {\n    if (typeof render !== 'function') {\n      error('A context consumer was rendered with multiple children, or a child ' + \\\\\"that isn't a function. A context consumer expects a single child \\\\\" + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');\n    }\n  }\n  prepareToReadContext(workInProgress, renderExpirationTime);\n  var newValue = readContext(context, newProps.unstable_observedBits);\n  var newChildren;\n  {\n    ReactCurrentOwner$1.current = workInProgress;\n    setIsRendering(true);\n    newChildren = render(newValue);\n    setIsRendering(false);\n  } // React DevTools reads this flag.\n  workInProgress.effectTag |= PerformedWork;\n  reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);\n  return workInProgress.child;\n}\nfunction markWorkInProgressReceivedUpdate() {\n  didReceiveUpdate = true;\n}\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime) {\n  cancelWorkTimer(workInProgress);\n  if (current !== null) {\n    // Reuse previous dependencies\n    workInProgress.dependencies = current.dependencies;\n  }\n  {\n    // Don't update \\\\\"base\\\\\" render times for bailouts.\n    stopProfilerTimerIfRunning();\n  }\n  var updateExpirationTime = workInProgress.expirationTime;\n  if (updateExpirationTime !== NoWork) {\n    markUnprocessedUpdateTime(updateExpirationTime);\n  } // Check if the children have any pending work.\n  var childExpirationTime = workInProgress.childExpirationTime;\n  if (childExpirationTime < renderExpirationTime) {\n    // The children don't have any work either. We can skip them.\n    // TODO: Once we add back resuming, we should check if the children are\n    // a work-in-progress set. If so, we need to transfer their effects.\n    return null;\n  } else {\n    // This fiber doesn't have work, but its subtree does. Clone the child\n    // fibers and continue.\n    cloneChildFibers(current, workInProgress);\n    return workInProgress.child;\n  }\n}\nfunction remountFiber(current, oldWorkInProgress, newWorkInProgress) {\n  {\n    var returnFiber = oldWorkInProgress.return;\n    if (returnFiber === null) {\n      throw new Error('Cannot swap the root fiber.');\n    } // Disconnect from the old current.\n    // It will get deleted.\n    current.alternate = null;\n    oldWorkInProgress.alternate = null; // Connect to the new tree.\n    newWorkInProgress.index = oldWorkInProgress.index;\n    newWorkInProgress.sibling = oldWorkInProgress.sibling;\n    newWorkInProgress.return = oldWorkInProgress.return;\n    newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.\n    if (oldWorkInProgress === returnFiber.child) {\n      returnFiber.child = newWorkInProgress;\n    } else {\n      var prevSibling = returnFiber.child;\n      if (prevSibling === null) {\n        throw new Error('Expected parent to have a child.');\n      }\n      while (prevSibling.sibling !== oldWorkInProgress) {\n        prevSibling = prevSibling.sibling;\n        if (prevSibling === null) {\n          throw new Error('Expected to find the previous sibling.');\n        }\n      }\n      prevSibling.sibling = newWorkInProgress;\n    } // Delete the old fiber and place the new one.\n    // Since the old fiber is disconnected, we have to schedule it manually.\n    var last = returnFiber.lastEffect;\n    if (last !== null) {\n      last.nextEffect = current;\n      returnFiber.lastEffect = current;\n    } else {\n      returnFiber.firstEffect = returnFiber.lastEffect = current;\n    }\n    current.nextEffect = null;\n    current.effectTag = Deletion;\n    newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber.\n    return newWorkInProgress;\n  }\n}\nfunction beginWork(current, workInProgress, renderExpirationTime) {\n  var updateExpirationTime = workInProgress.expirationTime;\n  {\n    if (workInProgress._debugNeedsRemount && current !== null) {\n      // This will restart the begin phase with a new fiber.\n      return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));\n    }\n  }\n  if (current !== null) {\n    var oldProps = current.memoizedProps;\n    var newProps = workInProgress.pendingProps;\n    if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:\n     workInProgress.type !== current.type )) {\n      // If props or context changed, mark the fiber as having performed work.\n      // This may be unset if the props are determined to be equal later (memo).\n      didReceiveUpdate = true;\n    } else if (updateExpirationTime < renderExpirationTime) {\n      didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering\n      // the begin phase. There's still some bookkeeping we that needs to be done\n      // in this optimized path, mostly pushing stuff onto the stack.\n      switch (workInProgress.tag) {\n        case HostRoot:\n          pushHostRootContext(workInProgress);\n          resetHydrationState();\n          break;\n        case HostComponent:\n          pushHostContext(workInProgress);\n          if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {\n            {\n              markSpawnedWork(Never);\n            } // Schedule this fiber to re-render at offscreen priority. Then bailout.\n            workInProgress.expirationTime = workInProgress.childExpirationTime = Never;\n            return null;\n          }\n          break;\n        case ClassComponent:\n          {\n            var Component = workInProgress.type;\n            if (isContextProvider(Component)) {\n              pushContextProvider(workInProgress);\n            }\n            break;\n          }\n        case HostPortal:\n          pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n          break;\n        case ContextProvider:\n          {\n            var newValue = workInProgress.memoizedProps.value;\n            pushProvider(workInProgress, newValue);\n            break;\n          }\n        case Profiler:\n          {\n            // Profiler should only call onRender when one of its descendants actually rendered.\n            var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;\n            if (hasChildWork) {\n              workInProgress.effectTag |= Update;\n            }\n          }\n          break;\n        case SuspenseComponent:\n          {\n            var state = workInProgress.memoizedState;\n            if (state !== null) {\n              // whether to retry the primary children, or to skip over it and\n              // go straight to the fallback. Check the priority of the primary\n              // child fragment.\n              var primaryChildFragment = workInProgress.child;\n              var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;\n              if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {\n                // The primary children have pending work. Use the normal path\n                // to attempt to render the primary children again.\n                return updateSuspenseComponent(current, workInProgress, renderExpirationTime);\n              } else {\n                pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient\n                // priority. Bailout.\n                var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n                if (child !== null) {\n                  // The fallback children have pending work. Skip over the\n                  // primary children and work on the fallback.\n                  return child.sibling;\n                } else {\n                  return null;\n                }\n              }\n            } else {\n              pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));\n            }\n            break;\n          }\n        case SuspenseListComponent:\n          {\n            var didSuspendBefore = (current.effectTag & DidCapture) !== NoEffect;\n            var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;\n            if (didSuspendBefore) {\n              if (_hasChildWork) {\n                // If something was in fallback state last time, and we have all the\n                // same children then we're still in progressive loading state.\n                // Something might get unblocked by state updates or retries in the\n                // tree which will affect the tail. So we need to use the normal\n                // path to compute the correct tail.\n                return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);\n              } // If none of the children had any work, that means that none of\n              // them got retried so they'll still be blocked in the same way\n              // as before. We can fast bail out.\n              workInProgress.effectTag |= DidCapture;\n            } // If nothing suspended before and we're rendering the same children,\n            // then the tail doesn't matter. Anything new that suspends will work\n            // in the \\\\\"together\\\\\" mode, so we can continue from the state we had.\n            var renderState = workInProgress.memoizedState;\n            if (renderState !== null) {\n              // Reset to the \\\\\"together\\\\\" mode in case we've started a different\n              // update in the past but didn't complete it.\n              renderState.rendering = null;\n              renderState.tail = null;\n            }\n            pushSuspenseContext(workInProgress, suspenseStackCursor.current);\n            if (_hasChildWork) {\n              break;\n            } else {\n              // If none of the children had any work, that means that none of\n              // them got retried so they'll still be blocked in the same way\n              // as before. We can fast bail out.\n              return null;\n            }\n          }\n      }\n      return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);\n    } else {\n      // An update was scheduled on this fiber, but there are no new props\n      // nor legacy context. Set this to false. If an update queue or context\n      // consumer produces a changed value, it will set this to true. Otherwise,\n      // the component will assume the children have not changed and bail out.\n      didReceiveUpdate = false;\n    }\n  } else {\n    didReceiveUpdate = false;\n  } // Before entering the begin phase, clear pending update priority.\n  // TODO: This assumes that we're about to evaluate the component and process\n  // the update queue. However, there's an exception: SimpleMemoComponent\n  // sometimes bails out later in the begin phase. This indicates that we should\n  // move this assignment out of the common path and into each branch.\n  workInProgress.expirationTime = NoWork;\n  switch (workInProgress.tag) {\n    case IndeterminateComponent:\n      {\n        return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime);\n      }\n    case LazyComponent:\n      {\n        var elementType = workInProgress.elementType;\n        return mountLazyComponent(current, workInProgress, elementType, updateExpirationTime, renderExpirationTime);\n      }\n    case FunctionComponent:\n      {\n        var _Component = workInProgress.type;\n        var unresolvedProps = workInProgress.pendingProps;\n        var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);\n        return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderExpirationTime);\n      }\n    case ClassComponent:\n      {\n        var _Component2 = workInProgress.type;\n        var _unresolvedProps = workInProgress.pendingProps;\n        var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);\n        return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderExpirationTime);\n      }\n    case HostRoot:\n      return updateHostRoot(current, workInProgress, renderExpirationTime);\n    case HostComponent:\n      return updateHostComponent(current, workInProgress, renderExpirationTime);\n    case HostText:\n      return updateHostText(current, workInProgress);\n    case SuspenseComponent:\n      return updateSuspenseComponent(current, workInProgress, renderExpirationTime);\n    case HostPortal:\n      return updatePortalComponent(current, workInProgress, renderExpirationTime);\n    case ForwardRef:\n      {\n        var type = workInProgress.type;\n        var _unresolvedProps2 = workInProgress.pendingProps;\n        var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);\n        return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderExpirationTime);\n      }\n    case Fragment:\n      return updateFragment(current, workInProgress, renderExpirationTime);\n    case Mode:\n      return updateMode(current, workInProgress, renderExpirationTime);\n    case Profiler:\n      return updateProfiler(current, workInProgress, renderExpirationTime);\n    case ContextProvider:\n      return updateContextProvider(current, workInProgress, renderExpirationTime);\n    case ContextConsumer:\n      return updateContextConsumer(current, workInProgress, renderExpirationTime);\n    case MemoComponent:\n      {\n        var _type2 = workInProgress.type;\n        var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.\n        var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);\n        {\n          if (workInProgress.type !== workInProgress.elementType) {\n            var outerPropTypes = _type2.propTypes;\n            if (outerPropTypes) {\n              checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only\n              'prop', getComponentName(_type2), getCurrentFiberStackInDev);\n            }\n          }\n        }\n        _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);\n        return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);\n      }\n    case SimpleMemoComponent:\n      {\n        return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);\n      }\n    case IncompleteClassComponent:\n      {\n        var _Component3 = workInProgress.type;\n        var _unresolvedProps4 = workInProgress.pendingProps;\n        var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);\n        return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);\n      }\n    case SuspenseListComponent:\n      {\n        return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);\n      }\n  }\n  {\n    {\n      throw Error( \\\\\"Unknown unit of work tag (\\\\\" + workInProgress.tag + \\\\\"). This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction markUpdate(workInProgress) {\n  // Tag the fiber with an update effect. This turns a Placement into\n  // a PlacementAndUpdate.\n  workInProgress.effectTag |= Update;\n}\nfunction markRef$1(workInProgress) {\n  workInProgress.effectTag |= Ref;\n}\nvar appendAllChildren;\nvar updateHostContainer;\nvar updateHostComponent$1;\nvar updateHostText$1;\n{\n  // Mutation mode\n  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {\n    // We only have the top Fiber that was created but we need recurse down its\n    // children to find all the terminal nodes.\n    var node = workInProgress.child;\n    while (node !== null) {\n      if (node.tag === HostComponent || node.tag === HostText) {\n        appendInitialChild(parent, node.stateNode);\n      } else if (node.tag === HostPortal) ; else if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n      if (node === workInProgress) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node.return === null || node.return === workInProgress) {\n          return;\n        }\n        node = node.return;\n      }\n      node.sibling.return = node.return;\n      node = node.sibling;\n    }\n  };\n  updateHostContainer = function (workInProgress) {// Noop\n  };\n  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {\n    // If we have an alternate, that means this is an update and we need to\n    // schedule a side-effect to do the updates.\n    var oldProps = current.memoizedProps;\n    if (oldProps === newProps) {\n      // In mutation mode, this is sufficient for a bailout because\n      // we won't touch this node even if children changed.\n      return;\n    } // If we get updated because one of our children updated, we don't\n    // have newProps so we'll have to reuse them.\n    // TODO: Split the update API as separate for the props vs. children.\n    // Even better would be if children weren't special cased at all tho.\n    var instance = workInProgress.stateNode;\n    var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host\n    // component is hitting the resume path. Figure out why. Possibly\n    // related to \\`hidden\\`.\n    var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.\n    workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there\n    // is a new ref we mark this as an update. All the work is done in commitWork.\n    if (updatePayload) {\n      markUpdate(workInProgress);\n    }\n  };\n  updateHostText$1 = function (current, workInProgress, oldText, newText) {\n    // If the text differs, mark it as an update. All the work in done in commitWork.\n    if (oldText !== newText) {\n      markUpdate(workInProgress);\n    }\n  };\n}\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n  switch (renderState.tailMode) {\n    case 'hidden':\n      {\n        // Any insertions at the end of the tail list after this point\n        // should be invisible. If there are already mounted boundaries\n        // anything before them are not considered for collapsing.\n        // Therefore we need to go through the whole tail to find if\n        // there are any.\n        var tailNode = renderState.tail;\n        var lastTailNode = null;\n        while (tailNode !== null) {\n          if (tailNode.alternate !== null) {\n            lastTailNode = tailNode;\n          }\n          tailNode = tailNode.sibling;\n        } // Next we're simply going to delete all insertions after the\n        // last rendered item.\n        if (lastTailNode === null) {\n          // All remaining items in the tail are insertions.\n          renderState.tail = null;\n        } else {\n          // Detach the insertion after the last node that was already\n          // inserted.\n          lastTailNode.sibling = null;\n        }\n        break;\n      }\n    case 'collapsed':\n      {\n        // Any insertions at the end of the tail list after this point\n        // should be invisible. If there are already mounted boundaries\n        // anything before them are not considered for collapsing.\n        // Therefore we need to go through the whole tail to find if\n        // there are any.\n        var _tailNode = renderState.tail;\n        var _lastTailNode = null;\n        while (_tailNode !== null) {\n          if (_tailNode.alternate !== null) {\n            _lastTailNode = _tailNode;\n          }\n          _tailNode = _tailNode.sibling;\n        } // Next we're simply going to delete all insertions after the\n        // last rendered item.\n        if (_lastTailNode === null) {\n          // All remaining items in the tail are insertions.\n          if (!hasRenderedATailFallback && renderState.tail !== null) {\n            // We suspended during the head. We want to show at least one\n            // row at the tail. So we'll keep on and cut off the rest.\n            renderState.tail.sibling = null;\n          } else {\n            renderState.tail = null;\n          }\n        } else {\n          // Detach the insertion after the last node that was already\n          // inserted.\n          _lastTailNode.sibling = null;\n        }\n        break;\n      }\n  }\n}\nfunction completeWork(current, workInProgress, renderExpirationTime) {\n  var newProps = workInProgress.pendingProps;\n  switch (workInProgress.tag) {\n    case IndeterminateComponent:\n    case LazyComponent:\n    case SimpleMemoComponent:\n    case FunctionComponent:\n    case ForwardRef:\n    case Fragment:\n    case Mode:\n    case Profiler:\n    case ContextConsumer:\n    case MemoComponent:\n      return null;\n    case ClassComponent:\n      {\n        var Component = workInProgress.type;\n        if (isContextProvider(Component)) {\n          popContext(workInProgress);\n        }\n        return null;\n      }\n    case HostRoot:\n      {\n        popHostContainer(workInProgress);\n        popTopLevelContextObject(workInProgress);\n        var fiberRoot = workInProgress.stateNode;\n        if (fiberRoot.pendingContext) {\n          fiberRoot.context = fiberRoot.pendingContext;\n          fiberRoot.pendingContext = null;\n        }\n        if (current === null || current.child === null) {\n          // If we hydrated, pop so that we can delete any remaining children\n          // that weren't hydrated.\n          var wasHydrated = popHydrationState(workInProgress);\n          if (wasHydrated) {\n            // If we hydrated, then we'll need to schedule an update for\n            // the commit side-effects on the root.\n            markUpdate(workInProgress);\n          }\n        }\n        updateHostContainer(workInProgress);\n        return null;\n      }\n    case HostComponent:\n      {\n        popHostContext(workInProgress);\n        var rootContainerInstance = getRootHostContainer();\n        var type = workInProgress.type;\n        if (current !== null && workInProgress.stateNode != null) {\n          updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);\n          if (current.ref !== workInProgress.ref) {\n            markRef$1(workInProgress);\n          }\n        } else {\n          if (!newProps) {\n            if (!(workInProgress.stateNode !== null)) {\n              {\n                throw Error( \\\\\"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n              }\n            } // This can happen when we abort work.\n            return null;\n          }\n          var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context\n          // \\\\\"stack\\\\\" as the parent. Then append children as we go in beginWork\n          // or completeWork depending on whether we want to add them top->down or\n          // bottom->up. Top->down is faster in IE11.\n          var _wasHydrated = popHydrationState(workInProgress);\n          if (_wasHydrated) {\n            // TODO: Move this and createInstance step into the beginPhase\n            // to consolidate.\n            if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {\n              // If changes to the hydrated node need to be applied at the\n              // commit-phase we mark this as such.\n              markUpdate(workInProgress);\n            }\n          } else {\n            var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);\n            appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners\n            workInProgress.stateNode = instance;\n            // (eg DOM renderer supports auto-focus for certain elements).\n            // Make sure such renderers get scheduled for later work.\n            if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {\n              markUpdate(workInProgress);\n            }\n          }\n          if (workInProgress.ref !== null) {\n            // If there is a ref on a host node we need to schedule a callback\n            markRef$1(workInProgress);\n          }\n        }\n        return null;\n      }\n    case HostText:\n      {\n        var newText = newProps;\n        if (current && workInProgress.stateNode != null) {\n          var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need\n          // to schedule a side-effect to do the updates.\n          updateHostText$1(current, workInProgress, oldText, newText);\n        } else {\n          if (typeof newText !== 'string') {\n            if (!(workInProgress.stateNode !== null)) {\n              {\n                throw Error( \\\\\"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n              }\n            } // This can happen when we abort work.\n          }\n          var _rootContainerInstance = getRootHostContainer();\n          var _currentHostContext = getHostContext();\n          var _wasHydrated2 = popHydrationState(workInProgress);\n          if (_wasHydrated2) {\n            if (prepareToHydrateHostTextInstance(workInProgress)) {\n              markUpdate(workInProgress);\n            }\n          } else {\n            workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);\n          }\n        }\n        return null;\n      }\n    case SuspenseComponent:\n      {\n        popSuspenseContext(workInProgress);\n        var nextState = workInProgress.memoizedState;\n        if ((workInProgress.effectTag & DidCapture) !== NoEffect) {\n          // Something suspended. Re-render with the fallback children.\n          workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list.\n          return workInProgress;\n        }\n        var nextDidTimeout = nextState !== null;\n        var prevDidTimeout = false;\n        if (current === null) {\n          if (workInProgress.memoizedProps.fallback !== undefined) {\n            popHydrationState(workInProgress);\n          }\n        } else {\n          var prevState = current.memoizedState;\n          prevDidTimeout = prevState !== null;\n          if (!nextDidTimeout && prevState !== null) {\n            // We just switched from the fallback to the normal children.\n            // Delete the fallback.\n            // TODO: Would it be better to store the fallback fragment on\n            // the stateNode during the begin phase?\n            var currentFallbackChild = current.child.sibling;\n            if (currentFallbackChild !== null) {\n              // Deletions go at the beginning of the return fiber's effect list\n              var first = workInProgress.firstEffect;\n              if (first !== null) {\n                workInProgress.firstEffect = currentFallbackChild;\n                currentFallbackChild.nextEffect = first;\n              } else {\n                workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;\n                currentFallbackChild.nextEffect = null;\n              }\n              currentFallbackChild.effectTag = Deletion;\n            }\n          }\n        }\n        if (nextDidTimeout && !prevDidTimeout) {\n          // If this subtreee is running in blocking mode we can suspend,\n          // otherwise we won't suspend.\n          // TODO: This will still suspend a synchronous tree if anything\n          // in the concurrent tree already suspended during this render.\n          // This is a known bug.\n          if ((workInProgress.mode & BlockingMode) !== NoMode) {\n            // TODO: Move this back to throwException because this is too late\n            // if this is a large tree which is common for initial loads. We\n            // don't know if we should restart a render or not until we get\n            // this marker, and this is too late.\n            // If this render already had a ping or lower pri updates,\n            // and this is the first time we know we're going to suspend we\n            // should be able to immediately restart from within throwException.\n            var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;\n            if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {\n              // If this was in an invisible tree or a new render, then showing\n              // this boundary is ok.\n              renderDidSuspend();\n            } else {\n              // Otherwise, we're going to have to hide content so we should\n              // suspend for longer if possible.\n              renderDidSuspendDelayIfPossible();\n            }\n          }\n        }\n        {\n          // TODO: Only schedule updates if these values are non equal, i.e. it changed.\n          if (nextDidTimeout || prevDidTimeout) {\n            // If this boundary just timed out, schedule an effect to attach a\n            // retry listener to the promise. This flag is also used to hide the\n            // primary children. In mutation mode, we also need the flag to\n            // *unhide* children that were previously hidden, so check if this\n            // is currently timed out, too.\n            workInProgress.effectTag |= Update;\n          }\n        }\n        return null;\n      }\n    case HostPortal:\n      popHostContainer(workInProgress);\n      updateHostContainer(workInProgress);\n      return null;\n    case ContextProvider:\n      // Pop provider fiber\n      popProvider(workInProgress);\n      return null;\n    case IncompleteClassComponent:\n      {\n        // Same as class component case. I put it down here so that the tags are\n        // sequential to ensure this switch is compiled to a jump table.\n        var _Component = workInProgress.type;\n        if (isContextProvider(_Component)) {\n          popContext(workInProgress);\n        }\n        return null;\n      }\n    case SuspenseListComponent:\n      {\n        popSuspenseContext(workInProgress);\n        var renderState = workInProgress.memoizedState;\n        if (renderState === null) {\n          // We're running in the default, \\\\\"independent\\\\\" mode.\n          // We don't do anything in this mode.\n          return null;\n        }\n        var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;\n        var renderedTail = renderState.rendering;\n        if (renderedTail === null) {\n          // We just rendered the head.\n          if (!didSuspendAlready) {\n            // This is the first pass. We need to figure out if anything is still\n            // suspended in the rendered set.\n            // If new content unsuspended, but there's still some content that\n            // didn't. Then we need to do a second pass that forces everything\n            // to keep showing their fallbacks.\n            // We might be suspended if something in this render pass suspended, or\n            // something in the previous committed pass suspended. Otherwise,\n            // there's no chance so we can skip the expensive call to\n            // findFirstSuspended.\n            var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);\n            if (!cannotBeSuspended) {\n              var row = workInProgress.child;\n              while (row !== null) {\n                var suspended = findFirstSuspended(row);\n                if (suspended !== null) {\n                  didSuspendAlready = true;\n                  workInProgress.effectTag |= DidCapture;\n                  cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as\n                  // part of the second pass. In that case nothing will subscribe to\n                  // its thennables. Instead, we'll transfer its thennables to the\n                  // SuspenseList so that it can retry if they resolve.\n                  // There might be multiple of these in the list but since we're\n                  // going to wait for all of them anyway, it doesn't really matter\n                  // which ones gets to ping. In theory we could get clever and keep\n                  // track of how many dependencies remain but it gets tricky because\n                  // in the meantime, we can add/remove/change items and dependencies.\n                  // We might bail out of the loop before finding any but that\n                  // doesn't matter since that means that the other boundaries that\n                  // we did find already has their listeners attached.\n                  var newThennables = suspended.updateQueue;\n                  if (newThennables !== null) {\n                    workInProgress.updateQueue = newThennables;\n                    workInProgress.effectTag |= Update;\n                  } // Rerender the whole list, but this time, we'll force fallbacks\n                  // to stay in place.\n                  // Reset the effect list before doing the second pass since that's now invalid.\n                  if (renderState.lastEffect === null) {\n                    workInProgress.firstEffect = null;\n                  }\n                  workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.\n                  resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately\n                  // rerender the children.\n                  pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));\n                  return workInProgress.child;\n                }\n                row = row.sibling;\n              }\n            }\n          } else {\n            cutOffTailIfNeeded(renderState, false);\n          } // Next we're going to render the tail.\n        } else {\n          // Append the rendered row to the child list.\n          if (!didSuspendAlready) {\n            var _suspended = findFirstSuspended(renderedTail);\n            if (_suspended !== null) {\n              workInProgress.effectTag |= DidCapture;\n              didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't\n              // get lost if this row ends up dropped during a second pass.\n              var _newThennables = _suspended.updateQueue;\n              if (_newThennables !== null) {\n                workInProgress.updateQueue = _newThennables;\n                workInProgress.effectTag |= Update;\n              }\n              cutOffTailIfNeeded(renderState, true); // This might have been modified.\n              if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {\n                // We need to delete the row we just rendered.\n                // Reset the effect list to what it was before we rendered this\n                // child. The nested children have already appended themselves.\n                var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.\n                if (lastEffect !== null) {\n                  lastEffect.nextEffect = null;\n                } // We're done.\n                return null;\n              }\n            } else if ( // The time it took to render last row is greater than time until\n            // the expiration.\n            now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime > Never) {\n              // We have now passed our CPU deadline and we'll just give up further\n              // attempts to render the main content and only render fallbacks.\n              // The assumption is that this is usually faster.\n              workInProgress.effectTag |= DidCapture;\n              didSuspendAlready = true;\n              cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this\n              // to get it started back up to attempt the next item. If we can show\n              // them, then they really have the same priority as this render.\n              // So we'll pick it back up the very next render pass once we've had\n              // an opportunity to yield for paint.\n              var nextPriority = renderExpirationTime - 1;\n              workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;\n              {\n                markSpawnedWork(nextPriority);\n              }\n            }\n          }\n          if (renderState.isBackwards) {\n            // The effect list of the backwards tail will have been added\n            // to the end. This breaks the guarantee that life-cycles fire in\n            // sibling order but that isn't a strong guarantee promised by React.\n            // Especially since these might also just pop in during future commits.\n            // Append to the beginning of the list.\n            renderedTail.sibling = workInProgress.child;\n            workInProgress.child = renderedTail;\n          } else {\n            var previousSibling = renderState.last;\n            if (previousSibling !== null) {\n              previousSibling.sibling = renderedTail;\n            } else {\n              workInProgress.child = renderedTail;\n            }\n            renderState.last = renderedTail;\n          }\n        }\n        if (renderState.tail !== null) {\n          // We still have tail rows to render.\n          if (renderState.tailExpiration === 0) {\n            // Heuristic for how long we're willing to spend rendering rows\n            // until we just give up and show what we have so far.\n            var TAIL_EXPIRATION_TIMEOUT_MS = 500;\n            renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS; // TODO: This is meant to mimic the train model or JND but this\n            // is a per component value. It should really be since the start\n            // of the total render or last commit. Consider using something like\n            // globalMostRecentFallbackTime. That doesn't account for being\n            // suspended for part of the time or when it's a new render.\n            // It should probably use a global start time value instead.\n          } // Pop a row.\n          var next = renderState.tail;\n          renderState.rendering = next;\n          renderState.tail = next.sibling;\n          renderState.lastEffect = workInProgress.lastEffect;\n          renderState.renderingStartTime = now();\n          next.sibling = null; // Restore the context.\n          // TODO: We can probably just avoid popping it instead and only\n          // setting it the first time we go from not suspended to suspended.\n          var suspenseContext = suspenseStackCursor.current;\n          if (didSuspendAlready) {\n            suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n          } else {\n            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n          }\n          pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.\n          return next;\n        }\n        return null;\n      }\n  }\n  {\n    {\n      throw Error( \\\\\"Unknown unit of work tag (\\\\\" + workInProgress.tag + \\\\\"). This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction unwindWork(workInProgress, renderExpirationTime) {\n  switch (workInProgress.tag) {\n    case ClassComponent:\n      {\n        var Component = workInProgress.type;\n        if (isContextProvider(Component)) {\n          popContext(workInProgress);\n        }\n        var effectTag = workInProgress.effectTag;\n        if (effectTag & ShouldCapture) {\n          workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;\n          return workInProgress;\n        }\n        return null;\n      }\n    case HostRoot:\n      {\n        popHostContainer(workInProgress);\n        popTopLevelContextObject(workInProgress);\n        var _effectTag = workInProgress.effectTag;\n        if (!((_effectTag & DidCapture) === NoEffect)) {\n          {\n            throw Error( \\\\\"The root failed to unmount after an error. This is likely a bug in React. Please file an issue.\\\\\" );\n          }\n        }\n        workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;\n        return workInProgress;\n      }\n    case HostComponent:\n      {\n        // TODO: popHydrationState\n        popHostContext(workInProgress);\n        return null;\n      }\n    case SuspenseComponent:\n      {\n        popSuspenseContext(workInProgress);\n        var _effectTag2 = workInProgress.effectTag;\n        if (_effectTag2 & ShouldCapture) {\n          workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.\n          return workInProgress;\n        }\n        return null;\n      }\n    case SuspenseListComponent:\n      {\n        popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been\n        // caught by a nested boundary. If not, it should bubble through.\n        return null;\n      }\n    case HostPortal:\n      popHostContainer(workInProgress);\n      return null;\n    case ContextProvider:\n      popProvider(workInProgress);\n      return null;\n    default:\n      return null;\n  }\n}\nfunction unwindInterruptedWork(interruptedWork) {\n  switch (interruptedWork.tag) {\n    case ClassComponent:\n      {\n        var childContextTypes = interruptedWork.type.childContextTypes;\n        if (childContextTypes !== null && childContextTypes !== undefined) {\n          popContext(interruptedWork);\n        }\n        break;\n      }\n    case HostRoot:\n      {\n        popHostContainer(interruptedWork);\n        popTopLevelContextObject(interruptedWork);\n        break;\n      }\n    case HostComponent:\n      {\n        popHostContext(interruptedWork);\n        break;\n      }\n    case HostPortal:\n      popHostContainer(interruptedWork);\n      break;\n    case SuspenseComponent:\n      popSuspenseContext(interruptedWork);\n      break;\n    case SuspenseListComponent:\n      popSuspenseContext(interruptedWork);\n      break;\n    case ContextProvider:\n      popProvider(interruptedWork);\n      break;\n  }\n}\nfunction createCapturedValue(value, source) {\n  // If the value is an error, call this function immediately after it is thrown\n  // so the stack is accurate.\n  return {\n    value: value,\n    source: source,\n    stack: getStackByFiberInDevAndProd(source)\n  };\n}\nfunction logCapturedError(capturedError) {\n  var error = capturedError.error;\n  {\n    var componentName = capturedError.componentName,\n        componentStack = capturedError.componentStack,\n        errorBoundaryName = capturedError.errorBoundaryName,\n        errorBoundaryFound = capturedError.errorBoundaryFound,\n        willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling\n    // \\`preventDefault()\\` in window \\`error\\` handler.\n    // We record this information as an expando on the error.\n    if (error != null && error._suppressLogging) {\n      if (errorBoundaryFound && willRetry) {\n        // The error is recoverable and was silenced.\n        // Ignore it and don't print the stack addendum.\n        // This is handy for testing error boundaries without noise.\n        return;\n      } // The error is fatal. Since the silencing might have\n      // been accidental, we'll surface it anyway.\n      // However, the browser would have silenced the original error\n      // so we'll print it first, and then print the stack addendum.\n      console['error'](error); // Don't transform to our wrapper\n      // For a more detailed description of this block, see:\n      // https://github.com/facebook/react/pull/13384\n    }\n    var componentNameMessage = componentName ? \\\\\"The above error occurred in the <\\\\\" + componentName + \\\\\"> component:\\\\\" : 'The above error occurred in one of your React components:';\n    var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.\n    if (errorBoundaryFound && errorBoundaryName) {\n      if (willRetry) {\n        errorBoundaryMessage = \\\\\"React will try to recreate this component tree from scratch \\\\\" + (\\\\\"using the error boundary you provided, \\\\\" + errorBoundaryName + \\\\\".\\\\\");\n      } else {\n        errorBoundaryMessage = \\\\\"This error was initially handled by the error boundary \\\\\" + errorBoundaryName + \\\\\".\\\\\" + \\\\\"Recreating the tree from scratch failed so React will unmount the tree.\\\\\";\n      }\n    } else {\n      errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';\n    }\n    var combinedMessage = \\\\\"\\\\\" + componentNameMessage + componentStack + \\\\\"\\\\\" + (\\\\\"\\\\\" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.\n    // We don't include the original error message and JS stack because the browser\n    // has already printed it. Even if the application swallows the error, it is still\n    // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n    console['error'](combinedMessage); // Don't transform to our wrapper\n  }\n}\nvar didWarnAboutUndefinedSnapshotBeforeUpdate = null;\n{\n  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();\n}\nvar PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;\nfunction logError(boundary, errorInfo) {\n  var source = errorInfo.source;\n  var stack = errorInfo.stack;\n  if (stack === null && source !== null) {\n    stack = getStackByFiberInDevAndProd(source);\n  }\n  var capturedError = {\n    componentName: source !== null ? getComponentName(source.type) : null,\n    componentStack: stack !== null ? stack : '',\n    error: errorInfo.value,\n    errorBoundary: null,\n    errorBoundaryName: null,\n    errorBoundaryFound: false,\n    willRetry: false\n  };\n  if (boundary !== null && boundary.tag === ClassComponent) {\n    capturedError.errorBoundary = boundary.stateNode;\n    capturedError.errorBoundaryName = getComponentName(boundary.type);\n    capturedError.errorBoundaryFound = true;\n    capturedError.willRetry = true;\n  }\n  try {\n    logCapturedError(capturedError);\n  } catch (e) {\n    // This method must not throw, or React internal state will get messed up.\n    // If console.error is overridden, or logCapturedError() shows a dialog that throws,\n    // we want to report this error outside of the normal stack as a last resort.\n    // https://github.com/facebook/react/issues/13188\n    setTimeout(function () {\n      throw e;\n    });\n  }\n}\nvar callComponentWillUnmountWithTimer = function (current, instance) {\n  startPhaseTimer(current, 'componentWillUnmount');\n  instance.props = current.memoizedProps;\n  instance.state = current.memoizedState;\n  instance.componentWillUnmount();\n  stopPhaseTimer();\n}; // Capture errors so they don't interrupt unmounting.\nfunction safelyCallComponentWillUnmount(current, instance) {\n  {\n    invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);\n    if (hasCaughtError()) {\n      var unmountError = clearCaughtError();\n      captureCommitPhaseError(current, unmountError);\n    }\n  }\n}\nfunction safelyDetachRef(current) {\n  var ref = current.ref;\n  if (ref !== null) {\n    if (typeof ref === 'function') {\n      {\n        invokeGuardedCallback(null, ref, null, null);\n        if (hasCaughtError()) {\n          var refError = clearCaughtError();\n          captureCommitPhaseError(current, refError);\n        }\n      }\n    } else {\n      ref.current = null;\n    }\n  }\n}\nfunction safelyCallDestroy(current, destroy) {\n  {\n    invokeGuardedCallback(null, destroy, null);\n    if (hasCaughtError()) {\n      var error = clearCaughtError();\n      captureCommitPhaseError(current, error);\n    }\n  }\n}\nfunction commitBeforeMutationLifeCycles(current, finishedWork) {\n  switch (finishedWork.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        return;\n      }\n    case ClassComponent:\n      {\n        if (finishedWork.effectTag & Snapshot) {\n          if (current !== null) {\n            var prevProps = current.memoizedProps;\n            var prevState = current.memoizedState;\n            startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');\n            var instance = finishedWork.stateNode; // We could update instance props and state here,\n            // but instead we rely on them being set during last render.\n            // TODO: revisit this when we implement resuming.\n            {\n              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n                if (instance.props !== finishedWork.memoizedProps) {\n                  error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n                if (instance.state !== finishedWork.memoizedState) {\n                  error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n              }\n            }\n            var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);\n            {\n              var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;\n              if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {\n                didWarnSet.add(finishedWork.type);\n                error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));\n              }\n            }\n            instance.__reactInternalSnapshotBeforeUpdate = snapshot;\n            stopPhaseTimer();\n          }\n        }\n        return;\n      }\n    case HostRoot:\n    case HostComponent:\n    case HostText:\n    case HostPortal:\n    case IncompleteClassComponent:\n      // Nothing to do for these component types\n      return;\n  }\n  {\n    {\n      throw Error( \\\\\"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction commitHookEffectListUnmount(tag, finishedWork) {\n  var updateQueue = finishedWork.updateQueue;\n  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n  if (lastEffect !== null) {\n    var firstEffect = lastEffect.next;\n    var effect = firstEffect;\n    do {\n      if ((effect.tag & tag) === tag) {\n        // Unmount\n        var destroy = effect.destroy;\n        effect.destroy = undefined;\n        if (destroy !== undefined) {\n          destroy();\n        }\n      }\n      effect = effect.next;\n    } while (effect !== firstEffect);\n  }\n}\nfunction commitHookEffectListMount(tag, finishedWork) {\n  var updateQueue = finishedWork.updateQueue;\n  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n  if (lastEffect !== null) {\n    var firstEffect = lastEffect.next;\n    var effect = firstEffect;\n    do {\n      if ((effect.tag & tag) === tag) {\n        // Mount\n        var create = effect.create;\n        effect.destroy = create();\n        {\n          var destroy = effect.destroy;\n          if (destroy !== undefined && typeof destroy !== 'function') {\n            var addendum = void 0;\n            if (destroy === null) {\n              addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';\n            } else if (typeof destroy.then === 'function') {\n              addendum = 'It looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:' + 'useEffect(() => {' + '  async function fetchData() {' + '    // You can await here' + '    const response = await MyAPI.getData(someId);' + '    // ...' + '  }' + '  fetchData();' + \\\\\"}, [someId]); // Or [] if effect doesn't need props or state\\\\\" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';\n            } else {\n              addendum = ' You returned: ' + destroy;\n            }\n            error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));\n          }\n        }\n      }\n      effect = effect.next;\n    } while (effect !== firstEffect);\n  }\n}\nfunction commitPassiveHookEffects(finishedWork) {\n  if ((finishedWork.effectTag & Passive) !== NoEffect) {\n    switch (finishedWork.tag) {\n      case FunctionComponent:\n      case ForwardRef:\n      case SimpleMemoComponent:\n      case Block:\n        {\n          // TODO (#17945) We should call all passive destroy functions (for all fibers)\n          // before calling any create functions. The current approach only serializes\n          // these for a single fiber.\n          commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork);\n          commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);\n          break;\n        }\n    }\n  }\n}\nfunction commitLifeCycles(finishedRoot, current, finishedWork, committedExpirationTime) {\n  switch (finishedWork.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        // At this point layout effects have already been destroyed (during mutation phase).\n        // This is done to prevent sibling component effects from interfering with each other,\n        // e.g. a destroy function in one component should never override a ref set\n        // by a create function in another component during the same commit.\n        commitHookEffectListMount(Layout | HasEffect, finishedWork);\n        return;\n      }\n    case ClassComponent:\n      {\n        var instance = finishedWork.stateNode;\n        if (finishedWork.effectTag & Update) {\n          if (current === null) {\n            startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here,\n            // but instead we rely on them being set during last render.\n            // TODO: revisit this when we implement resuming.\n            {\n              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n                if (instance.props !== finishedWork.memoizedProps) {\n                  error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n                if (instance.state !== finishedWork.memoizedState) {\n                  error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n              }\n            }\n            instance.componentDidMount();\n            stopPhaseTimer();\n          } else {\n            var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);\n            var prevState = current.memoizedState;\n            startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here,\n            // but instead we rely on them being set during last render.\n            // TODO: revisit this when we implement resuming.\n            {\n              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n                if (instance.props !== finishedWork.memoizedProps) {\n                  error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n                if (instance.state !== finishedWork.memoizedState) {\n                  error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n                }\n              }\n            }\n            instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n            stopPhaseTimer();\n          }\n        }\n        var updateQueue = finishedWork.updateQueue;\n        if (updateQueue !== null) {\n          {\n            if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n              if (instance.props !== finishedWork.memoizedProps) {\n                error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n              }\n              if (instance.state !== finishedWork.memoizedState) {\n                error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own \\`this.props\\`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n              }\n            }\n          } // We could update instance props and state here,\n          // but instead we rely on them being set during last render.\n          // TODO: revisit this when we implement resuming.\n          commitUpdateQueue(finishedWork, updateQueue, instance);\n        }\n        return;\n      }\n    case HostRoot:\n      {\n        var _updateQueue = finishedWork.updateQueue;\n        if (_updateQueue !== null) {\n          var _instance = null;\n          if (finishedWork.child !== null) {\n            switch (finishedWork.child.tag) {\n              case HostComponent:\n                _instance = getPublicInstance(finishedWork.child.stateNode);\n                break;\n              case ClassComponent:\n                _instance = finishedWork.child.stateNode;\n                break;\n            }\n          }\n          commitUpdateQueue(finishedWork, _updateQueue, _instance);\n        }\n        return;\n      }\n    case HostComponent:\n      {\n        var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted\n        // (eg DOM renderer may schedule auto-focus for inputs and form controls).\n        // These effects should only be committed when components are first mounted,\n        // aka when there is no current/alternate.\n        if (current === null && finishedWork.effectTag & Update) {\n          var type = finishedWork.type;\n          var props = finishedWork.memoizedProps;\n          commitMount(_instance2, type, props);\n        }\n        return;\n      }\n    case HostText:\n      {\n        // We have no life-cycles associated with text.\n        return;\n      }\n    case HostPortal:\n      {\n        // We have no life-cycles associated with portals.\n        return;\n      }\n    case Profiler:\n      {\n        {\n          var onRender = finishedWork.memoizedProps.onRender;\n          if (typeof onRender === 'function') {\n            {\n              onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);\n            }\n          }\n        }\n        return;\n      }\n    case SuspenseComponent:\n      {\n        commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);\n        return;\n      }\n    case SuspenseListComponent:\n    case IncompleteClassComponent:\n    case FundamentalComponent:\n    case ScopeComponent:\n      return;\n  }\n  {\n    {\n      throw Error( \\\\\"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction hideOrUnhideAllChildren(finishedWork, isHidden) {\n  {\n    // We only have the top Fiber that was inserted but we need to recurse down its\n    // children to find all the terminal nodes.\n    var node = finishedWork;\n    while (true) {\n      if (node.tag === HostComponent) {\n        var instance = node.stateNode;\n        if (isHidden) {\n          hideInstance(instance);\n        } else {\n          unhideInstance(node.stateNode, node.memoizedProps);\n        }\n      } else if (node.tag === HostText) {\n        var _instance3 = node.stateNode;\n        if (isHidden) {\n          hideTextInstance(_instance3);\n        } else {\n          unhideTextInstance(_instance3, node.memoizedProps);\n        }\n      } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {\n        // Found a nested Suspense component that timed out. Skip over the\n        // primary child fragment, which should remain hidden.\n        var fallbackChildFragment = node.child.sibling;\n        fallbackChildFragment.return = node;\n        node = fallbackChildFragment;\n        continue;\n      } else if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n      if (node === finishedWork) {\n        return;\n      }\n      while (node.sibling === null) {\n        if (node.return === null || node.return === finishedWork) {\n          return;\n        }\n        node = node.return;\n      }\n      node.sibling.return = node.return;\n      node = node.sibling;\n    }\n  }\n}\nfunction commitAttachRef(finishedWork) {\n  var ref = finishedWork.ref;\n  if (ref !== null) {\n    var instance = finishedWork.stateNode;\n    var instanceToUse;\n    switch (finishedWork.tag) {\n      case HostComponent:\n        instanceToUse = getPublicInstance(instance);\n        break;\n      default:\n        instanceToUse = instance;\n    } // Moved outside to ensure DCE works with this flag\n    if (typeof ref === 'function') {\n      ref(instanceToUse);\n    } else {\n      {\n        if (!ref.hasOwnProperty('current')) {\n          error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));\n        }\n      }\n      ref.current = instanceToUse;\n    }\n  }\n}\nfunction commitDetachRef(current) {\n  var currentRef = current.ref;\n  if (currentRef !== null) {\n    if (typeof currentRef === 'function') {\n      currentRef(null);\n    } else {\n      currentRef.current = null;\n    }\n  }\n} // User-originating errors (lifecycles and refs) should not interrupt\n// deletion, so don't let them throw. Host-originating errors should\n// interrupt deletion, so it's okay\nfunction commitUnmount(finishedRoot, current, renderPriorityLevel) {\n  onCommitUnmount(current);\n  switch (current.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case MemoComponent:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        var updateQueue = current.updateQueue;\n        if (updateQueue !== null) {\n          var lastEffect = updateQueue.lastEffect;\n          if (lastEffect !== null) {\n            var firstEffect = lastEffect.next;\n            {\n              // When the owner fiber is deleted, the destroy function of a passive\n              // effect hook is called during the synchronous commit phase. This is\n              // a concession to implementation complexity. Calling it in the\n              // passive effect phase (like they usually are, when dependencies\n              // change during an update) would require either traversing the\n              // children of the deleted fiber again, or including unmount effects\n              // as part of the fiber effect list.\n              //\n              // Because this is during the sync commit phase, we need to change\n              // the priority.\n              //\n              // TODO: Reconsider this implementation trade off.\n              var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;\n              runWithPriority$1(priorityLevel, function () {\n                var effect = firstEffect;\n                do {\n                  var _destroy = effect.destroy;\n                  if (_destroy !== undefined) {\n                    safelyCallDestroy(current, _destroy);\n                  }\n                  effect = effect.next;\n                } while (effect !== firstEffect);\n              });\n            }\n          }\n        }\n        return;\n      }\n    case ClassComponent:\n      {\n        safelyDetachRef(current);\n        var instance = current.stateNode;\n        if (typeof instance.componentWillUnmount === 'function') {\n          safelyCallComponentWillUnmount(current, instance);\n        }\n        return;\n      }\n    case HostComponent:\n      {\n        safelyDetachRef(current);\n        return;\n      }\n    case HostPortal:\n      {\n        // TODO: this is recursive.\n        // We are also not using this parent because\n        // the portal will get pushed immediately.\n        {\n          unmountHostComponents(finishedRoot, current, renderPriorityLevel);\n        }\n        return;\n      }\n    case FundamentalComponent:\n      {\n        return;\n      }\n    case DehydratedFragment:\n      {\n        return;\n      }\n    case ScopeComponent:\n      {\n        return;\n      }\n  }\n}\nfunction commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {\n  // While we're inside a removed host node we don't want to call\n  // removeChild on the inner nodes because they're removed by the top\n  // call anyway. We also want to call componentWillUnmount on all\n  // composites before this host node is removed from the tree. Therefore\n  // we do an inner loop while we're still inside the host node.\n  var node = root;\n  while (true) {\n    commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes.\n    // Skip portals because commitUnmount() currently visits them recursively.\n    if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.\n    // If we don't use mutation we drill down into portals here instead.\n     node.tag !== HostPortal)) {\n      node.child.return = node;\n      node = node.child;\n      continue;\n    }\n    if (node === root) {\n      return;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === root) {\n        return;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n}\nfunction detachFiber(current) {\n  var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we\n  // should clear the child pointer of the parent alternate to let this\n  // get GC:ed but we don't know which for sure which parent is the current\n  // one so we'll settle for GC:ing the subtree of this child. This child\n  // itself will be GC:ed when the parent updates the next time.\n  current.return = null;\n  current.child = null;\n  current.memoizedState = null;\n  current.updateQueue = null;\n  current.dependencies = null;\n  current.alternate = null;\n  current.firstEffect = null;\n  current.lastEffect = null;\n  current.pendingProps = null;\n  current.memoizedProps = null;\n  current.stateNode = null;\n  if (alternate !== null) {\n    detachFiber(alternate);\n  }\n}\nfunction getHostParentFiber(fiber) {\n  var parent = fiber.return;\n  while (parent !== null) {\n    if (isHostParent(parent)) {\n      return parent;\n    }\n    parent = parent.return;\n  }\n  {\n    {\n      throw Error( \\\\\"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction isHostParent(fiber) {\n  return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n}\nfunction getHostSibling(fiber) {\n  // We're going to search forward into the tree until we find a sibling host\n  // node. Unfortunately, if multiple insertions are done in a row we have to\n  // search past them. This leads to exponential search for the next sibling.\n  // TODO: Find a more efficient way to do this.\n  var node = fiber;\n  siblings: while (true) {\n    // If we didn't find anything, let's try the next sibling.\n    while (node.sibling === null) {\n      if (node.return === null || isHostParent(node.return)) {\n        // If we pop out of the root or hit the parent the fiber we are the\n        // last sibling.\n        return null;\n      }\n      node = node.return;\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n    while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {\n      // If it is not host node and, we might have a host node inside it.\n      // Try to search down until we find one.\n      if (node.effectTag & Placement) {\n        // If we don't have a child, try the siblings instead.\n        continue siblings;\n      } // If we don't have a child, try the siblings instead.\n      // We also skip portals because they are not part of this host tree.\n      if (node.child === null || node.tag === HostPortal) {\n        continue siblings;\n      } else {\n        node.child.return = node;\n        node = node.child;\n      }\n    } // Check if this host node is stable or about to be placed.\n    if (!(node.effectTag & Placement)) {\n      // Found it!\n      return node.stateNode;\n    }\n  }\n}\nfunction commitPlacement(finishedWork) {\n  var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.\n  var parent;\n  var isContainer;\n  var parentStateNode = parentFiber.stateNode;\n  switch (parentFiber.tag) {\n    case HostComponent:\n      parent = parentStateNode;\n      isContainer = false;\n      break;\n    case HostRoot:\n      parent = parentStateNode.containerInfo;\n      isContainer = true;\n      break;\n    case HostPortal:\n      parent = parentStateNode.containerInfo;\n      isContainer = true;\n      break;\n    case FundamentalComponent:\n    // eslint-disable-next-line-no-fallthrough\n    default:\n      {\n        {\n          throw Error( \\\\\"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n        }\n      }\n  }\n  if (parentFiber.effectTag & ContentReset) {\n    // Reset the text content of the parent before doing any insertions\n    resetTextContent(parent); // Clear ContentReset from the effect tag\n    parentFiber.effectTag &= ~ContentReset;\n  }\n  var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its\n  // children to find all the terminal nodes.\n  if (isContainer) {\n    insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);\n  } else {\n    insertOrAppendPlacementNode(finishedWork, before, parent);\n  }\n}\nfunction insertOrAppendPlacementNodeIntoContainer(node, before, parent) {\n  var tag = node.tag;\n  var isHost = tag === HostComponent || tag === HostText;\n  if (isHost || enableFundamentalAPI ) {\n    var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n    if (before) {\n      insertInContainerBefore(parent, stateNode, before);\n    } else {\n      appendChildToContainer(parent, stateNode);\n    }\n  } else if (tag === HostPortal) ; else {\n    var child = node.child;\n    if (child !== null) {\n      insertOrAppendPlacementNodeIntoContainer(child, before, parent);\n      var sibling = child.sibling;\n      while (sibling !== null) {\n        insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);\n        sibling = sibling.sibling;\n      }\n    }\n  }\n}\nfunction insertOrAppendPlacementNode(node, before, parent) {\n  var tag = node.tag;\n  var isHost = tag === HostComponent || tag === HostText;\n  if (isHost || enableFundamentalAPI ) {\n    var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n    if (before) {\n      insertBefore(parent, stateNode, before);\n    } else {\n      appendChild(parent, stateNode);\n    }\n  } else if (tag === HostPortal) ; else {\n    var child = node.child;\n    if (child !== null) {\n      insertOrAppendPlacementNode(child, before, parent);\n      var sibling = child.sibling;\n      while (sibling !== null) {\n        insertOrAppendPlacementNode(sibling, before, parent);\n        sibling = sibling.sibling;\n      }\n    }\n  }\n}\nfunction unmountHostComponents(finishedRoot, current, renderPriorityLevel) {\n  // We only have the top Fiber that was deleted but we need to recurse down its\n  // children to find all the terminal nodes.\n  var node = current; // Each iteration, currentParent is populated with node's host parent if not\n  // currentParentIsValid.\n  var currentParentIsValid = false; // Note: these two variables *must* always be updated together.\n  var currentParent;\n  var currentParentIsContainer;\n  while (true) {\n    if (!currentParentIsValid) {\n      var parent = node.return;\n      findParent: while (true) {\n        if (!(parent !== null)) {\n          {\n            throw Error( \\\\\"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n          }\n        }\n        var parentStateNode = parent.stateNode;\n        switch (parent.tag) {\n          case HostComponent:\n            currentParent = parentStateNode;\n            currentParentIsContainer = false;\n            break findParent;\n          case HostRoot:\n            currentParent = parentStateNode.containerInfo;\n            currentParentIsContainer = true;\n            break findParent;\n          case HostPortal:\n            currentParent = parentStateNode.containerInfo;\n            currentParentIsContainer = true;\n            break findParent;\n        }\n        parent = parent.return;\n      }\n      currentParentIsValid = true;\n    }\n    if (node.tag === HostComponent || node.tag === HostText) {\n      commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the\n      // node from the tree.\n      if (currentParentIsContainer) {\n        removeChildFromContainer(currentParent, node.stateNode);\n      } else {\n        removeChild(currentParent, node.stateNode);\n      } // Don't visit children because we already visited them.\n    } else if (node.tag === HostPortal) {\n      if (node.child !== null) {\n        // When we go into a portal, it becomes the parent to remove from.\n        // We will reassign it back when we pop the portal on the way up.\n        currentParent = node.stateNode.containerInfo;\n        currentParentIsContainer = true; // Visit children because portals might contain host components.\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n    } else {\n      commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below.\n      if (node.child !== null) {\n        node.child.return = node;\n        node = node.child;\n        continue;\n      }\n    }\n    if (node === current) {\n      return;\n    }\n    while (node.sibling === null) {\n      if (node.return === null || node.return === current) {\n        return;\n      }\n      node = node.return;\n      if (node.tag === HostPortal) {\n        // When we go out of the portal, we need to restore the parent.\n        // Since we don't keep a stack of them, we will search for it.\n        currentParentIsValid = false;\n      }\n    }\n    node.sibling.return = node.return;\n    node = node.sibling;\n  }\n}\nfunction commitDeletion(finishedRoot, current, renderPriorityLevel) {\n  {\n    // Recursively delete all host nodes from the parent.\n    // Detach refs and call componentWillUnmount() on the whole subtree.\n    unmountHostComponents(finishedRoot, current, renderPriorityLevel);\n  }\n  detachFiber(current);\n}\nfunction commitWork(current, finishedWork) {\n  switch (finishedWork.tag) {\n    case FunctionComponent:\n    case ForwardRef:\n    case MemoComponent:\n    case SimpleMemoComponent:\n    case Block:\n      {\n        // Layout effects are destroyed during the mutation phase so that all\n        // destroy functions for all fibers are called before any create functions.\n        // This prevents sibling component effects from interfering with each other,\n        // e.g. a destroy function in one component should never override a ref set\n        // by a create function in another component during the same commit.\n        commitHookEffectListUnmount(Layout | HasEffect, finishedWork);\n        return;\n      }\n    case ClassComponent:\n      {\n        return;\n      }\n    case HostComponent:\n      {\n        var instance = finishedWork.stateNode;\n        if (instance != null) {\n          // Commit the work prepared earlier.\n          var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n          // as the newProps. The updatePayload will contain the real change in\n          // this case.\n          var oldProps = current !== null ? current.memoizedProps : newProps;\n          var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.\n          var updatePayload = finishedWork.updateQueue;\n          finishedWork.updateQueue = null;\n          if (updatePayload !== null) {\n            commitUpdate(instance, updatePayload, type, oldProps, newProps);\n          }\n        }\n        return;\n      }\n    case HostText:\n      {\n        if (!(finishedWork.stateNode !== null)) {\n          {\n            throw Error( \\\\\"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n          }\n        }\n        var textInstance = finishedWork.stateNode;\n        var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps\n        // as the newProps. The updatePayload will contain the real change in\n        // this case.\n        var oldText = current !== null ? current.memoizedProps : newText;\n        commitTextUpdate(textInstance, oldText, newText);\n        return;\n      }\n    case HostRoot:\n      {\n        {\n          var _root = finishedWork.stateNode;\n          if (_root.hydrate) {\n            // We've just hydrated. No need to hydrate again.\n            _root.hydrate = false;\n            commitHydratedContainer(_root.containerInfo);\n          }\n        }\n        return;\n      }\n    case Profiler:\n      {\n        return;\n      }\n    case SuspenseComponent:\n      {\n        commitSuspenseComponent(finishedWork);\n        attachSuspenseRetryListeners(finishedWork);\n        return;\n      }\n    case SuspenseListComponent:\n      {\n        attachSuspenseRetryListeners(finishedWork);\n        return;\n      }\n    case IncompleteClassComponent:\n      {\n        return;\n      }\n  }\n  {\n    {\n      throw Error( \\\\\"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  }\n}\nfunction commitSuspenseComponent(finishedWork) {\n  var newState = finishedWork.memoizedState;\n  var newDidTimeout;\n  var primaryChildParent = finishedWork;\n  if (newState === null) {\n    newDidTimeout = false;\n  } else {\n    newDidTimeout = true;\n    primaryChildParent = finishedWork.child;\n    markCommitTimeOfFallback();\n  }\n  if ( primaryChildParent !== null) {\n    hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);\n  }\n}\nfunction commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {\n  var newState = finishedWork.memoizedState;\n  if (newState === null) {\n    var current = finishedWork.alternate;\n    if (current !== null) {\n      var prevState = current.memoizedState;\n      if (prevState !== null) {\n        var suspenseInstance = prevState.dehydrated;\n        if (suspenseInstance !== null) {\n          commitHydratedSuspenseInstance(suspenseInstance);\n        }\n      }\n    }\n  }\n}\nfunction attachSuspenseRetryListeners(finishedWork) {\n  // If this boundary just timed out, then it will have a set of thenables.\n  // For each thenable, attach a listener so that when it resolves, React\n  // attempts to re-render the boundary in the primary (pre-timeout) state.\n  var thenables = finishedWork.updateQueue;\n  if (thenables !== null) {\n    finishedWork.updateQueue = null;\n    var retryCache = finishedWork.stateNode;\n    if (retryCache === null) {\n      retryCache = finishedWork.stateNode = new PossiblyWeakSet();\n    }\n    thenables.forEach(function (thenable) {\n      // Memoize using the boundary fiber to prevent redundant listeners.\n      var retry = resolveRetryThenable.bind(null, finishedWork, thenable);\n      if (!retryCache.has(thenable)) {\n        {\n          if (thenable.__reactDoNotTraceInteractions !== true) {\n            retry = tracing$1.unstable_wrap(retry);\n          }\n        }\n        retryCache.add(thenable);\n        thenable.then(retry, retry);\n      }\n    });\n  }\n}\nfunction commitResetTextContent(current) {\n  resetTextContent(current.stateNode);\n}\nvar PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;\nfunction createRootErrorUpdate(fiber, errorInfo, expirationTime) {\n  var update = createUpdate(expirationTime, null); // Unmount the root by rendering null.\n  update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property\n  // being called \\\\\"element\\\\\".\n  update.payload = {\n    element: null\n  };\n  var error = errorInfo.value;\n  update.callback = function () {\n    onUncaughtError(error);\n    logError(fiber, errorInfo);\n  };\n  return update;\n}\nfunction createClassErrorUpdate(fiber, errorInfo, expirationTime) {\n  var update = createUpdate(expirationTime, null);\n  update.tag = CaptureUpdate;\n  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n  if (typeof getDerivedStateFromError === 'function') {\n    var error$1 = errorInfo.value;\n    update.payload = function () {\n      logError(fiber, errorInfo);\n      return getDerivedStateFromError(error$1);\n    };\n  }\n  var inst = fiber.stateNode;\n  if (inst !== null && typeof inst.componentDidCatch === 'function') {\n    update.callback = function callback() {\n      {\n        markFailedErrorBoundaryForHotReloading(fiber);\n      }\n      if (typeof getDerivedStateFromError !== 'function') {\n        // To preserve the preexisting retry behavior of error boundaries,\n        // we keep track of which ones already failed during this batch.\n        // This gets reset before we yield back to the browser.\n        // TODO: Warn in strict mode if getDerivedStateFromError is\n        // not defined.\n        markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined\n        logError(fiber, errorInfo);\n      }\n      var error$1 = errorInfo.value;\n      var stack = errorInfo.stack;\n      this.componentDidCatch(error$1, {\n        componentStack: stack !== null ? stack : ''\n      });\n      {\n        if (typeof getDerivedStateFromError !== 'function') {\n          // If componentDidCatch is the only error boundary method defined,\n          // then it needs to call setState to recover from errors.\n          // If no state update is scheduled then the boundary will swallow the error.\n          if (fiber.expirationTime !== Sync) {\n            error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');\n          }\n        }\n      }\n    };\n  } else {\n    update.callback = function () {\n      markFailedErrorBoundaryForHotReloading(fiber);\n    };\n  }\n  return update;\n}\nfunction attachPingListener(root, renderExpirationTime, thenable) {\n  // Attach a listener to the promise to \\\\\"ping\\\\\" the root and retry. But\n  // only if one does not already exist for the current render expiration\n  // time (which acts like a \\\\\"thread ID\\\\\" here).\n  var pingCache = root.pingCache;\n  var threadIDs;\n  if (pingCache === null) {\n    pingCache = root.pingCache = new PossiblyWeakMap$1();\n    threadIDs = new Set();\n    pingCache.set(thenable, threadIDs);\n  } else {\n    threadIDs = pingCache.get(thenable);\n    if (threadIDs === undefined) {\n      threadIDs = new Set();\n      pingCache.set(thenable, threadIDs);\n    }\n  }\n  if (!threadIDs.has(renderExpirationTime)) {\n    // Memoize using the thread ID to prevent redundant listeners.\n    threadIDs.add(renderExpirationTime);\n    var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);\n    thenable.then(ping, ping);\n  }\n}\nfunction throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {\n  // The source fiber did not complete.\n  sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid.\n  sourceFiber.firstEffect = sourceFiber.lastEffect = null;\n  if (value !== null && typeof value === 'object' && typeof value.then === 'function') {\n    // This is a thenable.\n    var thenable = value;\n    if ((sourceFiber.mode & BlockingMode) === NoMode) {\n      // Reset the memoizedState to what it was before we attempted\n      // to render it.\n      var currentSource = sourceFiber.alternate;\n      if (currentSource) {\n        sourceFiber.updateQueue = currentSource.updateQueue;\n        sourceFiber.memoizedState = currentSource.memoizedState;\n        sourceFiber.expirationTime = currentSource.expirationTime;\n      } else {\n        sourceFiber.updateQueue = null;\n        sourceFiber.memoizedState = null;\n      }\n    }\n    var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.\n    var _workInProgress = returnFiber;\n    do {\n      if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {\n        // Found the nearest boundary.\n        // Stash the promise on the boundary fiber. If the boundary times out, we'll\n        // attach another listener to flip the boundary back to its normal state.\n        var thenables = _workInProgress.updateQueue;\n        if (thenables === null) {\n          var updateQueue = new Set();\n          updateQueue.add(thenable);\n          _workInProgress.updateQueue = updateQueue;\n        } else {\n          thenables.add(thenable);\n        } // If the boundary is outside of blocking mode, we should *not*\n        // suspend the commit. Pretend as if the suspended component rendered\n        // null and keep rendering. In the commit phase, we'll schedule a\n        // subsequent synchronous update to re-render the Suspense.\n        //\n        // Note: It doesn't matter whether the component that suspended was\n        // inside a blocking mode tree. If the Suspense is outside of it, we\n        // should *not* suspend the commit.\n        if ((_workInProgress.mode & BlockingMode) === NoMode) {\n          _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.\n          // But we shouldn't call any lifecycle methods or callbacks. Remove\n          // all lifecycle effect tags.\n          sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);\n          if (sourceFiber.tag === ClassComponent) {\n            var currentSourceFiber = sourceFiber.alternate;\n            if (currentSourceFiber === null) {\n              // This is a new mount. Change the tag so it's not mistaken for a\n              // completed class component. For example, we should not call\n              // componentWillUnmount if it is deleted.\n              sourceFiber.tag = IncompleteClassComponent;\n            } else {\n              // When we try rendering again, we should not reuse the current fiber,\n              // since it's known to be in an inconsistent state. Use a force update to\n              // prevent a bail out.\n              var update = createUpdate(Sync, null);\n              update.tag = ForceUpdate;\n              enqueueUpdate(sourceFiber, update);\n            }\n          } // The source fiber did not complete. Mark it with Sync priority to\n          // indicate that it still has pending work.\n          sourceFiber.expirationTime = Sync; // Exit without suspending.\n          return;\n        } // Confirmed that the boundary is in a concurrent mode tree. Continue\n        // with the normal suspend path.\n        //\n        // After this we'll use a set of heuristics to determine whether this\n        // render pass will run to completion or restart or \\\\\"suspend\\\\\" the commit.\n        // The actual logic for this is spread out in different places.\n        //\n        // This first principle is that if we're going to suspend when we complete\n        // a root, then we should also restart if we get an update or ping that\n        // might unsuspend it, and vice versa. The only reason to suspend is\n        // because you think you might want to restart before committing. However,\n        // it doesn't make sense to restart only while in the period we're suspended.\n        //\n        // Restarting too aggressively is also not good because it starves out any\n        // intermediate loading state. So we use heuristics to determine when.\n        // Suspense Heuristics\n        //\n        // If nothing threw a Promise or all the same fallbacks are already showing,\n        // then don't suspend/restart.\n        //\n        // If this is an initial render of a new tree of Suspense boundaries and\n        // those trigger a fallback, then don't suspend/restart. We want to ensure\n        // that we can show the initial loading state as quickly as possible.\n        //\n        // If we hit a \\\\\"Delayed\\\\\" case, such as when we'd switch from content back into\n        // a fallback, then we should always suspend/restart. SuspenseConfig applies to\n        // this case. If none is defined, JND is used instead.\n        //\n        // If we're already showing a fallback and it gets \\\\\"retried\\\\\", allowing us to show\n        // another level, but there's still an inner boundary that would show a fallback,\n        // then we suspend/restart for 500ms since the last time we showed a fallback\n        // anywhere in the tree. This effectively throttles progressive loading into a\n        // consistent train of commits. This also gives us an opportunity to restart to\n        // get to the completed state slightly earlier.\n        //\n        // If there's ambiguity due to batching it's resolved in preference of:\n        // 1) \\\\\"delayed\\\\\", 2) \\\\\"initial render\\\\\", 3) \\\\\"retry\\\\\".\n        //\n        // We want to ensure that a \\\\\"busy\\\\\" state doesn't get force committed. We want to\n        // ensure that new initial loading states can commit as soon as possible.\n        attachPingListener(root, renderExpirationTime, thenable);\n        _workInProgress.effectTag |= ShouldCapture;\n        _workInProgress.expirationTime = renderExpirationTime;\n        return;\n      } // This boundary already captured during this render. Continue to the next\n      // boundary.\n      _workInProgress = _workInProgress.return;\n    } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.\n    // TODO: Use invariant so the message is stripped in prod?\n    value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.' + '' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));\n  } // We didn't find a boundary that could handle this type of exception. Start\n  // over and traverse parent path again, this time treating the exception\n  // as an error.\n  renderDidError();\n  value = createCapturedValue(value, sourceFiber);\n  var workInProgress = returnFiber;\n  do {\n    switch (workInProgress.tag) {\n      case HostRoot:\n        {\n          var _errorInfo = value;\n          workInProgress.effectTag |= ShouldCapture;\n          workInProgress.expirationTime = renderExpirationTime;\n          var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);\n          enqueueCapturedUpdate(workInProgress, _update);\n          return;\n        }\n      case ClassComponent:\n        // Capture and retry\n        var errorInfo = value;\n        var ctor = workInProgress.type;\n        var instance = workInProgress.stateNode;\n        if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {\n          workInProgress.effectTag |= ShouldCapture;\n          workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state\n          var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);\n          enqueueCapturedUpdate(workInProgress, _update2);\n          return;\n        }\n        break;\n    }\n    workInProgress = workInProgress.return;\n  } while (workInProgress !== null);\n}\nvar ceil = Math.ceil;\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,\n    ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,\n    IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;\nvar NoContext =\n/*                    */\n0;\nvar BatchedContext =\n/*               */\n1;\nvar EventContext =\n/*                 */\n2;\nvar DiscreteEventContext =\n/*         */\n4;\nvar LegacyUnbatchedContext =\n/*       */\n8;\nvar RenderContext =\n/*                */\n16;\nvar CommitContext =\n/*                */\n32;\nvar RootIncomplete = 0;\nvar RootFatalErrored = 1;\nvar RootErrored = 2;\nvar RootSuspended = 3;\nvar RootSuspendedWithDelay = 4;\nvar RootCompleted = 5;\n// Describes where we are in the React execution stack\nvar executionContext = NoContext; // The root we're working on\nvar workInProgressRoot = null; // The fiber we're working on\nvar workInProgress = null; // The expiration time we're rendering\nvar renderExpirationTime$1 = NoWork; // Whether to root completed, errored, suspended, etc.\nvar workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown\nvar workInProgressRootFatalError = null; // Most recent event time among processed updates during this render.\n// This is conceptually a time stamp but expressed in terms of an ExpirationTime\n// because we deal mostly with expiration times in the hot path, so this avoids\n// the conversion happening in the hot path.\nvar workInProgressRootLatestProcessedExpirationTime = Sync;\nvar workInProgressRootLatestSuspenseTimeout = Sync;\nvar workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only\n// includes unprocessed updates, not work in bailed out children.\nvar workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately.\n// This flag determines if it might be worthwhile to restart if an opportunity\n// happens latere.\nvar workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train\n// model where we don't commit new loading states in too quick succession.\nvar globalMostRecentFallbackTime = 0;\nvar FALLBACK_THROTTLE_MS = 500;\nvar nextEffect = null;\nvar hasUncaughtError = false;\nvar firstUncaughtError = null;\nvar legacyErrorBoundariesThatAlreadyFailed = null;\nvar rootDoesHavePassiveEffects = false;\nvar rootWithPendingPassiveEffects = null;\nvar pendingPassiveEffectsRenderPriority = NoPriority;\nvar pendingPassiveEffectsExpirationTime = NoWork;\nvar rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates\nvar NESTED_UPDATE_LIMIT = 50;\nvar nestedUpdateCount = 0;\nvar rootWithNestedUpdates = null;\nvar NESTED_PASSIVE_UPDATE_LIMIT = 50;\nvar nestedPassiveUpdateCount = 0;\nvar interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times\n// during the commit phase. This enables them to be traced across components\n// that spawn new work during render. E.g. hidden boundaries, suspended SSR\n// hydration or SuspenseList.\nvar spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start\n// time). However, if two updates are scheduled within the same event, we\n// should treat their start times as simultaneous, even if the actual clock\n// time has advanced between the first and second call.\n// In other words, because expiration times determine how updates are batched,\n// we want all updates of like priority that occur within the same event to\n// receive the same expiration time. Otherwise we get tearing.\nvar currentEventTime = NoWork;\nfunction requestCurrentTimeForUpdate() {\n  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n    // We're inside React, so it's fine to read the actual time.\n    return msToExpirationTime(now());\n  } // We're not inside React, so we may be in the middle of a browser event.\n  if (currentEventTime !== NoWork) {\n    // Use the same start time for all updates until we enter React again.\n    return currentEventTime;\n  } // This is the first update since React yielded. Compute a new start time.\n  currentEventTime = msToExpirationTime(now());\n  return currentEventTime;\n}\nfunction getCurrentTime() {\n  return msToExpirationTime(now());\n}\nfunction computeExpirationForFiber(currentTime, fiber, suspenseConfig) {\n  var mode = fiber.mode;\n  if ((mode & BlockingMode) === NoMode) {\n    return Sync;\n  }\n  var priorityLevel = getCurrentPriorityLevel();\n  if ((mode & ConcurrentMode) === NoMode) {\n    return priorityLevel === ImmediatePriority ? Sync : Batched;\n  }\n  if ((executionContext & RenderContext) !== NoContext) {\n    // Use whatever time we're already rendering\n    // TODO: Should there be a way to opt out, like with \\`runWithPriority\\`?\n    return renderExpirationTime$1;\n  }\n  var expirationTime;\n  if (suspenseConfig !== null) {\n    // Compute an expiration time based on the Suspense timeout.\n    expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);\n  } else {\n    // Compute an expiration time based on the Scheduler priority.\n    switch (priorityLevel) {\n      case ImmediatePriority:\n        expirationTime = Sync;\n        break;\n      case UserBlockingPriority$1:\n        // TODO: Rename this to computeUserBlockingExpiration\n        expirationTime = computeInteractiveExpiration(currentTime);\n        break;\n      case NormalPriority:\n      case LowPriority:\n        // TODO: Handle LowPriority\n        // TODO: Rename this to... something better.\n        expirationTime = computeAsyncExpiration(currentTime);\n        break;\n      case IdlePriority:\n        expirationTime = Idle;\n        break;\n      default:\n        {\n          {\n            throw Error( \\\\\"Expected a valid priority level\\\\\" );\n          }\n        }\n    }\n  } // If we're in the middle of rendering a tree, do not update at the same\n  // expiration time that is already rendering.\n  // TODO: We shouldn't have to do this if the update is on a different root.\n  // Refactor computeExpirationForFiber + scheduleUpdate so we have access to\n  // the root when we check for this condition.\n  if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) {\n    // This is a trick to move this update into a separate batch\n    expirationTime -= 1;\n  }\n  return expirationTime;\n}\nfunction scheduleUpdateOnFiber(fiber, expirationTime) {\n  checkForNestedUpdates();\n  warnAboutRenderPhaseUpdatesInDEV(fiber);\n  var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);\n  if (root === null) {\n    warnAboutUpdateOnUnmountedFiberInDEV(fiber);\n    return;\n  }\n  checkForInterruption(fiber, expirationTime);\n  recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the\n  // priority as an argument to that function and this one.\n  var priorityLevel = getCurrentPriorityLevel();\n  if (expirationTime === Sync) {\n    if ( // Check if we're inside unbatchedUpdates\n    (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering\n    (executionContext & (RenderContext | CommitContext)) === NoContext) {\n      // Register pending interactions on the root to avoid losing traced interaction data.\n      schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed\n      // root inside of batchedUpdates should be synchronous, but layout updates\n      // should be deferred until the end of the batch.\n      performSyncWorkOnRoot(root);\n    } else {\n      ensureRootIsScheduled(root);\n      schedulePendingInteractions(root, expirationTime);\n      if (executionContext === NoContext) {\n        // Flush the synchronous work now, unless we're already working or inside\n        // a batch. This is intentionally inside scheduleUpdateOnFiber instead of\n        // scheduleCallbackForFiber to preserve the ability to schedule a callback\n        // without immediately flushing it. We only do this for user-initiated\n        // updates, to preserve historical behavior of legacy mode.\n        flushSyncCallbackQueue();\n      }\n    }\n  } else {\n    ensureRootIsScheduled(root);\n    schedulePendingInteractions(root, expirationTime);\n  }\n  if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered\n  // discrete, even inside a discrete event.\n  priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) {\n    // This is the result of a discrete event. Track the lowest priority\n    // discrete update per root so we can flush them early, if needed.\n    if (rootsWithPendingDiscreteUpdates === null) {\n      rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);\n    } else {\n      var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);\n      if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {\n        rootsWithPendingDiscreteUpdates.set(root, expirationTime);\n      }\n    }\n  }\n}\nvar scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending\n// work without treating it as a typical update that originates from an event;\n// e.g. retrying a Suspense boundary isn't an update, but it does schedule work\n// on a fiber.\nfunction markUpdateTimeFromFiberToRoot(fiber, expirationTime) {\n  // Update the source fiber's expiration time\n  if (fiber.expirationTime < expirationTime) {\n    fiber.expirationTime = expirationTime;\n  }\n  var alternate = fiber.alternate;\n  if (alternate !== null && alternate.expirationTime < expirationTime) {\n    alternate.expirationTime = expirationTime;\n  } // Walk the parent path to the root and update the child expiration time.\n  var node = fiber.return;\n  var root = null;\n  if (node === null && fiber.tag === HostRoot) {\n    root = fiber.stateNode;\n  } else {\n    while (node !== null) {\n      alternate = node.alternate;\n      if (node.childExpirationTime < expirationTime) {\n        node.childExpirationTime = expirationTime;\n        if (alternate !== null && alternate.childExpirationTime < expirationTime) {\n          alternate.childExpirationTime = expirationTime;\n        }\n      } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {\n        alternate.childExpirationTime = expirationTime;\n      }\n      if (node.return === null && node.tag === HostRoot) {\n        root = node.stateNode;\n        break;\n      }\n      node = node.return;\n    }\n  }\n  if (root !== null) {\n    if (workInProgressRoot === root) {\n      // Received an update to a tree that's in the middle of rendering. Mark\n      // that's unprocessed work on this root.\n      markUnprocessedUpdateTime(expirationTime);\n      if (workInProgressRootExitStatus === RootSuspendedWithDelay) {\n        // The root already suspended with a delay, which means this render\n        // definitely won't finish. Since we have a new update, let's mark it as\n        // suspended now, right before marking the incoming update. This has the\n        // effect of interrupting the current render and switching to the update.\n        // TODO: This happens to work when receiving an update during the render\n        // phase, because of the trick inside computeExpirationForFiber to\n        // subtract 1 from \\`renderExpirationTime\\` to move it into a\n        // separate bucket. But we should probably model it with an exception,\n        // using the same mechanism we use to force hydration of a subtree.\n        // TODO: This does not account for low pri updates that were already\n        // scheduled before the root started rendering. Need to track the next\n        // pending expiration time (perhaps by backtracking the return path) and\n        // then trigger a restart in the \\`renderDidSuspendDelayIfPossible\\` path.\n        markRootSuspendedAtTime(root, renderExpirationTime$1);\n      }\n    } // Mark that the root has a pending update.\n    markRootUpdatedAtTime(root, expirationTime);\n  }\n  return root;\n}\nfunction getNextRootExpirationTimeToWorkOn(root) {\n  // Determines the next expiration time that the root should render, taking\n  // into account levels that may be suspended, or levels that may have\n  // received a ping.\n  var lastExpiredTime = root.lastExpiredTime;\n  if (lastExpiredTime !== NoWork) {\n    return lastExpiredTime;\n  } // \\\\\"Pending\\\\\" refers to any update that hasn't committed yet, including if it\n  // suspended. The \\\\\"suspended\\\\\" range is therefore a subset.\n  var firstPendingTime = root.firstPendingTime;\n  if (!isRootSuspendedAtTime(root, firstPendingTime)) {\n    // The highest priority pending time is not suspended. Let's work on that.\n    return firstPendingTime;\n  } // If the first pending time is suspended, check if there's a lower priority\n  // pending level that we know about. Or check if we received a ping. Work\n  // on whichever is higher priority.\n  var lastPingedTime = root.lastPingedTime;\n  var nextKnownPendingLevel = root.nextKnownPendingLevel;\n  var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;\n  if ( nextLevel <= Idle && firstPendingTime !== nextLevel) {\n    // Don't work on Idle/Never priority unless everything else is committed.\n    return NoWork;\n  }\n  return nextLevel;\n} // Use this function to schedule a task for a root. There's only one task per\n// root; if a task was already scheduled, we'll check to make sure the\n// expiration time of the existing task is the same as the expiration time of\n// the next level that the root has work on. This function is called on every\n// update, and right before exiting a task.\nfunction ensureRootIsScheduled(root) {\n  var lastExpiredTime = root.lastExpiredTime;\n  if (lastExpiredTime !== NoWork) {\n    // Special case: Expired work should flush synchronously.\n    root.callbackExpirationTime = Sync;\n    root.callbackPriority = ImmediatePriority;\n    root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n    return;\n  }\n  var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n  var existingCallbackNode = root.callbackNode;\n  if (expirationTime === NoWork) {\n    // There's nothing to work on.\n    if (existingCallbackNode !== null) {\n      root.callbackNode = null;\n      root.callbackExpirationTime = NoWork;\n      root.callbackPriority = NoPriority;\n    }\n    return;\n  } // TODO: If this is an update, we already read the current time. Pass the\n  // time as an argument.\n  var currentTime = requestCurrentTimeForUpdate();\n  var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and\n  // expiration time. Otherwise, we'll cancel it and schedule a new one.\n  if (existingCallbackNode !== null) {\n    var existingCallbackPriority = root.callbackPriority;\n    var existingCallbackExpirationTime = root.callbackExpirationTime;\n    if ( // Callback must have the exact same expiration time.\n    existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.\n    existingCallbackPriority >= priorityLevel) {\n      // Existing callback is sufficient.\n      return;\n    } // Need to schedule a new task.\n    // TODO: Instead of scheduling a new task, we should be able to change the\n    // priority of the existing one.\n    cancelCallback(existingCallbackNode);\n  }\n  root.callbackExpirationTime = expirationTime;\n  root.callbackPriority = priorityLevel;\n  var callbackNode;\n  if (expirationTime === Sync) {\n    // Sync React callbacks are scheduled on a special internal queue\n    callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n  } else {\n    callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects\n    // ordering because tasks are processed in timeout order.\n    {\n      timeout: expirationTimeToMs(expirationTime) - now()\n    });\n  }\n  root.callbackNode = callbackNode;\n} // This is the entry point for every concurrent task, i.e. anything that\n// goes through Scheduler.\nfunction performConcurrentWorkOnRoot(root, didTimeout) {\n  // Since we know we're in a React event, we can clear the current\n  // event time. The next update will compute a new event time.\n  currentEventTime = NoWork;\n  if (didTimeout) {\n    // The render task took too long to complete. Mark the current time as\n    // expired to synchronously render all expired work in a single batch.\n    var currentTime = requestCurrentTimeForUpdate();\n    markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback.\n    ensureRootIsScheduled(root);\n    return null;\n  } // Determine the next expiration time to work on, using the fields stored\n  // on the root.\n  var expirationTime = getNextRootExpirationTimeToWorkOn(root);\n  if (expirationTime !== NoWork) {\n    var originalCallbackNode = root.callbackNode;\n    if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n      {\n        throw Error( \\\\\"Should not already be working.\\\\\" );\n      }\n    }\n    flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack\n    // and prepare a fresh one. Otherwise we'll continue where we left off.\n    if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {\n      prepareFreshStack(root, expirationTime);\n      startWorkOnPendingInteractions(root, expirationTime);\n    } // If we have a work-in-progress fiber, it means there's still work to do\n    // in this root.\n    if (workInProgress !== null) {\n      var prevExecutionContext = executionContext;\n      executionContext |= RenderContext;\n      var prevDispatcher = pushDispatcher();\n      var prevInteractions = pushInteractions(root);\n      startWorkLoopTimer(workInProgress);\n      do {\n        try {\n          workLoopConcurrent();\n          break;\n        } catch (thrownValue) {\n          handleError(root, thrownValue);\n        }\n      } while (true);\n      resetContextDependencies();\n      executionContext = prevExecutionContext;\n      popDispatcher(prevDispatcher);\n      {\n        popInteractions(prevInteractions);\n      }\n      if (workInProgressRootExitStatus === RootFatalErrored) {\n        var fatalError = workInProgressRootFatalError;\n        stopInterruptedWorkLoopTimer();\n        prepareFreshStack(root, expirationTime);\n        markRootSuspendedAtTime(root, expirationTime);\n        ensureRootIsScheduled(root);\n        throw fatalError;\n      }\n      if (workInProgress !== null) {\n        // There's still work left over. Exit without committing.\n        stopInterruptedWorkLoopTimer();\n      } else {\n        // We now have a consistent tree. The next step is either to commit it,\n        // or, if something suspended, wait to commit it after a timeout.\n        stopFinishedWorkLoopTimer();\n        var finishedWork = root.finishedWork = root.current.alternate;\n        root.finishedExpirationTime = expirationTime;\n        finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);\n      }\n      ensureRootIsScheduled(root);\n      if (root.callbackNode === originalCallbackNode) {\n        // The task node scheduled for this root is the same one that's\n        // currently executed. Need to return a continuation.\n        return performConcurrentWorkOnRoot.bind(null, root);\n      }\n    }\n  }\n  return null;\n}\nfunction finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {\n  // Set this to null to indicate there's no in-progress render.\n  workInProgressRoot = null;\n  switch (exitStatus) {\n    case RootIncomplete:\n    case RootFatalErrored:\n      {\n        {\n          {\n            throw Error( \\\\\"Root did not complete. This is a bug in React.\\\\\" );\n          }\n        }\n      }\n    // Flow knows about invariant, so it complains if I add a break\n    // statement, but eslint doesn't know about invariant, so it complains\n    // if I do. eslint-disable-next-line no-fallthrough\n    case RootErrored:\n      {\n        // If this was an async render, the error may have happened due to\n        // a mutation in a concurrent event. Try rendering one more time,\n        // synchronously, to see if the error goes away. If there are\n        // lower priority updates, let's include those, too, in case they\n        // fix the inconsistency. Render at Idle to include all updates.\n        // If it was Idle or Never or some not-yet-invented time, render\n        // at that time.\n        markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous\n        // and therefore not hit this path again.\n        break;\n      }\n    case RootSuspended:\n      {\n        markRootSuspendedAtTime(root, expirationTime);\n        var lastSuspendedTime = root.lastSuspendedTime;\n        if (expirationTime === lastSuspendedTime) {\n          root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);\n        } // We have an acceptable loading state. We need to figure out if we\n        // should immediately commit it or wait a bit.\n        // If we have processed new updates during this render, we may now\n        // have a new loading state ready. We want to ensure that we commit\n        // that as soon as possible.\n        var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;\n        if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope\n        !( IsThisRendererActing.current)) {\n          // If we have not processed any new updates during this pass, then\n          // this is either a retry of an existing fallback state or a\n          // hidden tree. Hidden trees shouldn't be batched with other work\n          // and after that's fixed it can only be a retry. We're going to\n          // throttle committing retries so that we don't show too many\n          // loading states too quickly.\n          var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.\n          if (msUntilTimeout > 10) {\n            if (workInProgressRootHasPendingPing) {\n              var lastPingedTime = root.lastPingedTime;\n              if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {\n                // This render was pinged but we didn't get to restart\n                // earlier so try restarting now instead.\n                root.lastPingedTime = expirationTime;\n                prepareFreshStack(root, expirationTime);\n                break;\n              }\n            }\n            var nextTime = getNextRootExpirationTimeToWorkOn(root);\n            if (nextTime !== NoWork && nextTime !== expirationTime) {\n              // There's additional work on this root.\n              break;\n            }\n            if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {\n              // We should prefer to render the fallback of at the last\n              // suspended level. Ping the last suspended level to try\n              // rendering it again.\n              root.lastPingedTime = lastSuspendedTime;\n              break;\n            } // The render is suspended, it hasn't timed out, and there's no\n            // lower priority work to do. Instead of committing the fallback\n            // immediately, wait for more data to arrive.\n            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);\n            break;\n          }\n        } // The work expired. Commit immediately.\n        commitRoot(root);\n        break;\n      }\n    case RootSuspendedWithDelay:\n      {\n        markRootSuspendedAtTime(root, expirationTime);\n        var _lastSuspendedTime = root.lastSuspendedTime;\n        if (expirationTime === _lastSuspendedTime) {\n          root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);\n        }\n        if ( // do not delay if we're inside an act() scope\n        !( IsThisRendererActing.current)) {\n          // We're suspended in a state that should be avoided. We'll try to\n          // avoid committing it for as long as the timeouts let us.\n          if (workInProgressRootHasPendingPing) {\n            var _lastPingedTime = root.lastPingedTime;\n            if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {\n              // This render was pinged but we didn't get to restart earlier\n              // so try restarting now instead.\n              root.lastPingedTime = expirationTime;\n              prepareFreshStack(root, expirationTime);\n              break;\n            }\n          }\n          var _nextTime = getNextRootExpirationTimeToWorkOn(root);\n          if (_nextTime !== NoWork && _nextTime !== expirationTime) {\n            // There's additional work on this root.\n            break;\n          }\n          if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {\n            // We should prefer to render the fallback of at the last\n            // suspended level. Ping the last suspended level to try\n            // rendering it again.\n            root.lastPingedTime = _lastSuspendedTime;\n            break;\n          }\n          var _msUntilTimeout;\n          if (workInProgressRootLatestSuspenseTimeout !== Sync) {\n            // We have processed a suspense config whose expiration time we\n            // can use as the timeout.\n            _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();\n          } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {\n            // This should never normally happen because only new updates\n            // cause delayed states, so we should have processed something.\n            // However, this could also happen in an offscreen tree.\n            _msUntilTimeout = 0;\n          } else {\n            // If we don't have a suspense config, we're going to use a\n            // heuristic to determine how long we can suspend.\n            var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);\n            var currentTimeMs = now();\n            var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;\n            var timeElapsed = currentTimeMs - eventTimeMs;\n            if (timeElapsed < 0) {\n              // We get this wrong some time since we estimate the time.\n              timeElapsed = 0;\n            }\n            _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the\n            // event time is exact instead of inferred from expiration time\n            // we don't need this.\n            if (timeUntilExpirationMs < _msUntilTimeout) {\n              _msUntilTimeout = timeUntilExpirationMs;\n            }\n          } // Don't bother with a very short suspense time.\n          if (_msUntilTimeout > 10) {\n            // The render is suspended, it hasn't timed out, and there's no\n            // lower priority work to do. Instead of committing the fallback\n            // immediately, wait for more data to arrive.\n            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);\n            break;\n          }\n        } // The work expired. Commit immediately.\n        commitRoot(root);\n        break;\n      }\n    case RootCompleted:\n      {\n        // The work completed. Ready to commit.\n        if ( // do not delay if we're inside an act() scope\n        !( IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {\n          // If we have exceeded the minimum loading delay, which probably\n          // means we have shown a spinner already, we might have to suspend\n          // a bit longer to ensure that the spinner is shown for\n          // enough time.\n          var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);\n          if (_msUntilTimeout2 > 10) {\n            markRootSuspendedAtTime(root, expirationTime);\n            root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);\n            break;\n          }\n        }\n        commitRoot(root);\n        break;\n      }\n    default:\n      {\n        {\n          {\n            throw Error( \\\\\"Unknown root exit status.\\\\\" );\n          }\n        }\n      }\n  }\n} // This is the entry point for synchronous tasks that don't go\n// through Scheduler\nfunction performSyncWorkOnRoot(root) {\n  // Check if there's expired work on this root. Otherwise, render at Sync.\n  var lastExpiredTime = root.lastExpiredTime;\n  var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Should not already be working.\\\\\" );\n    }\n  }\n  flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack\n  // and prepare a fresh one. Otherwise we'll continue where we left off.\n  if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {\n    prepareFreshStack(root, expirationTime);\n    startWorkOnPendingInteractions(root, expirationTime);\n  } // If we have a work-in-progress fiber, it means there's still work to do\n  // in this root.\n  if (workInProgress !== null) {\n    var prevExecutionContext = executionContext;\n    executionContext |= RenderContext;\n    var prevDispatcher = pushDispatcher();\n    var prevInteractions = pushInteractions(root);\n    startWorkLoopTimer(workInProgress);\n    do {\n      try {\n        workLoopSync();\n        break;\n      } catch (thrownValue) {\n        handleError(root, thrownValue);\n      }\n    } while (true);\n    resetContextDependencies();\n    executionContext = prevExecutionContext;\n    popDispatcher(prevDispatcher);\n    {\n      popInteractions(prevInteractions);\n    }\n    if (workInProgressRootExitStatus === RootFatalErrored) {\n      var fatalError = workInProgressRootFatalError;\n      stopInterruptedWorkLoopTimer();\n      prepareFreshStack(root, expirationTime);\n      markRootSuspendedAtTime(root, expirationTime);\n      ensureRootIsScheduled(root);\n      throw fatalError;\n    }\n    if (workInProgress !== null) {\n      // This is a sync render, so we should have finished the whole tree.\n      {\n        {\n          throw Error( \\\\\"Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n        }\n      }\n    } else {\n      // We now have a consistent tree. Because this is a sync render, we\n      // will commit it even if something suspended.\n      stopFinishedWorkLoopTimer();\n      root.finishedWork = root.current.alternate;\n      root.finishedExpirationTime = expirationTime;\n      finishSyncRender(root);\n    } // Before exiting, make sure there's a callback scheduled for the next\n    // pending level.\n    ensureRootIsScheduled(root);\n  }\n  return null;\n}\nfunction finishSyncRender(root) {\n  // Set this to null to indicate there's no in-progress render.\n  workInProgressRoot = null;\n  commitRoot(root);\n}\nfunction flushDiscreteUpdates() {\n  // TODO: Should be able to flush inside batchedUpdates, but not inside \\`act\\`.\n  // However, \\`act\\` uses \\`batchedUpdates\\`, so there's no way to distinguish\n  // those two cases. Need to fix this before exposing flushDiscreteUpdates\n  // as a public API.\n  if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {\n    {\n      if ((executionContext & RenderContext) !== NoContext) {\n        error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');\n      }\n    } // We're already rendering, so we can't synchronously flush pending work.\n    // This is probably a nested event dispatch triggered by a lifecycle/effect,\n    // like \\`el.focus()\\`. Exit.\n    return;\n  }\n  flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that\n  // they fire before the next serial event.\n  flushPassiveEffects();\n}\nfunction syncUpdates(fn, a, b, c) {\n  return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c));\n}\nfunction flushPendingDiscreteUpdates() {\n  if (rootsWithPendingDiscreteUpdates !== null) {\n    // For each root with pending discrete updates, schedule a callback to\n    // immediately flush them.\n    var roots = rootsWithPendingDiscreteUpdates;\n    rootsWithPendingDiscreteUpdates = null;\n    roots.forEach(function (expirationTime, root) {\n      markRootExpiredAtTime(root, expirationTime);\n      ensureRootIsScheduled(root);\n    }); // Now flush the immediate queue.\n    flushSyncCallbackQueue();\n  }\n}\nfunction batchedUpdates$1(fn, a) {\n  var prevExecutionContext = executionContext;\n  executionContext |= BatchedContext;\n  try {\n    return fn(a);\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction batchedEventUpdates$1(fn, a) {\n  var prevExecutionContext = executionContext;\n  executionContext |= EventContext;\n  try {\n    return fn(a);\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction discreteUpdates$1(fn, a, b, c, d) {\n  var prevExecutionContext = executionContext;\n  executionContext |= DiscreteEventContext;\n  try {\n    // Should this\n    return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a, b, c, d));\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction unbatchedUpdates(fn, a) {\n  var prevExecutionContext = executionContext;\n  executionContext &= ~BatchedContext;\n  executionContext |= LegacyUnbatchedContext;\n  try {\n    return fn(a);\n  } finally {\n    executionContext = prevExecutionContext;\n    if (executionContext === NoContext) {\n      // Flush the immediate callbacks that were scheduled during this batch\n      flushSyncCallbackQueue();\n    }\n  }\n}\nfunction flushSync(fn, a) {\n  if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n    {\n      {\n        throw Error( \\\\\"flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.\\\\\" );\n      }\n    }\n  }\n  var prevExecutionContext = executionContext;\n  executionContext |= BatchedContext;\n  try {\n    return runWithPriority$1(ImmediatePriority, fn.bind(null, a));\n  } finally {\n    executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.\n    // Note that this will happen even if batchedUpdates is higher up\n    // the stack.\n    flushSyncCallbackQueue();\n  }\n}\nfunction prepareFreshStack(root, expirationTime) {\n  root.finishedWork = null;\n  root.finishedExpirationTime = NoWork;\n  var timeoutHandle = root.timeoutHandle;\n  if (timeoutHandle !== noTimeout) {\n    // The root previous suspended and scheduled a timeout to commit a fallback\n    // state. Now that we have additional work, cancel the timeout.\n    root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above\n    cancelTimeout(timeoutHandle);\n  }\n  if (workInProgress !== null) {\n    var interruptedWork = workInProgress.return;\n    while (interruptedWork !== null) {\n      unwindInterruptedWork(interruptedWork);\n      interruptedWork = interruptedWork.return;\n    }\n  }\n  workInProgressRoot = root;\n  workInProgress = createWorkInProgress(root.current, null);\n  renderExpirationTime$1 = expirationTime;\n  workInProgressRootExitStatus = RootIncomplete;\n  workInProgressRootFatalError = null;\n  workInProgressRootLatestProcessedExpirationTime = Sync;\n  workInProgressRootLatestSuspenseTimeout = Sync;\n  workInProgressRootCanSuspendUsingConfig = null;\n  workInProgressRootNextUnprocessedUpdateTime = NoWork;\n  workInProgressRootHasPendingPing = false;\n  {\n    spawnedWorkDuringRender = null;\n  }\n  {\n    ReactStrictModeWarnings.discardPendingWarnings();\n  }\n}\nfunction handleError(root, thrownValue) {\n  do {\n    try {\n      // Reset module-level state that was set during the render phase.\n      resetContextDependencies();\n      resetHooksAfterThrow();\n      resetCurrentFiber();\n      if (workInProgress === null || workInProgress.return === null) {\n        // Expected to be working on a non-root fiber. This is a fatal error\n        // because there's no ancestor that can handle it; the root is\n        // supposed to capture all errors that weren't caught by an error\n        // boundary.\n        workInProgressRootExitStatus = RootFatalErrored;\n        workInProgressRootFatalError = thrownValue; // Set \\`workInProgress\\` to null. This represents advancing to the next\n        // sibling, or the parent if there are no siblings. But since the root\n        // has no siblings nor a parent, we set it to null. Usually this is\n        // handled by \\`completeUnitOfWork\\` or \\`unwindWork\\`, but since we're\n        // interntionally not calling those, we need set it here.\n        // TODO: Consider calling \\`unwindWork\\` to pop the contexts.\n        workInProgress = null;\n        return null;\n      }\n      if (enableProfilerTimer && workInProgress.mode & ProfileMode) {\n        // Record the time spent rendering before an error was thrown. This\n        // avoids inaccurate Profiler durations in the case of a\n        // suspended render.\n        stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);\n      }\n      throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1);\n      workInProgress = completeUnitOfWork(workInProgress);\n    } catch (yetAnotherThrownValue) {\n      // Something in the return path also threw.\n      thrownValue = yetAnotherThrownValue;\n      continue;\n    } // Return to the normal work loop.\n    return;\n  } while (true);\n}\nfunction pushDispatcher(root) {\n  var prevDispatcher = ReactCurrentDispatcher$1.current;\n  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n  if (prevDispatcher === null) {\n    // The React isomorphic package does not include a default dispatcher.\n    // Instead the first renderer will lazily attach one, in order to give\n    // nicer error messages.\n    return ContextOnlyDispatcher;\n  } else {\n    return prevDispatcher;\n  }\n}\nfunction popDispatcher(prevDispatcher) {\n  ReactCurrentDispatcher$1.current = prevDispatcher;\n}\nfunction pushInteractions(root) {\n  {\n    var prevInteractions = tracing$1.__interactionsRef.current;\n    tracing$1.__interactionsRef.current = root.memoizedInteractions;\n    return prevInteractions;\n  }\n}\nfunction popInteractions(prevInteractions) {\n  {\n    tracing$1.__interactionsRef.current = prevInteractions;\n  }\n}\nfunction markCommitTimeOfFallback() {\n  globalMostRecentFallbackTime = now();\n}\nfunction markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {\n  if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {\n    workInProgressRootLatestProcessedExpirationTime = expirationTime;\n  }\n  if (suspenseConfig !== null) {\n    if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {\n      workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad.\n      workInProgressRootCanSuspendUsingConfig = suspenseConfig;\n    }\n  }\n}\nfunction markUnprocessedUpdateTime(expirationTime) {\n  if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {\n    workInProgressRootNextUnprocessedUpdateTime = expirationTime;\n  }\n}\nfunction renderDidSuspend() {\n  if (workInProgressRootExitStatus === RootIncomplete) {\n    workInProgressRootExitStatus = RootSuspended;\n  }\n}\nfunction renderDidSuspendDelayIfPossible() {\n  if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {\n    workInProgressRootExitStatus = RootSuspendedWithDelay;\n  } // Check if there's a lower priority update somewhere else in the tree.\n  if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {\n    // Mark the current render as suspended, and then mark that there's a\n    // pending update.\n    // TODO: This should immediately interrupt the current render, instead\n    // of waiting until the next time we yield.\n    markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1);\n    markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);\n  }\n}\nfunction renderDidError() {\n  if (workInProgressRootExitStatus !== RootCompleted) {\n    workInProgressRootExitStatus = RootErrored;\n  }\n} // Called during render to determine if anything has suspended.\n// Returns false if we're not sure.\nfunction renderHasNotSuspendedYet() {\n  // If something errored or completed, we can't really be sure,\n  // so those are false.\n  return workInProgressRootExitStatus === RootIncomplete;\n}\nfunction inferTimeFromExpirationTime(expirationTime) {\n  // We don't know exactly when the update was scheduled, but we can infer an\n  // approximate start time from the expiration time.\n  var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);\n  return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;\n}\nfunction inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {\n  // We don't know exactly when the update was scheduled, but we can infer an\n  // approximate start time from the expiration time by subtracting the timeout\n  // that was added to the event time.\n  var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);\n  return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);\n} // The work loop is an extremely hot path. Tell Closure not to inline it.\n/** @noinline */\nfunction workLoopSync() {\n  // Already timed out, so perform work without checking if we need to yield.\n  while (workInProgress !== null) {\n    workInProgress = performUnitOfWork(workInProgress);\n  }\n}\n/** @noinline */\nfunction workLoopConcurrent() {\n  // Perform work until Scheduler asks us to yield\n  while (workInProgress !== null && !shouldYield()) {\n    workInProgress = performUnitOfWork(workInProgress);\n  }\n}\nfunction performUnitOfWork(unitOfWork) {\n  // The current, flushed, state of this fiber is the alternate. Ideally\n  // nothing should rely on this, but relying on it here means that we don't\n  // need an additional field on the work in progress.\n  var current = unitOfWork.alternate;\n  startWorkTimer(unitOfWork);\n  setCurrentFiber(unitOfWork);\n  var next;\n  if ( (unitOfWork.mode & ProfileMode) !== NoMode) {\n    startProfilerTimer(unitOfWork);\n    next = beginWork$1(current, unitOfWork, renderExpirationTime$1);\n    stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);\n  } else {\n    next = beginWork$1(current, unitOfWork, renderExpirationTime$1);\n  }\n  resetCurrentFiber();\n  unitOfWork.memoizedProps = unitOfWork.pendingProps;\n  if (next === null) {\n    // If this doesn't spawn new work, complete the current work.\n    next = completeUnitOfWork(unitOfWork);\n  }\n  ReactCurrentOwner$2.current = null;\n  return next;\n}\nfunction completeUnitOfWork(unitOfWork) {\n  // Attempt to complete the current unit of work, then move to the next\n  // sibling. If there are no more siblings, return to the parent fiber.\n  workInProgress = unitOfWork;\n  do {\n    // The current, flushed, state of this fiber is the alternate. Ideally\n    // nothing should rely on this, but relying on it here means that we don't\n    // need an additional field on the work in progress.\n    var current = workInProgress.alternate;\n    var returnFiber = workInProgress.return; // Check if the work completed or if something threw.\n    if ((workInProgress.effectTag & Incomplete) === NoEffect) {\n      setCurrentFiber(workInProgress);\n      var next = void 0;\n      if ( (workInProgress.mode & ProfileMode) === NoMode) {\n        next = completeWork(current, workInProgress, renderExpirationTime$1);\n      } else {\n        startProfilerTimer(workInProgress);\n        next = completeWork(current, workInProgress, renderExpirationTime$1); // Update render duration assuming we didn't error.\n        stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);\n      }\n      stopWorkTimer(workInProgress);\n      resetCurrentFiber();\n      resetChildExpirationTime(workInProgress);\n      if (next !== null) {\n        // Completing this fiber spawned new work. Work on that next.\n        return next;\n      }\n      if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete\n      (returnFiber.effectTag & Incomplete) === NoEffect) {\n        // Append all the effects of the subtree and this fiber onto the effect\n        // list of the parent. The completion order of the children affects the\n        // side-effect order.\n        if (returnFiber.firstEffect === null) {\n          returnFiber.firstEffect = workInProgress.firstEffect;\n        }\n        if (workInProgress.lastEffect !== null) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;\n          }\n          returnFiber.lastEffect = workInProgress.lastEffect;\n        } // If this fiber had side-effects, we append it AFTER the children's\n        // side-effects. We can perform certain side-effects earlier if needed,\n        // by doing multiple passes over the effect list. We don't want to\n        // schedule our own side-effect on our own list because if end up\n        // reusing children we'll schedule this effect onto itself since we're\n        // at the end.\n        var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect\n        // list. PerformedWork effect is read by React DevTools but shouldn't be\n        // committed.\n        if (effectTag > PerformedWork) {\n          if (returnFiber.lastEffect !== null) {\n            returnFiber.lastEffect.nextEffect = workInProgress;\n          } else {\n            returnFiber.firstEffect = workInProgress;\n          }\n          returnFiber.lastEffect = workInProgress;\n        }\n      }\n    } else {\n      // This fiber did not complete because something threw. Pop values off\n      // the stack without entering the complete phase. If this is a boundary,\n      // capture values if possible.\n      var _next = unwindWork(workInProgress); // Because this fiber did not complete, don't reset its expiration time.\n      if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n        // Record the render duration for the fiber that errored.\n        stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing.\n        var actualDuration = workInProgress.actualDuration;\n        var child = workInProgress.child;\n        while (child !== null) {\n          actualDuration += child.actualDuration;\n          child = child.sibling;\n        }\n        workInProgress.actualDuration = actualDuration;\n      }\n      if (_next !== null) {\n        // If completing this work spawned new work, do that next. We'll come\n        // back here again.\n        // Since we're restarting, remove anything that is not a host effect\n        // from the effect tag.\n        // TODO: The name stopFailedWorkTimer is misleading because Suspense\n        // also captures and restarts.\n        stopFailedWorkTimer(workInProgress);\n        _next.effectTag &= HostEffectMask;\n        return _next;\n      }\n      stopWorkTimer(workInProgress);\n      if (returnFiber !== null) {\n        // Mark the parent fiber as incomplete and clear its effect list.\n        returnFiber.firstEffect = returnFiber.lastEffect = null;\n        returnFiber.effectTag |= Incomplete;\n      }\n    }\n    var siblingFiber = workInProgress.sibling;\n    if (siblingFiber !== null) {\n      // If there is more work to do in this returnFiber, do that next.\n      return siblingFiber;\n    } // Otherwise, return to the parent\n    workInProgress = returnFiber;\n  } while (workInProgress !== null); // We've reached the root.\n  if (workInProgressRootExitStatus === RootIncomplete) {\n    workInProgressRootExitStatus = RootCompleted;\n  }\n  return null;\n}\nfunction getRemainingExpirationTime(fiber) {\n  var updateExpirationTime = fiber.expirationTime;\n  var childExpirationTime = fiber.childExpirationTime;\n  return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;\n}\nfunction resetChildExpirationTime(completedWork) {\n  if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) {\n    // The children of this component are hidden. Don't bubble their\n    // expiration times.\n    return;\n  }\n  var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time.\n  if ( (completedWork.mode & ProfileMode) !== NoMode) {\n    // In profiling mode, resetChildExpirationTime is also used to reset\n    // profiler durations.\n    var actualDuration = completedWork.actualDuration;\n    var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will\n    // only be updated if work is done on the fiber (i.e. it doesn't bailout).\n    // When work is done, it should bubble to the parent's actualDuration. If\n    // the fiber has not been cloned though, (meaning no work was done), then\n    // this value will reflect the amount of time spent working on a previous\n    // render. In that case it should not bubble. We determine whether it was\n    // cloned by comparing the child pointer.\n    var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;\n    var child = completedWork.child;\n    while (child !== null) {\n      var childUpdateExpirationTime = child.expirationTime;\n      var childChildExpirationTime = child.childExpirationTime;\n      if (childUpdateExpirationTime > newChildExpirationTime) {\n        newChildExpirationTime = childUpdateExpirationTime;\n      }\n      if (childChildExpirationTime > newChildExpirationTime) {\n        newChildExpirationTime = childChildExpirationTime;\n      }\n      if (shouldBubbleActualDurations) {\n        actualDuration += child.actualDuration;\n      }\n      treeBaseDuration += child.treeBaseDuration;\n      child = child.sibling;\n    }\n    completedWork.actualDuration = actualDuration;\n    completedWork.treeBaseDuration = treeBaseDuration;\n  } else {\n    var _child = completedWork.child;\n    while (_child !== null) {\n      var _childUpdateExpirationTime = _child.expirationTime;\n      var _childChildExpirationTime = _child.childExpirationTime;\n      if (_childUpdateExpirationTime > newChildExpirationTime) {\n        newChildExpirationTime = _childUpdateExpirationTime;\n      }\n      if (_childChildExpirationTime > newChildExpirationTime) {\n        newChildExpirationTime = _childChildExpirationTime;\n      }\n      _child = _child.sibling;\n    }\n  }\n  completedWork.childExpirationTime = newChildExpirationTime;\n}\nfunction commitRoot(root) {\n  var renderPriorityLevel = getCurrentPriorityLevel();\n  runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));\n  return null;\n}\nfunction commitRootImpl(root, renderPriorityLevel) {\n  do {\n    // \\`flushPassiveEffects\\` will call \\`flushSyncUpdateQueue\\` at the end, which\n    // means \\`flushPassiveEffects\\` will sometimes result in additional\n    // passive effects. So we need to keep flushing in a loop until there are\n    // no more pending effects.\n    // TODO: Might be better if \\`flushPassiveEffects\\` did not automatically\n    // flush synchronous work at the end, to avoid factoring hazards like this.\n    flushPassiveEffects();\n  } while (rootWithPendingPassiveEffects !== null);\n  flushRenderPhaseStrictModeWarningsInDEV();\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Should not already be working.\\\\\" );\n    }\n  }\n  var finishedWork = root.finishedWork;\n  var expirationTime = root.finishedExpirationTime;\n  if (finishedWork === null) {\n    return null;\n  }\n  root.finishedWork = null;\n  root.finishedExpirationTime = NoWork;\n  if (!(finishedWork !== root.current)) {\n    {\n      throw Error( \\\\\"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.\\\\\" );\n    }\n  } // commitRoot never returns a continuation; it always finishes synchronously.\n  // So we can clear these now to allow a new callback to be scheduled.\n  root.callbackNode = null;\n  root.callbackExpirationTime = NoWork;\n  root.callbackPriority = NoPriority;\n  root.nextKnownPendingLevel = NoWork;\n  startCommitTimer(); // Update the first and last pending times on this root. The new first\n  // pending time is whatever is left on the root fiber.\n  var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);\n  markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);\n  if (root === workInProgressRoot) {\n    // We can reset these now that they are finished.\n    workInProgressRoot = null;\n    workInProgress = null;\n    renderExpirationTime$1 = NoWork;\n  } // This indicates that the last root we worked on is not the same one that\n  // we're committing now. This most commonly happens when a suspended root\n  // times out.\n  // Get the list of effects.\n  var firstEffect;\n  if (finishedWork.effectTag > PerformedWork) {\n    // A fiber's effect list consists only of its children, not itself. So if\n    // the root has an effect, we need to add it to the end of the list. The\n    // resulting list is the set that would belong to the root's parent, if it\n    // had one; that is, all the effects in the tree including the root.\n    if (finishedWork.lastEffect !== null) {\n      finishedWork.lastEffect.nextEffect = finishedWork;\n      firstEffect = finishedWork.firstEffect;\n    } else {\n      firstEffect = finishedWork;\n    }\n  } else {\n    // There is no effect on the root.\n    firstEffect = finishedWork.firstEffect;\n  }\n  if (firstEffect !== null) {\n    var prevExecutionContext = executionContext;\n    executionContext |= CommitContext;\n    var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles\n    ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass\n    // of the effect list for each phase: all mutation effects come before all\n    // layout effects, and so on.\n    // The first phase a \\\\\"before mutation\\\\\" phase. We use this phase to read the\n    // state of the host tree right before we mutate it. This is where\n    // getSnapshotBeforeUpdate is called.\n    startCommitSnapshotEffectsTimer();\n    prepareForCommit(root.containerInfo);\n    nextEffect = firstEffect;\n    do {\n      {\n        invokeGuardedCallback(null, commitBeforeMutationEffects, null);\n        if (hasCaughtError()) {\n          if (!(nextEffect !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var error = clearCaughtError();\n          captureCommitPhaseError(nextEffect, error);\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    } while (nextEffect !== null);\n    stopCommitSnapshotEffectsTimer();\n    {\n      // Mark the current commit time to be shared by all Profilers in this\n      // batch. This enables them to be grouped later.\n      recordCommitTime();\n    } // The next phase is the mutation phase, where we mutate the host tree.\n    startCommitHostEffectsTimer();\n    nextEffect = firstEffect;\n    do {\n      {\n        invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);\n        if (hasCaughtError()) {\n          if (!(nextEffect !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var _error = clearCaughtError();\n          captureCommitPhaseError(nextEffect, _error);\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    } while (nextEffect !== null);\n    stopCommitHostEffectsTimer();\n    resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after\n    // the mutation phase, so that the previous tree is still current during\n    // componentWillUnmount, but before the layout phase, so that the finished\n    // work is current during componentDidMount/Update.\n    root.current = finishedWork; // The next phase is the layout phase, where we call effects that read\n    // the host tree after it's been mutated. The idiomatic use case for this is\n    // layout, but class component lifecycles also fire here for legacy reasons.\n    startCommitLifeCyclesTimer();\n    nextEffect = firstEffect;\n    do {\n      {\n        invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);\n        if (hasCaughtError()) {\n          if (!(nextEffect !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var _error2 = clearCaughtError();\n          captureCommitPhaseError(nextEffect, _error2);\n          nextEffect = nextEffect.nextEffect;\n        }\n      }\n    } while (nextEffect !== null);\n    stopCommitLifeCyclesTimer();\n    nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an\n    // opportunity to paint.\n    requestPaint();\n    {\n      popInteractions(prevInteractions);\n    }\n    executionContext = prevExecutionContext;\n  } else {\n    // No effects.\n    root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were\n    // no effects.\n    // TODO: Maybe there's a better way to report this.\n    startCommitSnapshotEffectsTimer();\n    stopCommitSnapshotEffectsTimer();\n    {\n      recordCommitTime();\n    }\n    startCommitHostEffectsTimer();\n    stopCommitHostEffectsTimer();\n    startCommitLifeCyclesTimer();\n    stopCommitLifeCyclesTimer();\n  }\n  stopCommitTimer();\n  var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;\n  if (rootDoesHavePassiveEffects) {\n    // This commit has passive effects. Stash a reference to them. But don't\n    // schedule a callback until after flushing layout work.\n    rootDoesHavePassiveEffects = false;\n    rootWithPendingPassiveEffects = root;\n    pendingPassiveEffectsExpirationTime = expirationTime;\n    pendingPassiveEffectsRenderPriority = renderPriorityLevel;\n  } else {\n    // We are done with the effect chain at this point so let's clear the\n    // nextEffect pointers to assist with GC. If we have passive effects, we'll\n    // clear this in flushPassiveEffects.\n    nextEffect = firstEffect;\n    while (nextEffect !== null) {\n      var nextNextEffect = nextEffect.nextEffect;\n      nextEffect.nextEffect = null;\n      nextEffect = nextNextEffect;\n    }\n  } // Check if there's remaining work on this root\n  var remainingExpirationTime = root.firstPendingTime;\n  if (remainingExpirationTime !== NoWork) {\n    {\n      if (spawnedWorkDuringRender !== null) {\n        var expirationTimes = spawnedWorkDuringRender;\n        spawnedWorkDuringRender = null;\n        for (var i = 0; i < expirationTimes.length; i++) {\n          scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);\n        }\n      }\n      schedulePendingInteractions(root, remainingExpirationTime);\n    }\n  } else {\n    // If there's no remaining work, we can clear the set of already failed\n    // error boundaries.\n    legacyErrorBoundariesThatAlreadyFailed = null;\n  }\n  {\n    if (!rootDidHavePassiveEffects) {\n      // If there are no passive effects, then we can complete the pending interactions.\n      // Otherwise, we'll wait until after the passive effects are flushed.\n      // Wait to do this until after remaining work has been scheduled,\n      // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.\n      finishPendingInteractions(root, expirationTime);\n    }\n  }\n  if (remainingExpirationTime === Sync) {\n    // Count the number of times the root synchronously re-renders without\n    // finishing. If there are too many, it indicates an infinite update loop.\n    if (root === rootWithNestedUpdates) {\n      nestedUpdateCount++;\n    } else {\n      nestedUpdateCount = 0;\n      rootWithNestedUpdates = root;\n    }\n  } else {\n    nestedUpdateCount = 0;\n  }\n  onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting \\`commitRoot\\`, to ensure that any\n  // additional work on this root is scheduled.\n  ensureRootIsScheduled(root);\n  if (hasUncaughtError) {\n    hasUncaughtError = false;\n    var _error3 = firstUncaughtError;\n    firstUncaughtError = null;\n    throw _error3;\n  }\n  if ((executionContext & LegacyUnbatchedContext) !== NoContext) {\n    // This is a legacy edge case. We just committed the initial mount of\n    // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired\n    // synchronously, but layout updates should be deferred until the end\n    // of the batch.\n    return null;\n  } // If layout work was scheduled, flush it now.\n  flushSyncCallbackQueue();\n  return null;\n}\nfunction commitBeforeMutationEffects() {\n  while (nextEffect !== null) {\n    var effectTag = nextEffect.effectTag;\n    if ((effectTag & Snapshot) !== NoEffect) {\n      setCurrentFiber(nextEffect);\n      recordEffect();\n      var current = nextEffect.alternate;\n      commitBeforeMutationLifeCycles(current, nextEffect);\n      resetCurrentFiber();\n    }\n    if ((effectTag & Passive) !== NoEffect) {\n      // If there are passive effects, schedule a callback to flush at\n      // the earliest opportunity.\n      if (!rootDoesHavePassiveEffects) {\n        rootDoesHavePassiveEffects = true;\n        scheduleCallback(NormalPriority, function () {\n          flushPassiveEffects();\n          return null;\n        });\n      }\n    }\n    nextEffect = nextEffect.nextEffect;\n  }\n}\nfunction commitMutationEffects(root, renderPriorityLevel) {\n  // TODO: Should probably move the bulk of this function to commitWork.\n  while (nextEffect !== null) {\n    setCurrentFiber(nextEffect);\n    var effectTag = nextEffect.effectTag;\n    if (effectTag & ContentReset) {\n      commitResetTextContent(nextEffect);\n    }\n    if (effectTag & Ref) {\n      var current = nextEffect.alternate;\n      if (current !== null) {\n        commitDetachRef(current);\n      }\n    } // The following switch statement is only concerned about placement,\n    // updates, and deletions. To avoid needing to add a case for every possible\n    // bitmap value, we remove the secondary effects from the effect tag and\n    // switch on that value.\n    var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);\n    switch (primaryEffectTag) {\n      case Placement:\n        {\n          commitPlacement(nextEffect); // Clear the \\\\\"placement\\\\\" from effect tag so that we know that this is\n          // inserted, before any life-cycles like componentDidMount gets called.\n          // TODO: findDOMNode doesn't rely on this any more but isMounted does\n          // and isMounted is deprecated anyway so we should be able to kill this.\n          nextEffect.effectTag &= ~Placement;\n          break;\n        }\n      case PlacementAndUpdate:\n        {\n          // Placement\n          commitPlacement(nextEffect); // Clear the \\\\\"placement\\\\\" from effect tag so that we know that this is\n          // inserted, before any life-cycles like componentDidMount gets called.\n          nextEffect.effectTag &= ~Placement; // Update\n          var _current = nextEffect.alternate;\n          commitWork(_current, nextEffect);\n          break;\n        }\n      case Hydrating:\n        {\n          nextEffect.effectTag &= ~Hydrating;\n          break;\n        }\n      case HydratingAndUpdate:\n        {\n          nextEffect.effectTag &= ~Hydrating; // Update\n          var _current2 = nextEffect.alternate;\n          commitWork(_current2, nextEffect);\n          break;\n        }\n      case Update:\n        {\n          var _current3 = nextEffect.alternate;\n          commitWork(_current3, nextEffect);\n          break;\n        }\n      case Deletion:\n        {\n          commitDeletion(root, nextEffect, renderPriorityLevel);\n          break;\n        }\n    } // TODO: Only record a mutation effect if primaryEffectTag is non-zero.\n    recordEffect();\n    resetCurrentFiber();\n    nextEffect = nextEffect.nextEffect;\n  }\n}\nfunction commitLayoutEffects(root, committedExpirationTime) {\n  // TODO: Should probably move the bulk of this function to commitWork.\n  while (nextEffect !== null) {\n    setCurrentFiber(nextEffect);\n    var effectTag = nextEffect.effectTag;\n    if (effectTag & (Update | Callback)) {\n      recordEffect();\n      var current = nextEffect.alternate;\n      commitLifeCycles(root, current, nextEffect);\n    }\n    if (effectTag & Ref) {\n      recordEffect();\n      commitAttachRef(nextEffect);\n    }\n    resetCurrentFiber();\n    nextEffect = nextEffect.nextEffect;\n  }\n}\nfunction flushPassiveEffects() {\n  if (pendingPassiveEffectsRenderPriority !== NoPriority) {\n    var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;\n    pendingPassiveEffectsRenderPriority = NoPriority;\n    return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);\n  }\n}\nfunction flushPassiveEffectsImpl() {\n  if (rootWithPendingPassiveEffects === null) {\n    return false;\n  }\n  var root = rootWithPendingPassiveEffects;\n  var expirationTime = pendingPassiveEffectsExpirationTime;\n  rootWithPendingPassiveEffects = null;\n  pendingPassiveEffectsExpirationTime = NoWork;\n  if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n    {\n      throw Error( \\\\\"Cannot flush passive effects while already rendering.\\\\\" );\n    }\n  }\n  var prevExecutionContext = executionContext;\n  executionContext |= CommitContext;\n  var prevInteractions = pushInteractions(root);\n  {\n    // Note: This currently assumes there are no passive effects on the root fiber\n    // because the root is not part of its own effect list.\n    // This could change in the future.\n    var _effect2 = root.current.firstEffect;\n    while (_effect2 !== null) {\n      {\n        setCurrentFiber(_effect2);\n        invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2);\n        if (hasCaughtError()) {\n          if (!(_effect2 !== null)) {\n            {\n              throw Error( \\\\\"Should be working on an effect.\\\\\" );\n            }\n          }\n          var _error5 = clearCaughtError();\n          captureCommitPhaseError(_effect2, _error5);\n        }\n        resetCurrentFiber();\n      }\n      var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC\n      _effect2.nextEffect = null;\n      _effect2 = nextNextEffect;\n    }\n  }\n  {\n    popInteractions(prevInteractions);\n    finishPendingInteractions(root, expirationTime);\n  }\n  executionContext = prevExecutionContext;\n  flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this\n  // exceeds the limit, we'll fire a warning.\n  nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;\n  return true;\n}\nfunction isAlreadyFailedLegacyErrorBoundary(instance) {\n  return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);\n}\nfunction markLegacyErrorBoundaryAsFailed(instance) {\n  if (legacyErrorBoundariesThatAlreadyFailed === null) {\n    legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);\n  } else {\n    legacyErrorBoundariesThatAlreadyFailed.add(instance);\n  }\n}\nfunction prepareToThrowUncaughtError(error) {\n  if (!hasUncaughtError) {\n    hasUncaughtError = true;\n    firstUncaughtError = error;\n  }\n}\nvar onUncaughtError = prepareToThrowUncaughtError;\nfunction captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {\n  var errorInfo = createCapturedValue(error, sourceFiber);\n  var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);\n  enqueueUpdate(rootFiber, update);\n  var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);\n  if (root !== null) {\n    ensureRootIsScheduled(root);\n    schedulePendingInteractions(root, Sync);\n  }\n}\nfunction captureCommitPhaseError(sourceFiber, error) {\n  if (sourceFiber.tag === HostRoot) {\n    // Error was thrown at the root. There is no parent, so the root\n    // itself should capture it.\n    captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);\n    return;\n  }\n  var fiber = sourceFiber.return;\n  while (fiber !== null) {\n    if (fiber.tag === HostRoot) {\n      captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);\n      return;\n    } else if (fiber.tag === ClassComponent) {\n      var ctor = fiber.type;\n      var instance = fiber.stateNode;\n      if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n        var errorInfo = createCapturedValue(error, sourceFiber);\n        var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync\n        Sync);\n        enqueueUpdate(fiber, update);\n        var root = markUpdateTimeFromFiberToRoot(fiber, Sync);\n        if (root !== null) {\n          ensureRootIsScheduled(root);\n          schedulePendingInteractions(root, Sync);\n        }\n        return;\n      }\n    }\n    fiber = fiber.return;\n  }\n}\nfunction pingSuspendedRoot(root, thenable, suspendedTime) {\n  var pingCache = root.pingCache;\n  if (pingCache !== null) {\n    // The thenable resolved, so we no longer need to memoize, because it will\n    // never be thrown again.\n    pingCache.delete(thenable);\n  }\n  if (workInProgressRoot === root && renderExpirationTime$1 === suspendedTime) {\n    // Received a ping at the same priority level at which we're currently\n    // rendering. We might want to restart this render. This should mirror\n    // the logic of whether or not a root suspends once it completes.\n    // TODO: If we're rendering sync either due to Sync, Batched or expired,\n    // we should probably never restart.\n    // If we're suspended with delay, we'll always suspend so we can always\n    // restart. If we're suspended without any updates, it might be a retry.\n    // If it's early in the retry we can restart. We can't know for sure\n    // whether we'll eventually process an update during this render pass,\n    // but it's somewhat unlikely that we get to a ping before that, since\n    // getting to the root most update is usually very fast.\n    if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {\n      // Restart from the root. Don't need to schedule a ping because\n      // we're already working on this tree.\n      prepareFreshStack(root, renderExpirationTime$1);\n    } else {\n      // Even though we can't restart right now, we might get an\n      // opportunity later. So we mark this render as having a ping.\n      workInProgressRootHasPendingPing = true;\n    }\n    return;\n  }\n  if (!isRootSuspendedAtTime(root, suspendedTime)) {\n    // The root is no longer suspended at this time.\n    return;\n  }\n  var lastPingedTime = root.lastPingedTime;\n  if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {\n    // There's already a lower priority ping scheduled.\n    return;\n  } // Mark the time at which this ping was scheduled.\n  root.lastPingedTime = suspendedTime;\n  ensureRootIsScheduled(root);\n  schedulePendingInteractions(root, suspendedTime);\n}\nfunction retryTimedOutBoundary(boundaryFiber, retryTime) {\n  // The boundary fiber (a Suspense component or SuspenseList component)\n  // previously was rendered in its fallback state. One of the promises that\n  // suspended it has resolved, which means at least part of the tree was\n  // likely unblocked. Try rendering again, at a new expiration time.\n  if (retryTime === NoWork) {\n    var suspenseConfig = null; // Retries don't carry over the already committed update.\n    var currentTime = requestCurrentTimeForUpdate();\n    retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);\n  } // TODO: Special case idle priority?\n  var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);\n  if (root !== null) {\n    ensureRootIsScheduled(root);\n    schedulePendingInteractions(root, retryTime);\n  }\n}\nfunction resolveRetryThenable(boundaryFiber, thenable) {\n  var retryTime = NoWork; // Default\n  var retryCache;\n  {\n    retryCache = boundaryFiber.stateNode;\n  }\n  if (retryCache !== null) {\n    // The thenable resolved, so we no longer need to memoize, because it will\n    // never be thrown again.\n    retryCache.delete(thenable);\n  }\n  retryTimedOutBoundary(boundaryFiber, retryTime);\n} // Computes the next Just Noticeable Difference (JND) boundary.\n// The theory is that a person can't tell the difference between small differences in time.\n// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable\n// difference in the experience. However, waiting for longer might mean that we can avoid\n// showing an intermediate loading state. The longer we have already waited, the harder it\n// is to tell small differences in time. Therefore, the longer we've already waited,\n// the longer we can wait additionally. At some point we have to give up though.\n// We pick a train model where the next boundary commits at a consistent schedule.\n// These particular numbers are vague estimates. We expect to adjust them based on research.\nfunction jnd(timeElapsed) {\n  return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;\n}\nfunction computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {\n  var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;\n  if (busyMinDurationMs <= 0) {\n    return 0;\n  }\n  var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire.\n  var currentTimeMs = now();\n  var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);\n  var timeElapsed = currentTimeMs - eventTimeMs;\n  if (timeElapsed <= busyDelayMs) {\n    // If we haven't yet waited longer than the initial delay, we don't\n    // have to wait any additional time.\n    return 0;\n  }\n  var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to \\`setTimeout\\`.\n  return msUntilTimeout;\n}\nfunction checkForNestedUpdates() {\n  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {\n    nestedUpdateCount = 0;\n    rootWithNestedUpdates = null;\n    {\n      {\n        throw Error( \\\\\"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\\\\\" );\n      }\n    }\n  }\n  {\n    if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {\n      nestedPassiveUpdateCount = 0;\n      error('Maximum update depth exceeded. This can happen when a component ' + \\\\\"calls setState inside useEffect, but useEffect either doesn't \\\\\" + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');\n    }\n  }\n}\nfunction flushRenderPhaseStrictModeWarningsInDEV() {\n  {\n    ReactStrictModeWarnings.flushLegacyContextWarning();\n    {\n      ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();\n    }\n  }\n}\nfunction stopFinishedWorkLoopTimer() {\n  var didCompleteRoot = true;\n  stopWorkLoopTimer(interruptedBy, didCompleteRoot);\n  interruptedBy = null;\n}\nfunction stopInterruptedWorkLoopTimer() {\n  // TODO: Track which fiber caused the interruption.\n  var didCompleteRoot = false;\n  stopWorkLoopTimer(interruptedBy, didCompleteRoot);\n  interruptedBy = null;\n}\nfunction checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {\n  if ( workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) {\n    interruptedBy = fiberThatReceivedUpdate;\n  }\n}\nvar didWarnStateUpdateForUnmountedComponent = null;\nfunction warnAboutUpdateOnUnmountedFiberInDEV(fiber) {\n  {\n    var tag = fiber.tag;\n    if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n      // Only warn for user-defined components, not internal ones like Suspense.\n      return;\n    }\n    // the problematic code almost always lies inside that component.\n    var componentName = getComponentName(fiber.type) || 'ReactComponent';\n    if (didWarnStateUpdateForUnmountedComponent !== null) {\n      if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {\n        return;\n      }\n      didWarnStateUpdateForUnmountedComponent.add(componentName);\n    } else {\n      didWarnStateUpdateForUnmountedComponent = new Set([componentName]);\n    }\n    error(\\\\\"Can't perform a React state update on an unmounted component. This \\\\\" + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));\n  }\n}\nvar beginWork$1;\n{\n  var dummyFiber = null;\n  beginWork$1 = function (current, unitOfWork, expirationTime) {\n    // If a component throws an error, we replay it again in a synchronously\n    // dispatched event, so that the debugger will treat it as an uncaught\n    // error See ReactErrorUtils for more information.\n    // Before entering the begin phase, copy the work-in-progress onto a dummy\n    // fiber. If beginWork throws, we'll use this to reset the state.\n    var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);\n    try {\n      return beginWork(current, unitOfWork, expirationTime);\n    } catch (originalError) {\n      if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {\n        // Don't replay promises. Treat everything else like an error.\n        throw originalError;\n      } // Keep this code in sync with handleError; any changes here must have\n      // corresponding changes there.\n      resetContextDependencies();\n      resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the\n      // same fiber again.\n      // Unwind the failed stack frame\n      unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.\n      assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n      if ( unitOfWork.mode & ProfileMode) {\n        // Reset the profiler timer.\n        startProfilerTimer(unitOfWork);\n      } // Run beginWork again.\n      invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime);\n      if (hasCaughtError()) {\n        var replayError = clearCaughtError(); // \\`invokeGuardedCallback\\` sometimes sets an expando \\`_suppressLogging\\`.\n        // Rethrow this error instead of the original one.\n        throw replayError;\n      } else {\n        // This branch is reachable if the render phase is impure.\n        throw originalError;\n      }\n    }\n  };\n}\nvar didWarnAboutUpdateInRender = false;\nvar didWarnAboutUpdateInRenderForAnotherComponent;\n{\n  didWarnAboutUpdateInRenderForAnotherComponent = new Set();\n}\nfunction warnAboutRenderPhaseUpdatesInDEV(fiber) {\n  {\n    if (isRendering && (executionContext & RenderContext) !== NoContext) {\n      switch (fiber.tag) {\n        case FunctionComponent:\n        case ForwardRef:\n        case SimpleMemoComponent:\n          {\n            var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.\n            var dedupeKey = renderingComponentName;\n            if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {\n              didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);\n              var setStateComponentName = getComponentName(fiber.type) || 'Unknown';\n              error('Cannot update a component (\\`%s\\`) while rendering a ' + 'different component (\\`%s\\`). To locate the bad setState() call inside \\`%s\\`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);\n            }\n            break;\n          }\n        case ClassComponent:\n          {\n            if (!didWarnAboutUpdateInRender) {\n              error('Cannot update during an existing state transition (such as ' + 'within \\`render\\`). Render methods should be a pure ' + 'function of props and state.');\n              didWarnAboutUpdateInRender = true;\n            }\n            break;\n          }\n      }\n    }\n  }\n} // a 'shared' variable that changes when act() opens/closes in tests.\nvar IsThisRendererActing = {\n  current: false\n};\nfunction warnIfNotScopedWithMatchingAct(fiber) {\n  {\n    if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {\n      error(\\\\\"It looks like you're using the wrong act() around your test interactions.\\\\\" + 'Be sure to use the matching version of act() corresponding to your renderer:' + '// for react-dom:' + \\\\\"import {act} from 'react-dom/test-utils';\\\\\" + '// ...' + 'act(() => ...);' + '// for react-test-renderer:' + \\\\\"import TestRenderer from 'react-test-renderer';\\\\\" + 'const {act} = TestRenderer;' + '// ...' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));\n    }\n  }\n}\nfunction warnIfNotCurrentlyActingEffectsInDEV(fiber) {\n  {\n    if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n      error('An update to %s ran an effect, but was not wrapped in act(...).' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):' + 'act(() => {' + '  /* fire events that update state */' + '});' + '/* assert on the output */' + \\\\\"This ensures that you're testing the behavior the user would see \\\\\" + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));\n    }\n  }\n}\nfunction warnIfNotCurrentlyActingUpdatesInDEV(fiber) {\n  {\n    if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n      error('An update to %s inside a test was not wrapped in act(...).' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):' + 'act(() => {' + '  /* fire events that update state */' + '});' + '/* assert on the output */' + \\\\\"This ensures that you're testing the behavior the user would see \\\\\" + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));\n    }\n  }\n}\nvar warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.\nvar didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked\n// scheduler is the actual recommendation. The alternative could be a testing build,\n// a new lib, or whatever; we dunno just yet. This message is for early adopters\n// to get their tests right.\nfunction warnIfUnmockedScheduler(fiber) {\n  {\n    if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n      if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n        didWarnAboutUnmockedScheduler = true;\n        error('In Concurrent or Sync modes, the \\\\\"scheduler\\\\\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: ' + \\\\\"jest.mock('scheduler', () => require('scheduler/unstable_mock'));\\\\\" + 'For more info, visit https://fb.me/react-mock-scheduler');\n      }\n    }\n  }\n}\nfunction computeThreadID(root, expirationTime) {\n  // Interaction threads are unique per root and expiration time.\n  return expirationTime * 1000 + root.interactionThreadID;\n}\nfunction markSpawnedWork(expirationTime) {\n  if (spawnedWorkDuringRender === null) {\n    spawnedWorkDuringRender = [expirationTime];\n  } else {\n    spawnedWorkDuringRender.push(expirationTime);\n  }\n}\nfunction scheduleInteractions(root, expirationTime, interactions) {\n  if (interactions.size > 0) {\n    var pendingInteractionMap = root.pendingInteractionMap;\n    var pendingInteractions = pendingInteractionMap.get(expirationTime);\n    if (pendingInteractions != null) {\n      interactions.forEach(function (interaction) {\n        if (!pendingInteractions.has(interaction)) {\n          // Update the pending async work count for previously unscheduled interaction.\n          interaction.__count++;\n        }\n        pendingInteractions.add(interaction);\n      });\n    } else {\n      pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions.\n      interactions.forEach(function (interaction) {\n        interaction.__count++;\n      });\n    }\n    var subscriber = tracing$1.__subscriberRef.current;\n    if (subscriber !== null) {\n      var threadID = computeThreadID(root, expirationTime);\n      subscriber.onWorkScheduled(interactions, threadID);\n    }\n  }\n}\nfunction schedulePendingInteractions(root, expirationTime) {\n  scheduleInteractions(root, expirationTime, tracing$1.__interactionsRef.current);\n}\nfunction startWorkOnPendingInteractions(root, expirationTime) {\n  // we can accurately attribute time spent working on it, And so that cascading\n  // work triggered during the render phase will be associated with it.\n  var interactions = new Set();\n  root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {\n    if (scheduledExpirationTime >= expirationTime) {\n      scheduledInteractions.forEach(function (interaction) {\n        return interactions.add(interaction);\n      });\n    }\n  }); // Store the current set of interactions on the FiberRoot for a few reasons:\n  // We can re-use it in hot functions like performConcurrentWorkOnRoot()\n  // without having to recalculate it. We will also use it in commitWork() to\n  // pass to any Profiler onRender() hooks. This also provides DevTools with a\n  // way to access it when the onCommitRoot() hook is called.\n  root.memoizedInteractions = interactions;\n  if (interactions.size > 0) {\n    var subscriber = tracing$1.__subscriberRef.current;\n    if (subscriber !== null) {\n      var threadID = computeThreadID(root, expirationTime);\n      try {\n        subscriber.onWorkStarted(interactions, threadID);\n      } catch (error) {\n        // If the subscriber throws, rethrow it in a separate task\n        scheduleCallback(ImmediatePriority, function () {\n          throw error;\n        });\n      }\n    }\n  }\n}\nfunction finishPendingInteractions(root, committedExpirationTime) {\n  var earliestRemainingTimeAfterCommit = root.firstPendingTime;\n  var subscriber;\n  try {\n    subscriber = tracing$1.__subscriberRef.current;\n    if (subscriber !== null && root.memoizedInteractions.size > 0) {\n      var threadID = computeThreadID(root, committedExpirationTime);\n      subscriber.onWorkStopped(root.memoizedInteractions, threadID);\n    }\n  } catch (error) {\n    // If the subscriber throws, rethrow it in a separate task\n    scheduleCallback(ImmediatePriority, function () {\n      throw error;\n    });\n  } finally {\n    // Clear completed interactions from the pending Map.\n    // Unless the render was suspended or cascading work was scheduled,\n    // In which case– leave pending interactions until the subsequent render.\n    var pendingInteractionMap = root.pendingInteractionMap;\n    pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {\n      // Only decrement the pending interaction count if we're done.\n      // If there's still work at the current priority,\n      // That indicates that we are waiting for suspense data.\n      if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {\n        pendingInteractionMap.delete(scheduledExpirationTime);\n        scheduledInteractions.forEach(function (interaction) {\n          interaction.__count--;\n          if (subscriber !== null && interaction.__count === 0) {\n            try {\n              subscriber.onInteractionScheduledWorkCompleted(interaction);\n            } catch (error) {\n              // If the subscriber throws, rethrow it in a separate task\n              scheduleCallback(ImmediatePriority, function () {\n                throw error;\n              });\n            }\n          }\n        });\n      }\n    });\n  }\n}\nvar onScheduleFiberRoot = null;\nvar onCommitFiberRoot = null;\nvar onCommitFiberUnmount = null;\nvar hasLoggedError = false;\nvar isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';\nfunction injectInternals(internals) {\n  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n    // No DevTools\n    return false;\n  }\n  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n  if (hook.isDisabled) {\n    // This isn't a real property on the hook, but it can be set to opt out\n    // of DevTools integration and associated warnings and logs.\n    // https://github.com/facebook/react/issues/3877\n    return true;\n  }\n  if (!hook.supportsFiber) {\n    {\n      error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');\n    } // DevTools exists, even though it doesn't support Fiber.\n    return true;\n  }\n  try {\n    var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.\n    if (true) {\n      // Only used by Fast Refresh\n      if (typeof hook.onScheduleFiberRoot === 'function') {\n        onScheduleFiberRoot = function (root, children) {\n          try {\n            hook.onScheduleFiberRoot(rendererID, root, children);\n          } catch (err) {\n            if (true && !hasLoggedError) {\n              hasLoggedError = true;\n              error('React instrumentation encountered an error: %s', err);\n            }\n          }\n        };\n      }\n    }\n    onCommitFiberRoot = function (root, expirationTime) {\n      try {\n        var didError = (root.current.effectTag & DidCapture) === DidCapture;\n        if (enableProfilerTimer) {\n          var currentTime = getCurrentTime();\n          var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);\n          hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);\n        }\n      } catch (err) {\n        if (true) {\n          if (!hasLoggedError) {\n            hasLoggedError = true;\n            error('React instrumentation encountered an error: %s', err);\n          }\n        }\n      }\n    };\n    onCommitFiberUnmount = function (fiber) {\n      try {\n        hook.onCommitFiberUnmount(rendererID, fiber);\n      } catch (err) {\n        if (true) {\n          if (!hasLoggedError) {\n            hasLoggedError = true;\n            error('React instrumentation encountered an error: %s', err);\n          }\n        }\n      }\n    };\n  } catch (err) {\n    // Catch all errors because it is unsafe to throw during initialization.\n    {\n      error('React instrumentation encountered an error: %s.', err);\n    }\n  } // DevTools exists\n  return true;\n}\nfunction onScheduleRoot(root, children) {\n  if (typeof onScheduleFiberRoot === 'function') {\n    onScheduleFiberRoot(root, children);\n  }\n}\nfunction onCommitRoot(root, expirationTime) {\n  if (typeof onCommitFiberRoot === 'function') {\n    onCommitFiberRoot(root, expirationTime);\n  }\n}\nfunction onCommitUnmount(fiber) {\n  if (typeof onCommitFiberUnmount === 'function') {\n    onCommitFiberUnmount(fiber);\n  }\n}\nvar hasBadMapPolyfill;\n{\n  hasBadMapPolyfill = false;\n  try {\n    var nonExtensibleObject = Object.preventExtensions({});\n    var testMap = new Map([[nonExtensibleObject, null]]);\n    var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused.\n    // https://github.com/rollup/rollup/issues/1771\n    // TODO: we can remove these if Rollup fixes the bug.\n    testMap.set(0, 0);\n    testSet.add(0);\n  } catch (e) {\n    // TODO: Consider warning about bad polyfills\n    hasBadMapPolyfill = true;\n  }\n}\nvar debugCounter = 1;\nfunction FiberNode(tag, pendingProps, key, mode) {\n  // Instance\n  this.tag = tag;\n  this.key = key;\n  this.elementType = null;\n  this.type = null;\n  this.stateNode = null; // Fiber\n  this.return = null;\n  this.child = null;\n  this.sibling = null;\n  this.index = 0;\n  this.ref = null;\n  this.pendingProps = pendingProps;\n  this.memoizedProps = null;\n  this.updateQueue = null;\n  this.memoizedState = null;\n  this.dependencies = null;\n  this.mode = mode; // Effects\n  this.effectTag = NoEffect;\n  this.nextEffect = null;\n  this.firstEffect = null;\n  this.lastEffect = null;\n  this.expirationTime = NoWork;\n  this.childExpirationTime = NoWork;\n  this.alternate = null;\n  {\n    // Note: The following is done to avoid a v8 performance cliff.\n    //\n    // Initializing the fields below to smis and later updating them with\n    // double values will cause Fibers to end up having separate shapes.\n    // This behavior/bug has something to do with Object.preventExtension().\n    // Fortunately this only impacts DEV builds.\n    // Unfortunately it makes React unusably slow for some applications.\n    // To work around this, initialize the fields below with doubles.\n    //\n    // Learn more about this here:\n    // https://github.com/facebook/react/issues/14365\n    // https://bugs.chromium.org/p/v8/issues/detail?id=8538\n    this.actualDuration = Number.NaN;\n    this.actualStartTime = Number.NaN;\n    this.selfBaseDuration = Number.NaN;\n    this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.\n    // This won't trigger the performance cliff mentioned above,\n    // and it simplifies other profiler code (including DevTools).\n    this.actualDuration = 0;\n    this.actualStartTime = -1;\n    this.selfBaseDuration = 0;\n    this.treeBaseDuration = 0;\n  } // This is normally DEV-only except www when it adds listeners.\n  // TODO: remove the User Timing integration in favor of Root Events.\n  {\n    this._debugID = debugCounter++;\n    this._debugIsCurrentlyTiming = false;\n  }\n  {\n    this._debugSource = null;\n    this._debugOwner = null;\n    this._debugNeedsRemount = false;\n    this._debugHookTypes = null;\n    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n      Object.preventExtensions(this);\n    }\n  }\n} // This is a constructor function, rather than a POJO constructor, still\n// please ensure we do the following:\n// 1) Nobody should add any instance methods on this. Instance methods can be\n//    more difficult to predict when they get optimized and they are almost\n//    never inlined properly in static compilers.\n// 2) Nobody should rely on \\`instanceof Fiber\\` for type testing. We should\n//    always know when it is a fiber.\n// 3) We might want to experiment with using numeric keys since they are easier\n//    to optimize in a non-JIT environment.\n// 4) We can easily go from a constructor to a createFiber object literal if that\n//    is faster.\n// 5) It should be easy to port this to a C struct and keep a C implementation\n//    compatible.\nvar createFiber = function (tag, pendingProps, key, mode) {\n  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n  return new FiberNode(tag, pendingProps, key, mode);\n};\nfunction shouldConstruct(Component) {\n  var prototype = Component.prototype;\n  return !!(prototype && prototype.isReactComponent);\n}\nfunction isSimpleFunctionComponent(type) {\n  return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;\n}\nfunction resolveLazyComponentTag(Component) {\n  if (typeof Component === 'function') {\n    return shouldConstruct(Component) ? ClassComponent : FunctionComponent;\n  } else if (Component !== undefined && Component !== null) {\n    var $$typeof = Component.$$typeof;\n    if ($$typeof === REACT_FORWARD_REF_TYPE) {\n      return ForwardRef;\n    }\n    if ($$typeof === REACT_MEMO_TYPE) {\n      return MemoComponent;\n    }\n  }\n  return IndeterminateComponent;\n} // This is used to create an alternate fiber to do work on.\nfunction createWorkInProgress(current, pendingProps) {\n  var workInProgress = current.alternate;\n  if (workInProgress === null) {\n    // We use a double buffering pooling technique because we know that we'll\n    // only ever need at most two versions of a tree. We pool the \\\\\"other\\\\\" unused\n    // node that we're free to reuse. This is lazily created to avoid allocating\n    // extra objects for things that are never updated. It also allow us to\n    // reclaim the extra memory if needed.\n    workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);\n    workInProgress.elementType = current.elementType;\n    workInProgress.type = current.type;\n    workInProgress.stateNode = current.stateNode;\n    {\n      // DEV-only fields\n      {\n        workInProgress._debugID = current._debugID;\n      }\n      workInProgress._debugSource = current._debugSource;\n      workInProgress._debugOwner = current._debugOwner;\n      workInProgress._debugHookTypes = current._debugHookTypes;\n    }\n    workInProgress.alternate = current;\n    current.alternate = workInProgress;\n  } else {\n    workInProgress.pendingProps = pendingProps; // We already have an alternate.\n    // Reset the effect tag.\n    workInProgress.effectTag = NoEffect; // The effect list is no longer valid.\n    workInProgress.nextEffect = null;\n    workInProgress.firstEffect = null;\n    workInProgress.lastEffect = null;\n    {\n      // We intentionally reset, rather than copy, actualDuration & actualStartTime.\n      // This prevents time from endlessly accumulating in new commits.\n      // This has the downside of resetting values for different priority renders,\n      // But works for yielding (the common case) and should support resuming.\n      workInProgress.actualDuration = 0;\n      workInProgress.actualStartTime = -1;\n    }\n  }\n  workInProgress.childExpirationTime = current.childExpirationTime;\n  workInProgress.expirationTime = current.expirationTime;\n  workInProgress.child = current.child;\n  workInProgress.memoizedProps = current.memoizedProps;\n  workInProgress.memoizedState = current.memoizedState;\n  workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n  // it cannot be shared with the current fiber.\n  var currentDependencies = current.dependencies;\n  workInProgress.dependencies = currentDependencies === null ? null : {\n    expirationTime: currentDependencies.expirationTime,\n    firstContext: currentDependencies.firstContext,\n    responders: currentDependencies.responders\n  }; // These will be overridden during the parent's reconciliation\n  workInProgress.sibling = current.sibling;\n  workInProgress.index = current.index;\n  workInProgress.ref = current.ref;\n  {\n    workInProgress.selfBaseDuration = current.selfBaseDuration;\n    workInProgress.treeBaseDuration = current.treeBaseDuration;\n  }\n  {\n    workInProgress._debugNeedsRemount = current._debugNeedsRemount;\n    switch (workInProgress.tag) {\n      case IndeterminateComponent:\n      case FunctionComponent:\n      case SimpleMemoComponent:\n        workInProgress.type = resolveFunctionForHotReloading(current.type);\n        break;\n      case ClassComponent:\n        workInProgress.type = resolveClassForHotReloading(current.type);\n        break;\n      case ForwardRef:\n        workInProgress.type = resolveForwardRefForHotReloading(current.type);\n        break;\n    }\n  }\n  return workInProgress;\n} // Used to reuse a Fiber for a second pass.\nfunction resetWorkInProgress(workInProgress, renderExpirationTime) {\n  // This resets the Fiber to what createFiber or createWorkInProgress would\n  // have set the values to before during the first pass. Ideally this wouldn't\n  // be necessary but unfortunately many code paths reads from the workInProgress\n  // when they should be reading from current and writing to workInProgress.\n  // We assume pendingProps, index, key, ref, return are still untouched to\n  // avoid doing another reconciliation.\n  // Reset the effect tag but keep any Placement tags, since that's something\n  // that child fiber is setting, not the reconciliation.\n  workInProgress.effectTag &= Placement; // The effect list is no longer valid.\n  workInProgress.nextEffect = null;\n  workInProgress.firstEffect = null;\n  workInProgress.lastEffect = null;\n  var current = workInProgress.alternate;\n  if (current === null) {\n    // Reset to createFiber's initial values.\n    workInProgress.childExpirationTime = NoWork;\n    workInProgress.expirationTime = renderExpirationTime;\n    workInProgress.child = null;\n    workInProgress.memoizedProps = null;\n    workInProgress.memoizedState = null;\n    workInProgress.updateQueue = null;\n    workInProgress.dependencies = null;\n    {\n      // Note: We don't reset the actualTime counts. It's useful to accumulate\n      // actual time across multiple render passes.\n      workInProgress.selfBaseDuration = 0;\n      workInProgress.treeBaseDuration = 0;\n    }\n  } else {\n    // Reset to the cloned values that createWorkInProgress would've.\n    workInProgress.childExpirationTime = current.childExpirationTime;\n    workInProgress.expirationTime = current.expirationTime;\n    workInProgress.child = current.child;\n    workInProgress.memoizedProps = current.memoizedProps;\n    workInProgress.memoizedState = current.memoizedState;\n    workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so\n    // it cannot be shared with the current fiber.\n    var currentDependencies = current.dependencies;\n    workInProgress.dependencies = currentDependencies === null ? null : {\n      expirationTime: currentDependencies.expirationTime,\n      firstContext: currentDependencies.firstContext,\n      responders: currentDependencies.responders\n    };\n    {\n      // Note: We don't reset the actualTime counts. It's useful to accumulate\n      // actual time across multiple render passes.\n      workInProgress.selfBaseDuration = current.selfBaseDuration;\n      workInProgress.treeBaseDuration = current.treeBaseDuration;\n    }\n  }\n  return workInProgress;\n}\nfunction createHostRootFiber(tag) {\n  var mode;\n  if (tag === ConcurrentRoot) {\n    mode = ConcurrentMode | BlockingMode | StrictMode;\n  } else if (tag === BlockingRoot) {\n    mode = BlockingMode | StrictMode;\n  } else {\n    mode = NoMode;\n  }\n  if ( isDevToolsPresent) {\n    // Always collect profile timings when DevTools are present.\n    // This enables DevTools to start capturing timing at any point–\n    // Without some nodes in the tree having empty base times.\n    mode |= ProfileMode;\n  }\n  return createFiber(HostRoot, null, null, mode);\n}\nfunction createFiberFromTypeAndProps(type, // React$ElementType\nkey, pendingProps, owner, mode, expirationTime) {\n  var fiber;\n  var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.\n  var resolvedType = type;\n  if (typeof type === 'function') {\n    if (shouldConstruct(type)) {\n      fiberTag = ClassComponent;\n      {\n        resolvedType = resolveClassForHotReloading(resolvedType);\n      }\n    } else {\n      {\n        resolvedType = resolveFunctionForHotReloading(resolvedType);\n      }\n    }\n  } else if (typeof type === 'string') {\n    fiberTag = HostComponent;\n  } else {\n    getTag: switch (type) {\n      case REACT_FRAGMENT_TYPE:\n        return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);\n      case REACT_CONCURRENT_MODE_TYPE:\n        fiberTag = Mode;\n        mode |= ConcurrentMode | BlockingMode | StrictMode;\n        break;\n      case REACT_STRICT_MODE_TYPE:\n        fiberTag = Mode;\n        mode |= StrictMode;\n        break;\n      case REACT_PROFILER_TYPE:\n        return createFiberFromProfiler(pendingProps, mode, expirationTime, key);\n      case REACT_SUSPENSE_TYPE:\n        return createFiberFromSuspense(pendingProps, mode, expirationTime, key);\n      case REACT_SUSPENSE_LIST_TYPE:\n        return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);\n      default:\n        {\n          if (typeof type === 'object' && type !== null) {\n            switch (type.$$typeof) {\n              case REACT_PROVIDER_TYPE:\n                fiberTag = ContextProvider;\n                break getTag;\n              case REACT_CONTEXT_TYPE:\n                // This is a consumer\n                fiberTag = ContextConsumer;\n                break getTag;\n              case REACT_FORWARD_REF_TYPE:\n                fiberTag = ForwardRef;\n                {\n                  resolvedType = resolveForwardRefForHotReloading(resolvedType);\n                }\n                break getTag;\n              case REACT_MEMO_TYPE:\n                fiberTag = MemoComponent;\n                break getTag;\n              case REACT_LAZY_TYPE:\n                fiberTag = LazyComponent;\n                resolvedType = null;\n                break getTag;\n              case REACT_BLOCK_TYPE:\n                fiberTag = Block;\n                break getTag;\n            }\n          }\n          var info = '';\n          {\n            if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n              info += ' You likely forgot to export your component from the file ' + \\\\\"it's defined in, or you might have mixed up default and \\\\\" + 'named imports.';\n            }\n            var ownerName = owner ? getComponentName(owner.type) : null;\n            if (ownerName) {\n              info += 'Check the render method of \\`' + ownerName + '\\`.';\n            }\n          }\n          {\n            {\n              throw Error( \\\\\"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: \\\\\" + (type == null ? type : typeof type) + \\\\\".\\\\\" + info );\n            }\n          }\n        }\n    }\n  }\n  fiber = createFiber(fiberTag, pendingProps, key, mode);\n  fiber.elementType = type;\n  fiber.type = resolvedType;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromElement(element, mode, expirationTime) {\n  var owner = null;\n  {\n    owner = element._owner;\n  }\n  var type = element.type;\n  var key = element.key;\n  var pendingProps = element.props;\n  var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);\n  {\n    fiber._debugSource = element._source;\n    fiber._debugOwner = element._owner;\n  }\n  return fiber;\n}\nfunction createFiberFromFragment(elements, mode, expirationTime, key) {\n  var fiber = createFiber(Fragment, elements, key, mode);\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromProfiler(pendingProps, mode, expirationTime, key) {\n  {\n    if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {\n      error('Profiler must specify an \\\\\"id\\\\\" string and \\\\\"onRender\\\\\" function as props');\n    }\n  }\n  var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.\n  fiber.elementType = REACT_PROFILER_TYPE;\n  fiber.type = REACT_PROFILER_TYPE;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromSuspense(pendingProps, mode, expirationTime, key) {\n  var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.\n  // This needs to be fixed in getComponentName so that it relies on the tag\n  // instead.\n  fiber.type = REACT_SUSPENSE_TYPE;\n  fiber.elementType = REACT_SUSPENSE_TYPE;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {\n  var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);\n  {\n    // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.\n    // This needs to be fixed in getComponentName so that it relies on the tag\n    // instead.\n    fiber.type = REACT_SUSPENSE_LIST_TYPE;\n  }\n  fiber.elementType = REACT_SUSPENSE_LIST_TYPE;\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromText(content, mode, expirationTime) {\n  var fiber = createFiber(HostText, content, null, mode);\n  fiber.expirationTime = expirationTime;\n  return fiber;\n}\nfunction createFiberFromHostInstanceForDeletion() {\n  var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.\n  fiber.elementType = 'DELETED';\n  fiber.type = 'DELETED';\n  return fiber;\n}\nfunction createFiberFromPortal(portal, mode, expirationTime) {\n  var pendingProps = portal.children !== null ? portal.children : [];\n  var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);\n  fiber.expirationTime = expirationTime;\n  fiber.stateNode = {\n    containerInfo: portal.containerInfo,\n    pendingChildren: null,\n    // Used by persistent updates\n    implementation: portal.implementation\n  };\n  return fiber;\n} // Used for stashing WIP properties to replay failed work in DEV.\nfunction assignFiberPropertiesInDEV(target, source) {\n  if (target === null) {\n    // This Fiber's initial properties will always be overwritten.\n    // We only use a Fiber to ensure the same hidden class so DEV isn't slow.\n    target = createFiber(IndeterminateComponent, null, null, NoMode);\n  } // This is intentionally written as a list of all properties.\n  // We tried to use Object.assign() instead but this is called in\n  // the hottest path, and Object.assign() was too slow:\n  // https://github.com/facebook/react/issues/12502\n  // This code is DEV-only so size is not a concern.\n  target.tag = source.tag;\n  target.key = source.key;\n  target.elementType = source.elementType;\n  target.type = source.type;\n  target.stateNode = source.stateNode;\n  target.return = source.return;\n  target.child = source.child;\n  target.sibling = source.sibling;\n  target.index = source.index;\n  target.ref = source.ref;\n  target.pendingProps = source.pendingProps;\n  target.memoizedProps = source.memoizedProps;\n  target.updateQueue = source.updateQueue;\n  target.memoizedState = source.memoizedState;\n  target.dependencies = source.dependencies;\n  target.mode = source.mode;\n  target.effectTag = source.effectTag;\n  target.nextEffect = source.nextEffect;\n  target.firstEffect = source.firstEffect;\n  target.lastEffect = source.lastEffect;\n  target.expirationTime = source.expirationTime;\n  target.childExpirationTime = source.childExpirationTime;\n  target.alternate = source.alternate;\n  {\n    target.actualDuration = source.actualDuration;\n    target.actualStartTime = source.actualStartTime;\n    target.selfBaseDuration = source.selfBaseDuration;\n    target.treeBaseDuration = source.treeBaseDuration;\n  }\n  {\n    target._debugID = source._debugID;\n  }\n  target._debugSource = source._debugSource;\n  target._debugOwner = source._debugOwner;\n  target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;\n  target._debugNeedsRemount = source._debugNeedsRemount;\n  target._debugHookTypes = source._debugHookTypes;\n  return target;\n}\nfunction FiberRootNode(containerInfo, tag, hydrate) {\n  this.tag = tag;\n  this.current = null;\n  this.containerInfo = containerInfo;\n  this.pendingChildren = null;\n  this.pingCache = null;\n  this.finishedExpirationTime = NoWork;\n  this.finishedWork = null;\n  this.timeoutHandle = noTimeout;\n  this.context = null;\n  this.pendingContext = null;\n  this.hydrate = hydrate;\n  this.callbackNode = null;\n  this.callbackPriority = NoPriority;\n  this.firstPendingTime = NoWork;\n  this.firstSuspendedTime = NoWork;\n  this.lastSuspendedTime = NoWork;\n  this.nextKnownPendingLevel = NoWork;\n  this.lastPingedTime = NoWork;\n  this.lastExpiredTime = NoWork;\n  {\n    this.interactionThreadID = tracing$1.unstable_getThreadID();\n    this.memoizedInteractions = new Set();\n    this.pendingInteractionMap = new Map();\n  }\n}\nfunction createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {\n  var root = new FiberRootNode(containerInfo, tag, hydrate);\n  // stateNode is any.\n  var uninitializedFiber = createHostRootFiber(tag);\n  root.current = uninitializedFiber;\n  uninitializedFiber.stateNode = root;\n  initializeUpdateQueue(uninitializedFiber);\n  return root;\n}\nfunction isRootSuspendedAtTime(root, expirationTime) {\n  var firstSuspendedTime = root.firstSuspendedTime;\n  var lastSuspendedTime = root.lastSuspendedTime;\n  return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;\n}\nfunction markRootSuspendedAtTime(root, expirationTime) {\n  var firstSuspendedTime = root.firstSuspendedTime;\n  var lastSuspendedTime = root.lastSuspendedTime;\n  if (firstSuspendedTime < expirationTime) {\n    root.firstSuspendedTime = expirationTime;\n  }\n  if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {\n    root.lastSuspendedTime = expirationTime;\n  }\n  if (expirationTime <= root.lastPingedTime) {\n    root.lastPingedTime = NoWork;\n  }\n  if (expirationTime <= root.lastExpiredTime) {\n    root.lastExpiredTime = NoWork;\n  }\n}\nfunction markRootUpdatedAtTime(root, expirationTime) {\n  // Update the range of pending times\n  var firstPendingTime = root.firstPendingTime;\n  if (expirationTime > firstPendingTime) {\n    root.firstPendingTime = expirationTime;\n  } // Update the range of suspended times. Treat everything lower priority or\n  // equal to this update as unsuspended.\n  var firstSuspendedTime = root.firstSuspendedTime;\n  if (firstSuspendedTime !== NoWork) {\n    if (expirationTime >= firstSuspendedTime) {\n      // The entire suspended range is now unsuspended.\n      root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;\n    } else if (expirationTime >= root.lastSuspendedTime) {\n      root.lastSuspendedTime = expirationTime + 1;\n    } // This is a pending level. Check if it's higher priority than the next\n    // known pending level.\n    if (expirationTime > root.nextKnownPendingLevel) {\n      root.nextKnownPendingLevel = expirationTime;\n    }\n  }\n}\nfunction markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {\n  // Update the range of pending times\n  root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or\n  // equal to this update as unsuspended.\n  if (finishedExpirationTime <= root.lastSuspendedTime) {\n    // The entire suspended range is now unsuspended.\n    root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;\n  } else if (finishedExpirationTime <= root.firstSuspendedTime) {\n    // Part of the suspended range is now unsuspended. Narrow the range to\n    // include everything between the unsuspended time (non-inclusive) and the\n    // last suspended time.\n    root.firstSuspendedTime = finishedExpirationTime - 1;\n  }\n  if (finishedExpirationTime <= root.lastPingedTime) {\n    // Clear the pinged time\n    root.lastPingedTime = NoWork;\n  }\n  if (finishedExpirationTime <= root.lastExpiredTime) {\n    // Clear the expired time\n    root.lastExpiredTime = NoWork;\n  }\n}\nfunction markRootExpiredAtTime(root, expirationTime) {\n  var lastExpiredTime = root.lastExpiredTime;\n  if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {\n    root.lastExpiredTime = expirationTime;\n  }\n}\nvar didWarnAboutNestedUpdates;\nvar didWarnAboutFindNodeInStrictMode;\n{\n  didWarnAboutNestedUpdates = false;\n  didWarnAboutFindNodeInStrictMode = {};\n}\nfunction getContextForSubtree(parentComponent) {\n  if (!parentComponent) {\n    return emptyContextObject;\n  }\n  var fiber = get(parentComponent);\n  var parentContext = findCurrentUnmaskedContext(fiber);\n  if (fiber.tag === ClassComponent) {\n    var Component = fiber.type;\n    if (isContextProvider(Component)) {\n      return processChildContext(fiber, Component, parentContext);\n    }\n  }\n  return parentContext;\n}\nfunction findHostInstanceWithWarning(component, methodName) {\n  {\n    var fiber = get(component);\n    if (fiber === undefined) {\n      if (typeof component.render === 'function') {\n        {\n          {\n            throw Error( \\\\\"Unable to find node on an unmounted component.\\\\\" );\n          }\n        }\n      } else {\n        {\n          {\n            throw Error( \\\\\"Argument appears to not be a ReactComponent. Keys: \\\\\" + Object.keys(component) );\n          }\n        }\n      }\n    }\n    var hostFiber = findCurrentHostFiber(fiber);\n    if (hostFiber === null) {\n      return null;\n    }\n    if (hostFiber.mode & StrictMode) {\n      var componentName = getComponentName(fiber.type) || 'Component';\n      if (!didWarnAboutFindNodeInStrictMode[componentName]) {\n        didWarnAboutFindNodeInStrictMode[componentName] = true;\n        if (fiber.mode & StrictMode) {\n          error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));\n        } else {\n          error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));\n        }\n      }\n    }\n    return hostFiber.stateNode;\n  }\n}\nfunction createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {\n  return createFiberRoot(containerInfo, tag, hydrate);\n}\nfunction updateContainer(element, container, parentComponent, callback) {\n  {\n    onScheduleRoot(container, element);\n  }\n  var current$1 = container.current;\n  var currentTime = requestCurrentTimeForUpdate();\n  {\n    // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n    if ('undefined' !== typeof jest) {\n      warnIfUnmockedScheduler(current$1);\n      warnIfNotScopedWithMatchingAct(current$1);\n    }\n  }\n  var suspenseConfig = requestCurrentSuspenseConfig();\n  var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig);\n  var context = getContextForSubtree(parentComponent);\n  if (container.context === null) {\n    container.context = context;\n  } else {\n    container.pendingContext = context;\n  }\n  {\n    if (isRendering && current !== null && !didWarnAboutNestedUpdates) {\n      didWarnAboutNestedUpdates = true;\n      error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');\n    }\n  }\n  var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property\n  // being called \\\\\"element\\\\\".\n  update.payload = {\n    element: element\n  };\n  callback = callback === undefined ? null : callback;\n  if (callback !== null) {\n    {\n      if (typeof callback !== 'function') {\n        error('render(...): Expected the last optional \\`callback\\` argument to be a ' + 'function. Instead received: %s.', callback);\n      }\n    }\n    update.callback = callback;\n  }\n  enqueueUpdate(current$1, update);\n  scheduleWork(current$1, expirationTime);\n  return expirationTime;\n}\nfunction getPublicRootInstance(container) {\n  var containerFiber = container.current;\n  if (!containerFiber.child) {\n    return null;\n  }\n  switch (containerFiber.child.tag) {\n    case HostComponent:\n      return getPublicInstance(containerFiber.child.stateNode);\n    default:\n      return containerFiber.child.stateNode;\n  }\n}\nfunction markRetryTimeImpl(fiber, retryTime) {\n  var suspenseState = fiber.memoizedState;\n  if (suspenseState !== null && suspenseState.dehydrated !== null) {\n    if (suspenseState.retryTime < retryTime) {\n      suspenseState.retryTime = retryTime;\n    }\n  }\n} // Increases the priority of thennables when they resolve within this boundary.\nfunction markRetryTimeIfNotHydrated(fiber, retryTime) {\n  markRetryTimeImpl(fiber, retryTime);\n  var alternate = fiber.alternate;\n  if (alternate) {\n    markRetryTimeImpl(alternate, retryTime);\n  }\n}\nfunction attemptUserBlockingHydration$1(fiber) {\n  if (fiber.tag !== SuspenseComponent) {\n    // We ignore HostRoots here because we can't increase\n    // their priority and they should not suspend on I/O,\n    // since you have to wrap anything that might suspend in\n    // Suspense.\n    return;\n  }\n  var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());\n  scheduleWork(fiber, expTime);\n  markRetryTimeIfNotHydrated(fiber, expTime);\n}\nfunction attemptContinuousHydration$1(fiber) {\n  if (fiber.tag !== SuspenseComponent) {\n    // We ignore HostRoots here because we can't increase\n    // their priority and they should not suspend on I/O,\n    // since you have to wrap anything that might suspend in\n    // Suspense.\n    return;\n  }\n  scheduleWork(fiber, ContinuousHydration);\n  markRetryTimeIfNotHydrated(fiber, ContinuousHydration);\n}\nfunction attemptHydrationAtCurrentPriority$1(fiber) {\n  if (fiber.tag !== SuspenseComponent) {\n    // We ignore HostRoots here because we can't increase\n    // their priority other than synchronously flush it.\n    return;\n  }\n  var currentTime = requestCurrentTimeForUpdate();\n  var expTime = computeExpirationForFiber(currentTime, fiber, null);\n  scheduleWork(fiber, expTime);\n  markRetryTimeIfNotHydrated(fiber, expTime);\n}\nfunction findHostInstanceWithNoPortals(fiber) {\n  var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n  if (hostFiber === null) {\n    return null;\n  }\n  if (hostFiber.tag === FundamentalComponent) {\n    return hostFiber.stateNode.instance;\n  }\n  return hostFiber.stateNode;\n}\nvar shouldSuspendImpl = function (fiber) {\n  return false;\n};\nfunction shouldSuspend(fiber) {\n  return shouldSuspendImpl(fiber);\n}\nvar overrideHookState = null;\nvar overrideProps = null;\nvar scheduleUpdate = null;\nvar setSuspenseHandler = null;\n{\n  var copyWithSetImpl = function (obj, path, idx, value) {\n    if (idx >= path.length) {\n      return value;\n    }\n    var key = path[idx];\n    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here\n    updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);\n    return updated;\n  };\n  var copyWithSet = function (obj, path, value) {\n    return copyWithSetImpl(obj, path, 0, value);\n  }; // Support DevTools editable values for useState and useReducer.\n  overrideHookState = function (fiber, id, path, value) {\n    // For now, the \\\\\"id\\\\\" of stateful hooks is just the stateful hook index.\n    // This may change in the future with e.g. nested hooks.\n    var currentHook = fiber.memoizedState;\n    while (currentHook !== null && id > 0) {\n      currentHook = currentHook.next;\n      id--;\n    }\n    if (currentHook !== null) {\n      var newState = copyWithSet(currentHook.memoizedState, path, value);\n      currentHook.memoizedState = newState;\n      currentHook.baseState = newState; // We aren't actually adding an update to the queue,\n      // because there is no update we can add for useReducer hooks that won't trigger an error.\n      // (There's no appropriate action type for DevTools overrides.)\n      // As a result though, React will see the scheduled update as a noop and bailout.\n      // Shallow cloning props works as a workaround for now to bypass the bailout check.\n      fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n      scheduleWork(fiber, Sync);\n    }\n  }; // Support DevTools props for function components, forwardRef, memo, host components, etc.\n  overrideProps = function (fiber, path, value) {\n    fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);\n    if (fiber.alternate) {\n      fiber.alternate.pendingProps = fiber.pendingProps;\n    }\n    scheduleWork(fiber, Sync);\n  };\n  scheduleUpdate = function (fiber) {\n    scheduleWork(fiber, Sync);\n  };\n  setSuspenseHandler = function (newShouldSuspendImpl) {\n    shouldSuspendImpl = newShouldSuspendImpl;\n  };\n}\nfunction injectIntoDevTools(devToolsConfig) {\n  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n  var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n  return injectInternals(_assign({}, devToolsConfig, {\n    overrideHookState: overrideHookState,\n    overrideProps: overrideProps,\n    setSuspenseHandler: setSuspenseHandler,\n    scheduleUpdate: scheduleUpdate,\n    currentDispatcherRef: ReactCurrentDispatcher,\n    findHostInstanceByFiber: function (fiber) {\n      var hostFiber = findCurrentHostFiber(fiber);\n      if (hostFiber === null) {\n        return null;\n      }\n      return hostFiber.stateNode;\n    },\n    findFiberByHostInstance: function (instance) {\n      if (!findFiberByHostInstance) {\n        // Might not be implemented by the renderer.\n        return null;\n      }\n      return findFiberByHostInstance(instance);\n    },\n    // React Refresh\n    findHostInstancesForRefresh:  findHostInstancesForRefresh ,\n    scheduleRefresh:  scheduleRefresh ,\n    scheduleRoot:  scheduleRoot ,\n    setRefreshHandler:  setRefreshHandler ,\n    // Enables DevTools to append owner stacks to error messages in DEV mode.\n    getCurrentFiber:  function () {\n      return current;\n    }\n  }));\n}\nvar IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing;\nfunction ReactDOMBlockingRoot(container, tag, options) {\n  this._internalRoot = createRootImpl(container, tag, options);\n}\nReactDOMBlockingRoot.prototype.render = function (children) {\n  var root = this._internalRoot;\n  {\n    if (typeof arguments[1] === 'function') {\n      error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n    }\n    var container = root.containerInfo;\n    if (container.nodeType !== COMMENT_NODE) {\n      var hostInstance = findHostInstanceWithNoPortals(root.current);\n      if (hostInstance) {\n        if (hostInstance.parentNode !== container) {\n          error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + \\\\\"root.unmount() to empty a root's container.\\\\\");\n        }\n      }\n    }\n  }\n  updateContainer(children, root, null, null);\n};\nReactDOMBlockingRoot.prototype.unmount = function () {\n  {\n    if (typeof arguments[0] === 'function') {\n      error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n    }\n  }\n  var root = this._internalRoot;\n  var container = root.containerInfo;\n  updateContainer(null, root, null, function () {\n    unmarkContainerAsRoot(container);\n  });\n};\nfunction createRootImpl(container, tag, options) {\n  // Tag is either LegacyRoot or Concurrent Root\n  var hydrate = options != null && options.hydrate === true;\n  var hydrationCallbacks = options != null && options.hydrationOptions || null;\n  var root = createContainer(container, tag, hydrate);\n  markContainerAsRoot(root.current, container);\n  if (hydrate && tag !== LegacyRoot) {\n    var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;\n    eagerlyTrapReplayableEvents(container, doc);\n  }\n  return root;\n}\nfunction createLegacyRoot(container, options) {\n  return new ReactDOMBlockingRoot(container, LegacyRoot, options);\n}\nfunction isValidContainer(node) {\n  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\nvar ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;\nvar topLevelUpdateWarnings;\nvar warnedAboutHydrateAPI = false;\n{\n  topLevelUpdateWarnings = function (container) {\n    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n      var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);\n      if (hostInstance) {\n        if (hostInstance.parentNode !== container) {\n          error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n        }\n      }\n    }\n    var isRootRenderedBySomeReact = !!container._reactRootContainer;\n    var rootEl = getReactRootElementInContainer(container);\n    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));\n    if (hasNonRootReactChild && !isRootRenderedBySomeReact) {\n      error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n    }\n    if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n      error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n    }\n  };\n}\nfunction getReactRootElementInContainer(container) {\n  if (!container) {\n    return null;\n  }\n  if (container.nodeType === DOCUMENT_NODE) {\n    return container.documentElement;\n  } else {\n    return container.firstChild;\n  }\n}\nfunction shouldHydrateDueToLegacyHeuristic(container) {\n  var rootElement = getReactRootElementInContainer(container);\n  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));\n}\nfunction legacyCreateRootFromDOMContainer(container, forceHydrate) {\n  var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.\n  if (!shouldHydrate) {\n    var warned = false;\n    var rootSibling;\n    while (rootSibling = container.lastChild) {\n      {\n        if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {\n          warned = true;\n          error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');\n        }\n      }\n      container.removeChild(rootSibling);\n    }\n  }\n  {\n    if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {\n      warnedAboutHydrateAPI = true;\n      warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');\n    }\n  }\n  return createLegacyRoot(container, shouldHydrate ? {\n    hydrate: true\n  } : undefined);\n}\nfunction warnOnInvalidCallback$1(callback, callerName) {\n  {\n    if (callback !== null && typeof callback !== 'function') {\n      error('%s(...): Expected the last optional \\`callback\\` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n    }\n  }\n}\nfunction legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n  {\n    topLevelUpdateWarnings(container);\n    warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');\n  } // TODO: Without \\`any\\` type, Flow says \\\\\"Property cannot be accessed on any\n  // member of intersection type.\\\\\" Whyyyyyy.\n  var root = container._reactRootContainer;\n  var fiberRoot;\n  if (!root) {\n    // Initial mount\n    root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);\n    fiberRoot = root._internalRoot;\n    if (typeof callback === 'function') {\n      var originalCallback = callback;\n      callback = function () {\n        var instance = getPublicRootInstance(fiberRoot);\n        originalCallback.call(instance);\n      };\n    } // Initial mount should not be batched.\n    unbatchedUpdates(function () {\n      updateContainer(children, fiberRoot, parentComponent, callback);\n    });\n  } else {\n    fiberRoot = root._internalRoot;\n    if (typeof callback === 'function') {\n      var _originalCallback = callback;\n      callback = function () {\n        var instance = getPublicRootInstance(fiberRoot);\n        _originalCallback.call(instance);\n      };\n    } // Update\n    updateContainer(children, fiberRoot, parentComponent, callback);\n  }\n  return getPublicRootInstance(fiberRoot);\n}\nfunction findDOMNode(componentOrElement) {\n  {\n    var owner = ReactCurrentOwner$3.current;\n    if (owner !== null && owner.stateNode !== null) {\n      var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n      if (!warnedAboutRefsInRender) {\n        error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');\n      }\n      owner.stateNode._warnedAboutRefsInRender = true;\n    }\n  }\n  if (componentOrElement == null) {\n    return null;\n  }\n  if (componentOrElement.nodeType === ELEMENT_NODE) {\n    return componentOrElement;\n  }\n  {\n    return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');\n  }\n}\nfunction hydrate(element, container, callback) {\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  }\n  {\n    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n    if (isModernRoot) {\n      error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');\n    }\n  } // TODO: throw or warn if we couldn't hydrate?\n  return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);\n}\nfunction render(element, container, callback) {\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  }\n  {\n    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n    if (isModernRoot) {\n      error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');\n    }\n  }\n  return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);\n}\nfunction unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n  if (!isValidContainer(containerNode)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  }\n  if (!(parentComponent != null && has(parentComponent))) {\n    {\n      throw Error( \\\\\"parentComponent must be a valid React Component\\\\\" );\n    }\n  }\n  return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n}\nfunction unmountComponentAtNode(container) {\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"unmountComponentAtNode(...): Target container is not a DOM element.\\\\\" );\n    }\n  }\n  {\n    var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n    if (isModernRoot) {\n      error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');\n    }\n  }\n  if (container._reactRootContainer) {\n    {\n      var rootEl = getReactRootElementInContainer(container);\n      var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);\n      if (renderedByDifferentReact) {\n        error(\\\\\"unmountComponentAtNode(): The node you're attempting to unmount \\\\\" + 'was rendered by another copy of React.');\n      }\n    } // Unmount should not be batched.\n    unbatchedUpdates(function () {\n      legacyRenderSubtreeIntoContainer(null, null, container, false, function () {\n        // $FlowFixMe This should probably use \\`delete container._reactRootContainer\\`\n        container._reactRootContainer = null;\n        unmarkContainerAsRoot(container);\n      });\n    }); // If you call unmountComponentAtNode twice in quick succession, you'll\n    // get \\`true\\` twice. That's probably fine?\n    return true;\n  } else {\n    {\n      var _rootEl = getReactRootElementInContainer(container);\n      var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node.\n      var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;\n      if (hasNonRootReactChild) {\n        error(\\\\\"unmountComponentAtNode(): The node you're attempting to unmount \\\\\" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n      }\n    }\n    return false;\n  }\n}\nfunction createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n  return {\n    // This tag allow us to uniquely identify this as a React Portal\n    $$typeof: REACT_PORTAL_TYPE,\n    key: key == null ? null : '' + key,\n    children: children,\n    containerInfo: containerInfo,\n    implementation: implementation\n  };\n}\nvar ReactVersion = '16.13.1';\nsetAttemptUserBlockingHydration(attemptUserBlockingHydration$1);\nsetAttemptContinuousHydration(attemptContinuousHydration$1);\nsetAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);\nvar didWarnAboutUnstableCreatePortal = false;\n{\n  if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype\n  Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype\n  Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n    error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');\n  }\n}\nsetRestoreImplementation(restoreControlledState$3);\nsetBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);\nfunction createPortal$1(children, container) {\n  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n  if (!isValidContainer(container)) {\n    {\n      throw Error( \\\\\"Target container is not a DOM element.\\\\\" );\n    }\n  } // TODO: pass ReactDOM portal implementation as third argument\n  // $FlowFixMe The Flow type is opaque but there's no way to actually create it.\n  return createPortal(children, container, null, key);\n}\nfunction renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n  return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);\n}\nfunction unstable_createPortal(children, container) {\n  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n  {\n    if (!didWarnAboutUnstableCreatePortal) {\n      didWarnAboutUnstableCreatePortal = true;\n      warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the \\\\\"unstable_\\\\\" prefix.');\n    }\n  }\n  return createPortal$1(children, container, key);\n}\nvar Internals = {\n  // Keep in sync with ReactDOMUnstableNativeDependencies.js\n  // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.\n  Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]\n};\nvar foundDevTools = injectIntoDevTools({\n  findFiberByHostInstance: getClosestInstanceFromNode,\n  bundleType:  1 ,\n  version: ReactVersion,\n  rendererPackageName: 'react-dom'\n});\n{\n  if (!foundDevTools && canUseDOM && window.top === window.self) {\n    // If we're in Chrome or Firefox, provide a download link if not installed.\n    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {\n      var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.\n      if (/^(https?|file):$/.test(protocol)) {\n        // eslint-disable-next-line react-internal/no-production-logging\n        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? 'You might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');\n      }\n    }\n  }\n}\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;\nexports.createPortal = createPortal$1;\nexports.findDOMNode = findDOMNode;\nexports.flushSync = flushSync;\nexports.hydrate = hydrate;\nexports.render = render;\nexports.unmountComponentAtNode = unmountComponentAtNode;\nexports.unstable_batchedUpdates = batchedUpdates$1;\nexports.unstable_createPortal = unstable_createPortal;\nexports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;\nexports.version = ReactVersion;\n  })();\n}\n});\nvar reactDom = createCommonjsModule(function (module) {\n{\n  module.exports = reactDom_development;\n}\n});\nvar __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = reactDom.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\nvar createPortal = reactDom.createPortal;\nexport default reactDom;\nvar findDOMNode = reactDom.findDOMNode;\nvar flushSync = reactDom.flushSync;\nvar hydrate = reactDom.hydrate;\nvar render = reactDom.render;\nvar unmountComponentAtNode = reactDom.unmountComponentAtNode;\nvar unstable_batchedUpdates = reactDom.unstable_batchedUpdates;\nvar unstable_createPortal = reactDom.unstable_createPortal;\nvar unstable_renderSubtreeIntoContainer = reactDom.unstable_renderSubtreeIntoContainer;\nvar version = reactDom.version;\nexport { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, reactDom as __moduleExports, createPortal, findDOMNode, flushSync, hydrate, render, unmountComponentAtNode, unstable_batchedUpdates, unstable_createPortal, unstable_renderSubtreeIntoContainer, version };\"\n`;\n"
  },
  {
    "path": "test/esinstall/package-react/package-react.test.js",
    "content": "const path = require('path');\nconst {\n  existsPackageJson,\n  runTest,\n  testLockFile,\n  testWebModules,\n} = require('../esinstall-test-utils.js');\n\nrequire('jest-specific-snapshot'); // allows to call expect().toMatchSpecificSnapshot(filename, snapshotName)\n\ndescribe('package-react', () => {\n  it('matches the snapshot', async () => {\n    const cwd = __dirname;\n\n    if (existsPackageJson(cwd) === false) return;\n\n    // Run Test\n    const {output, snapshotFile} = await runTest(['react', 'react-dom'], {cwd});\n\n    // Test output\n    expect(output).toMatchSpecificSnapshot(snapshotFile, 'cli output');\n\n    // Test Lockfile (if one exists)\n    await testLockFile(cwd);\n\n    // Cleanup\n    const {testAllSnapshots, testDiffs} = await testWebModules(cwd, snapshotFile);\n\n    // Assert that the snapshots match\n    testAllSnapshots();\n\n    // If any diffs are detected, we'll assert the difference so that we get nice output.\n    testDiffs();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/package-react/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-package-react\",\n  \"description\": \"Ensures React still works\",\n  \"dependencies\": {\n    \"react\": \"16.13.1\",\n    \"react-dom\": \"16.13.1\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/package-react/src/index.js",
    "content": "import React, {useState} from 'react';\nimport * as react from 'react';\nimport * as reactDOM from 'react-dom';\nimport {renderToString} from 'react-dom/server';\n"
  },
  {
    "path": "test/esinstall/polyfill-node/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/polyfill-node/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-polyfill-node\",\n  \"dependencies\": {\n    \"node-builtin-pkg\": \"file:./packages/node-builtin-pkg\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/polyfill-node/packages/node-builtin-pkg/entrypoint.js",
    "content": "export const FOO = 42;\nimport * as path from 'path';\nconsole.log(path);\n"
  },
  {
    "path": "test/esinstall/polyfill-node/packages/node-builtin-pkg/package.json",
    "content": "{\n  \"version\": \"1.2.3\",\n  \"name\": \"node-builtin-pkg\",\n  \"module\": \"entrypoint.js\"\n}\n"
  },
  {
    "path": "test/esinstall/polyfill-node/polyfill-node.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('polyfill node', () => {\n  it('is enabled through polyfillNode', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-polyfill-node');\n    const spec = 'node-builtin-pkg';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n      polyfillNode: true,\n    });\n\n    const output = fs.readFileSync(path.join(dest, `${spec}.js`), 'utf8');\n\n    // test output (note: this may be a bit too close to a snapshot, but pay attention to changes here)\n    expect(output).toEqual(\n      // This is testing that path.dirname is implemented\n      expect.stringContaining(`function dirname(path) {`),\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall/rollup/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/rollup/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-config-rollup\",\n  \"scripts\": {\n    \"testinstall\": \"snowpack install\"\n  },\n  \"dependencies\": {\n    \"rollup-plugin-svelte\": \"^7.0.0\",\n    \"svelte\": \"^3.18.2\",\n    \"svelte-routing\": \"^1.4.0\"\n  },\n  \"devDependencies\": {\n    \"snowpack\": \"^3.8.8\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/rollup/rollup.test.js",
    "content": "const path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('Rollup config', () => {\n  it('it can be passed through the rollup option', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-rollup');\n    const spec = 'svelte-routing';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n      rollup: {\n        plugins: [require('rollup-plugin-svelte')()],\n      },\n    });\n\n    // install would have thrown without the plugin, so getting here is enough.\n    expect(imports[spec]).toBeTruthy();\n  });\n\n  it('omitting the rollup plugin will throw on install', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-rollup-no-plugin');\n    const spec = 'svelte-routing';\n\n    try {\n      await runTest([spec], {\n        cwd,\n        dest,\n        rollup: {\n          // No plugin makes svelte sad\n        },\n      });\n\n      // Shouldn't have gotten here :(\n      expect(false).toBeTruthy();\n    } catch (err) {\n      expect(err).toBeInstanceOf(Error);\n    }\n  });\n});\n"
  },
  {
    "path": "test/esinstall/rollup/src/index.js",
    "content": "import {\n  SvelteComponentDev,\n  create_component,\n  destroy_component,\n  detach_dev,\n  dispatch_dev,\n  init,\n  insert_dev,\n  mount_component,\n  noop,\n  safe_not_equal,\n  space,\n  transition_in,\n  transition_out,\n} from 'svelte/internal';\n// this exports *.svelte files, and needs rollup-plugin-svelte\nimport {Router, Route} from 'svelte-routing';\n"
  },
  {
    "path": "test/esinstall/source-map-strip/__snapshots__",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`source-map-strip matches the snapshot: allFiles 1`] = `\nArray [\n  \"@auth0/auth0-spa-js.js\",\n  \"import-map.json\",\n]\n`;\n\nexports[`source-map-strip matches the snapshot: cli output 1`] = `\"\"`;\n\nexports[`source-map-strip matches the snapshot: web_modules/@auth0/auth0-spa-js.js 1`] = `\n\"/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \\\\\"License\\\\\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar e=function(t,n){return (e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);})(t,n)};function t(t,n){function i(){this.constructor=t;}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i);}var n=function(){return (n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function i(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&\\\\\"function\\\\\"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);}return n}function r(e,t,n,i){return new(n||(n=Promise))((function(r,o){function c(e){try{a(i.next(e));}catch(e){o(e);}}function s(e){try{a(i.throw(e));}catch(e){o(e);}}function a(e){e.done?r(e.value):new n((function(t){t(e.value);})).then(c,s);}a((i=i.apply(e,t||[])).next());}))}function o(e,t){var n,i,r,o,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\\\\\"function\\\\\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError(\\\\\"Generator is already executing.\\\\\");for(;c;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,i=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){c.label=o[1];break}if(6===o[0]&&c.label<r[1]){c.label=r[1],r=o;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(o);break}r[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c);}catch(e){o=[6,e],i=0;}finally{n=r=0;}if(5&o[0])throw o[1];return {value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var c=\\\\\"undefined\\\\\"!=typeof globalThis?globalThis:\\\\\"undefined\\\\\"!=typeof window?window:\\\\\"undefined\\\\\"!=typeof global?global:\\\\\"undefined\\\\\"!=typeof self?self:{};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\\\\\"default\\\\\")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports}var u=function(e){return e&&e.Math==Math&&e},l=u(\\\\\"object\\\\\"==typeof globalThis&&globalThis)||u(\\\\\"object\\\\\"==typeof window&&window)||u(\\\\\"object\\\\\"==typeof self&&self)||u(\\\\\"object\\\\\"==typeof c&&c)||Function(\\\\\"return this\\\\\")(),d=function(e){try{return !!e()}catch(e){return !0}},g=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),I={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,p={f:f&&!I.call({1:2},1)?function(e){var t=f(this,e);return !!t&&t.enumerable}:I},h=function(e,t){return {enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},y={}.toString,b=function(e){return y.call(e).slice(8,-1)},m=\\\\\"\\\\\".split,B=d((function(){return !Object(\\\\\"z\\\\\").propertyIsEnumerable(0)}))?function(e){return \\\\\"String\\\\\"==b(e)?m.call(e,\\\\\"\\\\\"):Object(e)}:Object,F=function(e){if(null==e)throw TypeError(\\\\\"Can't call method on \\\\\"+e);return e},v=function(e){return B(F(e))},C=function(e){return \\\\\"object\\\\\"==typeof e?null!==e:\\\\\"function\\\\\"==typeof e},U=function(e,t){if(!C(e))return e;var n,i;if(t&&\\\\\"function\\\\\"==typeof(n=e.toString)&&!C(i=n.call(e)))return i;if(\\\\\"function\\\\\"==typeof(n=e.valueOf)&&!C(i=n.call(e)))return i;if(!t&&\\\\\"function\\\\\"==typeof(n=e.toString)&&!C(i=n.call(e)))return i;throw TypeError(\\\\\"Can't convert object to primitive value\\\\\")},S={}.hasOwnProperty,V=function(e,t){return S.call(e,t)},Z=l.document,X=C(Z)&&C(Z.createElement),G=function(e){return X?Z.createElement(e):{}},w=!g&&!d((function(){return 7!=Object.defineProperty(G(\\\\\"div\\\\\"),\\\\\"a\\\\\",{get:function(){return 7}}).a})),R=Object.getOwnPropertyDescriptor,x={f:g?R:function(e,t){if(e=v(e),t=U(t,!0),w)try{return R(e,t)}catch(e){}if(V(e,t))return h(!p.f.call(e,t),e[t])}},A=function(e){if(!C(e))throw TypeError(String(e)+\\\\\" is not an object\\\\\");return e},Q=Object.defineProperty,W={f:g?Q:function(e,t,n){if(A(e),t=U(t,!0),A(n),w)try{return Q(e,t,n)}catch(e){}if(\\\\\"get\\\\\"in n||\\\\\"set\\\\\"in n)throw TypeError(\\\\\"Accessors not supported\\\\\");return \\\\\"value\\\\\"in n&&(e[t]=n.value),e}},L=g?function(e,t,n){return W.f(e,t,h(1,n))}:function(e,t,n){return e[t]=n,e},H=function(e,t){try{L(l,e,t);}catch(n){l[e]=t;}return t},J=l[\\\\\"__core-js_shared__\\\\\"]||H(\\\\\"__core-js_shared__\\\\\",{}),k=Function.toString;\\\\\"function\\\\\"!=typeof J.inspectSource&&(J.inspectSource=function(e){return k.call(e)});var E,Y,T,K=J.inspectSource,N=l.WeakMap,O=\\\\\"function\\\\\"==typeof N&&/native code/.test(K(N)),z=a((function(e){(e.exports=function(e,t){return J[e]||(J[e]=void 0!==t?t:{})})(\\\\\"versions\\\\\",[]).push({version:\\\\\"3.6.5\\\\\",mode:\\\\\"global\\\\\",copyright:\\\\\"© 2020 Denis Pushkarev (zloirock.ru)\\\\\"});})),j=0,P=Math.random(),_=function(e){return \\\\\"Symbol(\\\\\"+String(void 0===e?\\\\\"\\\\\":e)+\\\\\")_\\\\\"+(++j+P).toString(36)},D=z(\\\\\"keys\\\\\"),M=function(e){return D[e]||(D[e]=_(e))},q={},$=l.WeakMap;if(O){var ee=new $,te=ee.get,ne=ee.has,ie=ee.set;E=function(e,t){return ie.call(ee,e,t),t},Y=function(e){return te.call(ee,e)||{}},T=function(e){return ne.call(ee,e)};}else {var re=M(\\\\\"state\\\\\");q[re]=!0,E=function(e,t){return L(e,re,t),t},Y=function(e){return V(e,re)?e[re]:{}},T=function(e){return V(e,re)};}var oe,ce={set:E,get:Y,has:T,enforce:function(e){return T(e)?Y(e):E(e,{})},getterFor:function(e){return function(t){var n;if(!C(t)||(n=Y(t)).type!==e)throw TypeError(\\\\\"Incompatible receiver, \\\\\"+e+\\\\\" required\\\\\");return n}}},se=a((function(e){var t=ce.get,n=ce.enforce,i=String(String).split(\\\\\"String\\\\\");(e.exports=function(e,t,r,o){var c=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,a=!!o&&!!o.noTargetGet;\\\\\"function\\\\\"==typeof r&&(\\\\\"string\\\\\"!=typeof t||V(r,\\\\\"name\\\\\")||L(r,\\\\\"name\\\\\",t),n(r).source=i.join(\\\\\"string\\\\\"==typeof t?t:\\\\\"\\\\\")),e!==l?(c?!a&&e[t]&&(s=!0):delete e[t],s?e[t]=r:L(e,t,r)):s?e[t]=r:H(t,r);})(Function.prototype,\\\\\"toString\\\\\",(function(){return \\\\\"function\\\\\"==typeof this&&t(this).source||K(this)}));})),ae=l,ue=function(e){return \\\\\"function\\\\\"==typeof e?e:void 0},le=function(e,t){return arguments.length<2?ue(ae[e])||ue(l[e]):ae[e]&&ae[e][t]||l[e]&&l[e][t]},de=Math.ceil,ge=Math.floor,Ie=function(e){return isNaN(e=+e)?0:(e>0?ge:de)(e)},fe=Math.min,pe=function(e){return e>0?fe(Ie(e),9007199254740991):0},he=Math.max,ye=Math.min,be=function(e){return function(t,n,i){var r,o=v(t),c=pe(o.length),s=function(e,t){var n=Ie(e);return n<0?he(n+t,0):ye(n,t)}(i,c);if(e&&n!=n){for(;c>s;)if((r=o[s++])!=r)return !0}else for(;c>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return !e&&-1}},me={includes:be(!0),indexOf:be(!1)},Be=me.indexOf,Fe=function(e,t){var n,i=v(e),r=0,o=[];for(n in i)!V(q,n)&&V(i,n)&&o.push(n);for(;t.length>r;)V(i,n=t[r++])&&(~Be(o,n)||o.push(n));return o},ve=[\\\\\"constructor\\\\\",\\\\\"hasOwnProperty\\\\\",\\\\\"isPrototypeOf\\\\\",\\\\\"propertyIsEnumerable\\\\\",\\\\\"toLocaleString\\\\\",\\\\\"toString\\\\\",\\\\\"valueOf\\\\\"],Ce=ve.concat(\\\\\"length\\\\\",\\\\\"prototype\\\\\"),Ue={f:Object.getOwnPropertyNames||function(e){return Fe(e,Ce)}},Se={f:Object.getOwnPropertySymbols},Ve=le(\\\\\"Reflect\\\\\",\\\\\"ownKeys\\\\\")||function(e){var t=Ue.f(A(e)),n=Se.f;return n?t.concat(n(e)):t},Ze=function(e,t){for(var n=Ve(t),i=W.f,r=x.f,o=0;o<n.length;o++){var c=n[o];V(e,c)||i(e,c,r(t,c));}},Xe=/#|\\\\\\\\.prototype\\\\\\\\./,Ge=function(e,t){var n=Re[we(e)];return n==Ae||n!=xe&&(\\\\\"function\\\\\"==typeof t?d(t):!!t)},we=Ge.normalize=function(e){return String(e).replace(Xe,\\\\\".\\\\\").toLowerCase()},Re=Ge.data={},xe=Ge.NATIVE=\\\\\"N\\\\\",Ae=Ge.POLYFILL=\\\\\"P\\\\\",Qe=Ge,We=x.f,Le=function(e,t){var n,i,r,o,c,s=e.target,a=e.global,u=e.stat;if(n=a?l:u?l[s]||H(s,{}):(l[s]||{}).prototype)for(i in t){if(o=t[i],r=e.noTargetGet?(c=We(n,i))&&c.value:n[i],!Qe(a?i:s+(u?\\\\\".\\\\\":\\\\\"#\\\\\")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;Ze(o,r);}(e.sham||r&&r.sham)&&L(o,\\\\\"sham\\\\\",!0),se(n,i,o,e);}},He=!!Object.getOwnPropertySymbols&&!d((function(){return !String(Symbol())})),Je=He&&!Symbol.sham&&\\\\\"symbol\\\\\"==typeof Symbol.iterator,ke=z(\\\\\"wks\\\\\"),Ee=l.Symbol,Ye=Je?Ee:Ee&&Ee.withoutSetter||_,Te=function(e){return V(ke,e)||(He&&V(Ee,e)?ke[e]=Ee[e]:ke[e]=Ye(\\\\\"Symbol.\\\\\"+e)),ke[e]},Ke=Te(\\\\\"match\\\\\"),Ne=function(e){if(function(e){var t;return C(e)&&(void 0!==(t=e[Ke])?!!t:\\\\\"RegExp\\\\\"==b(e))}(e))throw TypeError(\\\\\"The method doesn't accept regular expressions\\\\\");return e},Oe=Te(\\\\\"match\\\\\"),ze=function(e){var t=/./;try{\\\\\"/./\\\\\"[e](t);}catch(n){try{return t[Oe]=!1,\\\\\"/./\\\\\"[e](t)}catch(e){}}return !1},je=x.f,Pe=\\\\\"\\\\\".startsWith,_e=Math.min,De=ze(\\\\\"startsWith\\\\\"),Me=!(De||(oe=je(String.prototype,\\\\\"startsWith\\\\\"),!oe||oe.writable));Le({target:\\\\\"String\\\\\",proto:!0,forced:!Me&&!De},{startsWith:function(e){var t=String(F(this));Ne(e);var n=pe(_e(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return Pe?Pe.call(t,i,n):t.slice(n,n+i.length)===i}});var qe,$e,et,tt=function(e){if(\\\\\"function\\\\\"!=typeof e)throw TypeError(String(e)+\\\\\" is not a function\\\\\");return e},nt=function(e,t,n){if(tt(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},it=Function.call,rt=function(e,t,n){return nt(it,l[e].prototype[t],n)},ot=(rt(\\\\\"String\\\\\",\\\\\"startsWith\\\\\"),function(e){return function(t,n){var i,r,o=String(F(t)),c=Ie(n),s=o.length;return c<0||c>=s?e?\\\\\"\\\\\":void 0:(i=o.charCodeAt(c))<55296||i>56319||c+1===s||(r=o.charCodeAt(c+1))<56320||r>57343?e?o.charAt(c):i:e?o.slice(c,c+2):r-56320+(i-55296<<10)+65536}}),ct={codeAt:ot(!1),charAt:ot(!0)},st=function(e){return Object(F(e))},at=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ut=M(\\\\\"IE_PROTO\\\\\"),lt=Object.prototype,dt=at?Object.getPrototypeOf:function(e){return e=st(e),V(e,ut)?e[ut]:\\\\\"function\\\\\"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?lt:null},gt=Te(\\\\\"iterator\\\\\"),It=!1;[].keys&&(\\\\\"next\\\\\"in(et=[].keys())?($e=dt(dt(et)))!==Object.prototype&&(qe=$e):It=!0),null==qe&&(qe={}),V(qe,gt)||L(qe,gt,(function(){return this}));var ft,pt={IteratorPrototype:qe,BUGGY_SAFARI_ITERATORS:It},ht=Object.keys||function(e){return Fe(e,ve)},yt=g?Object.defineProperties:function(e,t){A(e);for(var n,i=ht(t),r=i.length,o=0;r>o;)W.f(e,n=i[o++],t[n]);return e},bt=le(\\\\\"document\\\\\",\\\\\"documentElement\\\\\"),mt=M(\\\\\"IE_PROTO\\\\\"),Bt=function(){},Ft=function(e){return \\\\\"<script>\\\\\"+e+\\\\\"<\\\\\\\\/script>\\\\\"},vt=function(){try{ft=document.domain&&new ActiveXObject(\\\\\"htmlfile\\\\\");}catch(e){}var e,t;vt=ft?function(e){e.write(Ft(\\\\\"\\\\\")),e.close();var t=e.parentWindow.Object;return e=null,t}(ft):((t=G(\\\\\"iframe\\\\\")).style.display=\\\\\"none\\\\\",bt.appendChild(t),t.src=String(\\\\\"javascript:\\\\\"),(e=t.contentWindow.document).open(),e.write(Ft(\\\\\"document.F=Object\\\\\")),e.close(),e.F);for(var n=ve.length;n--;)delete vt.prototype[ve[n]];return vt()};q[mt]=!0;var Ct=Object.create||function(e,t){var n;return null!==e?(Bt.prototype=A(e),n=new Bt,Bt.prototype=null,n[mt]=e):n=vt(),void 0===t?n:yt(n,t)},Ut=W.f,St=Te(\\\\\"toStringTag\\\\\"),Vt=function(e,t,n){e&&!V(e=n?e:e.prototype,St)&&Ut(e,St,{configurable:!0,value:t});},Zt={},Xt=pt.IteratorPrototype,Gt=function(){return this},wt=Object.setPrototypeOf||(\\\\\"__proto__\\\\\"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,\\\\\"__proto__\\\\\").set).call(n,[]),t=n instanceof Array;}catch(e){}return function(n,i){return A(n),function(e){if(!C(e)&&null!==e)throw TypeError(\\\\\"Can't set \\\\\"+String(e)+\\\\\" as a prototype\\\\\")}(i),t?e.call(n,i):n.__proto__=i,n}}():void 0),Rt=pt.IteratorPrototype,xt=pt.BUGGY_SAFARI_ITERATORS,At=Te(\\\\\"iterator\\\\\"),Qt=function(){return this},Wt=function(e,t,n,i,r,o,c){!function(e,t,n){var i=t+\\\\\" Iterator\\\\\";e.prototype=Ct(Xt,{next:h(1,n)}),Vt(e,i,!1),Zt[i]=Gt;}(n,t,i);var s,a,u,l=function(e){if(e===r&&p)return p;if(!xt&&e in I)return I[e];switch(e){case\\\\\"keys\\\\\":case\\\\\"values\\\\\":case\\\\\"entries\\\\\":return function(){return new n(this,e)}}return function(){return new n(this)}},d=t+\\\\\" Iterator\\\\\",g=!1,I=e.prototype,f=I[At]||I[\\\\\"@@iterator\\\\\"]||r&&I[r],p=!xt&&f||l(r),y=\\\\\"Array\\\\\"==t&&I.entries||f;if(y&&(s=dt(y.call(new e)),Rt!==Object.prototype&&s.next&&(dt(s)!==Rt&&(wt?wt(s,Rt):\\\\\"function\\\\\"!=typeof s[At]&&L(s,At,Qt)),Vt(s,d,!0))),\\\\\"values\\\\\"==r&&f&&\\\\\"values\\\\\"!==f.name&&(g=!0,p=function(){return f.call(this)}),I[At]!==p&&L(I,At,p),Zt[t]=p,r)if(a={values:l(\\\\\"values\\\\\"),keys:o?p:l(\\\\\"keys\\\\\"),entries:l(\\\\\"entries\\\\\")},c)for(u in a)(xt||g||!(u in I))&&se(I,u,a[u]);else Le({target:t,proto:!0,forced:xt||g},a);return a},Lt=ct.charAt,Ht=ce.set,Jt=ce.getterFor(\\\\\"String Iterator\\\\\");Wt(String,\\\\\"String\\\\\",(function(e){Ht(this,{type:\\\\\"String Iterator\\\\\",string:String(e),index:0});}),(function(){var e,t=Jt(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=Lt(n,i),t.index+=e.length,{value:e,done:!1})}));var kt=function(e,t,n,i){try{return i?t(A(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&A(r.call(e)),t}},Et=Te(\\\\\"iterator\\\\\"),Yt=Array.prototype,Tt=function(e){return void 0!==e&&(Zt.Array===e||Yt[Et]===e)},Kt=function(e,t,n){var i=U(t);i in e?W.f(e,i,h(0,n)):e[i]=n;},Nt={};Nt[Te(\\\\\"toStringTag\\\\\")]=\\\\\"z\\\\\";var Ot=\\\\\"[object z]\\\\\"===String(Nt),zt=Te(\\\\\"toStringTag\\\\\"),jt=\\\\\"Arguments\\\\\"==b(function(){return arguments}()),Pt=Ot?b:function(e){var t,n,i;return void 0===e?\\\\\"Undefined\\\\\":null===e?\\\\\"Null\\\\\":\\\\\"string\\\\\"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),zt))?n:jt?b(t):\\\\\"Object\\\\\"==(i=b(t))&&\\\\\"function\\\\\"==typeof t.callee?\\\\\"Arguments\\\\\":i},_t=Te(\\\\\"iterator\\\\\"),Dt=function(e){if(null!=e)return e[_t]||e[\\\\\"@@iterator\\\\\"]||Zt[Pt(e)]},Mt=Te(\\\\\"iterator\\\\\"),qt=!1;try{var $t=0,en={next:function(){return {done:!!$t++}},return:function(){qt=!0;}};en[Mt]=function(){return this},Array.from(en,(function(){throw 2}));}catch(e){}var tn=function(e,t){if(!t&&!qt)return !1;var n=!1;try{var i={};i[Mt]=function(){return {next:function(){return {done:n=!0}}}},e(i);}catch(e){}return n},nn=!tn((function(e){Array.from(e);}));Le({target:\\\\\"Array\\\\\",stat:!0,forced:nn},{from:function(e){var t,n,i,r,o,c,s=st(e),a=\\\\\"function\\\\\"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,d=void 0!==l,g=Dt(s),I=0;if(d&&(l=nt(l,u>2?arguments[2]:void 0,2)),null==g||a==Array&&Tt(g))for(n=new a(t=pe(s.length));t>I;I++)c=d?l(s[I],I):s[I],Kt(n,I,c);else for(o=(r=g.call(s)).next,n=new a;!(i=o.call(r)).done;I++)c=d?kt(r,l,[i.value,I],!0):i.value,Kt(n,I,c);return n.length=I,n}});ae.Array.from;var rn,on=\\\\\"undefined\\\\\"!=typeof ArrayBuffer&&\\\\\"undefined\\\\\"!=typeof DataView,cn=W.f,sn=l.Int8Array,an=sn&&sn.prototype,un=l.Uint8ClampedArray,ln=un&&un.prototype,dn=sn&&dt(sn),gn=an&&dt(an),In=Object.prototype,fn=In.isPrototypeOf,pn=Te(\\\\\"toStringTag\\\\\"),hn=_(\\\\\"TYPED_ARRAY_TAG\\\\\"),yn=on&&!!wt&&\\\\\"Opera\\\\\"!==Pt(l.opera),bn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},mn=function(e){return C(e)&&V(bn,Pt(e))};for(rn in bn)l[rn]||(yn=!1);if((!yn||\\\\\"function\\\\\"!=typeof dn||dn===Function.prototype)&&(dn=function(){throw TypeError(\\\\\"Incorrect invocation\\\\\")},yn))for(rn in bn)l[rn]&&wt(l[rn],dn);if((!yn||!gn||gn===In)&&(gn=dn.prototype,yn))for(rn in bn)l[rn]&&wt(l[rn].prototype,gn);if(yn&&dt(ln)!==gn&&wt(ln,gn),g&&!V(gn,pn))for(rn in cn(gn,pn,{get:function(){return C(this)?this[hn]:void 0}}),bn)l[rn]&&L(l[rn],hn,rn);var Bn=function(e){if(mn(e))return e;throw TypeError(\\\\\"Target is not a typed array\\\\\")},Fn=function(e){if(wt){if(fn.call(dn,e))return e}else for(var t in bn)if(V(bn,rn)){var n=l[t];if(n&&(e===n||fn.call(n,e)))return e}throw TypeError(\\\\\"Target is not a typed array constructor\\\\\")},vn=function(e,t,n){if(g){if(n)for(var i in bn){var r=l[i];r&&V(r.prototype,e)&&delete r.prototype[e];}gn[e]&&!n||se(gn,e,n?t:yn&&an[e]||t);}},Cn=Te(\\\\\"species\\\\\"),Un=Bn,Sn=Fn,Vn=[].slice;vn(\\\\\"slice\\\\\",(function(e,t){for(var n=Vn.call(Un(this),e,t),i=function(e,t){var n,i=A(e).constructor;return void 0===i||null==(n=A(i)[Cn])?t:tt(n)}(this,this.constructor),r=0,o=n.length,c=new(Sn(i))(o);o>r;)c[r]=n[r++];return c}),d((function(){new Int8Array(1).slice();})));var Zn=Te(\\\\\"unscopables\\\\\"),Xn=Array.prototype;null==Xn[Zn]&&W.f(Xn,Zn,{configurable:!0,value:Ct(null)});var Gn=function(e){Xn[Zn][e]=!0;},wn=Object.defineProperty,Rn={},xn=function(e){throw e},An=me.includes,Qn=function(e,t){if(V(Rn,e))return Rn[e];t||(t={});var n=[][e],i=!!V(t,\\\\\"ACCESSORS\\\\\")&&t.ACCESSORS,r=V(t,0)?t[0]:xn,o=V(t,1)?t[1]:void 0;return Rn[e]=!!n&&!d((function(){if(i&&!g)return !0;var e={length:-1};i?wn(e,1,{enumerable:!0,get:xn}):e[1]=1,n.call(e,r,o);}))}(\\\\\"indexOf\\\\\",{ACCESSORS:!0,1:0});Le({target:\\\\\"Array\\\\\",proto:!0,forced:!Qn},{includes:function(e){return An(this,e,arguments.length>1?arguments[1]:void 0)}}),Gn(\\\\\"includes\\\\\");rt(\\\\\"Array\\\\\",\\\\\"includes\\\\\");Le({target:\\\\\"String\\\\\",proto:!0,forced:!ze(\\\\\"includes\\\\\")},{includes:function(e){return !!~String(F(this)).indexOf(Ne(e),arguments.length>1?arguments[1]:void 0)}});rt(\\\\\"String\\\\\",\\\\\"includes\\\\\");var Wn=!d((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ln=a((function(e){var t=W.f,n=_(\\\\\"meta\\\\\"),i=0,r=Object.isExtensible||function(){return !0},o=function(e){t(e,n,{value:{objectID:\\\\\"O\\\\\"+ ++i,weakData:{}}});},c=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!C(e))return \\\\\"symbol\\\\\"==typeof e?e:(\\\\\"string\\\\\"==typeof e?\\\\\"S\\\\\":\\\\\"P\\\\\")+e;if(!V(e,n)){if(!r(e))return \\\\\"F\\\\\";if(!t)return \\\\\"E\\\\\";o(e);}return e[n].objectID},getWeakData:function(e,t){if(!V(e,n)){if(!r(e))return !0;if(!t)return !1;o(e);}return e[n].weakData},onFreeze:function(e){return Wn&&c.REQUIRED&&r(e)&&!V(e,n)&&o(e),e}};q[n]=!0;})),Hn=(Ln.REQUIRED,Ln.fastKey,Ln.getWeakData,Ln.onFreeze,a((function(e){var t=function(e,t){this.stopped=e,this.result=t;};(e.exports=function(e,n,i,r,o){var c,s,a,u,l,d,g,I=nt(n,i,r?2:1);if(o)c=e;else {if(\\\\\"function\\\\\"!=typeof(s=Dt(e)))throw TypeError(\\\\\"Target is not iterable\\\\\");if(Tt(s)){for(a=0,u=pe(e.length);u>a;a++)if((l=r?I(A(g=e[a])[0],g[1]):I(e[a]))&&l instanceof t)return l;return new t(!1)}c=s.call(e);}for(d=c.next;!(g=d.call(c)).done;)if(\\\\\"object\\\\\"==typeof(l=kt(c,I,g.value,r))&&l&&l instanceof t)return l;return new t(!1)}).stop=function(e){return new t(!0,e)};}))),Jn=function(e,t,n){if(!(e instanceof t))throw TypeError(\\\\\"Incorrect \\\\\"+(n?n+\\\\\" \\\\\":\\\\\"\\\\\")+\\\\\"invocation\\\\\");return e},kn=function(e,t,n){for(var i in t)se(e,i,t[i],n);return e},En=Te(\\\\\"species\\\\\"),Yn=W.f,Tn=Ln.fastKey,Kn=ce.set,Nn=ce.getterFor,On=(function(e,t,n){var i=-1!==e.indexOf(\\\\\"Map\\\\\"),r=-1!==e.indexOf(\\\\\"Weak\\\\\"),o=i?\\\\\"set\\\\\":\\\\\"add\\\\\",c=l[e],s=c&&c.prototype,a=c,u={},g=function(e){var t=s[e];se(s,e,\\\\\"add\\\\\"==e?function(e){return t.call(this,0===e?0:e),this}:\\\\\"delete\\\\\"==e?function(e){return !(r&&!C(e))&&t.call(this,0===e?0:e)}:\\\\\"get\\\\\"==e?function(e){return r&&!C(e)?void 0:t.call(this,0===e?0:e)}:\\\\\"has\\\\\"==e?function(e){return !(r&&!C(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this});};if(Qe(e,\\\\\"function\\\\\"!=typeof c||!(r||s.forEach&&!d((function(){(new c).entries().next();})))))a=n.getConstructor(t,e,i,o),Ln.REQUIRED=!0;else if(Qe(e,!0)){var I=new a,f=I[o](r?{}:-0,1)!=I,p=d((function(){I.has(1);})),h=tn((function(e){new c(e);})),y=!r&&d((function(){for(var e=new c,t=5;t--;)e[o](t,t);return !e.has(-0)}));h||((a=t((function(t,n){Jn(t,a,e);var r=function(e,t,n){var i,r;return wt&&\\\\\"function\\\\\"==typeof(i=t.constructor)&&i!==n&&C(r=i.prototype)&&r!==n.prototype&&wt(e,r),e}(new c,t,a);return null!=n&&Hn(n,r[o],r,i),r}))).prototype=s,s.constructor=a),(p||y)&&(g(\\\\\"delete\\\\\"),g(\\\\\"has\\\\\"),i&&g(\\\\\"get\\\\\")),(y||f)&&g(o),r&&s.clear&&delete s.clear;}u[e]=a,Le({global:!0,forced:a!=c},u),Vt(a,e),r||n.setStrong(a,e,i);}(\\\\\"Set\\\\\",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(e,t,n,i){var r=e((function(e,o){Jn(e,r,t),Kn(e,{type:t,index:Ct(null),first:void 0,last:void 0,size:0}),g||(e.size=0),null!=o&&Hn(o,e[i],e,n);})),o=Nn(t),c=function(e,t,n){var i,r,c=o(e),a=s(e,t);return a?a.value=n:(c.last=a={index:r=Tn(t,!0),key:t,value:n,previous:i=c.last,next:void 0,removed:!1},c.first||(c.first=a),i&&(i.next=a),g?c.size++:e.size++,\\\\\"F\\\\\"!==r&&(c.index[r]=a)),e},s=function(e,t){var n,i=o(e),r=Tn(t);if(\\\\\"F\\\\\"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==t)return n};return kn(r.prototype,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,g?e.size=0:this.size=0;},delete:function(e){var t=this,n=o(t),i=s(t,e);if(i){var r=i.next,c=i.previous;delete n.index[i.index],i.removed=!0,c&&(c.next=r),r&&(r.previous=c),n.first==i&&(n.first=r),n.last==i&&(n.last=c),g?n.size--:t.size--;}return !!i},forEach:function(e){for(var t,n=o(this),i=nt(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(i(t.value,t.key,this);t&&t.removed;)t=t.previous;},has:function(e){return !!s(this,e)}}),kn(r.prototype,n?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return c(this,0===e?0:e,t)}}:{add:function(e){return c(this,e=0===e?0:e,e)}}),g&&Yn(r.prototype,\\\\\"size\\\\\",{get:function(){return o(this).size}}),r},setStrong:function(e,t,n){var i=t+\\\\\" Iterator\\\\\",r=Nn(t),o=Nn(i);Wt(e,t,(function(e,t){Kn(this,{type:i,target:e,state:r(e),kind:t,last:void 0});}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?\\\\\"keys\\\\\"==t?{value:n.key,done:!1}:\\\\\"values\\\\\"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?\\\\\"entries\\\\\":\\\\\"values\\\\\",!n,!0),function(e){var t=le(e),n=W.f;g&&t&&!t[En]&&n(t,En,{configurable:!0,get:function(){return this}});}(t);}}),Ot?{}.toString:function(){return \\\\\"[object \\\\\"+Pt(this)+\\\\\"]\\\\\"});Ot||se(Object.prototype,\\\\\"toString\\\\\",On,{unsafe:!0});var zn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},jn=ce.set,Pn=ce.getterFor(\\\\\"Array Iterator\\\\\"),_n=Wt(Array,\\\\\"Array\\\\\",(function(e,t){jn(this,{type:\\\\\"Array Iterator\\\\\",target:v(e),index:0,kind:t});}),(function(){var e=Pn(this),t=e.target,n=e.kind,i=e.index++;return !t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):\\\\\"keys\\\\\"==n?{value:i,done:!1}:\\\\\"values\\\\\"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),\\\\\"values\\\\\");Zt.Arguments=Zt.Array,Gn(\\\\\"keys\\\\\"),Gn(\\\\\"values\\\\\"),Gn(\\\\\"entries\\\\\");var Dn=Te(\\\\\"iterator\\\\\"),Mn=Te(\\\\\"toStringTag\\\\\"),qn=_n.values;for(var $n in zn){var ei=l[$n],ti=ei&&ei.prototype;if(ti){if(ti[Dn]!==qn)try{L(ti,Dn,qn);}catch(e){ti[Dn]=qn;}if(ti[Mn]||L(ti,Mn,$n),zn[$n])for(var ni in _n)if(ti[ni]!==_n[ni])try{L(ti,ni,_n[ni]);}catch(e){ti[ni]=_n[ni];}}}ae.Set;function ii(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}var ri=setTimeout;function oi(e){return Boolean(e&&void 0!==e.length)}function ci(){}function si(e){if(!(this instanceof si))throw new TypeError(\\\\\"Promises must be constructed via new\\\\\");if(\\\\\"function\\\\\"!=typeof e)throw new TypeError(\\\\\"not a function\\\\\");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Ii(e,this);}function ai(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,si._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value);}catch(e){return void li(t.promise,e)}ui(t.promise,i);}else (1===e._state?ui:li)(t.promise,e._value);}))):e._deferreds.push(t);}function ui(e,t){try{if(t===e)throw new TypeError(\\\\\"A promise cannot be resolved with itself.\\\\\");if(t&&(\\\\\"object\\\\\"==typeof t||\\\\\"function\\\\\"==typeof t)){var n=t.then;if(t instanceof si)return e._state=3,e._value=t,void di(e);if(\\\\\"function\\\\\"==typeof n)return void Ii((i=n,r=t,function(){i.apply(r,arguments);}),e)}e._state=1,e._value=t,di(e);}catch(t){li(e,t);}var i,r;}function li(e,t){e._state=2,e._value=t,di(e);}function di(e){2===e._state&&0===e._deferreds.length&&si._immediateFn((function(){e._handled||si._unhandledRejectionFn(e._value);}));for(var t=0,n=e._deferreds.length;t<n;t++)ai(e,e._deferreds[t]);e._deferreds=null;}function gi(e,t,n){this.onFulfilled=\\\\\"function\\\\\"==typeof e?e:null,this.onRejected=\\\\\"function\\\\\"==typeof t?t:null,this.promise=n;}function Ii(e,t){var n=!1;try{e((function(e){n||(n=!0,ui(t,e));}),(function(e){n||(n=!0,li(t,e));}));}catch(e){if(n)return;n=!0,li(t,e);}}si.prototype.catch=function(e){return this.then(null,e)},si.prototype.then=function(e,t){var n=new this.constructor(ci);return ai(this,new gi(e,t,n)),n},si.prototype.finally=ii,si.all=function(e){return new si((function(t,n){if(!oi(e))return n(new TypeError(\\\\\"Promise.all accepts an array\\\\\"));var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var r=i.length;function o(e,c){try{if(c&&(\\\\\"object\\\\\"==typeof c||\\\\\"function\\\\\"==typeof c)){var s=c.then;if(\\\\\"function\\\\\"==typeof s)return void s.call(c,(function(t){o(e,t);}),n)}i[e]=c,0==--r&&t(i);}catch(e){n(e);}}for(var c=0;c<i.length;c++)o(c,i[c]);}))},si.resolve=function(e){return e&&\\\\\"object\\\\\"==typeof e&&e.constructor===si?e:new si((function(t){t(e);}))},si.reject=function(e){return new si((function(t,n){n(e);}))},si.race=function(e){return new si((function(t,n){if(!oi(e))return n(new TypeError(\\\\\"Promise.race accepts an array\\\\\"));for(var i=0,r=e.length;i<r;i++)si.resolve(e[i]).then(t,n);}))},si._immediateFn=\\\\\"function\\\\\"==typeof setImmediate&&function(e){setImmediate(e);}||function(e){ri(e,0);},si._unhandledRejectionFn=function(e){\\\\\"undefined\\\\\"!=typeof console&&console&&console.warn(\\\\\"Possible Unhandled Promise Rejection:\\\\\",e);};var fi=function(){if(\\\\\"undefined\\\\\"!=typeof self)return self;if(\\\\\"undefined\\\\\"!=typeof window)return window;if(\\\\\"undefined\\\\\"!=typeof global)return global;throw new Error(\\\\\"unable to locate global object\\\\\")}();\\\\\"Promise\\\\\"in fi?fi.Promise.prototype.finally||(fi.Promise.prototype.finally=ii):fi.Promise=si,function(e){function t(){}function n(e,t){if(e=void 0===e?\\\\\"utf-8\\\\\":e,t=void 0===t?{fatal:!1}:t,-1===r.indexOf(e.toLowerCase()))throw new RangeError(\\\\\"Failed to construct 'TextDecoder': The encoding label provided ('\\\\\"+e+\\\\\"') is invalid.\\\\\");if(t.fatal)throw Error(\\\\\"Failed to construct 'TextDecoder': the 'fatal' option is unsupported.\\\\\")}function i(e){for(var t=0,n=Math.min(65536,e.length+1),i=new Uint16Array(n),r=[],o=0;;){var c=t<e.length;if(!c||o>=n-1){if(r.push(String.fromCharCode.apply(null,i.subarray(0,o))),!c)return r.join(\\\\\"\\\\\");e=e.subarray(t),o=t=0;}if(0==(128&(c=e[t++])))i[o++]=c;else if(192==(224&c)){var s=63&e[t++];i[o++]=(31&c)<<6|s;}else if(224==(240&c)){s=63&e[t++];var a=63&e[t++];i[o++]=(31&c)<<12|s<<6|a;}else if(240==(248&c)){65535<(c=(7&c)<<18|(s=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(c-=65536,i[o++]=c>>>10&1023|55296,c=56320|1023&c),i[o++]=c;}}}if(e.TextEncoder&&e.TextDecoder)return !1;var r=[\\\\\"utf-8\\\\\",\\\\\"utf8\\\\\",\\\\\"unicode-1-1-utf-8\\\\\"];Object.defineProperty(t.prototype,\\\\\"encoding\\\\\",{value:\\\\\"utf-8\\\\\"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error(\\\\\"Failed to encode: the 'stream' option is unsupported.\\\\\");t=0;for(var n=e.length,i=0,r=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(r>>>3<<3);t<n;){var c=e.charCodeAt(t++);if(55296<=c&&56319>=c){if(t<n){var s=e.charCodeAt(t);56320==(64512&s)&&(++t,c=((1023&c)<<10)+(1023&s)+65536);}if(55296<=c&&56319>=c)continue}if(i+4>o.length&&(r+=8,r=(r*=1+t/e.length*2)>>>3<<3,(s=new Uint8Array(r)).set(o),o=s),0==(4294967168&c))o[i++]=c;else {if(0==(4294965248&c))o[i++]=c>>>6&31|192;else if(0==(4294901760&c))o[i++]=c>>>12&15|224,o[i++]=c>>>6&63|128;else {if(0!=(4292870144&c))continue;o[i++]=c>>>18&7|240,o[i++]=c>>>12&63|128,o[i++]=c>>>6&63|128;}o[i++]=63&c|128;}}return o.slice?o.slice(0,i):o.subarray(0,i)},Object.defineProperty(n.prototype,\\\\\"encoding\\\\\",{value:\\\\\"utf-8\\\\\"}),Object.defineProperty(n.prototype,\\\\\"fatal\\\\\",{value:!1}),Object.defineProperty(n.prototype,\\\\\"ignoreBOM\\\\\",{value:!1});var o=i;\\\\\"function\\\\\"==typeof Buffer&&Buffer.from?o=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(\\\\\"utf-8\\\\\")}:\\\\\"function\\\\\"==typeof Blob&&\\\\\"function\\\\\"==typeof URL&&\\\\\"function\\\\\"==typeof URL.createObjectURL&&(o=function(e){var t=URL.createObjectURL(new Blob([e],{type:\\\\\"text/plain;charset=UTF-8\\\\\"}));try{var n=new XMLHttpRequest;return n.open(\\\\\"GET\\\\\",t,!1),n.send(),n.responseText}catch(t){return i(e)}finally{URL.revokeObjectURL(t);}}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error(\\\\\"Failed to decode: the 'stream' option is unsupported.\\\\\");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),o(e)},e.TextEncoder=t,e.TextDecoder=n;}(\\\\\"undefined\\\\\"!=typeof window?window:c),function(){function e(e,t){if(!(e instanceof t))throw new TypeError(\\\\\"Cannot call a class as a function\\\\\")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,\\\\\"value\\\\\"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}function i(e,t){if(\\\\\"function\\\\\"!=typeof t&&null!==t)throw new TypeError(\\\\\"Super expression must either be null or a function\\\\\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t);}function r(e){return (r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return (o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){if(\\\\\"undefined\\\\\"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if(\\\\\"function\\\\\"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}function a(e){if(void 0===e)throw new ReferenceError(\\\\\"this hasn't been initialised - super() hasn't been called\\\\\");return e}function u(e,t){return !t||\\\\\"object\\\\\"!=typeof t&&\\\\\"function\\\\\"!=typeof t?a(e):t}function l(e){var t=s();return function(){var n,i=r(e);if(t){var o=r(this).constructor;n=Reflect.construct(i,arguments,o);}else n=i.apply(this,arguments);return u(this,n)}}function d(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}function g(e,t,n){return (g=\\\\\"undefined\\\\\"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=d(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var I=function(){function t(){e(this,t),Object.defineProperty(this,\\\\\"listeners\\\\\",{value:{},writable:!0,configurable:!0});}return n(t,[{key:\\\\\"addEventListener\\\\\",value:function(e,t){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t);}},{key:\\\\\"removeEventListener\\\\\",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],i=0,r=n.length;i<r;i++)if(n[i]===t)return void n.splice(i,1)}},{key:\\\\\"dispatchEvent\\\\\",value:function(e){var t=this;if(e.type in this.listeners){for(var n=function(n){setTimeout((function(){return n.call(t,e)}));},i=this.listeners[e.type],r=0,o=i.length;r<o;r++)n(i[r]);return !e.defaultPrevented}}}]),t}(),f=function(t){i(c,t);var o=l(c);function c(){var t;return e(this,c),(t=o.call(this)).listeners||I.call(a(t)),Object.defineProperty(a(t),\\\\\"aborted\\\\\",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(t),\\\\\"onabort\\\\\",{value:null,writable:!0,configurable:!0}),t}return n(c,[{key:\\\\\"toString\\\\\",value:function(){return \\\\\"[object AbortSignal]\\\\\"}},{key:\\\\\"dispatchEvent\\\\\",value:function(e){\\\\\"abort\\\\\"===e.type&&(this.aborted=!0,\\\\\"function\\\\\"==typeof this.onabort&&this.onabort.call(this,e)),g(r(c.prototype),\\\\\"dispatchEvent\\\\\",this).call(this,e);}}]),c}(I),p=function(){function t(){e(this,t),Object.defineProperty(this,\\\\\"signal\\\\\",{value:new f,writable:!0,configurable:!0});}return n(t,[{key:\\\\\"abort\\\\\",value:function(){var e;try{e=new Event(\\\\\"abort\\\\\");}catch(t){\\\\\"undefined\\\\\"!=typeof document?document.createEvent?(e=document.createEvent(\\\\\"Event\\\\\")).initEvent(\\\\\"abort\\\\\",!1,!1):(e=document.createEventObject()).type=\\\\\"abort\\\\\":e={type:\\\\\"abort\\\\\",bubbles:!1,cancelable:!1};}this.signal.dispatchEvent(e);}},{key:\\\\\"toString\\\\\",value:function(){return \\\\\"[object AbortController]\\\\\"}}]),t}();function h(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log(\\\\\"__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill\\\\\"),!0):\\\\\"function\\\\\"==typeof e.Request&&!e.Request.prototype.hasOwnProperty(\\\\\"signal\\\\\")||!e.AbortController}\\\\\"undefined\\\\\"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]=\\\\\"AbortController\\\\\",f.prototype[Symbol.toStringTag]=\\\\\"AbortSignal\\\\\"),function(e){h(e)&&(e.AbortController=p,e.AbortSignal=f);}(\\\\\"undefined\\\\\"!=typeof self?self:c);}();var pi=a((function(e,t){Object.defineProperty(t,\\\\\"__esModule\\\\\",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var i=e.locked.get(t);void 0===i?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(i.unshift(n),e.locked.set(t,i));},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,i){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n());}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var i=n.pop();e.locked.set(t,n),void 0!==i&&setTimeout(i,0);}else e.locked.delete(t);};}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()};}));s(pi);var hi=s(a((function(e,t){var n=c&&c.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function c(e){try{a(i.next(e));}catch(e){o(e);}}function s(e){try{a(i.throw(e));}catch(e){o(e);}}function a(e){e.done?r(e.value):new n((function(t){t(e.value);})).then(c,s);}a((i=i.apply(e,t||[])).next());}))},i=c&&c.__generator||function(e,t){var n,i,r,o,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\\\\\"function\\\\\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError(\\\\\"Generator is already executing.\\\\\");for(;c;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,i=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){c.label=o[1];break}if(6===o[0]&&c.label<r[1]){c.label=r[1],r=o;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(o);break}r[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c);}catch(e){o=[6,e],i=0;}finally{n=r=0;}if(5&o[0])throw o[1];return {value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,\\\\\"__esModule\\\\\",{value:!0});var r=\\\\\"browser-tabs-lock-key\\\\\";function o(e){return new Promise((function(t){return setTimeout(t,e)}))}function s(e){for(var t=\\\\\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\\\\\",n=\\\\\"\\\\\",i=0;i<e;i++){n+=t[Math.floor(Math.random()*t.length)];}return n}var a=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+s(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[]);}return e.prototype.acquireLock=function(t,c){return void 0===c&&(c=5e3),n(this,void 0,void 0,(function(){var n,a,u,l,d,g;return i(this,(function(i){switch(i.label){case 0:n=Date.now()+s(4),a=Date.now()+c,u=r+\\\\\"-\\\\\"+t,l=window.localStorage,i.label=1;case 1:return Date.now()<a?[4,o(30)]:[3,8];case 2:return i.sent(),null!==l.getItem(u)?[3,5]:(d=this.id+\\\\\"-\\\\\"+t+\\\\\"-\\\\\"+n,[4,o(Math.floor(25*Math.random()))]);case 3:return i.sent(),l.setItem(u,JSON.stringify({id:this.id,iat:n,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return i.sent(),null!==(g=l.getItem(u))&&(g=JSON.parse(g)).id===this.id&&g.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(u,n),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(a)];case 6:i.sent(),i.label=7;case 7:return n=Date.now()+s(4),[3,1];case 8:return [2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,(function(){var r=this;return i(this,(function(o){return setTimeout((function(){return n(r,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return [4,pi.default().lock(t)];case 1:return i.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(r=n.getItem(e))?(pi.default().unlock(t),[2]):((r=JSON.parse(r)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(r)),pi.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(pi.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return [4,new Promise((function(n){var i=!1,r=Date.now(),o=!1;function c(){if(o||(window.removeEventListener(\\\\\"storage\\\\\",c),e.removeFromWaiting(c),clearTimeout(s),o=!0),!i){i=!0;var t=50-(Date.now()-r);t>0?setTimeout(n,t):n();}}window.addEventListener(\\\\\"storage\\\\\",c),e.addToWaiting(c);var s=setTimeout(c,Math.max(0,t-Date.now()));}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t);},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})));},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}));},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,this.releaseLock__private__(e)];case 1:return [2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return n=window.localStorage,o=r+\\\\\"-\\\\\"+t,null===(c=n.getItem(o))?[2]:(c=JSON.parse(c)).id!==this.id?[3,2]:[4,pi.default().lock(c.iat)];case 1:i.sent(),this.acquiredIatSet.delete(c.iat),n.removeItem(o),pi.default().unlock(c.iat),e.notifyWaiters(),i.label=2;case 2:return [2]}}))}))},e.lockCorrector=function(){for(var t=Date.now()-5e3,n=window.localStorage,i=Object.keys(n),o=!1,c=0;c<i.length;c++){var s=i[c];if(s.includes(r)){var a=n.getItem(s);null!==a&&(void 0===(a=JSON.parse(a)).timeRefreshed&&a.timeAcquired<t||void 0!==a.timeRefreshed&&a.timeRefreshed<t)&&(n.removeItem(s),o=!0);}}o&&e.notifyWaiters();},e.waiters=void 0,e}();t.default=a;})));var yi={timeoutInSeconds:60},bi=[\\\\\"login_required\\\\\",\\\\\"consent_required\\\\\",\\\\\"interaction_required\\\\\",\\\\\"account_selection_required\\\\\",\\\\\"access_denied\\\\\"],mi=function(e){function n(t,i){var r=e.call(this,i)||this;return r.error=t,r.error_description=i,Object.setPrototypeOf(r,n.prototype),r}return t(n,e),n.fromPayload=function(e){return new n(e.error,e.error_description)},n}(Error),Bi=function(e){function n(t,i,r,o){void 0===o&&(o=null);var c=e.call(this,t,i)||this;return c.state=r,c.appState=o,Object.setPrototypeOf(c,n.prototype),c}return t(n,e),n}(mi),Fi=function(e){function n(){var t=e.call(this,\\\\\"timeout\\\\\",\\\\\"Timeout\\\\\")||this;return Object.setPrototypeOf(t,n.prototype),t}return t(n,e),n}(mi),vi=function(e){function n(t){var i=e.call(this)||this;return i.popup=t,Object.setPrototypeOf(i,n.prototype),i}return t(n,e),n}(Fi),Ci=function(e,t,n){return void 0===n&&(n=60),new Promise((function(i,r){var o=window.document.createElement(\\\\\"iframe\\\\\");o.setAttribute(\\\\\"width\\\\\",\\\\\"0\\\\\"),o.setAttribute(\\\\\"height\\\\\",\\\\\"0\\\\\"),o.style.display=\\\\\"none\\\\\";var c=function(){window.document.body.contains(o)&&window.document.body.removeChild(o);},s=setTimeout((function(){r(new Fi),c();}),1e3*n),a=function(e){if(e.origin==t&&e.data&&\\\\\"authorization_response\\\\\"===e.data.type){var n=e.source;n&&n.close(),e.data.response.error?r(mi.fromPayload(e.data.response)):i(e.data.response),clearTimeout(s),window.removeEventListener(\\\\\"message\\\\\",a,!1),setTimeout(c,2e3);}};window.addEventListener(\\\\\"message\\\\\",a,!1),window.document.body.appendChild(o),o.setAttribute(\\\\\"src\\\\\",e);}))},Ui=function(e,t){var n,i,r,o=t.popup;if(o?o.location.href=e:(n=e,i=window.screenX+(window.innerWidth-400)/2,r=window.screenY+(window.innerHeight-600)/2,o=window.open(n,\\\\\"auth0:authorize:popup\\\\\",\\\\\"left=\\\\\"+i+\\\\\",top=\\\\\"+r+\\\\\",width=400,height=600,resizable,scrollbars=yes,status=1\\\\\")),!o)throw new Error(\\\\\"Could not open popup\\\\\");return new Promise((function(e,n){var i=setTimeout((function(){n(new vi(o));}),1e3*(t.timeoutInSeconds||60));window.addEventListener(\\\\\"message\\\\\",(function(t){if(t.data&&\\\\\"authorization_response\\\\\"===t.data.type){if(clearTimeout(i),o.close(),t.data.response.error)return n(mi.fromPayload(t.data.response));e(t.data.response);}}));}))},Si=function(){return window.crypto||window.msCrypto},Vi=function(){var e=Si();return e.subtle||e.webkitSubtle},Zi=function(){var e=\\\\\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.\\\\\",t=\\\\\"\\\\\";return Array.from(Si().getRandomValues(new Uint8Array(43))).forEach((function(n){return t+=e[n%e.length]})),t},Xi=function(e){return btoa(e)},Gi=function(e){return Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return encodeURIComponent(t)+\\\\\"=\\\\\"+encodeURIComponent(e[t])})).join(\\\\\"&\\\\\")},wi=function(e){return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return t=Vi().digest({name:\\\\\"SHA-256\\\\\"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise((function(e,n){t.oncomplete=function(t){e(t.target.result);},t.onerror=function(e){n(e.error);},t.onabort=function(){n(\\\\\"The digest operation was aborted\\\\\");};}))]:[4,t];case 1:return [2,n.sent()]}}))}))},Ri=function(e){return function(e){return decodeURIComponent(atob(e).split(\\\\\"\\\\\").map((function(e){return \\\\\"%\\\\\"+(\\\\\"00\\\\\"+e.charCodeAt(0).toString(16)).slice(-2)})).join(\\\\\"\\\\\"))}(e.replace(/_/g,\\\\\"/\\\\\").replace(/-/g,\\\\\"+\\\\\"))},xi=function(e){var t=new Uint8Array(e);return function(e){var t={\\\\\"+\\\\\":\\\\\"-\\\\\",\\\\\"/\\\\\":\\\\\"_\\\\\",\\\\\"=\\\\\":\\\\\"\\\\\"};return e.replace(/[+/=]/g,(function(e){return t[e]}))}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},Ai=function(e,t,i,c,s,a){return r(void 0,void 0,void 0,(function(){var r,u;return o(this,(function(o){switch(o.label){case 0:return a?(delete c.signal,[2,(g=n({url:e,audience:t,scope:i,timeout:s},c),I=a,new Promise((function(e,t){var n=new MessageChannel;n.port1.onmessage=function(n){n.data.error?t(new Error(n.data.error)):e(n.data);},I.postMessage(g,[n.port2]);})))]):[3,1];case 1:return [4,(l=e,d=c,d=d||{},new Promise((function(e,t){var n=new XMLHttpRequest,i=[],r=[],o={},c=function(){return {ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:c,headers:{keys:function(){return i},entries:function(){return r},get:function(e){return o[e.toLowerCase()]},has:function(e){return e.toLowerCase()in o}}}};for(var s in n.open(d.method||\\\\\"get\\\\\",l,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\\\\\\\\S]*([\\\\\\\\s\\\\\\\\S]*?)$/gm,(function(e,t,n){i.push(t=t.toLowerCase()),r.push([t,n]),o[t]=o[t]?o[t]+\\\\\",\\\\\"+n:n;})),e(c());},n.onerror=t,n.withCredentials=\\\\\"include\\\\\"==d.credentials,d.headers)n.setRequestHeader(s,d.headers[s]);n.send(d.body||null);})))];case 2:return r=o.sent(),u={ok:r.ok},[4,r.json()];case 3:return [2,(u.json=o.sent(),u)]}var l,d,g,I;}))}))},Qi=function(e,t,i,r,o,c){void 0===c&&(c=1e4);var s,a=new AbortController,u=a.signal,l=n(n({},r),{signal:u});return Promise.race([Ai(e,t,i,l,c,o),new Promise((function(e,t){s=setTimeout((function(){a.abort(),t(new Error(\\\\\"Timeout when executing 'fetch'\\\\\"));}),c);}))]).finally((function(){clearTimeout(s);}))},Wi=function(e,t,n,c,s,a){return r(void 0,void 0,void 0,(function(){var r,u,l,d,g,I,f,p,h,y;return o(this,(function(o){switch(o.label){case 0:r=null,l=0,o.label=1;case 1:if(!(l<3))return [3,6];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,Qi(e,n,c,s,a,t)];case 3:return u=o.sent(),r=null,[3,6];case 4:return d=o.sent(),r=d,[3,5];case 5:return l++,[3,1];case 6:if(r)throw r.message=r.message||\\\\\"Failed to fetch\\\\\",r;if(g=u.json,I=g.error,f=g.error_description,p=i(g,[\\\\\"error\\\\\",\\\\\"error_description\\\\\"]),!u.ok)throw h=f||\\\\\"HTTP error. Unable to fetch \\\\\"+e,(y=new Error(h)).error=I||\\\\\"request_error\\\\\",y.error_description=h,y;return [2,p]}}))}))},Li=function(e,t){return r(void 0,void 0,void 0,(function(){var r=e.baseUrl,c=e.timeout,s=e.audience,a=e.scope,u=i(e,[\\\\\"baseUrl\\\\\",\\\\\"timeout\\\\\",\\\\\"audience\\\\\",\\\\\"scope\\\\\"]);return o(this,(function(e){switch(e.label){case 0:return [4,Wi(r+\\\\\"/oauth/token\\\\\",c,s||\\\\\"default\\\\\",a,{method:\\\\\"POST\\\\\",body:JSON.stringify(n({redirect_uri:window.location.origin},u)),headers:{\\\\\"Content-type\\\\\":\\\\\"application/json\\\\\"}},t)];case 1:return [2,e.sent()]}}))}))},Hi=function(e){return Array.from(new Set(e))},Ji=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Hi(e.join(\\\\\" \\\\\").trim().split(/\\\\\\\\s+/)).join(\\\\\" \\\\\")},ki=function(e){return \\\\\"@@auth0spajs@@::\\\\\"+e.client_id+\\\\\"::\\\\\"+e.audience+\\\\\"::\\\\\"+e.scope},Ei=function(e){var t=Math.floor(Date.now()/1e3)+e.expires_in;return {body:e,expiresAt:Math.min(t,e.decodedToken.claims.exp)}},Yi=function(){function e(){}return e.prototype.save=function(e){var t=ki(e),n=Ei(e);window.localStorage.setItem(t,JSON.stringify(n));},e.prototype.get=function(e,t){void 0===t&&(t=0);var n=ki(e),i=this.readJson(n),r=Math.floor(Date.now()/1e3);if(i){if(!(i.expiresAt-t<r))return i.body;if(i.body.refresh_token){var o=this.stripData(i);return this.writeJson(n,o),o.body}localStorage.removeItem(n);}},e.prototype.clear=function(){for(var e=localStorage.length-1;e>=0;e--)localStorage.key(e).startsWith(\\\\\"@@auth0spajs@@\\\\\")&&localStorage.removeItem(localStorage.key(e));},e.prototype.readJson=function(e){var t,n=window.localStorage.getItem(e);if(n&&(t=JSON.parse(n)))return t},e.prototype.writeJson=function(e,t){localStorage.setItem(e,JSON.stringify(t));},e.prototype.stripData=function(e){return {body:{refresh_token:e.body.refresh_token},expiresAt:e.expiresAt}},e}(),Ti=function(){this.enclosedCache=function(){var e={body:{},expiresAt:0};return {save:function(t){var n=ki(t),i=Ei(t);e[n]=i;},get:function(t,n){void 0===n&&(n=0);var i=ki(t),r=e[i],o=Math.floor(Date.now()/1e3);if(r)return r.expiresAt-n<o?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},r.body):void delete e[i]:r.body},clear:function(){e={body:{},expiresAt:0};}}}();},Ki=function(){function e(e){this.storage=e,this.transaction=this.storage.get(\\\\\"a0.spajs.txs\\\\\");}return e.prototype.create=function(e){this.transaction=e,this.storage.save(\\\\\"a0.spajs.txs\\\\\",e,{daysUntilExpire:1});},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(\\\\\"a0.spajs.txs\\\\\");},e}(),Ni=function(e){return \\\\\"number\\\\\"==typeof e},Oi=[\\\\\"iss\\\\\",\\\\\"aud\\\\\",\\\\\"exp\\\\\",\\\\\"nbf\\\\\",\\\\\"iat\\\\\",\\\\\"jti\\\\\",\\\\\"azp\\\\\",\\\\\"nonce\\\\\",\\\\\"auth_time\\\\\",\\\\\"at_hash\\\\\",\\\\\"c_hash\\\\\",\\\\\"acr\\\\\",\\\\\"amr\\\\\",\\\\\"sub_jwk\\\\\",\\\\\"cnf\\\\\",\\\\\"sip_from_tag\\\\\",\\\\\"sip_date\\\\\",\\\\\"sip_callid\\\\\",\\\\\"sip_cseq_num\\\\\",\\\\\"sip_via_branch\\\\\",\\\\\"orig\\\\\",\\\\\"dest\\\\\",\\\\\"mky\\\\\",\\\\\"events\\\\\",\\\\\"toe\\\\\",\\\\\"txn\\\\\",\\\\\"rph\\\\\",\\\\\"sid\\\\\",\\\\\"vot\\\\\",\\\\\"vtm\\\\\"],zi=function(e){if(!e.id_token)throw new Error(\\\\\"ID token is required but missing\\\\\");var t=function(e){var t=e.split(\\\\\".\\\\\"),n=t[0],i=t[1],r=t[2];if(3!==t.length||!n||!i||!r)throw new Error(\\\\\"ID token could not be decoded\\\\\");var o=JSON.parse(Ri(i)),c={__raw:e},s={};return Object.keys(o).forEach((function(e){c[e]=o[e],Oi.includes(e)||(s[e]=o[e]);})),{encoded:{header:n,payload:i,signature:r},header:JSON.parse(Ri(n)),claims:c,user:s}}(e.id_token);if(!t.claims.iss)throw new Error(\\\\\"Issuer (iss) claim must be a string present in the ID token\\\\\");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected \\\\\"'+e.iss+'\\\\\", found \\\\\"'+t.claims.iss+'\\\\\"');if(!t.user.sub)throw new Error(\\\\\"Subject (sub) claim must be a string present in the ID token\\\\\");if(\\\\\"RS256\\\\\"!==t.header.alg)throw new Error('Signature algorithm of \\\\\"'+t.header.alg+'\\\\\" is not supported. Expected the ID token to be signed with \\\\\"RS256\\\\\".');if(!t.claims.aud||\\\\\"string\\\\\"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error(\\\\\"Audience (aud) claim must be a string or array of strings present in the ID token\\\\\");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected \\\\\"'+e.aud+'\\\\\" but was not one of \\\\\"'+t.claims.aud.join(\\\\\", \\\\\")+'\\\\\"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error(\\\\\"Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values\\\\\");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected \\\\\"'+e.aud+'\\\\\", found \\\\\"'+t.claims.azp+'\\\\\"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected \\\\\"'+e.aud+'\\\\\" but found \\\\\"'+t.claims.aud+'\\\\\"');if(e.nonce){if(!t.claims.nonce)throw new Error(\\\\\"Nonce (nonce) claim must be a string present in the ID token\\\\\");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected \\\\\"'+e.nonce+'\\\\\", found \\\\\"'+t.claims.nonce+'\\\\\"')}if(e.max_age&&!Ni(t.claims.auth_time))throw new Error(\\\\\"Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified\\\\\");if(!Ni(t.claims.exp))throw new Error(\\\\\"Expiration Time (exp) claim must be a number present in the ID token\\\\\");if(!Ni(t.claims.iat))throw new Error(\\\\\"Issued At (iat) claim must be a number present in the ID token\\\\\");var n=e.leeway||60,i=new Date(Date.now()),r=new Date(0),o=new Date(0),c=new Date(0);if(c.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),r.setUTCSeconds(t.claims.exp+n),o.setUTCSeconds(t.claims.nbf-n),i>r)throw new Error(\\\\\"Expiration Time (exp) claim error in the ID token; current time (\\\\\"+i+\\\\\") is after expiration time (\\\\\"+r+\\\\\")\\\\\");if(Ni(t.claims.nbf)&&i<o)throw new Error(\\\\\"Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (\\\\\"+i+\\\\\") is before \\\\\"+o);if(Ni(t.claims.auth_time)&&i>c)throw new Error(\\\\\"Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (\\\\\"+i+\\\\\") is after last auth at \\\\\"+c);return t},ji=a((function(e,t){var n=c&&c.__assign||function(){return (n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function i(e,t){if(!t)return \\\\\"\\\\\";var n=\\\\\"; \\\\\"+e;return !0===t?n:n+\\\\\"=\\\\\"+t}function r(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\\\\\\\\(/g,\\\\\"%28\\\\\").replace(/\\\\\\\\)/g,\\\\\"%29\\\\\")+\\\\\"=\\\\\"+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if(\\\\\"number\\\\\"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t;}return i(\\\\\"Expires\\\\\",e.expires?e.expires.toUTCString():\\\\\"\\\\\")+i(\\\\\"Domain\\\\\",e.domain)+i(\\\\\"Path\\\\\",e.path)+i(\\\\\"Secure\\\\\",e.secure)+i(\\\\\"SameSite\\\\\",e.sameSite)}(n)}function o(e){for(var t={},n=e?e.split(\\\\\"; \\\\\"):[],i=/(%[\\\\\\\\dA-F]{2})+/gi,r=0;r<n.length;r++){var o=n[r].split(\\\\\"=\\\\\"),c=o.slice(1).join(\\\\\"=\\\\\");'\\\\\"'===c.charAt(0)&&(c=c.slice(1,-1));try{t[o[0].replace(i,decodeURIComponent)]=c.replace(i,decodeURIComponent);}catch(e){}}return t}function s(){return o(document.cookie)}function a(e,t,i){document.cookie=r(e,t,n({path:\\\\\"/\\\\\"},i));}t.__esModule=!0,t.encode=r,t.parse=o,t.getAll=s,t.get=function(e){return s()[e]},t.set=a,t.remove=function(e,t){a(e,\\\\\"\\\\\",n(n({},t),{expires:-1}));};}));s(ji);ji.encode,ji.parse,ji.getAll;var Pi=ji.get,_i=ji.set,Di=ji.remove,Mi={get:function(e){var t=Pi(e);if(void 0!==t)return JSON.parse(t)},save:function(e,t,n){var i={};\\\\\"https:\\\\\"===window.location.protocol&&(i={secure:!0,sameSite:\\\\\"none\\\\\"}),i.expires=n.daysUntilExpire,_i(e,JSON.stringify(t),i);},remove:function(e){Di(e);}},qi={get:function(e){var t=Mi.get(e);return t||Mi.get(\\\\\"_legacy_\\\\\"+e)},save:function(e,t,n){var i={};\\\\\"https:\\\\\"===window.location.protocol&&(i={secure:!0}),i.expires=n.daysUntilExpire,_i(\\\\\"_legacy_\\\\\"+e,JSON.stringify(t),i),Mi.save(e,t,n);},remove:function(e){Mi.remove(e),Mi.remove(\\\\\"_legacy_\\\\\"+e);}},$i={get:function(e){if(\\\\\"undefined\\\\\"!=typeof sessionStorage){var t=sessionStorage.getItem(e);if(void 0!==t)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t));},remove:function(e){sessionStorage.removeItem(e);}};function er(e,t,n){var i=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var i=new Uint8Array(n.length),r=0,o=n.length;r<o;++r)i[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return n}(e,void 0!==n&&n),o=r.indexOf(\\\\\"\\\\\",10)+1,c=r.substring(o)+(i?\\\\\"//# sourceMappingURL=\\\\\"+i:\\\\\"\\\\\"),s=new Blob([c],{type:\\\\\"application/javascript\\\\\"});return URL.createObjectURL(s)}var tr,nr,ir,rr,or=(tr=\\\\\"Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwovKiEgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQ29weXJpZ2h0IChjKSBNaWNyb3NvZnQgQ29ycG9yYXRpb24uIEFsbCByaWdodHMgcmVzZXJ2ZWQuCkxpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOyB5b3UgbWF5IG5vdCB1c2UKdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUKTGljZW5zZSBhdCBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKClRISVMgQ09ERSBJUyBQUk9WSURFRCBPTiBBTiAqQVMgSVMqIEJBU0lTLCBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkKS0lORCwgRUlUSEVSIEVYUFJFU1MgT1IgSU1QTElFRCwgSU5DTFVESU5HIFdJVEhPVVQgTElNSVRBVElPTiBBTlkgSU1QTElFRApXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgVElUTEUsIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLApNRVJDSEFOVEFCTElUWSBPUiBOT04tSU5GUklOR0VNRU5ULgoKU2VlIHRoZSBBcGFjaGUgVmVyc2lvbiAyLjAgTGljZW5zZSBmb3Igc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zCmFuZCBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KdmFyIGU9ZnVuY3Rpb24oKXtyZXR1cm4oZT1PYmplY3QuYXNzaWdufHxmdW5jdGlvbihlKXtmb3IodmFyIHIsdD0xLG49YXJndW1lbnRzLmxlbmd0aDt0PG47dCsrKWZvcih2YXIgbyBpbiByPWFyZ3VtZW50c1t0XSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocixvKSYmKGVbb109cltvXSk7cmV0dXJuIGV9KS5hcHBseSh0aGlzLGFyZ3VtZW50cyl9O2Z1bmN0aW9uIHIoZSxyKXt2YXIgdCxuLG8scyxhPXtsYWJlbDowLHNlbnQ6ZnVuY3Rpb24oKXtpZigxJm9bMF0pdGhyb3cgb1sxXTtyZXR1cm4gb1sxXX0sdHJ5czpbXSxvcHM6W119O3JldHVybiBzPXtuZXh0OmkoMCksdGhyb3c6aSgxKSxyZXR1cm46aSgyKX0sImZ1bmN0aW9uIj09dHlwZW9mIFN5bWJvbCYmKHNbU3ltYm9sLml0ZXJhdG9yXT1mdW5jdGlvbigpe3JldHVybiB0aGlzfSkscztmdW5jdGlvbiBpKHMpe3JldHVybiBmdW5jdGlvbihpKXtyZXR1cm4gZnVuY3Rpb24ocyl7aWYodCl0aHJvdyBuZXcgVHlwZUVycm9yKCJHZW5lcmF0b3IgaXMgYWxyZWFkeSBleGVjdXRpbmcuIik7Zm9yKDthOyl0cnl7aWYodD0xLG4mJihvPTImc1swXT9uLnJldHVybjpzWzBdP24udGhyb3d8fCgobz1uLnJldHVybikmJm8uY2FsbChuKSwwKTpuLm5leHQpJiYhKG89by5jYWxsKG4sc1sxXSkpLmRvbmUpcmV0dXJuIG87c3dpdGNoKG49MCxvJiYocz1bMiZzWzBdLG8udmFsdWVdKSxzWzBdKXtjYXNlIDA6Y2FzZSAxOm89czticmVhaztjYXNlIDQ6cmV0dXJuIGEubGFiZWwrKyx7dmFsdWU6c1sxXSxkb25lOiExfTtjYXNlIDU6YS5sYWJlbCsrLG49c1sxXSxzPVswXTtjb250aW51ZTtjYXNlIDc6cz1hLm9wcy5wb3AoKSxhLnRyeXMucG9wKCk7Y29udGludWU7ZGVmYXVsdDppZighKG89YS50cnlzLChvPW8ubGVuZ3RoPjAmJm9bby5sZW5ndGgtMV0pfHw2IT09c1swXSYmMiE9PXNbMF0pKXthPTA7Y29udGludWV9aWYoMz09PXNbMF0mJighb3x8c1sxXT5vWzBdJiZzWzFdPG9bM10pKXthLmxhYmVsPXNbMV07YnJlYWt9aWYoNj09PXNbMF0mJmEubGFiZWw8b1sxXSl7YS5sYWJlbD1vWzFdLG89czticmVha31pZihvJiZhLmxhYmVsPG9bMl0pe2EubGFiZWw9b1syXSxhLm9wcy5wdXNoKHMpO2JyZWFrfW9bMl0mJmEub3BzLnBvcCgpLGEudHJ5cy5wb3AoKTtjb250aW51ZX1zPXIuY2FsbChlLGEpfWNhdGNoKGUpe3M9WzYsZV0sbj0wfWZpbmFsbHl7dD1vPTB9aWYoNSZzWzBdKXRocm93IHNbMV07cmV0dXJue3ZhbHVlOnNbMF0/c1sxXTp2b2lkIDAsZG9uZTohMH19KFtzLGldKX19fXZhciB0PXt9LG49ZnVuY3Rpb24oZSxyKXtyZXR1cm4gZSsifCIrcn07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGZ1bmN0aW9uKG8pe3ZhciBzLGEsaSx1LGMsbCxmLHAsaCx5LGI7cmV0dXJuIHA9dm9pZCAwLGg9dm9pZCAwLGI9ZnVuY3Rpb24oKXt2YXIgcCxoLHksYixkLHYsdyxnO3JldHVybiByKHRoaXMsKGZ1bmN0aW9uKHIpe3N3aXRjaChyLmxhYmVsKXtjYXNlIDA6cz1vLmRhdGEsYT1zLnVybCxpPXMudGltZW91dCx1PXMuYXVkaWVuY2UsYz1zLnNjb3BlLGw9ZnVuY3Rpb24oZSxyKXt2YXIgdD17fTtmb3IodmFyIG4gaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxuKSYmci5pbmRleE9mKG4pPDAmJih0W25dPWVbbl0pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihuPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxuLmxlbmd0aDtvKyspci5pbmRleE9mKG5bb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLG5bb10pJiYodFtuW29dXT1lW25bb11dKX1yZXR1cm4gdH0ocyxbInVybCIsInRpbWVvdXQiLCJhdWRpZW5jZSIsInNjb3BlIl0pLGY9by5wb3J0c1swXSxyLmxhYmVsPTE7Y2FzZSAxOmlmKHIudHJ5cy5wdXNoKFsxLDcsLDhdKSwhKGg9SlNPTi5wYXJzZShsLmJvZHkpKS5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1oLmdyYW50X3R5cGUpe2lmKCEoeT1mdW5jdGlvbihlLHIpe3JldHVybiB0W24oZSxyKV19KHUsYykpKXRocm93IG5ldyBFcnJvcigiVGhlIHdlYiB3b3JrZXIgaXMgbWlzc2luZyB0aGUgcmVmcmVzaCB0b2tlbiIpO2wuYm9keT1KU09OLnN0cmluZ2lmeShlKGUoe30saCkse3JlZnJlc2hfdG9rZW46eX0pKX1iPW5ldyBBYm9ydENvbnRyb2xsZXIsZD1iLnNpZ25hbCx2PXZvaWQgMCxyLmxhYmVsPTI7Y2FzZSAyOnJldHVybiByLnRyeXMucHVzaChbMiw0LCw1XSksWzQsUHJvbWlzZS5yYWNlKFsoaz1pLG5ldyBQcm9taXNlKChmdW5jdGlvbihlKXtyZXR1cm4gc2V0VGltZW91dChlLGspfSkpKSxmZXRjaChhLGUoZSh7fSxsKSx7c2lnbmFsOmR9KSldKV07Y2FzZSAzOnJldHVybiB2PXIuc2VudCgpLFszLDVdO2Nhc2UgNDpyZXR1cm4gdz1yLnNlbnQoKSxmLnBvc3RNZXNzYWdlKHtlcnJvcjp3Lm1lc3NhZ2V9KSxbMl07Y2FzZSA1OnJldHVybiB2P1s0LHYuanNvbigpXTooYi5hYm9ydCgpLFsyXSk7Y2FzZSA2OnJldHVybihwPXIuc2VudCgpKS5yZWZyZXNoX3Rva2VuPyhmdW5jdGlvbihlLHIsbyl7dFtuKHIsbyldPWV9KHAucmVmcmVzaF90b2tlbix1LGMpLGRlbGV0ZSBwLnJlZnJlc2hfdG9rZW4pOmZ1bmN0aW9uKGUscil7ZGVsZXRlIHRbbihlLHIpXX0odSxjKSxmLnBvc3RNZXNzYWdlKHtvazp2Lm9rLGpzb246cH0pLFszLDhdO2Nhc2UgNzpyZXR1cm4gZz1yLnNlbnQoKSxmLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcl9kZXNjcmlwdGlvbjpnLm1lc3NhZ2V9fSksWzMsOF07Y2FzZSA4OnJldHVyblsyXX12YXIga30pKX0sbmV3KCh5PXZvaWQgMCl8fCh5PVByb21pc2UpKSgoZnVuY3Rpb24oZSxyKXtmdW5jdGlvbiB0KGUpe3RyeXtvKGIubmV4dChlKSl9Y2F0Y2goZSl7cihlKX19ZnVuY3Rpb24gbihlKXt0cnl7byhiLnRocm93KGUpKX1jYXRjaChlKXtyKGUpfX1mdW5jdGlvbiBvKHIpe3IuZG9uZT9lKHIudmFsdWUpOm5ldyB5KChmdW5jdGlvbihlKXtlKHIudmFsdWUpfSkpLnRoZW4odCxuKX1vKChiPWIuYXBwbHkocCxofHxbXSkpLm5leHQoKSl9KSl9KSk7Cgo=\\\\\",nr=\\\\\"data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4ud29ya2VyLmpzIiwic291cmNlcyI6WyJ3b3JrZXI6Ly93ZWItd29ya2VyL25vZGVfbW9kdWxlcy90c2xpYi90c2xpYi5lczYuanMiLCJ3b3JrZXI6Ly93ZWItd29ya2VyL3NyYy9jb25zdGFudHMudHMiLCJ3b3JrZXI6Ly93ZWItd29ya2VyL3NyYy90b2tlbi53b3JrZXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyohICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXHJcbkNvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLiBBbGwgcmlnaHRzIHJlc2VydmVkLlxyXG5MaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpOyB5b3UgbWF5IG5vdCB1c2VcclxudGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGVcclxuTGljZW5zZSBhdCBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjBcclxuXHJcblRISVMgQ09ERSBJUyBQUk9WSURFRCBPTiBBTiAqQVMgSVMqIEJBU0lTLCBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTllcclxuS0lORCwgRUlUSEVSIEVYUFJFU1MgT1IgSU1QTElFRCwgSU5DTFVESU5HIFdJVEhPVVQgTElNSVRBVElPTiBBTlkgSU1QTElFRFxyXG5XQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgVElUTEUsIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLFxyXG5NRVJDSEFOVEFCTElUWSBPUiBOT04tSU5GUklOR0VNRU5ULlxyXG5cclxuU2VlIHRoZSBBcGFjaGUgVmVyc2lvbiAyLjAgTGljZW5zZSBmb3Igc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zXHJcbmFuZCBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS5cclxuKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi9cclxuLyogZ2xvYmFsIFJlZmxlY3QsIFByb21pc2UgKi9cclxuXHJcbnZhciBleHRlbmRTdGF0aWNzID0gZnVuY3Rpb24oZCwgYikge1xyXG4gICAgZXh0ZW5kU3RhdGljcyA9IE9iamVjdC5zZXRQcm90b3R5cGVPZiB8fFxyXG4gICAgICAgICh7IF9fcHJvdG9fXzogW10gfSBpbnN0YW5jZW9mIEFycmF5ICYmIGZ1bmN0aW9uIChkLCBiKSB7IGQuX19wcm90b19fID0gYjsgfSkgfHxcclxuICAgICAgICBmdW5jdGlvbiAoZCwgYikgeyBmb3IgKHZhciBwIGluIGIpIGlmIChiLmhhc093blByb3BlcnR5KHApKSBkW3BdID0gYltwXTsgfTtcclxuICAgIHJldHVybiBleHRlbmRTdGF0aWNzKGQsIGIpO1xyXG59O1xyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9fZXh0ZW5kcyhkLCBiKSB7XHJcbiAgICBleHRlbmRTdGF0aWNzKGQsIGIpO1xyXG4gICAgZnVuY3Rpb24gX18oKSB7IHRoaXMuY29uc3RydWN0b3IgPSBkOyB9XHJcbiAgICBkLnByb3RvdHlwZSA9IGIgPT09IG51bGwgPyBPYmplY3QuY3JlYXRlKGIpIDogKF9fLnByb3RvdHlwZSA9IGIucHJvdG90eXBlLCBuZXcgX18oKSk7XHJcbn1cclxuXHJcbmV4cG9ydCB2YXIgX19hc3NpZ24gPSBmdW5jdGlvbigpIHtcclxuICAgIF9fYXNzaWduID0gT2JqZWN0LmFzc2lnbiB8fCBmdW5jdGlvbiBfX2Fzc2lnbih0KSB7XHJcbiAgICAgICAgZm9yICh2YXIgcywgaSA9IDEsIG4gPSBhcmd1bWVudHMubGVuZ3RoOyBpIDwgbjsgaSsrKSB7XHJcbiAgICAgICAgICAgIHMgPSBhcmd1bWVudHNbaV07XHJcbiAgICAgICAgICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSkgdFtwXSA9IHNbcF07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0O1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIF9fYXNzaWduLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBfX3Jlc3QocywgZSkge1xyXG4gICAgdmFyIHQgPSB7fTtcclxuICAgIGZvciAodmFyIHAgaW4gcykgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChzLCBwKSAmJiBlLmluZGV4T2YocCkgPCAwKVxyXG4gICAgICAgIHRbcF0gPSBzW3BdO1xyXG4gICAgaWYgKHMgIT0gbnVsbCAmJiB0eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyA9PT0gXCJmdW5jdGlvblwiKVxyXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBwID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyhzKTsgaSA8IHAubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgaWYgKGUuaW5kZXhPZihwW2ldKSA8IDAgJiYgT2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZS5jYWxsKHMsIHBbaV0pKVxyXG4gICAgICAgICAgICAgICAgdFtwW2ldXSA9IHNbcFtpXV07XHJcbiAgICAgICAgfVxyXG4gICAgcmV0dXJuIHQ7XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBfX2RlY29yYXRlKGRlY29yYXRvcnMsIHRhcmdldCwga2V5LCBkZXNjKSB7XHJcbiAgICB2YXIgYyA9IGFyZ3VtZW50cy5sZW5ndGgsIHIgPSBjIDwgMyA/IHRhcmdldCA6IGRlc2MgPT09IG51bGwgPyBkZXNjID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcih0YXJnZXQsIGtleSkgOiBkZXNjLCBkO1xyXG4gICAgaWYgKHR5cGVvZiBSZWZsZWN0ID09PSBcIm9iamVjdFwiICYmIHR5cGVvZiBSZWZsZWN0LmRlY29yYXRlID09PSBcImZ1bmN0aW9uXCIpIHIgPSBSZWZsZWN0LmRlY29yYXRlKGRlY29yYXRvcnMsIHRhcmdldCwga2V5LCBkZXNjKTtcclxuICAgIGVsc2UgZm9yICh2YXIgaSA9IGRlY29yYXRvcnMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIGlmIChkID0gZGVjb3JhdG9yc1tpXSkgciA9IChjIDwgMyA/IGQocikgOiBjID4gMyA/IGQodGFyZ2V0LCBrZXksIHIpIDogZCh0YXJnZXQsIGtleSkpIHx8IHI7XHJcbiAgICByZXR1cm4gYyA+IDMgJiYgciAmJiBPYmplY3QuZGVmaW5lUHJvcGVydHkodGFyZ2V0LCBrZXksIHIpLCByO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19wYXJhbShwYXJhbUluZGV4LCBkZWNvcmF0b3IpIHtcclxuICAgIHJldHVybiBmdW5jdGlvbiAodGFyZ2V0LCBrZXkpIHsgZGVjb3JhdG9yKHRhcmdldCwga2V5LCBwYXJhbUluZGV4KTsgfVxyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19tZXRhZGF0YShtZXRhZGF0YUtleSwgbWV0YWRhdGFWYWx1ZSkge1xyXG4gICAgaWYgKHR5cGVvZiBSZWZsZWN0ID09PSBcIm9iamVjdFwiICYmIHR5cGVvZiBSZWZsZWN0Lm1ldGFkYXRhID09PSBcImZ1bmN0aW9uXCIpIHJldHVybiBSZWZsZWN0Lm1ldGFkYXRhKG1ldGFkYXRhS2V5LCBtZXRhZGF0YVZhbHVlKTtcclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9fYXdhaXRlcih0aGlzQXJnLCBfYXJndW1lbnRzLCBQLCBnZW5lcmF0b3IpIHtcclxuICAgIHJldHVybiBuZXcgKFAgfHwgKFAgPSBQcm9taXNlKSkoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgIGZ1bmN0aW9uIGZ1bGZpbGxlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvci5uZXh0KHZhbHVlKSk7IH0gY2F0Y2ggKGUpIHsgcmVqZWN0KGUpOyB9IH1cclxuICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvcltcInRocm93XCJdKHZhbHVlKSk7IH0gY2F0Y2ggKGUpIHsgcmVqZWN0KGUpOyB9IH1cclxuICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IG5ldyBQKGZ1bmN0aW9uIChyZXNvbHZlKSB7IHJlc29sdmUocmVzdWx0LnZhbHVlKTsgfSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfVxyXG4gICAgICAgIHN0ZXAoKGdlbmVyYXRvciA9IGdlbmVyYXRvci5hcHBseSh0aGlzQXJnLCBfYXJndW1lbnRzIHx8IFtdKSkubmV4dCgpKTtcclxuICAgIH0pO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19nZW5lcmF0b3IodGhpc0FyZywgYm9keSkge1xyXG4gICAgdmFyIF8gPSB7IGxhYmVsOiAwLCBzZW50OiBmdW5jdGlvbigpIHsgaWYgKHRbMF0gJiAxKSB0aHJvdyB0WzFdOyByZXR1cm4gdFsxXTsgfSwgdHJ5czogW10sIG9wczogW10gfSwgZiwgeSwgdCwgZztcclxuICAgIHJldHVybiBnID0geyBuZXh0OiB2ZXJiKDApLCBcInRocm93XCI6IHZlcmIoMSksIFwicmV0dXJuXCI6IHZlcmIoMikgfSwgdHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblwiICYmIChnW1N5bWJvbC5pdGVyYXRvcl0gPSBmdW5jdGlvbigpIHsgcmV0dXJuIHRoaXM7IH0pLCBnO1xyXG4gICAgZnVuY3Rpb24gdmVyYihuKSB7IHJldHVybiBmdW5jdGlvbiAodikgeyByZXR1cm4gc3RlcChbbiwgdl0pOyB9OyB9XHJcbiAgICBmdW5jdGlvbiBzdGVwKG9wKSB7XHJcbiAgICAgICAgaWYgKGYpIHRocm93IG5ldyBUeXBlRXJyb3IoXCJHZW5lcmF0b3IgaXMgYWxyZWFkeSBleGVjdXRpbmcuXCIpO1xyXG4gICAgICAgIHdoaWxlIChfKSB0cnkge1xyXG4gICAgICAgICAgICBpZiAoZiA9IDEsIHkgJiYgKHQgPSBvcFswXSAmIDIgPyB5W1wicmV0dXJuXCJdIDogb3BbMF0gPyB5W1widGhyb3dcIl0gfHwgKCh0ID0geVtcInJldHVyblwiXSkgJiYgdC5jYWxsKHkpLCAwKSA6IHkubmV4dCkgJiYgISh0ID0gdC5jYWxsKHksIG9wWzFdKSkuZG9uZSkgcmV0dXJuIHQ7XHJcbiAgICAgICAgICAgIGlmICh5ID0gMCwgdCkgb3AgPSBbb3BbMF0gJiAyLCB0LnZhbHVlXTtcclxuICAgICAgICAgICAgc3dpdGNoIChvcFswXSkge1xyXG4gICAgICAgICAgICAgICAgY2FzZSAwOiBjYXNlIDE6IHQgPSBvcDsgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDQ6IF8ubGFiZWwrKzsgcmV0dXJuIHsgdmFsdWU6IG9wWzFdLCBkb25lOiBmYWxzZSB9O1xyXG4gICAgICAgICAgICAgICAgY2FzZSA1OiBfLmxhYmVsKys7IHkgPSBvcFsxXTsgb3AgPSBbMF07IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA3OiBvcCA9IF8ub3BzLnBvcCgpOyBfLnRyeXMucG9wKCk7IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICBpZiAoISh0ID0gXy50cnlzLCB0ID0gdC5sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDMgJiYgKCF0IHx8IChvcFsxXSA+IHRbMF0gJiYgb3BbMV0gPCB0WzNdKSkpIHsgXy5sYWJlbCA9IG9wWzFdOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcFswXSA9PT0gNiAmJiBfLmxhYmVsIDwgdFsxXSkgeyBfLmxhYmVsID0gdFsxXTsgdCA9IG9wOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ICYmIF8ubGFiZWwgPCB0WzJdKSB7IF8ubGFiZWwgPSB0WzJdOyBfLm9wcy5wdXNoKG9wKTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodFsyXSkgXy5vcHMucG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBvcCA9IGJvZHkuY2FsbCh0aGlzQXJnLCBfKTtcclxuICAgICAgICB9IGNhdGNoIChlKSB7IG9wID0gWzYsIGVdOyB5ID0gMDsgfSBmaW5hbGx5IHsgZiA9IHQgPSAwOyB9XHJcbiAgICAgICAgaWYgKG9wWzBdICYgNSkgdGhyb3cgb3BbMV07IHJldHVybiB7IHZhbHVlOiBvcFswXSA/IG9wWzFdIDogdm9pZCAwLCBkb25lOiB0cnVlIH07XHJcbiAgICB9XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBfX2V4cG9ydFN0YXIobSwgZXhwb3J0cykge1xyXG4gICAgZm9yICh2YXIgcCBpbiBtKSBpZiAoIWV4cG9ydHMuaGFzT3duUHJvcGVydHkocCkpIGV4cG9ydHNbcF0gPSBtW3BdO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX192YWx1ZXMobykge1xyXG4gICAgdmFyIG0gPSB0eXBlb2YgU3ltYm9sID09PSBcImZ1bmN0aW9uXCIgJiYgb1tTeW1ib2wuaXRlcmF0b3JdLCBpID0gMDtcclxuICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pO1xyXG4gICAgcmV0dXJuIHtcclxuICAgICAgICBuZXh0OiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7XHJcbiAgICAgICAgICAgIHJldHVybiB7IHZhbHVlOiBvICYmIG9baSsrXSwgZG9uZTogIW8gfTtcclxuICAgICAgICB9XHJcbiAgICB9O1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19yZWFkKG8sIG4pIHtcclxuICAgIHZhciBtID0gdHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblwiICYmIG9bU3ltYm9sLml0ZXJhdG9yXTtcclxuICAgIGlmICghbSkgcmV0dXJuIG87XHJcbiAgICB2YXIgaSA9IG0uY2FsbChvKSwgciwgYXIgPSBbXSwgZTtcclxuICAgIHRyeSB7XHJcbiAgICAgICAgd2hpbGUgKChuID09PSB2b2lkIDAgfHwgbi0tID4gMCkgJiYgIShyID0gaS5uZXh0KCkpLmRvbmUpIGFyLnB1c2goci52YWx1ZSk7XHJcbiAgICB9XHJcbiAgICBjYXRjaCAoZXJyb3IpIHsgZSA9IHsgZXJyb3I6IGVycm9yIH07IH1cclxuICAgIGZpbmFsbHkge1xyXG4gICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIGlmIChyICYmICFyLmRvbmUgJiYgKG0gPSBpW1wicmV0dXJuXCJdKSkgbS5jYWxsKGkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBmaW5hbGx5IHsgaWYgKGUpIHRocm93IGUuZXJyb3I7IH1cclxuICAgIH1cclxuICAgIHJldHVybiBhcjtcclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9fc3ByZWFkKCkge1xyXG4gICAgZm9yICh2YXIgYXIgPSBbXSwgaSA9IDA7IGkgPCBhcmd1bWVudHMubGVuZ3RoOyBpKyspXHJcbiAgICAgICAgYXIgPSBhci5jb25jYXQoX19yZWFkKGFyZ3VtZW50c1tpXSkpO1xyXG4gICAgcmV0dXJuIGFyO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19zcHJlYWRBcnJheXMoKSB7XHJcbiAgICBmb3IgKHZhciBzID0gMCwgaSA9IDAsIGlsID0gYXJndW1lbnRzLmxlbmd0aDsgaSA8IGlsOyBpKyspIHMgKz0gYXJndW1lbnRzW2ldLmxlbmd0aDtcclxuICAgIGZvciAodmFyIHIgPSBBcnJheShzKSwgayA9IDAsIGkgPSAwOyBpIDwgaWw7IGkrKylcclxuICAgICAgICBmb3IgKHZhciBhID0gYXJndW1lbnRzW2ldLCBqID0gMCwgamwgPSBhLmxlbmd0aDsgaiA8IGpsOyBqKyssIGsrKylcclxuICAgICAgICAgICAgcltrXSA9IGFbal07XHJcbiAgICByZXR1cm4gcjtcclxufTtcclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBfX2F3YWl0KHYpIHtcclxuICAgIHJldHVybiB0aGlzIGluc3RhbmNlb2YgX19hd2FpdCA/ICh0aGlzLnYgPSB2LCB0aGlzKSA6IG5ldyBfX2F3YWl0KHYpO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19hc3luY0dlbmVyYXRvcih0aGlzQXJnLCBfYXJndW1lbnRzLCBnZW5lcmF0b3IpIHtcclxuICAgIGlmICghU3ltYm9sLmFzeW5jSXRlcmF0b3IpIHRocm93IG5ldyBUeXBlRXJyb3IoXCJTeW1ib2wuYXN5bmNJdGVyYXRvciBpcyBub3QgZGVmaW5lZC5cIik7XHJcbiAgICB2YXIgZyA9IGdlbmVyYXRvci5hcHBseSh0aGlzQXJnLCBfYXJndW1lbnRzIHx8IFtdKSwgaSwgcSA9IFtdO1xyXG4gICAgcmV0dXJuIGkgPSB7fSwgdmVyYihcIm5leHRcIiksIHZlcmIoXCJ0aHJvd1wiKSwgdmVyYihcInJldHVyblwiKSwgaVtTeW1ib2wuYXN5bmNJdGVyYXRvcl0gPSBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9LCBpO1xyXG4gICAgZnVuY3Rpb24gdmVyYihuKSB7IGlmIChnW25dKSBpW25dID0gZnVuY3Rpb24gKHYpIHsgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChhLCBiKSB7IHEucHVzaChbbiwgdiwgYSwgYl0pID4gMSB8fCByZXN1bWUobiwgdik7IH0pOyB9OyB9XHJcbiAgICBmdW5jdGlvbiByZXN1bWUobiwgdikgeyB0cnkgeyBzdGVwKGdbbl0odikpOyB9IGNhdGNoIChlKSB7IHNldHRsZShxWzBdWzNdLCBlKTsgfSB9XHJcbiAgICBmdW5jdGlvbiBzdGVwKHIpIHsgci52YWx1ZSBpbnN0YW5jZW9mIF9fYXdhaXQgPyBQcm9taXNlLnJlc29sdmUoci52YWx1ZS52KS50aGVuKGZ1bGZpbGwsIHJlamVjdCkgOiBzZXR0bGUocVswXVsyXSwgcik7IH1cclxuICAgIGZ1bmN0aW9uIGZ1bGZpbGwodmFsdWUpIHsgcmVzdW1lKFwibmV4dFwiLCB2YWx1ZSk7IH1cclxuICAgIGZ1bmN0aW9uIHJlamVjdCh2YWx1ZSkgeyByZXN1bWUoXCJ0aHJvd1wiLCB2YWx1ZSk7IH1cclxuICAgIGZ1bmN0aW9uIHNldHRsZShmLCB2KSB7IGlmIChmKHYpLCBxLnNoaWZ0KCksIHEubGVuZ3RoKSByZXN1bWUocVswXVswXSwgcVswXVsxXSk7IH1cclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9fYXN5bmNEZWxlZ2F0b3Iobykge1xyXG4gICAgdmFyIGksIHA7XHJcbiAgICByZXR1cm4gaSA9IHt9LCB2ZXJiKFwibmV4dFwiKSwgdmVyYihcInRocm93XCIsIGZ1bmN0aW9uIChlKSB7IHRocm93IGU7IH0pLCB2ZXJiKFwicmV0dXJuXCIpLCBpW1N5bWJvbC5pdGVyYXRvcl0gPSBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9LCBpO1xyXG4gICAgZnVuY3Rpb24gdmVyYihuLCBmKSB7IGlbbl0gPSBvW25dID8gZnVuY3Rpb24gKHYpIHsgcmV0dXJuIChwID0gIXApID8geyB2YWx1ZTogX19hd2FpdChvW25dKHYpKSwgZG9uZTogbiA9PT0gXCJyZXR1cm5cIiB9IDogZiA/IGYodikgOiB2OyB9IDogZjsgfVxyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19hc3luY1ZhbHVlcyhvKSB7XHJcbiAgICBpZiAoIVN5bWJvbC5hc3luY0l0ZXJhdG9yKSB0aHJvdyBuZXcgVHlwZUVycm9yKFwiU3ltYm9sLmFzeW5jSXRlcmF0b3IgaXMgbm90IGRlZmluZWQuXCIpO1xyXG4gICAgdmFyIG0gPSBvW1N5bWJvbC5hc3luY0l0ZXJhdG9yXSwgaTtcclxuICAgIHJldHVybiBtID8gbS5jYWxsKG8pIDogKG8gPSB0eXBlb2YgX192YWx1ZXMgPT09IFwiZnVuY3Rpb25cIiA/IF9fdmFsdWVzKG8pIDogb1tTeW1ib2wuaXRlcmF0b3JdKCksIGkgPSB7fSwgdmVyYihcIm5leHRcIiksIHZlcmIoXCJ0aHJvd1wiKSwgdmVyYihcInJldHVyblwiKSwgaVtTeW1ib2wuYXN5bmNJdGVyYXRvcl0gPSBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9LCBpKTtcclxuICAgIGZ1bmN0aW9uIHZlcmIobikgeyBpW25dID0gb1tuXSAmJiBmdW5jdGlvbiAodikgeyByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkgeyB2ID0gb1tuXSh2KSwgc2V0dGxlKHJlc29sdmUsIHJlamVjdCwgdi5kb25lLCB2LnZhbHVlKTsgfSk7IH07IH1cclxuICAgIGZ1bmN0aW9uIHNldHRsZShyZXNvbHZlLCByZWplY3QsIGQsIHYpIHsgUHJvbWlzZS5yZXNvbHZlKHYpLnRoZW4oZnVuY3Rpb24odikgeyByZXNvbHZlKHsgdmFsdWU6IHYsIGRvbmU6IGQgfSk7IH0sIHJlamVjdCk7IH1cclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9fbWFrZVRlbXBsYXRlT2JqZWN0KGNvb2tlZCwgcmF3KSB7XHJcbiAgICBpZiAoT2JqZWN0LmRlZmluZVByb3BlcnR5KSB7IE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjb29rZWQsIFwicmF3XCIsIHsgdmFsdWU6IHJhdyB9KTsgfSBlbHNlIHsgY29va2VkLnJhdyA9IHJhdzsgfVxyXG4gICAgcmV0dXJuIGNvb2tlZDtcclxufTtcclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBfX2ltcG9ydFN0YXIobW9kKSB7XHJcbiAgICBpZiAobW9kICYmIG1vZC5fX2VzTW9kdWxlKSByZXR1cm4gbW9kO1xyXG4gICAgdmFyIHJlc3VsdCA9IHt9O1xyXG4gICAgaWYgKG1vZCAhPSBudWxsKSBmb3IgKHZhciBrIGluIG1vZCkgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG1vZCwgaykpIHJlc3VsdFtrXSA9IG1vZFtrXTtcclxuICAgIHJlc3VsdC5kZWZhdWx0ID0gbW9kO1xyXG4gICAgcmV0dXJuIHJlc3VsdDtcclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9faW1wb3J0RGVmYXVsdChtb2QpIHtcclxuICAgIHJldHVybiAobW9kICYmIG1vZC5fX2VzTW9kdWxlKSA/IG1vZCA6IHsgZGVmYXVsdDogbW9kIH07XHJcbn1cclxuIiwiaW1wb3J0IHsgUG9wdXBDb25maWdPcHRpb25zIH0gZnJvbSAnLi9nbG9iYWwnO1xuXG4vKipcbiAqIEBpZ25vcmVcbiAqL1xuZXhwb3J0IGNvbnN0IERFRkFVTFRfQVVUSE9SSVpFX1RJTUVPVVRfSU5fU0VDT05EUyA9IDYwO1xuXG4vKipcbiAqIEBpZ25vcmVcbiAqL1xuZXhwb3J0IGNvbnN0IERFRkFVTFRfUE9QVVBfQ09ORklHX09QVElPTlM6IFBvcHVwQ29uZmlnT3B0aW9ucyA9IHtcbiAgdGltZW91dEluU2Vjb25kczogREVGQVVMVF9BVVRIT1JJWkVfVElNRU9VVF9JTl9TRUNPTkRTXG59O1xuXG4vKipcbiAqIEBpZ25vcmVcbiAqL1xuZXhwb3J0IGNvbnN0IERFRkFVTFRfU0lMRU5UX1RPS0VOX1JFVFJZX0NPVU5UID0gMztcblxuLyoqXG4gKiBAaWdub3JlXG4gKi9cbmV4cG9ydCBjb25zdCBDTEVBTlVQX0lGUkFNRV9USU1FT1VUX0lOX1NFQ09ORFMgPSAyO1xuXG4vKipcbiAqIEBpZ25vcmVcbiAqL1xuZXhwb3J0IGNvbnN0IERFRkFVTFRfRkVUQ0hfVElNRU9VVF9NUyA9IDEwMDAwO1xuXG5leHBvcnQgY29uc3QgQ0FDSEVfTE9DQVRJT05fTUVNT1JZID0gJ21lbW9yeSc7XG5leHBvcnQgY29uc3QgQ0FDSEVfTE9DQVRJT05fTE9DQUxfU1RPUkFHRSA9ICdsb2NhbHN0b3JhZ2UnO1xuZXhwb3J0IGNvbnN0IE1JU1NJTkdfUkVGUkVTSF9UT0tFTl9FUlJPUl9NRVNTQUdFID1cbiAgJ1RoZSB3ZWIgd29ya2VyIGlzIG1pc3NpbmcgdGhlIHJlZnJlc2ggdG9rZW4nO1xuXG4vKipcbiAqIEBpZ25vcmVcbiAqL1xuZXhwb3J0IGNvbnN0IERFRkFVTFRfU0NPUEUgPSAnb3BlbmlkIHByb2ZpbGUgZW1haWwnO1xuXG4vKipcbiAqIEEgbGlzdCBvZiBlcnJvcnMgdGhhdCBjYW4gYmUgaXNzdWVkIGJ5IHRoZSBhdXRob3JpemF0aW9uIHNlcnZlciB3aGljaCB0aGVcbiAqIHVzZXIgY2FuIHJlY292ZXIgZnJvbSBieSBzaWduaW5nIGluIGludGVyYWN0aXZlbHkuXG4gKiBodHRwczovL29wZW5pZC5uZXQvc3BlY3Mvb3BlbmlkLWNvbm5lY3QtY29yZS0xXzAuaHRtbCNBdXRoRXJyb3JcbiAqIEBpZ25vcmVcbiAqL1xuZXhwb3J0IGNvbnN0IFJFQ09WRVJBQkxFX0VSUk9SUyA9IFtcbiAgJ2xvZ2luX3JlcXVpcmVkJyxcbiAgJ2NvbnNlbnRfcmVxdWlyZWQnLFxuICAnaW50ZXJhY3Rpb25fcmVxdWlyZWQnLFxuICAnYWNjb3VudF9zZWxlY3Rpb25fcmVxdWlyZWQnLFxuICAvLyBTdHJpY3RseSBzcGVha2luZyB0aGUgdXNlciBjYW4ndCByZWNvdmVyIGZyb20gYGFjY2Vzc19kZW5pZWRgIC0gYnV0IHRoZXlcbiAgLy8gY2FuIGdldCBtb3JlIGluZm9ybWF0aW9uIGFib3V0IHRoZWlyIGFjY2VzcyBiZWluZyBkZW5pZWQgYnkgbG9nZ2luZyBpblxuICAvLyBpbnRlcmFjdGl2ZWx5LlxuICAnYWNjZXNzX2RlbmllZCdcbl07XG4iLCJpbXBvcnQgeyBNSVNTSU5HX1JFRlJFU0hfVE9LRU5fRVJST1JfTUVTU0FHRSB9IGZyb20gJy4vY29uc3RhbnRzJztcblxubGV0IHJlZnJlc2hUb2tlbnMgPSB7fTtcblxuY29uc3QgY2FjaGVLZXkgPSAoYXVkaWVuY2UsIHNjb3BlKSA9PiBgJHthdWRpZW5jZX18JHtzY29wZX1gO1xuXG5jb25zdCBnZXRSZWZyZXNoVG9rZW4gPSAoYXVkaWVuY2UsIHNjb3BlKSA9PlxuICByZWZyZXNoVG9rZW5zW2NhY2hlS2V5KGF1ZGllbmNlLCBzY29wZSldO1xuXG5jb25zdCBzZXRSZWZyZXNoVG9rZW4gPSAocmVmcmVzaFRva2VuLCBhdWRpZW5jZSwgc2NvcGUpID0+XG4gIChyZWZyZXNoVG9rZW5zW2NhY2hlS2V5KGF1ZGllbmNlLCBzY29wZSldID0gcmVmcmVzaFRva2VuKTtcblxuY29uc3QgZGVsZXRlUmVmcmVzaFRva2VuID0gKGF1ZGllbmNlLCBzY29wZSkgPT5cbiAgZGVsZXRlIHJlZnJlc2hUb2tlbnNbY2FjaGVLZXkoYXVkaWVuY2UsIHNjb3BlKV07XG5cbmNvbnN0IHdhaXQ6IGFueSA9IHRpbWUgPT4gbmV3IFByb21pc2UocmVzb2x2ZSA9PiBzZXRUaW1lb3V0KHJlc29sdmUsIHRpbWUpKTtcblxuY29uc3QgbWVzc2FnZUhhbmRsZXIgPSBhc3luYyAoe1xuICBkYXRhOiB7IHVybCwgdGltZW91dCwgYXVkaWVuY2UsIHNjb3BlLCAuLi5vcHRzIH0sXG4gIHBvcnRzOiBbcG9ydF1cbn0pID0+IHtcbiAgbGV0IGpzb247XG4gIHRyeSB7XG4gICAgY29uc3QgYm9keSA9IEpTT04ucGFyc2Uob3B0cy5ib2R5KTtcbiAgICBpZiAoIWJvZHkucmVmcmVzaF90b2tlbiAmJiBib2R5LmdyYW50X3R5cGUgPT09ICdyZWZyZXNoX3Rva2VuJykge1xuICAgICAgY29uc3QgcmVmcmVzaFRva2VuID0gZ2V0UmVmcmVzaFRva2VuKGF1ZGllbmNlLCBzY29wZSk7XG4gICAgICBpZiAoIXJlZnJlc2hUb2tlbikge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoTUlTU0lOR19SRUZSRVNIX1RPS0VOX0VSUk9SX01FU1NBR0UpO1xuICAgICAgfVxuICAgICAgb3B0cy5ib2R5ID0gSlNPTi5zdHJpbmdpZnkoeyAuLi5ib2R5LCByZWZyZXNoX3Rva2VuOiByZWZyZXNoVG9rZW4gfSk7XG4gICAgfVxuXG4gICAgY29uc3QgYWJvcnRDb250cm9sbGVyID0gbmV3IEFib3J0Q29udHJvbGxlcigpO1xuICAgIGNvbnN0IHsgc2lnbmFsIH0gPSBhYm9ydENvbnRyb2xsZXI7XG5cbiAgICBsZXQgcmVzcG9uc2U7XG4gICAgdHJ5IHtcbiAgICAgIHJlc3BvbnNlID0gYXdhaXQgUHJvbWlzZS5yYWNlKFtcbiAgICAgICAgd2FpdCh0aW1lb3V0KSxcbiAgICAgICAgZmV0Y2godXJsLCB7IC4uLm9wdHMsIHNpZ25hbCB9KVxuICAgICAgXSk7XG4gICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgIC8vIGZldGNoIGVycm9yLCByZWplY3QgYHNlbmRNZXNzYWdlYCB1c2luZyBgZXJyb3JgIGtleSBzbyB0aGF0IHdlIHJldHJ5LlxuICAgICAgcG9ydC5wb3N0TWVzc2FnZSh7XG4gICAgICAgIGVycm9yOiBlcnJvci5tZXNzYWdlXG4gICAgICB9KTtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICBpZiAoIXJlc3BvbnNlKSB7XG4gICAgICAvLyBJZiB0aGUgcmVxdWVzdCB0aW1lcyBvdXQsIGFib3J0IGl0IGFuZCBsZXQgYGZldGNoV2l0aFRpbWVvdXRgIHJhaXNlIHRoZSBlcnJvci5cbiAgICAgIGFib3J0Q29udHJvbGxlci5hYm9ydCgpO1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIGpzb24gPSBhd2FpdCByZXNwb25zZS5qc29uKCk7XG5cbiAgICBpZiAoanNvbi5yZWZyZXNoX3Rva2VuKSB7XG4gICAgICBzZXRSZWZyZXNoVG9rZW4oanNvbi5yZWZyZXNoX3Rva2VuLCBhdWRpZW5jZSwgc2NvcGUpO1xuICAgICAgZGVsZXRlIGpzb24ucmVmcmVzaF90b2tlbjtcbiAgICB9IGVsc2Uge1xuICAgICAgZGVsZXRlUmVmcmVzaFRva2VuKGF1ZGllbmNlLCBzY29wZSk7XG4gICAgfVxuXG4gICAgcG9ydC5wb3N0TWVzc2FnZSh7XG4gICAgICBvazogcmVzcG9uc2Uub2ssXG4gICAgICBqc29uXG4gICAgfSk7XG4gIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgcG9ydC5wb3N0TWVzc2FnZSh7XG4gICAgICBvazogZmFsc2UsXG4gICAgICBqc29uOiB7XG4gICAgICAgIGVycm9yX2Rlc2NyaXB0aW9uOiBlcnJvci5tZXNzYWdlXG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn07XG5cbi8vIERvbid0IHJ1biBgYWRkRXZlbnRMaXN0ZW5lcmAgaW4gb3VyIHRlc3RzICh0aGlzIGlzIHJlcGxhY2VkIGluIHJvbGx1cClcbi8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICAqL1xuaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSAndGVzdCcpIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSB7IG1lc3NhZ2VIYW5kbGVyIH07XG59IGVsc2Uge1xuICAvLyBAdHMtaWdub3JlXG4gIGFkZEV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCBtZXNzYWdlSGFuZGxlcik7XG59XG4iXSwibmFtZXMiOlsiX19hc3NpZ24iLCJPYmplY3QiLCJhc3NpZ24iLCJ0IiwicyIsImkiLCJuIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwicCIsInByb3RvdHlwZSIsImhhc093blByb3BlcnR5IiwiY2FsbCIsImFwcGx5IiwidGhpcyIsIl9fZ2VuZXJhdG9yIiwidGhpc0FyZyIsImJvZHkiLCJmIiwieSIsImciLCJfIiwibGFiZWwiLCJzZW50IiwidHJ5cyIsIm9wcyIsIm5leHQiLCJ2ZXJiIiwidGhyb3ciLCJyZXR1cm4iLCJTeW1ib2wiLCJpdGVyYXRvciIsInYiLCJvcCIsIlR5cGVFcnJvciIsImRvbmUiLCJ2YWx1ZSIsInBvcCIsInB1c2giLCJlIiwic3RlcCIsInJlZnJlc2hUb2tlbnMiLCJjYWNoZUtleSIsImF1ZGllbmNlIiwic2NvcGUiLCJhZGRFdmVudExpc3RlbmVyIiwiX2EiLCJfYXJndW1lbnRzIiwiUCIsImdlbmVyYXRvciIsIl9iIiwidXJsIiwidGltZW91dCIsIm9wdHMiLCJpbmRleE9mIiwiZ2V0T3duUHJvcGVydHlTeW1ib2xzIiwicHJvcGVydHlJc0VudW1lcmFibGUiLCJwb3J0IiwiSlNPTiIsInBhcnNlIiwicmVmcmVzaF90b2tlbiIsImdyYW50X3R5cGUiLCJyZWZyZXNoVG9rZW4iLCJnZXRSZWZyZXNoVG9rZW4iLCJFcnJvciIsInN0cmluZ2lmeSIsImFib3J0Q29udHJvbGxlciIsIkFib3J0Q29udHJvbGxlciIsInNpZ25hbCIsInJlc3BvbnNlIiwiUHJvbWlzZSIsInJhY2UiLCJ0aW1lIiwicmVzb2x2ZSIsInNldFRpbWVvdXQiLCJmZXRjaCIsIl9jIiwicG9zdE1lc3NhZ2UiLCJlcnJvciIsImVycm9yXzEiLCJtZXNzYWdlIiwianNvbiIsImFib3J0Iiwic2V0UmVmcmVzaFRva2VuIiwiZGVsZXRlUmVmcmVzaFRva2VuIiwib2siLCJlcnJvcl9kZXNjcmlwdGlvbiIsImVycm9yXzIiLCJyZWplY3QiLCJmdWxmaWxsZWQiLCJyZWplY3RlZCIsInJlc3VsdCIsInRoZW4iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBNkJPLElBQUlBLEVBQVcsV0FRbEIsT0FQQUEsRUFBV0MsT0FBT0MsUUFBVSxTQUFrQkMsR0FDMUMsSUFBSyxJQUFJQyxFQUFHQyxFQUFJLEVBQUdDLEVBQUlDLFVBQVVDLE9BQVFILEVBQUlDLEVBQUdELElBRTVDLElBQUssSUFBSUksS0FEVEwsRUFBSUcsVUFBVUYsR0FDT0osT0FBT1MsVUFBVUMsZUFBZUMsS0FBS1IsRUFBR0ssS0FBSU4sRUFBRU0sR0FBS0wsRUFBRUssSUFFOUUsT0FBT04sSUFFS1UsTUFBTUMsS0FBTVAsWUF1Q3pCLFNBQVNRLEVBQVlDLEVBQVNDLEdBQ2pDLElBQXNHQyxFQUFHQyxFQUFHaEIsRUFBR2lCLEVBQTNHQyxFQUFJLENBQUVDLE1BQU8sRUFBR0MsS0FBTSxXQUFhLEdBQVcsRUFBUHBCLEVBQUUsR0FBUSxNQUFNQSxFQUFFLEdBQUksT0FBT0EsRUFBRSxJQUFPcUIsS0FBTSxHQUFJQyxJQUFLLElBQ2hHLE9BQU9MLEVBQUksQ0FBRU0sS0FBTUMsRUFBSyxHQUFJQyxNQUFTRCxFQUFLLEdBQUlFLE9BQVVGLEVBQUssSUFBd0IsbUJBQVhHLFNBQTBCVixFQUFFVSxPQUFPQyxVQUFZLFdBQWEsT0FBT2pCLE9BQVVNLEVBQ3ZKLFNBQVNPLEVBQUtyQixHQUFLLE9BQU8sU0FBVTBCLEdBQUssT0FDekMsU0FBY0MsR0FDVixHQUFJZixFQUFHLE1BQU0sSUFBSWdCLFVBQVUsbUNBQzNCLEtBQU9iLE9BQ0gsR0FBSUgsRUFBSSxFQUFHQyxJQUFNaEIsRUFBWSxFQUFSOEIsRUFBRyxHQUFTZCxFQUFVLE9BQUljLEVBQUcsR0FBS2QsRUFBUyxTQUFPaEIsRUFBSWdCLEVBQVUsU0FBTWhCLEVBQUVTLEtBQUtPLEdBQUksR0FBS0EsRUFBRU8sU0FBV3ZCLEVBQUlBLEVBQUVTLEtBQUtPLEVBQUdjLEVBQUcsS0FBS0UsS0FBTSxPQUFPaEMsRUFFM0osT0FESWdCLEVBQUksRUFBR2hCLElBQUc4QixFQUFLLENBQVMsRUFBUkEsRUFBRyxHQUFROUIsRUFBRWlDLFFBQ3pCSCxFQUFHLElBQ1AsS0FBSyxFQUFHLEtBQUssRUFBRzlCLEVBQUk4QixFQUFJLE1BQ3hCLEtBQUssRUFBYyxPQUFYWixFQUFFQyxRQUFnQixDQUFFYyxNQUFPSCxFQUFHLEdBQUlFLE1BQU0sR0FDaEQsS0FBSyxFQUFHZCxFQUFFQyxRQUFTSCxFQUFJYyxFQUFHLEdBQUlBLEVBQUssQ0FBQyxHQUFJLFNBQ3hDLEtBQUssRUFBR0EsRUFBS1osRUFBRUksSUFBSVksTUFBT2hCLEVBQUVHLEtBQUthLE1BQU8sU0FDeEMsUUFDSSxLQUFNbEMsRUFBSWtCLEVBQUVHLE1BQU1yQixFQUFJQSxFQUFFSyxPQUFTLEdBQUtMLEVBQUVBLEVBQUVLLE9BQVMsS0FBa0IsSUFBVnlCLEVBQUcsSUFBc0IsSUFBVkEsRUFBRyxJQUFXLENBQUVaLEVBQUksRUFBRyxTQUNqRyxHQUFjLElBQVZZLEVBQUcsTUFBYzlCLEdBQU04QixFQUFHLEdBQUs5QixFQUFFLElBQU04QixFQUFHLEdBQUs5QixFQUFFLElBQU0sQ0FBRWtCLEVBQUVDLE1BQVFXLEVBQUcsR0FBSSxNQUM5RSxHQUFjLElBQVZBLEVBQUcsSUFBWVosRUFBRUMsTUFBUW5CLEVBQUUsR0FBSSxDQUFFa0IsRUFBRUMsTUFBUW5CLEVBQUUsR0FBSUEsRUFBSThCLEVBQUksTUFDN0QsR0FBSTlCLEdBQUtrQixFQUFFQyxNQUFRbkIsRUFBRSxHQUFJLENBQUVrQixFQUFFQyxNQUFRbkIsRUFBRSxHQUFJa0IsRUFBRUksSUFBSWEsS0FBS0wsR0FBSyxNQUN2RDlCLEVBQUUsSUFBSWtCLEVBQUVJLElBQUlZLE1BQ2hCaEIsRUFBRUcsS0FBS2EsTUFBTyxTQUV0QkosRUFBS2hCLEVBQUtMLEtBQUtJLEVBQVNLLEdBQzFCLE1BQU9rQixHQUFLTixFQUFLLENBQUMsRUFBR00sR0FBSXBCLEVBQUksVUFBZUQsRUFBSWYsRUFBSSxFQUN0RCxHQUFZLEVBQVI4QixFQUFHLEdBQVEsTUFBTUEsRUFBRyxHQUFJLE1BQU8sQ0FBRUcsTUFBT0gsRUFBRyxHQUFLQSxFQUFHLFFBQUssRUFBUUUsTUFBTSxHQXJCOUJLLENBQUssQ0FBQ2xDLEVBQUcwQixNQ2hEdEQsSUM3QkhTLEVBQWdCLEdBRWRDLEVBQVcsU0FBQ0MsRUFBVUMsR0FBVSxPQUFHRCxNQUFZQyxHQWdGbkRDLGlCQUFpQixXQW5FSSxTQUFPQyxxQkZrREo5QixFQUFTK0IsRUFBWUMsRUFBR0MsU0FBeEJqQyxTQUFTK0IsU0FBZUUsbUZFakRoREMsU0FBUUMsUUFBS0MsWUFBU1QsYUFBVUMsVUFBVVMsRUZzQnJDLFNBQWdCakQsRUFBR21DLEdBQ3RCLElBQUlwQyxFQUFJLEdBQ1IsSUFBSyxJQUFJTSxLQUFLTCxFQUFPSCxPQUFPUyxVQUFVQyxlQUFlQyxLQUFLUixFQUFHSyxJQUFNOEIsRUFBRWUsUUFBUTdDLEdBQUssSUFDOUVOLEVBQUVNLEdBQUtMLEVBQUVLLElBQ2IsR0FBUyxNQUFMTCxHQUFxRCxtQkFBakNILE9BQU9zRCxzQkFDdEIsQ0FBQSxJQUFJbEQsRUFBSSxFQUFiLElBQWdCSSxFQUFJUixPQUFPc0Qsc0JBQXNCbkQsR0FBSUMsRUFBSUksRUFBRUQsT0FBUUgsSUFDM0RrQyxFQUFFZSxRQUFRN0MsRUFBRUosSUFBTSxHQUFLSixPQUFPUyxVQUFVOEMscUJBQXFCNUMsS0FBS1IsRUFBR0ssRUFBRUosTUFDdkVGLEVBQUVNLEVBQUVKLElBQU1ELEVBQUVLLEVBQUVKLEtBRTFCLE9BQU9GLEtFL0JILHNDQUNFc0QsOEJBS04sMkJBRE14QyxFQUFPeUMsS0FBS0MsTUFBTU4sRUFBS3BDLE9BQ25CMkMsZUFBcUMsa0JBQXBCM0MsRUFBSzRDLFdBQWdDLENBRTlELEtBRE1DLEVBbkJZLFNBQUNuQixFQUFVQyxHQUNqQyxPQUFBSCxFQUFjQyxFQUFTQyxFQUFVQyxJQWtCUm1CLENBQWdCcEIsRUFBVUMsSUFFN0MsTUFBTSxJQUFJb0IsTURLaEIsK0NDSElYLEVBQUtwQyxLQUFPeUMsS0FBS08saUJBQWVoRCxJQUFNMkMsY0FBZUUsS0FHakRJLEVBQWtCLElBQUlDLGdCQUNwQkMsRUFBV0YsU0FFZkcsMEJBRVMsZ0NBQU1DLFFBQVFDLEtBQUssRUF0QmxCQyxFQXVCTHBCLEVBdkJhLElBQUlrQixTQUFRLFNBQUFHLEdBQVcsT0FBQUMsV0FBV0QsRUFBU0QsT0F3QjdERyxNQUFNeEIsU0FBVUUsSUFBTWUsNkJBRnhCQyxFQUFXTyxzQkFTWCxrQkFIQW5CLEVBQUtvQixZQUFZLENBQ2ZDLE1BQU9DLEVBQU1DLHFCQUtqQixPQUFLWCxLQU1RQSxFQUFTWSxTQUpwQmYsRUFBZ0JnQiwyQkFJbEJELEVBQU9MLFVBRUVoQixlQWhEVyxTQUFDRSxFQUFjbkIsRUFBVUMsR0FDOUNILEVBQWNDLEVBQVNDLEVBQVVDLElBQVVrQixFQWdEeENxQixDQUFnQkYsRUFBS3JCLGNBQWVqQixFQUFVQyxVQUN2Q3FDLEVBQUtyQixlQS9DUyxTQUFDakIsRUFBVUMsVUFDN0JILEVBQWNDLEVBQVNDLEVBQVVDLElBZ0RwQ3dDLENBQW1CekMsRUFBVUMsR0FHL0JhLEVBQUtvQixZQUFZLENBQ2ZRLEdBQUloQixFQUFTZ0IsR0FDYkosd0NBR0Z4QixFQUFLb0IsWUFBWSxDQUNmUSxJQUFJLEVBQ0pKLEtBQU0sQ0FDSkssa0JBQW1CQyxFQUFNUCxrQ0F6RGYsSUFBQVIsTUZxRFAsS0FEb0N4QixZQUN6QkEsRUFBSXNCLFdBQVUsU0FBVUcsRUFBU2UsR0FDL0MsU0FBU0MsRUFBVXJELEdBQVMsSUFBTUksRUFBS1MsRUFBVXZCLEtBQUtVLElBQVcsTUFBT0csR0FBS2lELEVBQU9qRCxJQUNwRixTQUFTbUQsRUFBU3RELEdBQVMsSUFBTUksRUFBS1MsRUFBaUIsTUFBRWIsSUFBVyxNQUFPRyxHQUFLaUQsRUFBT2pELElBQ3ZGLFNBQVNDLEVBQUttRCxHQUFVQSxFQUFPeEQsS0FBT3NDLEVBQVFrQixFQUFPdkQsT0FBUyxJQUFJWSxHQUFFLFNBQVV5QixHQUFXQSxFQUFRa0IsRUFBT3ZELFVBQVd3RCxLQUFLSCxFQUFXQyxHQUNuSWxELEdBQU1TLEVBQVlBLEVBQVVwQyxNQUFNRyxFQUFTK0IsR0FBYyxLQUFLckIifQ==\\\\\",ir=!1,function(e){return rr=rr||er(tr,nr,ir),new Worker(rr,e)}),cr=new hi,sr={memory:function(){return (new Ti).enclosedCache},localstorage:function(){return new Yi}},ar=function(e){return sr[e]},ur=function(){function e(e){var t,n,r,o;if(this.options=e,\\\\\"undefined\\\\\"!=typeof window&&function(){if(!Si())throw new Error(\\\\\"For security reasons, \\`window.crypto\\` is required to run \\`auth0-spa-js\\`.\\\\\");if(void 0===Vi())throw new Error(\\\\\"      auth0-spa-js must run on a secure origin.      See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin       for more information.    \\\\\")}(),this.cacheLocation=e.cacheLocation||\\\\\"memory\\\\\",this.cookieStorage=!1===e.legacySameSiteCookie?Mi:qi,!ar(this.cacheLocation))throw new Error('Invalid cache location \\\\\"'+this.cacheLocation+'\\\\\"');this.cache=ar(this.cacheLocation)(),this.scope=this.options.scope,this.transactionManager=new Ki($i),this.domainUrl=\\\\\"https://\\\\\"+this.options.domain,this.tokenIssuer=(r=this.options.issuer,o=this.domainUrl,r?r.startsWith(\\\\\"https://\\\\\")?r:\\\\\"https://\\\\\"+r+\\\\\"/\\\\\":o+\\\\\"/\\\\\"),this.defaultScope=Ji(\\\\\"openid\\\\\",void 0!==(null===(n=null===(t=this.options)||void 0===t?void 0:t.advancedOptions)||void 0===n?void 0:n.defaultScope)?this.options.advancedOptions.defaultScope:\\\\\"openid profile email\\\\\"),this.options.useRefreshTokens&&(this.scope=Ji(this.scope,\\\\\"offline_access\\\\\")),\\\\\"undefined\\\\\"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&\\\\\"memory\\\\\"===this.cacheLocation&&!/Trident.*rv:11\\\\\\\\.0/.test(navigator.userAgent)&&(this.worker=new or),this.customOptions=function(e){return e.advancedOptions,e.audience,e.auth0Client,e.authorizeTimeoutInSeconds,e.cacheLocation,e.client_id,e.domain,e.issuer,e.leeway,e.max_age,e.redirect_uri,e.scope,e.useRefreshTokens,i(e,[\\\\\"advancedOptions\\\\\",\\\\\"audience\\\\\",\\\\\"auth0Client\\\\\",\\\\\"authorizeTimeoutInSeconds\\\\\",\\\\\"cacheLocation\\\\\",\\\\\"client_id\\\\\",\\\\\"domain\\\\\",\\\\\"issuer\\\\\",\\\\\"leeway\\\\\",\\\\\"max_age\\\\\",\\\\\"redirect_uri\\\\\",\\\\\"scope\\\\\",\\\\\"useRefreshTokens\\\\\"])}(e);}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||{name:\\\\\"auth0-spa-js\\\\\",version:\\\\\"1.12.1\\\\\"})));return \\\\\"\\\\\"+this.domainUrl+e+\\\\\"&auth0Client=\\\\\"+t},e.prototype._getParams=function(e,t,r,o,c){var s=this.options,a=(s.domain,s.leeway,s.useRefreshTokens,s.auth0Client,s.cacheLocation,s.advancedOptions,i(s,[\\\\\"domain\\\\\",\\\\\"leeway\\\\\",\\\\\"useRefreshTokens\\\\\",\\\\\"auth0Client\\\\\",\\\\\"cacheLocation\\\\\",\\\\\"advancedOptions\\\\\"]));return n(n(n({},a),e),{scope:Ji(this.defaultScope,this.scope,e.scope),response_type:\\\\\"code\\\\\",response_mode:\\\\\"query\\\\\",state:t,nonce:r,redirect_uri:c||this.options.redirect_uri,code_challenge:o,code_challenge_method:\\\\\"S256\\\\\"})},e.prototype._authorizeUrl=function(e){return this._url(\\\\\"/authorize?\\\\\"+Gi(e))},e.prototype._verifyIdToken=function(e,t){return zi({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},e.prototype._parseNumber=function(e){return \\\\\"string\\\\\"!=typeof e?e:parseInt(e,10)||void 0},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){var t,n,r,c,s,a,u,l,d,g,I;return o(this,(function(o){switch(o.label){case 0:return t=e.redirect_uri,n=e.appState,r=i(e,[\\\\\"redirect_uri\\\\\",\\\\\"appState\\\\\"]),c=Xi(Zi()),s=Xi(Zi()),a=Zi(),[4,wi(a)];case 1:return u=o.sent(),l=xi(u),d=e.fragment?\\\\\"#\\\\\"+e.fragment:\\\\\"\\\\\",g=this._getParams(r,c,s,l,t),I=this._authorizeUrl(g),this.transactionManager.create({nonce:s,code_verifier:a,appState:n,scope:g.scope,audience:g.audience||\\\\\"default\\\\\",redirect_uri:g.redirect_uri}),[2,I+d]}}))}))},e.prototype.loginWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),r(this,void 0,void 0,(function(){var r,c,s,a,u,l,d,g,I,f,p,h;return o(this,(function(o){switch(o.label){case 0:return r=i(e,[]),c=Xi(Zi()),s=Xi(Zi()),a=Zi(),[4,wi(a)];case 1:return u=o.sent(),l=xi(u),d=this._getParams(r,c,s,l,this.options.redirect_uri||window.location.origin),g=this._authorizeUrl(n(n({},d),{response_mode:\\\\\"web_message\\\\\"})),[4,Ui(g,n(n({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(I=o.sent(),c!==I.state)throw new Error(\\\\\"Invalid state\\\\\");return [4,Li({audience:d.audience,scope:d.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:a,code:I.code,grant_type:\\\\\"authorization_code\\\\\",redirect_uri:d.redirect_uri},this.worker)];case 3:return f=o.sent(),p=this._verifyIdToken(f.id_token,s),h=n(n({},f),{decodedToken:p,scope:d.scope,audience:d.audience||\\\\\"default\\\\\",client_id:this.options.client_id}),this.cache.save(h),this.cookieStorage.save(\\\\\"auth0.is.authenticated\\\\\",!0,{daysUntilExpire:1}),[2]}}))}))},e.prototype.getUser=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){var t,n,i;return o(this,(function(r){return t=e.audience||this.options.audience||\\\\\"default\\\\\",n=Ji(this.defaultScope,this.scope,e.scope),[2,(i=this.cache.get({client_id:this.options.client_id,audience:t,scope:n}))&&i.decodedToken&&i.decodedToken.user]}))}))},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){var t,n,i;return o(this,(function(r){return t=e.audience||this.options.audience||\\\\\"default\\\\\",n=Ji(this.defaultScope,this.scope,e.scope),[2,(i=this.cache.get({client_id:this.options.client_id,audience:t,scope:n}))&&i.decodedToken&&i.decodedToken.claims]}))}))},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return [4,this.buildAuthorizeUrl(e)];case 1:return t=n.sent(),window.location.assign(t),[2]}}))}))},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),r(this,void 0,void 0,(function(){var t,i,r,c,s,a,u,l,d,g,I;return o(this,(function(o){switch(o.label){case 0:if(0===(t=e.split(\\\\\"?\\\\\").slice(1)).length)throw new Error(\\\\\"There are no query params available for parsing.\\\\\");if(i=function(e){e.indexOf(\\\\\"#\\\\\")>-1&&(e=e.substr(0,e.indexOf(\\\\\"#\\\\\")));var t=e.split(\\\\\"&\\\\\"),i={};return t.forEach((function(e){var t=e.split(\\\\\"=\\\\\"),n=t[0],r=t[1];i[n]=decodeURIComponent(r);})),n(n({},i),{expires_in:parseInt(i.expires_in)})}(t.join(\\\\\"\\\\\")),r=i.state,c=i.code,s=i.error,a=i.error_description,!(u=this.transactionManager.get())||!u.code_verifier||!u.nonce)throw new Error(\\\\\"Invalid state\\\\\");if(s)throw this.transactionManager.remove(),new Bi(s,a,r,u.appState);return this.transactionManager.remove(),l={audience:u.audience,scope:u.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u.code_verifier,grant_type:\\\\\"authorization_code\\\\\",code:c},void 0!==u.redirect_uri&&(l.redirect_uri=u.redirect_uri),[4,Li(l,this.worker)];case 1:return d=o.sent(),g=this._verifyIdToken(d.id_token,u.nonce),I=n(n({},d),{decodedToken:g,audience:u.audience,scope:u.scope,client_id:this.options.client_id}),this.cache.save(I),this.cookieStorage.save(\\\\\"auth0.is.authenticated\\\\\",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}}))}))},e.prototype.checkSession=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:if(\\\\\"memory\\\\\"===this.cacheLocation&&!this.cookieStorage.get(\\\\\"auth0.is.authenticated\\\\\"))return [2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getTokenSilently(e)];case 2:return n.sent(),[3,4];case 3:if(t=n.sent(),!bi.includes(t.error))throw t;return [3,4];case 4:return [2]}}))}))},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){var t,r,c,s,a,u,l,d=this;return o(this,(function(o){switch(o.label){case 0:if(t=n(n({audience:this.options.audience,ignoreCache:!1},e),{scope:Ji(this.defaultScope,this.scope,e.scope)}),r=t.ignoreCache,c=i(t,[\\\\\"ignoreCache\\\\\"]),s=function(){var e=d.cache.get({scope:c.scope,audience:c.audience||\\\\\"default\\\\\",client_id:d.options.client_id},60);return e&&e.access_token},!r&&(a=s()))return [2,a];o.label=1;case 1:return o.trys.push([1,7,8,10]),[4,cr.acquireLock(\\\\\"auth0.lock.getTokenSilently\\\\\",5e3)];case 2:return o.sent(),!r&&(a=s())?[2,a]:this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(c)]:[3,4];case 3:return l=o.sent(),[3,6];case 4:return [4,this._getTokenFromIFrame(c)];case 5:l=o.sent(),o.label=6;case 6:return u=l,this.cache.save(n({client_id:this.options.client_id},u)),this.cookieStorage.save(\\\\\"auth0.is.authenticated\\\\\",!0,{daysUntilExpire:1}),[2,u.access_token];case 7:throw o.sent();case 8:return [4,cr.releaseLock(\\\\\"auth0.lock.getTokenSilently\\\\\")];case 9:return o.sent(),[7];case 10:return [2]}}))}))},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return e.audience=e.audience||this.options.audience,e.scope=Ji(this.defaultScope,this.scope,e.scope),t=n(n({},yi),t),[4,this.loginWithPopup(e,t)];case 1:return i.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||\\\\\"default\\\\\",client_id:this.options.client_id}).access_token]}}))}))},e.prototype.isAuthenticated=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return [4,this.getUser()];case 1:return [2,!!e.sent()]}}))}))},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id;var t=e.federated,n=e.localOnly,r=i(e,[\\\\\"federated\\\\\",\\\\\"localOnly\\\\\"]);if(n&&t)throw new Error(\\\\\"It is invalid to set both the \\`federated\\` and \\`localOnly\\` options to \\`true\\`\\\\\");if(this.cache.clear(),this.cookieStorage.remove(\\\\\"auth0.is.authenticated\\\\\"),!n){var o=t?\\\\\"&federated\\\\\":\\\\\"\\\\\",c=this._url(\\\\\"/v2/logout?\\\\\"+Gi(r));window.location.assign(\\\\\"\\\\\"+c+o);}},e.prototype._getTokenFromIFrame=function(e){return r(this,void 0,void 0,(function(){var t,r,c,s,a,u,l,d,g,I,f,p,h,y;return o(this,(function(o){switch(o.label){case 0:return t=Xi(Zi()),r=Xi(Zi()),c=Zi(),[4,wi(c)];case 1:return s=o.sent(),a=xi(s),u=this._getParams(e,t,r,a,e.redirect_uri||this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(n(n({},u),{prompt:\\\\\"none\\\\\",response_mode:\\\\\"web_message\\\\\"})),d=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,[4,Ci(l,this.domainUrl,d)];case 2:if(g=o.sent(),t!==g.state)throw new Error(\\\\\"Invalid state\\\\\");return I=e.scope,f=e.audience,e.redirect_uri,e.ignoreCache,e.timeoutInSeconds,p=i(e,[\\\\\"scope\\\\\",\\\\\"audience\\\\\",\\\\\"redirect_uri\\\\\",\\\\\"ignoreCache\\\\\",\\\\\"timeoutInSeconds\\\\\"]),[4,Li(n(n(n({},this.customOptions),p),{scope:I,audience:f,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:c,code:g.code,grant_type:\\\\\"authorization_code\\\\\",redirect_uri:u.redirect_uri}),this.worker)];case 3:return h=o.sent(),y=this._verifyIdToken(h.id_token,r),[2,n(n({},h),{decodedToken:y,scope:u.scope,audience:u.audience||\\\\\"default\\\\\"})]}}))}))},e.prototype._getTokenUsingRefreshToken=function(e){return r(this,void 0,void 0,(function(){var t,r,c,s,a,u,l,d;return o(this,(function(o){switch(o.label){case 0:return e.scope=Ji(this.defaultScope,this.options.scope,e.scope),(t=this.cache.get({scope:e.scope,audience:e.audience||\\\\\"default\\\\\",client_id:this.options.client_id}))&&t.refresh_token||this.worker?[3,2]:[4,this._getTokenFromIFrame(e)];case 1:return [2,o.sent()];case 2:r=e.redirect_uri||this.options.redirect_uri||window.location.origin,s=e.scope,a=e.audience,e.ignoreCache,e.timeoutInSeconds,u=i(e,[\\\\\"scope\\\\\",\\\\\"audience\\\\\",\\\\\"ignoreCache\\\\\",\\\\\"timeoutInSeconds\\\\\"]),o.label=3;case 3:return o.trys.push([3,5,,8]),[4,Li(n(n(n({},this.customOptions),u),{audience:a,scope:s,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:\\\\\"refresh_token\\\\\",refresh_token:t&&t.refresh_token,redirect_uri:r}),this.worker)];case 4:return c=o.sent(),[3,8];case 5:return \\\\\"The web worker is missing the refresh token\\\\\"!==(l=o.sent()).message?[3,7]:[4,this._getTokenFromIFrame(e)];case 6:return [2,o.sent()];case 7:throw l;case 8:return d=this._verifyIdToken(c.id_token),[2,n(n({},c),{decodedToken:d,scope:e.scope,audience:e.audience||\\\\\"default\\\\\"})]}}))}))},e}();function auth0SpaJs_production_esm(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return [4,(t=new ur(e)).checkSession()];case 1:return n.sent(),[2,t]}}))}))}\nexport default auth0SpaJs_production_esm;\nexport { ur as Auth0Client };\"\n`;\n\nexports[`source-map-strip matches the snapshot: web_modules/import-map.json 1`] = `\n\"{\n  \\\\\"imports\\\\\": {\n    \\\\\"@auth0/auth0-spa-js\\\\\": \\\\\"./@auth0/auth0-spa-js.js\\\\\"\n  }\n}\"\n`;\n"
  },
  {
    "path": "test/esinstall/source-map-strip/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-source-map-strip\",\n  \"dependencies\": {\n    \"@auth0/auth0-spa-js\": \"1.12.1\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/source-map-strip/source-map-strip.test.js",
    "content": "const path = require('path');\nconst {\n  existsPackageJson,\n  runTest,\n  testLockFile,\n  testWebModules,\n} = require('../esinstall-test-utils.js');\n\nrequire('jest-specific-snapshot'); // allows to call expect().toMatchSpecificSnapshot(filename, snapshotName)\n\ndescribe('source-map-strip', () => {\n  it('matches the snapshot', async () => {\n    const cwd = __dirname;\n\n    if (existsPackageJson(cwd) === false) return;\n\n    // Run Test\n    const {output, snapshotFile} = await runTest(['@auth0/auth0-spa-js'], {cwd});\n\n    // Test output\n    expect(output).toMatchSpecificSnapshot(snapshotFile, 'cli output');\n\n    // Test Lockfile (if one exists)\n    await testLockFile(cwd);\n\n    // Cleanup\n    const {testAllSnapshots, testDiffs} = await testWebModules(cwd, snapshotFile);\n\n    // Assert that the snapshots match\n    testAllSnapshots();\n\n    // If any diffs are detected, we'll assert the difference so that we get nice output.\n    testDiffs();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/sub-package-json/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/sub-package-json/package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"1.0.1\",\n  \"name\": \"@snowpack/test-sub-package-json\",\n  \"dependencies\": {\n    \"solid-js\": \"^0.16.7\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/sub-package-json/sub-package-json.test.js",
    "content": "const path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\ndescribe('sub package with package.json', () => {\n  it('resolves to the right place', async () => {\n    const cwd = __dirname;\n    const dest = path.join(cwd, 'test-sub-package-json');\n    const spec = 'solid-js/dom';\n\n    const {\n      importMap: {imports},\n    } = await runTest([spec], {\n      cwd,\n      dest,\n    });\n\n    expect(imports[spec]).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/esinstall/tree-shake-expression/.gitignore",
    "content": "test-*"
  },
  {
    "path": "test/esinstall/tree-shake-expression/inner-module/main.js",
    "content": "var wiggle = function wiggle() {}.bind(this);\n\nexport default function () {}\n"
  },
  {
    "path": "test/esinstall/tree-shake-expression/inner-module/package.json",
    "content": "{\n  \"name\": \"inner-module\",\n  \"version\": \"1.0.0\",\n  \"main\": \"main.js\"\n}\n"
  },
  {
    "path": "test/esinstall/tree-shake-expression/package.json",
    "content": "{\n  \"name\": \"@snowpack/test-tree-shake-expression\",\n  \"version\": \"1.0.0\",\n  \"dependencies\": {\n    \"inner-module\": \"file:./inner-module\"\n  }\n}\n"
  },
  {
    "path": "test/esinstall/tree-shake-expression/tree-shake-expression.test.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {runTest} = require('../esinstall-test-utils.js');\n\nconst cwd = __dirname;\n\ndescribe('tree shaking expressions', () => {\n  it('works', async () => {\n    const pkg = 'inner-module';\n    const dest = path.join(cwd, 'test-output');\n    await runTest([pkg], {cwd, dest});\n\n    const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8');\n\n    expect(output).toEqual(\n      // left hand assignment not removed\n      expect.stringContaining(`var wiggle`),\n    );\n  });\n});\n"
  },
  {
    "path": "test/esinstall.api.test.js",
    "content": "const {findExportMapEntry, findManifestEntry, explodeExportMap} = require('../esinstall/lib');\n\ndescribe('ESInstall API', () => {\n  describe('findExportMapEntry', () => {\n    it('returns a string value', () => {\n      expect(findExportMapEntry('foo.js')).toBe('foo.js');\n    });\n\n    it('prefers browser', () => {\n      expect(\n        findExportMapEntry({\n          browser: 'browser.js',\n          import: 'import.js',\n          default: 'default.js',\n          require: 'require.js',\n        }),\n      ).toBe('browser.js');\n    });\n\n    it('picks import', () => {\n      expect(\n        findExportMapEntry({\n          import: 'import.js',\n          default: 'default.js',\n          require: 'require.js',\n        }),\n      ).toBe('import.js');\n    });\n\n    it('picks default', () => {\n      expect(\n        findExportMapEntry({\n          default: 'default.js',\n          require: 'require.js',\n        }),\n      ).toBe('default.js');\n    });\n\n    it('picks require', () => {\n      expect(\n        findExportMapEntry({\n          require: 'require.js',\n          other: 'other.js',\n        }),\n      ).toBe('require.js');\n    });\n\n    it('takes conditions', () => {\n      expect(\n        findExportMapEntry(\n          {\n            development: {\n              browser: 'error.js',\n            },\n            production: {\n              import: 'prod.js',\n            },\n          },\n          ['production'],\n        ),\n      ).toBe('prod.js');\n    });\n  });\n\n  describe('findManifestEntry', () => {\n    it('gets \"exports\"', () => {\n      let entry = findManifestEntry({exports: 'esm.js', main: 'main.js'});\n      expect(entry).toBe('esm.js');\n    });\n\n    it('gets \"exports[.]\"', () => {\n      let entry = findManifestEntry({\n        exports: {\n          '.': 'esm.js',\n        },\n        main: 'main.js',\n      });\n      expect(entry).toBe('esm.js');\n    });\n\n    it('gets \"main\"', () => {\n      let entry = findManifestEntry({main: 'foo.js'});\n      expect(entry).toBe('foo.js');\n    });\n\n    it('gets \"module\"', () => {\n      let entry = findManifestEntry({main: 'error.js', module: 'foo.js'});\n      expect(entry).toBe('foo.js');\n    });\n\n    it('gets \"browser:module\"', () => {\n      let entry = findManifestEntry({main: 'error.js', 'browser:module': 'mod.js'});\n      expect(entry).toBe('mod.js');\n    });\n\n    it('gets \"main:esnext\"', () => {\n      let entry = findManifestEntry({main: 'error.js', 'main:esnext': 'main.js'});\n      expect(entry).toBe('main.js');\n    });\n\n    it('gets \"jsnext:main\"', () => {\n      let entry = findManifestEntry({main: 'error.js', 'jsnext:main': 'jsnext.js'});\n      expect(entry).toBe('jsnext.js');\n    });\n\n    it('gets \"browser\"', () => {\n      let entry = findManifestEntry({\n        main: 'error.js',\n        browser: 'browser.js',\n      });\n      expect(entry).toBe('browser.js');\n\n      entry = findManifestEntry({\n        main: 'error.js',\n        browser: {\n          './': 'browser.js',\n        },\n      });\n      expect(entry).toBe('browser.js');\n    });\n  });\n\n  describe('explodeExportMap', () => {\n    const cwd = __dirname;\n\n    it('when export map is a string, returns an object with a .', () => {\n      let map = explodeExportMap('./main.js', {cwd});\n\n      expect(map).toStrictEqual({\n        '.': './main.js',\n      });\n    });\n\n    it('resolves keys to the entry', () => {\n      let map = explodeExportMap(\n        {\n          '.': {\n            browser: './entrypoint.js',\n          },\n          './other': {\n            import: './other.js',\n          },\n        },\n        {cwd},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n        './other': './other.js',\n      });\n    });\n\n    it(\"ignores keys that don't start with .\", () => {\n      let map = explodeExportMap(\n        {\n          '.': './entrypoint.js',\n          bad: './error.js',\n        },\n        {cwd},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n      });\n    });\n\n    it('ignores wildcards', () => {\n      let map = explodeExportMap(\n        {\n          './other': './other.js',\n          './': './',\n        },\n        {cwd},\n      );\n\n      expect(map).toStrictEqual({\n        './other': './other.js',\n      });\n    });\n\n    it('resolves arrays the first value', () => {\n      let map = explodeExportMap(\n        {\n          '.': ['./entrypoint.js', './fallback.js'],\n        },\n        {cwd},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n      });\n    });\n\n    it('returns undefined if there are no valid entries', () => {\n      let map = explodeExportMap(\n        {\n          bad: './error.js',\n        },\n        {cwd},\n      );\n      expect(map).toBe(undefined);\n    });\n\n    it('explodes wildcard exports', () => {\n      let map = explodeExportMap(\n        {\n          '.': './entrypoint.js',\n          './extras/*': './src/extras/*.js',\n        },\n        {cwd: __dirname + '/esinstall/package-entrypoints/export-map-star'},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n        './extras/one': './src/extras/one.js',\n        './extras/two': './src/extras/two.js',\n        './extras/three': './src/extras/three.js',\n      });\n    });\n\n    it('explodes wildcard exports with object values', () => {\n      let map = explodeExportMap(\n        {\n          '.': './entrypoint.js',\n          './extras/*': {\n            import: './src/extras/*.js',\n          },\n        },\n        {cwd: __dirname + '/esinstall/package-entrypoints/export-map-star'},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n        './extras/one': './src/extras/one.js',\n        './extras/two': './src/extras/two.js',\n        './extras/three': './src/extras/three.js',\n      });\n    });\n\n    it('explodes trailing slash exports', () => {\n      let map = explodeExportMap(\n        {\n          '.': './entrypoint.js',\n          './extras/': './src/extras/',\n        },\n        {cwd: __dirname + '/esinstall/package-entrypoints/export-map-trailing-slash'},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n        './extras/one.js': './src/extras/one.js',\n        './extras/other.css': './src/extras/other.css',\n        './extras/two.js': './src/extras/two.js',\n        './extras/three.js': './src/extras/three.js',\n      });\n    });\n\n    it('explodes trailing slash exports with object values', () => {\n      let map = explodeExportMap(\n        {\n          '.': './entrypoint.js',\n          './extras/': {\n            default: './src/extras/',\n          },\n        },\n        {cwd: __dirname + '/esinstall/package-entrypoints/export-map-trailing-slash'},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n        './extras/one.js': './src/extras/one.js',\n        './extras/other.css': './src/extras/other.css',\n        './extras/two.js': './src/extras/two.js',\n        './extras/three.js': './src/extras/three.js',\n      });\n    });\n\n    it('explodes trailing slash exports but ignores subdirs', () => {\n      let map = explodeExportMap(\n        {\n          '.': './entrypoint.js',\n          './dist/': './dist/',\n          './dist/esm/helpers.js': './dist/esm/helpers.js',\n        },\n        {cwd: __dirname + '/esinstall/package-entrypoints/export-map-trailing-slash'},\n      );\n\n      expect(map).toStrictEqual({\n        '.': './entrypoint.js',\n        './dist/index.js': './dist/index.js',\n        './dist/esm/helpers.js': './dist/esm/helpers.js',\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/fixture-utils.js",
    "content": "const rimraf = require('rimraf');\nconst glob = require('glob');\nconst path = require('path');\nconst fs = require('fs').promises;\nconst snowpack = require('snowpack');\nconst assert = require('assert');\n\nconst IGNORE_EXTS = ['.png', '.jpg', '.ico']; // only read non-binary files (add more exts here as needed)\n\nconst writeFile = (file, data) =>\n  fs.mkdir(path.dirname(file), {recursive: true}).then(() => fs.writeFile(file, data));\n\nasync function runInFixture(testFiles, {absolute = false, overrides = {}} = {}, callback) {\n  const inDir = await fs.mkdtemp(path.join(__dirname, '__temp__', 'snowpack-fixture-'));\n\n  if (typeof testFiles === 'string') {\n    testFiles = {'index.js': testFiles};\n  }\n  for (const [fileLoc, fileContents] of Object.entries(testFiles)) {\n    await writeFile(\n      path.join(inDir, fileLoc),\n      fileContents.replace(/%TEMP_TEST_DIRECTORY%/g, inDir.split(path.sep).join(path.posix.sep)),\n    );\n  }\n\n  // Install any dependencies\n  const hasPackageJson = testFiles['package.json'];\n  hasPackageJson &&\n    require('child_process').execSync('yarn', {\n      cwd: inDir,\n      stdio: 'ignore',\n    });\n\n  const config = await snowpack.loadConfiguration({root: inDir, ...overrides});\n  const outDir = config.buildOptions.out;\n\n  await callback(config);\n\n  const result = {};\n  assert(path.isAbsolute(outDir));\n\n  const allFiles = glob.sync(`**/*!(${IGNORE_EXTS.join('|')})`, {\n    cwd: outDir,\n    nodir: true,\n    absolute: true,\n    dot: true,\n  });\n\n  for (const fileLoc of allFiles) {\n    result[\n      (absolute ? fileLoc : path.relative(outDir, fileLoc)).split(path.sep).join(path.posix.sep)\n    ] = require('fs').readFileSync(fileLoc, 'utf8');\n  }\n\n  const snowpackCache = glob.sync(`.snowpack/**/*!(${IGNORE_EXTS.join('|')})`, {\n    cwd: inDir,\n    nodir: true,\n    absolute: true,\n  });\n\n  for (const fileLoc of snowpackCache) {\n    result[\n      (absolute ? fileLoc : path.relative(outDir, fileLoc)).split(path.sep).join(path.posix.sep)\n    ] = require('fs').readFileSync(fileLoc, 'utf8');\n  }\n\n  // TODO: Make it easier to turn this off when debugging.\n  await rimraf.sync(inDir);\n  // Return the result.\n  return result;\n}\n\nexports.testFixture = async function testFixture(testFiles, options = {}) {\n  return runInFixture(testFiles, options, (config) => {\n    return snowpack.build({\n      config,\n      lockfile: null,\n    });\n  });\n};\n\nexports.testPrepareFixture = async function testPrepareFixture(testFiles, options = {}) {\n  return runInFixture(testFiles, options, (config) => {\n    return snowpack.preparePackages({config});\n  });\n};\n\nexports.testRuntimeFixture = async function testRuntimeFixture(\n  testFiles,\n  {absolute = false, overrides = {}} = {},\n) {\n  const inDir = await fs.mkdtemp(path.join(__dirname, '__temp__', 'snowpack-fixture-'));\n\n  if (typeof testFiles === 'string') {\n    testFiles = {'index.js': testFiles};\n  }\n  for (const [fileLoc, fileContents] of Object.entries(testFiles)) {\n    await writeFile(\n      path.join(inDir, fileLoc),\n      fileContents.replace(/%TEMP_TEST_DIRECTORY%/g, inDir.split(path.sep).join(path.posix.sep)),\n    );\n  }\n\n  // Install any dependencies\n  const hasPackageJson = testFiles['package.json'];\n  hasPackageJson &&\n    require('child_process').execSync('yarn', {\n      cwd: inDir,\n      stdio: 'ignore',\n    });\n\n  const config = await snowpack.loadConfiguration({root: inDir, ...overrides});\n  const outDir = config.buildOptions.out;\n\n  const server = await snowpack.startServer(\n    {\n      config: config,\n      lockfile: null,\n    },\n    {\n      isWatch: false,\n    },\n  );\n\n  const runtime = server.getServerRuntime();\n\n  return {\n    runtime,\n    loadUrl: server.loadUrl,\n    async writeFile(fileLoc, fileContents) {\n      await writeFile(\n        path.join(inDir, fileLoc),\n        fileContents.replace(/%TEMP_TEST_DIRECTORY%/g, inDir.split(path.sep).join(path.posix.sep)),\n      );\n      server.markChanged(path.join(inDir, fileLoc));\n    },\n    readFiles() {\n      const result = {};\n      assert(path.isAbsolute(outDir));\n\n      const allFiles = glob.sync(`**/*!(${IGNORE_EXTS.join('|')})`, {\n        cwd: outDir,\n        nodir: true,\n        absolute: true,\n        dot: true,\n      });\n\n      for (const fileLoc of allFiles) {\n        result[\n          (absolute ? fileLoc : path.relative(outDir, fileLoc)).split(path.sep).join(path.posix.sep)\n        ] = require('fs').readFileSync(fileLoc, 'utf8');\n      }\n\n      const snowpackCache = glob.sync(`.snowpack/**/*.{${UTF8_FRIENDLY_EXTS.join(',')}}`, {\n        cwd: inDir,\n        nodir: true,\n        absolute: true,\n      });\n\n      for (const fileLoc of snowpackCache) {\n        result[\n          (absolute ? fileLoc : path.relative(outDir, fileLoc)).split(path.sep).join(path.posix.sep)\n        ] = require('fs').readFileSync(fileLoc, 'utf8');\n      }\n    },\n\n    async cleanup() {\n      // TODO: Make it easier to turn this off when debugging.\n      await rimraf.sync(inDir);\n      await server.shutdown();\n    },\n  };\n};\n"
  },
  {
    "path": "test/rollup-plugins.test.js",
    "content": "const {\n  rollupPluginStripSourceMapping,\n} = require('../esinstall/lib/rollup-plugins/rollup-plugin-strip-source-mapping.js');\n\ndescribe('snowpack:rollup-plugin-strip-source-mapping', () => {\n  const tests = [\n    {\n      name: 'inline',\n      given: `console.log('foo');//# sourceMappingURL=js.map.js`,\n      expected: `console.log('foo');`,\n    },\n    {\n      name: 'end of file',\n      given: `console.log('foo');\n//# sourceMappingURL=js.map.js`,\n      expected: `console.log('foo');\n`,\n    },\n    {\n      name: 'middle of file',\n      given: `console.log('foo');\n//# sourceMappingURL=js.map.js\nconsole.log('bar');\n  //# sourceMappingURL=js.map.js`,\n      expected: `console.log('foo');\n\nconsole.log('bar');\n  `,\n    },\n    {\n      name: 'inside string', // leave alone\n      given: `const myString ='//# sourceMappingURL=js.map.js';`,\n      expected: `const myString ='//# sourceMappingURL=js.map.js';`,\n    },\n    {\n      name: 'es-module-shim', // leave alone\n      given: `    sourceMappingResolved = \\`\\n//# sourceMappingURL=\\` + resolveUrl(sourceMapping.slice(21), load.r);`,\n      expected: `    sourceMappingResolved = \\`\\n//# sourceMappingURL=\\` + resolveUrl(sourceMapping.slice(21), load.r);`,\n    },\n  ];\n\n  const {transform} = rollupPluginStripSourceMapping();\n\n  tests.forEach(({name, given, expected}) => {\n    it(name, () => {\n      expect(transform(given).code).toBe(expected);\n    });\n  });\n});\n"
  },
  {
    "path": "test/snowpack/__template__/index.test.js",
    "content": "const {testFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('suite', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('test', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        // Content to prevent readFile error\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {}\n      `,\n    });\n    expect(result['index.js']);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/cdnUrls/index.test.js",
    "content": "const {testFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('cdnUrls', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Preserves CDN URLs in HTML', async () => {\n    const result = await testFixture({\n      'index.html': dedent`\n          <!DOCTYPE html>\n          <html lang=\"en\">\n            <head>\n              <meta charset=\"utf-8\" />\n              <link rel=\"icon\" href=\"/favicon.ico\" />\n              <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n              <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n              <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n              <title>Snowpack App</title>\n            </head>\n            <body>\n              <div id=\"root\"></div>\n              <noscript>You need to enable JavaScript to run this app.</noscript>\n              <!-- TEST: Don't break on remote script tags -->\n              <script src=\"https://unpkg.com/browse/preact@10.4.5/dist/preact.js\"></script>\n              <script type=\"module\" src=\"/_dist_/index.js\"></script>\n            </body>\n          </html> \n        `,\n    });\n    expect(result['index.html']).toContain(\n      '<script src=\"https://unpkg.com/browse/preact@10.4.5/dist/preact.js\"></script>',\n    );\n  });\n\n  it('Preserves CDN URLs in JS', async () => {\n    const result = await testFixture({\n      'index.jsx': dedent`\n          import React from 'https://cdn.skypack.dev/react@^17.0.0';\n          import ReactDOM from 'https://cdn.skypack.dev/react-dom@^17.0.0';\n          const App = () => <div>I’m an app!</div>;  \n          ReactDOM.render(<App />, document.getElementById('root'));\n        `,\n    });\n    expect(result['index.js']).toContain(\n      'import React from \"https://cdn.skypack.dev/react@^17.0.0\";',\n    );\n    expect(result['index.js']).toContain(\n      'import ReactDOM from \"https://cdn.skypack.dev/react-dom@^17.0.0\";',\n    );\n  });\n\n  it('Doesn’t install CDN packages locally', async () => {\n    const result = await testFixture({\n      'index.jsx': dedent`\n          import React from 'https://cdn.skypack.dev/react@^17.0.0';\n          import ReactDOM from 'https://cdn.skypack.dev/react-dom@^17.0.0';\n          const App = () => <div>I’m an app!</div>; \n          ReactDOM.render(<App />, document.getElementById('root'));\n        `,\n    });\n    expect(result['_snowpack/pkg/react.js']).not.toBeDefined();\n    expect(result['_snowpack/pkg/react-dom.js']).not.toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/alias/__snapshots__/index.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`alias Rewrites imports as expected 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <script type=\\\\\"module\\\\\" src=\\\\\"https://example.com/foo/_dist_/index.js\\\\\"></script>\n    <script type=\\\\\"module\\\\\">\n      // Path aliases\n      import {flatten} from '../TEST_WMU/pkg/array-flatten.js';\n      import * as aliasedDep from '../TEST_WMU/pkg/array-flatten.js';\n      console.log(flatten, aliasedDep);\n\n      // Importing a relative URL\n      import sort from './sort.js'; // relative import\n      import sort_ from './sort.js'; // bare import using alias\n      import sort__ from './sort.js'; // bare import using alias + extension\n      import sort___ from './sort.js'; // bare import using alias with trailing slash\n      import sort____ from './sort.js'; // bare import using file alias\n      console.log(sort, sort_, sort__, sort___, sort____);\n\n      // Importing a 1:1 built file\n      import oneToOneBuild from './test-mjs.js'; // plugin-provided file extension\n      import oneToOneBuild_ from './test-mjs.js'; // plugin-provided, missing file extension\n      console.log(oneToOneBuild, oneToOneBuild_);\n\n      // Importing a 1:N built file\n      import oneToManyBuild from './foo.svelte.js'; // plugin-provided file extension\n      console.log(oneToManyBuild);\n\n      // Importing an absolute URL: we don't touch these\n      import absoluteUrl from './sort.js'; // absolute import\n      import absoluteUrl_ from './foo.svelte.js'; // absolute URL, plugin-provided file extension\n      import absoluteUrl__ from './test-mjs.js'; // absolute URL, missing file extension\n      console.log(absoluteUrl, absoluteUrl_, absoluteUrl__);\n\n      // Importing a directory index.js file\n      import components from './components/index.js'; // relative import\n      import components_ from './components/index.js'; // relative import with index appended\n      import components__ from './components/index.js'; // relative import with index appended\n      import components___ from './components/index.js'; // bare import using alias\n      import components____ from './components/index.js'; // bare import using alias and index appended\n      import components_____ from './components/index.js'; // bare import using alias and index.js appended\n      console.log(\n        components,\n        components_,\n        components__,\n        components___,\n        components____,\n        components_____,\n      );\n\n      // Importing something that isn't JS\n      import styles from './components/style.css.proxy.js'; // relative import\n      import styles_ from './components/style.css.proxy.js'; // relative import\n      console.log(styles, styles_);\n\n      import robotsTxtRef from '../robots.txt.proxy.js';\n      import robotsTxtRef_ from '../robots.txt.proxy.js';\n      console.log(robotsTxtRef, robotsTxtRef_);\n    </script>\n\n    <!-- exception test 1: comments should be ignored -->\n    <!-- <script type=\\\\\"module\\\\\" src=\\\\\"preact\\\\\"></script> -->\n\n    <!-- exception test 2: ignore script tags that aren’t type=\\\\\"module\\\\\" -->\n    <script src=\\\\\"svelte\\\\\"></script>\n\n    <!-- exception test 3: obviously ignore HTML (this tests our RegEx) -->\n    <pre><code>import React from 'react';</code></pre>\n\n    <script></script>\n  </body>\n</html>\"\n`;\n\nexports[`alias Rewrites imports as expected 2`] = `\n\"// Path aliases\nimport {flatten} from '../TEST_WMU/pkg/array-flatten.js';\nimport * as aliasedDep from '../TEST_WMU/pkg/array-flatten.js';\nconsole.log(flatten, aliasedDep);\n\n// Importing a relative URL\nimport sort from './sort.js'; // relative import\nimport sort_ from './sort.js'; // bare import using alias\nimport sort__ from './sort.js'; // bare import using alias + extension\nimport sort___ from './sort.js'; // bare import using alias with trailing slash\nimport sort____ from './sort.js'; // bare import using file alias\nconsole.log(sort, sort_, sort__, sort___, sort____);\n\n// Importing a 1:1 built file\nimport oneToOneBuild from './test-mjs.js'; // plugin-provided file extension\nimport oneToOneBuild_ from './test-mjs.js'; // plugin-provided, missing file extension\nconsole.log(oneToOneBuild, oneToOneBuild_);\n\n// Importing a 1:N built file\nimport oneToManyBuild from './foo.svelte.js'; // plugin-provided file extension\nconsole.log(oneToManyBuild);\n\n// Importing an absolute URL: we don't touch these\nimport absoluteUrl from './sort.js'; // absolute URL\nimport absoluteUrl_ from './foo.svelte.js'; // absolute URL\nimport absoluteUrl__ from './test-mjs.js'; // absolute URL\nconsole.log(absoluteUrl, absoluteUrl_, absoluteUrl__);\n\n// Importing a directory index.js file\nimport components from './components/index.js'; // relative import\nimport components______ from './components/index.js'; // relative import with trailing slash\nimport components_ from './components/index.js'; // relative import with index appended\nimport components__ from './components/index.js'; // relative import with index appended\nimport components___ from './components/index.js'; // bare import using alias\nimport components____ from './components/index.js'; // bare import using alias and index appended\nimport components_____ from './components/index.js'; // bare import using alias and index.js appended\nimport components2 from './components/index.js'; // alias % to '.'\nconsole.log(\n  components,\n  components_,\n  components__,\n  components___,\n  components____,\n  components_____,\n  components______,\n  components2,\n);\n\n// Importing something that isn't JS\nimport styles from './components/style.css.proxy.js'; // relative import\nimport styles_ from './components/style.css.proxy.js'; // relative import\nconsole.log(styles, styles_);\n\nimport adSvg from '../TEST_WMU/pkg/@fortawesome/fontawesome-free/svgs/solid/ad.svg.proxy.js';\nconsole.log(adSvg);\n\n// Importing across mounted directories\nimport robotsTxtRef from '../robots.txt.proxy.js';\nimport robotsTxtRef_ from '../robots.txt.proxy.js';\nconsole.log(robotsTxtRef, robotsTxtRef_);\"\n`;\n\nexports[`alias Rewrites imports as expected 3`] = `\n\"// importing index.js by shortcut\nimport index from './index.js';\nimport index_ from './index.js';\nimport index__ from '../index.js';\nimport index___ from '../index.js';\nconsole.log(index, index_, index__, index___);\"\n`;\n"
  },
  {
    "path": "test/snowpack/config/alias/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('alias', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Rewrites imports as expected', async () => {\n    const result = await testFixture({\n      'packages/css-package-a/style.css': dedent`\n          body {\n            color: red;\n          }\n        `,\n      'packages/css-package-a/package.json': dedent`\n          {\n            \"name\": \"css-package-a\",\n            \"version\": \"1.2.3\"\n          }\n        `,\n      'packages/css-package-b/style.css': dedent`\n          body {\n            color: blue;\n          }\n        `,\n      'packages/css-package-b/package.json': dedent`\n          {\n            \"name\": \"css-package-a\",\n            \"version\": \"1.2.3\"\n          }\n        `,\n      'public/robots.txt': dedent`\n          THIS IS A ROBOTS.TXT TEST FILE\n        `,\n      'src/foo.svelte': dedent`\n          <div class=\"Foo\" />\n        `,\n      'src/index.html': dedent`\n          <!DOCTYPE html>\n          <html lang=\"en\">\n            <head>\n              <meta charset=\"utf-8\" />\n              <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n              <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n              <title>Snowpack App</title>\n            </head>\n            <body>\n              <script type=\"module\" src=\"%PUBLIC_URL%/_dist_/index.js\"></script>\n              <script type=\"module\">\n                // Path aliases\n                import {flatten} from 'array-flatten';\n                import * as aliasedDep from 'aliased-dep';\n                console.log(flatten, aliasedDep);\n\n                // Importing a relative URL\n                import sort from './sort'; // relative import\n                import sort_ from '@app/sort'; // bare import using alias\n                import sort__ from '@app/sort.js'; // bare import using alias + extension\n                import sort___ from '@/sort'; // bare import using alias with trailing slash\n                import sort____ from '@sort'; // bare import using file alias\n                console.log(sort, sort_, sort__, sort___, sort____);\n\n                // Importing a 1:1 built file\n                import oneToOneBuild from './test-mjs.mjs'; // plugin-provided file extension\n                import oneToOneBuild_ from './test-mjs'; // plugin-provided, missing file extension\n                console.log(oneToOneBuild, oneToOneBuild_);\n\n                // Importing a 1:N built file\n                import oneToManyBuild from './foo.svelte'; // plugin-provided file extension\n                console.log(oneToManyBuild);\n\n                // Importing an absolute URL: we don't touch these\n                import absoluteUrl from '/_dist_/sort.js'; // absolute import\n                import absoluteUrl_ from '/_dist_/foo.svelte.js'; // absolute URL, plugin-provided file extension\n                import absoluteUrl__ from '/_dist_/test-mjs.js'; // absolute URL, missing file extension\n                console.log(absoluteUrl, absoluteUrl_, absoluteUrl__);\n\n                // Importing a directory index.js file\n                import components from './components'; // relative import\n                import components_ from './components/index'; // relative import with index appended\n                import components__ from './components/index.js'; // relative import with index appended\n                import components___ from '@app/components'; // bare import using alias\n                import components____ from '@app/components/index'; // bare import using alias and index appended\n                import components_____ from '@app/components/index.js'; // bare import using alias and index.js appended\n                console.log(\n                  components,\n                  components_,\n                  components__,\n                  components___,\n                  components____,\n                  components_____,\n                );\n\n                // Importing something that isn't JS\n                import styles from './components/style.css'; // relative import\n                import styles_ from '@app/components/style.css'; // relative import\n                console.log(styles, styles_);\n\n                import robotsTxtRef from '../public/robots.txt';\n                import robotsTxtRef_ from '$public/robots.txt';\n                console.log(robotsTxtRef, robotsTxtRef_);\n              </script>\n\n              <!-- exception test 1: comments should be ignored -->\n              <!-- <script type=\"module\" src=\"preact\"></script> -->\n\n              <!-- exception test 2: ignore script tags that aren’t type=\"module\" -->\n              <script src=\"svelte\"></script>\n\n              <!-- exception test 3: obviously ignore HTML (this tests our RegEx) -->\n              <pre><code>import React from 'react';</code></pre>\n\n              <script></script>\n            </body>\n          </html>\n        `,\n      'src/index.js': dedent`\n          // Path aliases\n          import {flatten} from 'array-flatten';\n          import * as aliasedDep from 'aliased-dep';\n          console.log(flatten, aliasedDep);\n\n          // Importing a relative URL\n          import sort from './sort'; // relative import\n          import sort_ from '@app/sort'; // bare import using alias\n          import sort__ from '@app/sort.js'; // bare import using alias + extension\n          import sort___ from '@/sort'; // bare import using alias with trailing slash\n          import sort____ from '@sort'; // bare import using file alias\n          console.log(sort, sort_, sort__, sort___, sort____);\n\n          // Importing a 1:1 built file\n          import oneToOneBuild from './test-mjs.mjs'; // plugin-provided file extension\n          import oneToOneBuild_ from './test-mjs'; // plugin-provided, missing file extension\n          console.log(oneToOneBuild, oneToOneBuild_);\n\n          // Importing a 1:N built file\n          import oneToManyBuild from './foo.svelte'; // plugin-provided file extension\n          console.log(oneToManyBuild);\n\n          // Importing an absolute URL: we don't touch these\n          import absoluteUrl from '/_dist_/sort.js'; // absolute URL\n          import absoluteUrl_ from '/_dist_/foo.svelte.js'; // absolute URL\n          import absoluteUrl__ from '/_dist_/test-mjs.js'; // absolute URL\n          console.log(absoluteUrl, absoluteUrl_, absoluteUrl__);\n\n          // Importing a directory index.js file\n          import components from './components'; // relative import\n          import components______ from './components/'; // relative import with trailing slash\n          import components_ from './components/index'; // relative import with index appended\n          import components__ from './components/index.js'; // relative import with index appended\n          import components___ from '@app/components'; // bare import using alias\n          import components____ from '@app/components/index'; // bare import using alias and index appended\n          import components_____ from '@app/components/index.js'; // bare import using alias and index.js appended\n          import components2 from '%/src/components'; // alias % to '.'\n          console.log(\n            components,\n            components_,\n            components__,\n            components___,\n            components____,\n            components_____,\n            components______,\n            components2,\n          );\n\n          // Importing something that isn't JS\n          import styles from './components/style.css'; // relative import\n          import styles_ from '@app/components/style.css'; // relative import\n          console.log(styles, styles_);\n\n          import adSvg from '@fortawesome/fontawesome-free/svgs/solid/ad.svg';\n          console.log(adSvg);\n\n          // Importing across mounted directories\n          import robotsTxtRef from '../public/robots.txt';\n          import robotsTxtRef_ from '$public/robots.txt';\n          console.log(robotsTxtRef, robotsTxtRef_);\n        `,\n      'src/sort.js': dedent`\n          export default (arr) => arr.sort();\n        `,\n      'src/test-mjs.mjs': dedent`\n          // Path aliases\n          import {flatten} from 'array-flatten';\n          console.log(flatten);\n        `,\n      'src/components/index.js': dedent`\n          import sort from '../sort';\n          console.log(sort);\n\n          export default 'Button';\n        `,\n      'src/components/style.css': dedent`\n          /* Include 2+ imports to make sure regex isn't borked. */\n          @import 'css-package-a/style.css';\n          @import '@css/package-b/style.css';\n        `,\n      'src/nested/index.js': dedent`\n          import sort from '../sort';\n          console.log(sort);\n\n          export default 'Button';\n        `,\n      'src/nested/foo.js': dedent`\n          // importing index.js by shortcut\n          import index from '.';\n          import index_ from './';\n          import index__ from '..';\n          import index___ from '../';\n          console.log(index, index_, index__, index___);\n        `,\n      'simple-file-extension-change-plugin.js': dedent`\n          const {load} = require('signal-exit');\n\n          module.exports = function () {\n            return {\n              resolve: {\n                input: ['.svelte'],\n                output: ['.js', '.css'],\n              },\n              load() {\n                // Not tested in this test.\n                return null;\n              },\n            };\n          };\n        `,\n      'package.json': dedent`\n          {\n            \"private\": true,\n            \"version\": \"1.0.1\",\n            \"name\": \"@snowpack/test-build-config-alias\",\n            \"dependencies\": {\n              \"@fortawesome/fontawesome-free\": \"^5.14.0\",\n              \"array-flatten\": \"^3.0.0\",\n              \"css-package-a\": \"file:./packages/css-package-a\",\n              \"@css/package-b\": \"file:./packages/css-package-b\"\n            }\n          }\n        `,\n      'snowpack.config.js': dedent`\n          module.exports = {\n            alias: {\n              'aliased-dep': 'array-flatten',\n              '@app': './src',\n              '@/': './src/',\n              '%': '.',\n              '@sort': './src/sort.js',\n              $public: './public',\n            },\n            mount: {\n              './src': '/_dist_',\n              './public': '/',\n            },\n            buildOptions: {\n              baseUrl: 'https://example.com/foo',\n              metaUrlPath: '/TEST_WMU/',\n            },\n            plugins: ['@snowpack/plugin-svelte', './simple-file-extension-change-plugin.js'],\n          }\n        `,\n    });\n\n    expect(result['_dist_/index.html']).toMatchSnapshot();\n    expect(result['_dist_/index.js']).toMatchSnapshot();\n    expect(result['_dist_/nested/foo.js']).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/buildOptions.baseUrl/index.test.js",
    "content": "const dedent = require('dedent');\nconst {testFixture} = require('../../../fixture-utils');\n\ndescribe('buildOptions.baseUrl', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  describe.each([\n    ['local URL path', '/static/'],\n    ['remote URL', 'https://www.example.com'],\n  ])('%s', (_, baseUrl) => {\n    const config = dedent`\n      module.exports = {\n        buildOptions: {\n          baseUrl: \"${baseUrl}\"\n        }\n      }\n    `;\n\n    it('generates correct relative package imports', async () => {\n      const result = await testFixture({\n        'index.js': `import {flatten} from 'array-flatten';`,\n        'snowpack.config.js': config,\n      });\n      expect(result['_snowpack/pkg/array-flatten.js']).toBeDefined();\n      expect(result['index.js']).toContain(\n        `import {flatten} from './_snowpack/pkg/array-flatten.js';`,\n      );\n    });\n\n    it('generates correct <link> attributes', async () => {\n      const result = await testFixture({\n        'index.html': dedent`\n          <!DOCTYPE html>\n          <html lang=\"en\">\n            <head>\n              <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n              <link rel=\"stylesheet\" type=\"text/css\" href=\"%PUBLIC_URL%/index.css\" />\n            </head>\n          </html>\n        `,\n        'snowpack.config.js': config,\n      });\n      expect(result['index.html']).toContain(baseUrl);\n    });\n\n    it('generates correct <script> attributes', async () => {\n      const result = await testFixture({\n        'index.html': dedent`\n          <!DOCTYPE html>\n          <html lang=\"en\">\n            <body><script type=\"module\" src=\"%PUBLIC_URL%/_dist_/index.js\"></script></body>\n          </html>\n        `,\n        'snowpack.config.js': config,\n      });\n      expect(result['index.html']).toContain(baseUrl);\n    });\n\n    it('generates correct import proxies', async () => {\n      const result = await testFixture({\n        'index.js': `import logo from './logo.png';`,\n        'logo.png': '',\n        'snowpack.config.js': config,\n      });\n\n      expect(result['index.js']).toContain(`import logo from './logo.png.proxy.js';`);\n      expect(result['logo.png.proxy.js']).toContain(baseUrl);\n    });\n\n    it('generates correct import.meta.env imports', async () => {\n      const result = await testFixture({\n        'index.js': `console.log(import.meta.env)`,\n        'snowpack.config.js': config,\n      });\n\n      expect(result['index.js']).toContain(\n        `import * as __SNOWPACK_ENV__ from './_snowpack/env.js'`,\n      );\n      expect(result['index.js']).toContain(`console.log(__SNOWPACK_ENV__)`);\n    });\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/buildOptions.jsxInject/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('buildOptions.jsxInject', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Injects JSX factory function where appropriate', async () => {\n    const result = await testFixture({\n      'index.html': dedent`\n          <!DOCTYPE html>\n          <html lang=\"en\">\n            <head>\n              <meta charset=\"utf-8\" />\n              <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n              <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n              <title>Snowpack App</title>\n            </head>\n            <body>\n              <script type=\"module\" src=\"%PUBLIC_URL%/index.js\"></script>\n            </body>\n          </html>\n        `,\n      'js-file.js': dedent`export default 'no-jsx';`,\n      'ts-file.ts': dedent`export default 'no-jsx';`,\n      'jsx-file.jsx': dedent`const Component = () => <><h1>Hello world!</h1></>;`,\n      'tsx-file.tsx': dedent`const Component = () => <><h1>Hello world!</h1></>;`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          buildOptions: {\n            jsxInject: 'import { h, Fragment } from \"preact\";',\n          },\n        };\n      `,\n    });\n    const injected = 'import {h, Fragment} from \"./_snowpack/pkg/preact.js\";';\n    // Don't inject JSX factory functions where there is no JSX\n    expect(result['js-file.js']).not.toContain(injected);\n    expect(result['ts-file.js']).not.toContain(injected);\n    // Inject JSX factory functions where there is JSX\n    expect(result['jsx-file.js']).toContain(injected);\n    expect(result['tsx-file.js']).toContain(injected);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/buildOptions.metaUrlPath/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('buildOptions.metaUrlPath', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Uses the meta url path in the config with knownEntrypoints', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import {flatten} from 'array-flatten';\n        console.log(flatten);\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            knownEntrypoints: ['array-flatten'],\n          },\n          buildOptions: {\n            metaUrlPath: 'other_folder',\n          },\n        };\n      `,\n    });\n    expect(result['other_folder/pkg/array-flatten.js']).toBeDefined();\n    expect(result['index.js']).toContain(\n      `import {flatten} from './other_folder/pkg/array-flatten.js';`,\n    );\n  });\n\n  it('Uses the meta url path in the config with mounted directory', async () => {\n    const result = await testFixture({\n      'public/index.js': dedent`\n          export default function doNothing() {}\n          console.log(import.meta.env);        \n        `,\n      'public/sub/index.js': dedent`\n          export default function doNothing() {}\n          console.log(import.meta.env);        \n        `,\n      'snowpack.config.js': dedent`\n          module.exports = {\n            mount: {\n              './public': '/',\n            },\n            buildOptions: {\n              metaUrlPath: '/static/snowpack',\n            },\n          };\n        `,\n    });\n    expect(result['static/snowpack/env.js']).toBeDefined();\n    expect(result['index.js']).toContain(\n      `import * as __SNOWPACK_ENV__ from './static/snowpack/env.js';`,\n    );\n    expect(result['sub/index.js']).toContain(\n      `import * as __SNOWPACK_ENV__ from '../static/snowpack/env.js';`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/buildOptions.out/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('buildOptions.out', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('builds to the correct relative out path', async () => {\n    const result = await testFixture(\n      {\n        'index.js': `// Intentionally left blank`,\n        'snowpack.config.js': dedent`\n          module.exports = {\n            buildOptions: {\n              out: 'TEST_OUT'\n            }\n          }\n        `,\n      },\n      {absolute: true},\n    );\n    expect(Object.keys(result).every((f) => f.includes('TEST_OUT')));\n  });\n\n  it('builds to the correct absolute out path', async () => {\n    const result = await testFixture(\n      {\n        'index.js': `// Intentionally left blank.`,\n        'snowpack.config.js': dedent`\n          module.exports = {\n            buildOptions: {\n              out: '%TEMP_TEST_DIRECTORY%/TEST_OUT'\n            }\n          }\n        `,\n      },\n      {absolute: true},\n    );\n    expect(Object.keys(result).every((f) => f.includes('TEST_OUT')));\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/env/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('env', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Should load environment from config', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n          console.log(import.meta.env['API_URL']);\n        `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          env: {\n            API_URL: 'TEST'\n          },\n        };\n      `,\n    });\n    expect(result['_snowpack/env.js']).toContain('export const API_URL = \"TEST\";');\n  });\n\n  it('Should inject env variables into HTML', async () => {\n    const result = await testFixture({\n      'index.html': dedent`\n        <!DOCTYPE html>\n        <html\n          lang=\"en\"\n          data-mode=\"%MODE%\"\n          data-public-url=\"%PUBLIC_URL%\"\n          data-my-env-var=\"%API_URL%\"\n          data-edge-case-test=\"%SNOWPACK_PUBLIC_%\"\n          data-undefined=\"%SNOWPACK_PUBLIC_BUILD_UNDEFINED%\"\n        >\n          <head>\n            <meta charset=\"utf-8\" />\n            <link rel=\"icon\" href=\"/favicon.ico\" />\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n            <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n            <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n            <title>Snowpack App</title>\n          </head>\n          <body></body>\n        </html>\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          env: {\n            API_URL: 'my-var-replacement'\n          },\n        };\n      `,\n    });\n\n    expect(result['index.html']).toContain('lang=\"en\"');\n    expect(result['index.html']).toContain('data-mode=\"production\"');\n    expect(result['index.html']).toContain('data-my-env-var=\"my-var-replacement\"');\n    expect(result['index.html']).toContain('data-edge-case-test=\"%SNOWPACK_PUBLIC_%\"');\n    expect(result['index.html']).toContain('data-undefined=\"%SNOWPACK_PUBLIC_BUILD_UNDEFINED%\"');\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/invalid/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('invalid', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'warn';\n  });\n\n  it('Warns of invalid config values', async () => {\n    await testFixture({\n      'index.js': dedent`\n        // Intentionally left blank\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          buildOptions: {\n            ssr: 'shallow-equal',\n          },\n        };\n      `,\n    }).catch((e) =>\n      expect(e.message).toMatch('- snowpack.buildOptions.ssr is not of a type(s) boolean'),\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/mode/index.test.js",
    "content": "const dedent = require('dedent');\nconst {testFixture} = require('../../../fixture-utils');\n\ndescribe('mode', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'warn';\n  });\n\n  it('throws when mode is some unknown value', async () => {\n    await testFixture({\n      'index.js': dedent`console.log(import.meta.env.MODE)`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mode: 'UNEXPECTED'\n        }\n      `,\n    }).catch((e) =>\n      expect(e.message).toMatch(\n        '- snowpack.mode is not one of enum values: test,development,production',\n      ),\n    );\n  });\n\n  // For some reason, this is failing in CI. I think Luke Jackson has probably already solved this in his PR.\n  // Otherwise, take the time to investigate and understand why.\n  describe.each([\n    ['mode=production', 'production'],\n    ['mode=development', 'development'],\n    ['mode=test', 'test'],\n  ])('%s', (_, modeValue) => {\n    it('builds correctly', async () => {\n      const result = await testFixture({\n        'index.js': dedent`console.log(import.meta.env.MODE)`,\n        'snowpack.config.js': dedent`\n          module.exports = {\n            mode: '${modeValue}'\n          }\n        `,\n      });\n      expect(result['_snowpack/env.js']).toContain(`const NODE_ENV = \"${modeValue}\"`);\n    });\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/mount/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\nconst advanced = {\n  'src/g/dep.js': dedent`\n    console.log('dep');\n  `,\n  'src/g/.dotfile': dedent`\n    # I am a dotfile.\n  `,\n  'src/g/index.jsx': dedent`\n    import './dep';\n    console.log('index');\n  `,\n  'src/g/main.html': dedent`\n    <!DOCTYPE html>\n    <html lang=\"en\">\n      <head>\n        <meta charset=\"utf-8\" />\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n        <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n        <title>Snowpack App</title>\n      </head>\n      <body>\n        <script type=\"module\" src=\"%PUBLIC_URL%/_dist_/index.js\"></script>\n        <script type=\"module\">\n          import './dep';\n          console.log('main');\n        </script>\n      </body>\n    </html>\n  `,\n};\n\nconst node_modules = {\n  'node_modules/explicit/index.js': dedent`\n    console.log('explicit');\n  `,\n  'node_modules/explicit/node_modules/implicit/index.js': dedent`\n    console.log('implicit:nested');\n  `,\n  'node_modules/implicit/index.js': dedent`\n    console.log('implicit');\n  `,\n};\n\ndescribe('mount', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Allows direct mappings', async () => {\n    const result = await testFixture({\n      'a/index.js': dedent`console.log('a');`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            a: '/a'\n          }\n        };\n      `,\n    });\n    expect(result['a/index.js']).toContain(\"console.log('a');\");\n  });\n\n  it('Allows renamed mappings', async () => {\n    const result = await testFixture({\n      'src/b/index.js': dedent`console.log('b');`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/b': '/new-b'\n          }\n        };\n      `,\n    });\n    expect(result['new-b/index.js']).toContain(\"console.log('b');\");\n  });\n\n  it('Allows deep to deep renamed mappings', async () => {\n    const result = await testFixture({\n      'src/c/index.js': dedent`console.log('c');`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/c': '/deep/c'\n          }\n        };\n      `,\n    });\n    expect(result['deep/c/index.js']).toContain(\"console.log('c');\");\n  });\n\n  it('Allows mapping to directory with a trailing slash', async () => {\n    const result = await testFixture({\n      'src/d/index.js': dedent`console.log('d');`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/d': '/bad/d'\n          }\n        };\n      `,\n    });\n    expect(result['bad/d/index.js']).toContain(\"console.log('d');\");\n  });\n\n  it('Allows deep to shallow renamed mappings', async () => {\n    const result = await testFixture({\n      'src/e/f/index.js': dedent`console.log('e/f');`,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/e/f': '/e'\n          }\n        };\n      `,\n    });\n    expect(result['e/index.js']).toContain(\"console.log('e/f');\");\n  });\n\n  it('Allows mappings with transforms and import resolution on HTML and JS', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {\n              url: '/g',\n              static: false,\n              resolve: true,\n            },\n          }\n        };\n      `,\n    });\n    // JSX was transformed and imports resolved\n    expect(result['g/index.jsx']).not.toBeDefined();\n    expect(result['g/index.js']).toContain('import \"./dep.js\";');\n    // HTML imports were resolved\n    expect(result['g/main.html']).not.toContain('%PUBLIC_URL%');\n    expect(result['g/main.html']).toContain(\"import './dep.js';\");\n  });\n\n  it('Allows mappings with no transforms or import resolution on HTML and JS', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {\n              url: '/g',\n              static: true,\n              resolve: false,\n            },\n          }\n        };\n      `,\n    });\n    // JSX was not transformed and inputs not resolved\n    expect(result['g/index.js']).not.toBeDefined();\n    expect(result['g/index.jsx']).toContain(\"import './dep';\");\n    // HTML imports were not resolved\n    expect(result['g/main.html']).toContain('%PUBLIC_URL%');\n    expect(result['g/main.html']).toContain(\"import './dep';\");\n  });\n\n  it('Allows mappings with transforms but no import resolution on HTML and JS', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {\n              url: '/g',\n              static: false,\n              resolve: false,\n            },\n          }\n        };\n      `,\n    });\n    // JSX was transformed but imports not resolved\n    expect(result['g/index.js']).toContain('import \"./dep\";');\n    // HTML imports were not resolved\n    expect(result['g/main.html']).toContain('%PUBLIC_URL%');\n    expect(result['g/main.html']).toContain(\"import './dep';\");\n  });\n\n  it('Allows mappings with no transforms but import resolution on HTML', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {\n              url: '/g',\n              static: true,\n              resolve: true,\n            },\n          }\n        };\n      `,\n    });\n    // JSX was not transformed and imports not resolved\n    expect(result['g/index.jsx']).toContain(\"import './dep';\");\n    // HTML imports were resolved\n    expect(result['g/main.html']).not.toContain('%PUBLIC_URL%');\n    expect(result['g/main.html']).toContain(\"import './dep.js';\");\n  });\n\n  it('Allows explicity mounting directories within node_modules but does not mount implicit node_modules files', async () => {\n    const result = await testFixture({\n      ...node_modules,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'node_modules/explicit': {\n              url: '/explicit',\n              static: false,\n              resolve: true\n            },\n          }\n        };\n      `,\n    });\n\n    // Mounted node_modules directory is correctly transformed\n    expect(result['explicit/index.js']).toContain('explicit');\n    // Unmounted node_modules directories are not included\n    expect(result['explicit/node_modules/implicit/index.js']).not.toBeDefined();\n    expect(result['node_modules/implicit/index.js']).not.toBeDefined();\n  });\n\n  it('Ignores dotfiles when \"dot\" is undefined', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {url: '/g'},\n          }\n        };\n      `,\n    });\n    expect(result['g/.dotfile']).not.toBeDefined();\n  });\n\n  it('Ignores dotfiles when \"dot\" is false', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {url: '/g', dot: false},\n          }\n        };\n      `,\n    });\n    expect(result['g/.dotfile']).not.toBeDefined();\n  });\n\n  it('Includes dotfiles when \"dot\" is true', async () => {\n    const result = await testFixture({\n      ...advanced,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            'src/g': {url: '/g', dot: true},\n          }\n        };\n      `,\n    });\n    expect(result['g/.dotfile']).toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/optimize/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('optimize', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Bundles and optimizes all project files', async () => {\n    const result = await testFixture({\n      'src/App.css': dedent`\n        .App {\n            text-align: center;\n        }\n        .App code {\n            background: #FFF3;\n            padding: 4px 8px;\n            border-radius: 4px;\n        }\n        .App p {\n            margin: 0.4rem;\n        }\n        .App-logo {\n            height: 40vmin;\n            pointer-events: none;\n        }\n        \n        @media (prefers-reduced-motion: no-preference) {\n          .App-logo {\n            animation: App-logo-spin infinite 20s linear;\n          }\n        }\n        \n        .App-header {\n            background-color: #282c34;\n            min-height: 100vh;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            font-size: calc(10px + 2vmin);\n            color: white;\n        }\n        \n        .App-link {\n            color: #61dafb;\n        }\n        \n        @keyframes App-logo-spin {\n          from {\n            transform: rotate(0deg);\n          }\n          to {\n            transform: rotate(360deg);\n          }\n        }\n      `,\n      'src/App.jsx': dedent`\n        import React, { useState, useEffect } from \"react\";\n        import logo from \"./logo.svg\";\n        import \"./App.css\";\n        \n        function App() {\n          // Create the count state.\n          const [count, setCount] = useState(0);\n          // Create the counter (+1 every second).\n          useEffect(() => {\n            const timer = setTimeout(() => setCount(count + 1), 1000);\n            return () => clearTimeout(timer);\n          }, [count, setCount]);\n          // Return the App component.\n          return (\n            <div className=\"App\">\n              <header className=\"App-header\">\n                <img src={logo} className=\"App-logo\" alt=\"logo\" />\n                <p>\n                  Edit <code>src/App.jsx</code> and save to reload.\n                </p>\n                <p>\n                  Page has been open for <code>{count}</code> seconds.\n                </p>\n                <p>\n                  <a\n                    className=\"App-link\"\n                    href=\"https://reactjs.org\"\n                    target=\"_blank\"\n                    rel=\"noopener noreferrer\"\n                  >\n                    Learn React\n                  </a>\n                </p>\n              </header>\n            </div>\n          );\n        }\n\n        export default App;\n      `,\n      'src/index.css': dedent`\n        body {\n          margin: 0;\n          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n          -webkit-font-smoothing: antialiased;\n          -moz-osx-font-smoothing: grayscale;\n        }\n        \n        code {\n          font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n          monospace;\n        }\n      `,\n      'src/index.jsx': dedent`\n        import React from 'react';\n        import ReactDOM from 'react-dom';\n        import App from './App.jsx';\n        import './index.css';\n        \n        ReactDOM.render(\n          <React.StrictMode>\n            <App />\n          </React.StrictMode>,\n          document.getElementById('root'),\n        );\n        \n        // Hot Module Replacement (HMR) - Remove this snippet to remove HMR.\n        // Learn more: https://www.snowpack.dev/concepts/hot-module-replacement\n        if (import.meta.hot) {\n            import.meta.hot.accept();\n        }\n      `,\n      'src/logo.svg': dedent`\n        <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 841.9 595.3\">\n          <g fill=\"#61DAFB\">\n            <path d=\"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4a43.8 43.8 0 00-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9a487.8 487.8 0 00-41.6-50c32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9a467 467 0 00-63.6 11c-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4a44 44 0 0022.5 5.6c27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7a450.4 450.4 0 01-13.5 39.5 473.3 473.3 0 00-27.5-47.4c14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5a532.7 532.7 0 01-24.1 38.2 520.3 520.3 0 01-90.2.1 551.2 551.2 0 01-45-77.8 521.5 521.5 0 0144.8-78.1 520.3 520.3 0 0190.2-.1 551.2 551.2 0 0145 77.8 560 560 0 01-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8a448.8 448.8 0 01-41.2 8 552.4 552.4 0 0027.4-47.8zM421.2 430a412.3 412.3 0 01-27.8-32 619 619 0 0055.3 0c-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9a451.2 451.2 0 01-41-7.9c3.7-12.9 8.3-26.2 13.5-39.5a473.3 473.3 0 0027.5 47.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32a619 619 0 00-55.3 0c9-11.7 18.3-22.4 27.5-32zm-74 58.9a552.4 552.4 0 00-27.4 47.7c-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9a473.5 473.5 0 00-22.2 60.6c-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9a487.8 487.8 0 0041.6 50c-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9a467 467 0 0063.6-11 280 280 0 015.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9a473.5 473.5 0 0022.2-60.6c9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z\"/>\n            <circle cx=\"420.9\" cy=\"296.5\" r=\"45.7\"/>\n          </g>\n        </svg>\n      `,\n      'public/index.html': dedent`\n        <!DOCTYPE html>\n        <html lang=\"en\">\n          <head>\n            <meta charset=\"utf-8\" />\n            <link rel=\"icon\" href=\"/favicon.ico\" />\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n            <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n            <title>Snowpack App</title>\n          </head>\n          <body>\n            <div id=\"root\"></div>\n            <noscript>You need to enable JavaScript to run this app.</noscript>\n            <script type=\"module\" src=\"/dist/index.js\"></script>\n            <!--\n              This HTML file is a template.\n              If you open it directly in the browser, you will see an empty page.\n\n              You can add webfonts, meta tags, or analytics to this file.\n              The build step will place the bundled scripts into the <body> tag.\n            -->\n          </body>\n        </html>\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            public: {url: '/', static: true},\n            src: {url: '/dist'},\n          },\n          optimize: {\n            bundle: true,\n            minify: true,\n            target: 'es2020',\n          },\n        };\n      `,\n    });\n\n    expect(Object.keys(result)).toEqual([\n      'dist/index.css',\n      'dist/index.js',\n      'dist/index.js.map',\n      'dist/logo.svg',\n      'index.html',\n    ]);\n  });\n\n  it('Treeshakes imported modules', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        // Test: complex comments intermixed with imports\n        import def, {\n          waterfall,\n          /* map, */\n          all /* , */,\n        } from 'async';\n        console.log(def, waterfall, all);\n        \n        import(/* webpackChunkName: \"array-flatten\" */ 'array-flatten');   \n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          optimize: {\n            treeshake: true,\n          },\n        };\n      `,\n    });\n\n    expect(result['_snowpack/pkg/array-flatten.js']).toBeDefined();\n    expect(result['_snowpack/pkg/async.js']).toBeDefined();\n  });\n\n  it('Creates preload links from entrypoints in HTML', async () => {\n    const result = await testFixture({\n      'public/index.html': dedent`\n        <!DOCTYPE html>\n        <html lang=\"en\">\n          <head>\n            <meta charset=\"utf-8\" />\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n            <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n            <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n            <title>Snowpack App</title>\n          </head>\n          <body>\n            <app-root></app-root>\n            <noscript>You need to enable JavaScript to run this app.</noscript>\n            <script type=\"module\" src=\"/dist/index.js\"></script>\n          </body>\n        </html> \n      `,\n      'public/index.css': dedent`\n        body {\n          background: red;\n        }\n      `,\n      'src/app-root.ts': dedent`\n        import './app-root';\n      `,\n      'src/index.ts': dedent`\n        import './app-root';\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            public: { url: '/', static: true },\n            src: { url: '/dist' },\n          },\n          optimize: { preload: true },\n        };\n      `,\n    });\n\n    expect(result['index.html']).toContain('<link rel=\"modulepreload\" href=\"/dist/index.js\">');\n    expect(result['index.html']).toContain('<link rel=\"modulepreload\" href=\"/dist/app-root.js\">');\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/packageOptions.external/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('packageOptions.external', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Does not transform imports of external modules', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import 'fs';\n        import 'array-flatten';\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            external: ['fs'],\n          },\n        };\n      `,\n    });\n\n    expect(result['index.js']).toContain(`import 'fs';`);\n  });\n\n  it('Does not install externals that are deep package imports', async () => {\n    const result = await testFixture({\n      'packages/some-thing/main.js': dedent`\n        export default 'ok';\n      `,\n      'packages/some-thing/deep.js': dedent`\n        export default 'oops';\n      `,\n      'packages/some-thing/package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"some-thing\",\n          \"module\": \"main.js\"\n        }\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-config-external\",\n          \"dependencies\": {\n            \"some-thing\": \"file:./packages/some-thing\"\n          }\n        }\n      `,\n      'index.js': dedent`\n        import 'some-thing';\n        import 'some-thing/deep.js';\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            external: ['some-thing/deep.js']\n          }\n        }\n      `,\n    });\n\n    expect(result['index.js']).toContain(`import 'some-thing/deep.js';`);\n  });\n\n  it('will make node-fetch external if marked as external', async () => {\n    const result = await testFixture({\n      'packages/other/package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"other\",\n          \"module\": \"main.js\"\n        }\n      `,\n      'packages/other/main.js': dedent`\n        export default 'works';\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-config-external-node-fetch\",\n          \"dependencies\": {\n            \"other\": \"file:./packages/other\"\n          }\n        }\n      `,\n      'index.js': dedent`\n        import 'node-fetch';\n        import 'other';\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            external: ['node-fetch']\n          }\n        }\n      `,\n    });\n\n    expect(result['index.js']).toContain(`import 'node-fetch';`);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/packageOptions.packageLookupFields/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('packageLookupFields', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'silent';\n  });\n\n  it('Should resolve modules from the package lookup fields', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import 'some-custom-lookup-package';\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-config-package-lookup-fields\",\n          \"dependencies\": {\n            \"some-custom-lookup-package\": \"file:./packages/some-custom-lookup\"\n          }\n        }\n      `,\n      'packages/some-custom-lookup/package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"some-custom-lookup-package\",\n          \"custom-lookup\": \"good.js\",\n          \"module\": \"bad.js\"\n        }\n      `,\n      'packages/some-custom-lookup/bad.js': dedent`\n        console.log('THIS IS THE BAD ENTRYPOINT');\n      `,\n      'packages/some-custom-lookup/good.js': dedent`\n        console.log('THIS IS THE GOOD ENTRYPOINT');\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            packageLookupFields: ['custom-lookup'],\n          },\n        };\n      `,\n    });\n    expect(result['index.js']).toContain(`import './_snowpack/pkg/some-custom-lookup-package.js';`);\n    expect(result['_snowpack/pkg/some-custom-lookup-package.js']).toContain(\n      `console.log('THIS IS THE GOOD ENTRYPOINT');`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/packageOptions.source/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\nconst snowpackLogger = require('snowpack').logger;\n\ndescribe('packageOptions.source', () => {\n  const prevLoggerLevel = snowpackLogger.level;\n\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    snowpackLogger.level = 'error';\n  });\n\n  afterAll(() => {\n    snowpackLogger.level = prevLoggerLevel;\n  });\n\n  it('Loads modules into cache when source is remote-next', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import { flatten } from \"array-flatten\";\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-package-source-remote-next\",\n          \"dependencies\": {\n            \"array-flatten\": \"^3.0.0\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            source: 'remote-next',\n          },\n        };\n      `,\n    });\n    expect(result['../.snowpack/source/package.json']).toBeDefined();\n    expect(result['../.snowpack/source/package-lock.json']).toBeDefined();\n    expect(result['../.snowpack/source/node_modules/array-flatten/package.json']).toBeDefined();\n  });\n\n  describe('source: \"remote\"', () => {\n    let loggerInfos = [];\n\n    beforeEach(() => {\n      // We don't have a great way to introspect the streaming resolution, so we\n      // sniff the logging messages.\n      loggerInfos = [];\n      snowpackLogger.level = 'info';\n      snowpackLogger.on('info', (message) => {\n        loggerInfos.push(message);\n      });\n    });\n\n    it('streams from pkg.snowpack.dev by default', async () => {\n      await testFixture({\n        'index.js': dedent`\n          import { flatten } from \"array-flatten\";\n        `,\n        'package.json': dedent`\n          {\n            \"version\": \"1.0.1\",\n            \"name\": \"@snowpack/test-package-source-remote\",\n            \"dependencies\": {\n            }\n          }\n        `,\n        'snowpack.config.js': dedent`\n          module.exports = {\n            packageOptions: {\n              source: 'remote',\n            },\n          };\n        `,\n      });\n\n      expect(loggerInfos).toEqual(\n        expect.arrayContaining([\n          expect.stringMatching(\n            /import array-flatten@latest → https:\\/\\/pkg.snowpack.dev\\/array-flatten/,\n          ),\n        ]),\n      );\n    });\n\n    it('streams package from the requested origin', async () => {\n      // NOTE: There is some caching issue that prevents re-acquisition of a\n      // package acquired in the 'default origin' case above, so we use a\n      // different package name here.\n      await testFixture({\n        'index.js': dedent`\n          import skypack from \"skypack\";\n        `,\n        'package.json': dedent`\n          {\n            \"version\": \"1.0.1\",\n            \"name\": \"@snowpack/test-package-source-remote\",\n            \"dependencies\": {\n            }\n          }\n        `,\n        'snowpack.config.js': dedent`\n          module.exports = {\n            packageOptions: {\n              source: 'remote',\n              origin: 'https://cdn.skypack.dev',\n            },\n          };\n        `,\n      });\n\n      expect(loggerInfos).toEqual(\n        expect.arrayContaining([\n          expect.stringMatching(/import skypack@latest → https:\\/\\/cdn.skypack.dev\\/skypack/),\n        ]),\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/plugins/extends/index.test.js",
    "content": "const {testFixture} = require('../../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('extends', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  /* \n\n  CLI test: test/build/config-extends-plugins\n  Reason for skip: Fails locally on mac as the env file does not include secret value\n  \n  Error:\n\n    expect(received).toContain(expected) // indexOf\n\n      Expected substring: \"export const SNOWPACK_PUBLIC_SECRET_VALUE = \\\"pumpernickel\\\";\"\n      Received string:    \"export const MODE = \\\"test\\\";\n      export const NODE_ENV = \\\"test\\\";\n      export const SSR = false;\"\n\n        48 |     });\n        49 |\n      > 50 |     expect(result['_snowpack/env.js']).toContain(\n          |                                        ^\n        51 |       `export const SNOWPACK_PUBLIC_SECRET_VALUE = \"pumpernickel\";`,\n        52 |     );\n        53 |   });\n\n        at Object.<anonymous> (test/snowpack/config/plugins/extends/index.test.js:50:40)\n  \n  */\n\n  it('Loads plugin from extended config', async () => {\n    const result = await testFixture({\n      'base/package.json': dedent`\n        {\n          \"private\": true,\n          \"version\": \"1.0.0\",\n          \"name\": \"@snowpack/test-config-extends-plugins-base\",\n          \"devDependencies\": {\n            \"@snowpack/plugin-dotenv\": \"^2.1.0\"\n          }\n        } \n      `,\n      'base/snowpack.config.json': dedent`\n        {\n          \"plugins\": [\n            [\n              \"@snowpack/plugin-dotenv\",\n              {\n                \"dir\": \"%TEMP_TEST_DIRECTORY%\"\n              }\n            ]\n          ]\n        }        \n      `,\n      'index.js': dedent`\n        console.log(import.meta.env.SNOWPACK_PUBLIC_SECRET_VALUE);\n      `,\n      '.env': dedent`\n        SNOWPACK_PUBLIC_SECRET_VALUE=pumpernickel\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          extends: './base/snowpack.config.json'\n        };\n      `,\n    });\n\n    expect(result['_snowpack/env.js']).toContain(\n      `export const SNOWPACK_PUBLIC_SECRET_VALUE = \"pumpernickel\";`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/plugins/instantiatedObject/__snapshots__/index.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`instantiatedObject Instantiated objects do not affect build 1`] = `\"console.log('fooey');\"`;\n"
  },
  {
    "path": "test/snowpack/config/plugins/instantiatedObject/index.test.js",
    "content": "const {testFixture} = require('../../../../fixture-utils');\nconst dedent = require('dedent');\n\nclass Instantiable {\n  constructor() {\n    this.prop = true;\n  }\n\n  method() {}\n}\n\nconst instance = new Instantiable();\n\ndescribe('instantiatedObject', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Instantiated objects do not affect build', async () => {\n    const result = await testFixture(\n      {\n        'index.js': dedent`\n          console.log('fooey');\n        `,\n        'dummy-plugin.js': dedent`\n          module.exports = (snowpackConfig, {instance}) => {\n            if (!instance.prop) {\n              throw new Error(\"simple prop value didn't make it\");\n            }\n          \n            if (!instance.method) {\n              throw new Error(\"method value didn't make it\");\n            }\n          \n            return {name: 'dummy-plugin'};\n          };\n        `,\n      },\n      {\n        overrides: {\n          plugins: [['./dummy-plugin.js', {instance}]],\n        },\n      },\n    );\n    expect(result['index.js']).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/config/withExtension/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('withExtension', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Picks up a snowpack config with .cjs extension', async () => {\n    const result = await testFixture(\n      {\n        'index.js': dedent`\n          console.log(import.meta.env);\n        `,\n        'snowpack.config.cjs': dedent`\n          module.exports = {\n            buildOptions: {\n              \"out\": \"TEST_BUILD_OUT\"\n            }\n          }\n        `,\n      },\n      {absolute: true},\n    );\n\n    expect(Object.keys(result).every((x) => x.match('/TEST_BUILD_OUT/'))).toBeTruthy();\n  });\n\n  /* \n\n  CLI test: test/build/config-loading-esm-package\n  Reason for skip: Fails locally because Jest can't handle es module syntax (export)\n  \n  Error:\n\n    SyntaxError: Unexpected token 'export'\n\n        17 |               console.error(`Failed to load \"${filepath}\"!\\nESM format is not natively supported in \"node@${process.version}\".\\nPlease use CommonJS or upgrade to an LTS version of node above \"node@12.17.0\".`)\n        18 |             } else if (e.code === 'ERR_REQUIRE_ESM') {\n      > 19 |                 const url = pathToFileURL(filepath);\n          |                 ^\n        20 |                 return NATIVE_IMPORT(url).then(mdl => resolve(mdl.default ? mdl.default : mdl));\n        21 |             };\n        22 |             reject(e);\n\n        at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)\n        at snowpack/assets/require-or-import.js:19:17\n        at Object.REQUIRE_OR_IMPORT (snowpack/assets/require-or-import.js:17:10)\n        at loadConfigurationFile (snowpack/lib/config.js:634:33)\n    \n  */\n\n  it.skip('Picks up a snowpack config inside of a \"module\" type package', async () => {\n    const result = await testFixture(\n      {\n        'index.js': dedent`\n          console.log(import.meta.env);\n        `,\n        'snowpack.config.js': dedent`\n          export default {\n            buildOptions: {\n              out: 'TEST_BUILD_OUT',\n            },\n          };\n        `,\n        'package.json': dedent`\n          {\n            \"name\": \"@snowpack/test-config-loading-esm-package\",\n            \"version\": \"0.1.0\",\n            \"type\": \"module\"\n          }\n        `,\n      },\n      {absolute: true},\n    );\n\n    expect(Object.keys(result).every((x) => x.match('/TEST_BUILD_OUT/'))).toBeTruthy();\n  });\n\n  /* \n\n  CLI test: test/build/config-loading-mjs\n  Reason for skip: Fails locally because Jest can't handle es module syntax (export)\n  \n  Error:\n\n    SyntaxError: Unexpected token 'export'\n\n        17 |               console.error(`Failed to load \"${filepath}\"!\\nESM format is not natively supported in \"node@${process.version}\".\\nPlease use CommonJS or upgrade to an LTS version of node above \"node@12.17.0\".`)\n        18 |             } else if (e.code === 'ERR_REQUIRE_ESM') {\n      > 19 |                 const url = pathToFileURL(filepath);\n          |                 ^\n        20 |                 return NATIVE_IMPORT(url).then(mdl => resolve(mdl.default ? mdl.default : mdl));\n        21 |             };\n        22 |             reject(e);\n\n        at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)\n        at snowpack/assets/require-or-import.js:19:17\n        at Object.REQUIRE_OR_IMPORT (snowpack/assets/require-or-import.js:17:10)\n        at loadConfigurationFile (snowpack/lib/config.js:634:33)\n    \n  */\n\n  it.skip('Picks up a snowpack config with .mjs extension', async () => {\n    const result = await testFixture(\n      {\n        'index.js': dedent`\n          console.log(import.meta.env);\n        `,\n        'snowpack.config.mjs': dedent`\n          export default {\n            buildOptions: {\n              out: \"TEST_BUILD_OUT\"\n            }\n          }\n        `,\n      },\n      {absolute: true},\n    );\n    expect(Object.keys(result).every((x) => x.match('/TEST_BUILD_OUT/'))).toBeTruthy();\n  });\n\n  it('Picks up a snowpack config with .json extension', async () => {\n    const result = await testFixture(\n      {\n        'index.js': dedent`\n          console.log(import.meta.env);\n        `,\n        'snowpack.config.json': dedent`\n          {\n            \"buildOptions\": {\n              \"out\": \"TEST_BUILD_OUT\"\n            }\n          }\n        `,\n      },\n      {absolute: true},\n    );\n\n    expect(Object.keys(result).every((x) => x.match('/TEST_BUILD_OUT/'))).toBeTruthy();\n  });\n\n  it('Picks up a snowpack config within package.json', async () => {\n    const result = await testFixture(\n      {\n        'index.js': dedent`\n          console.log(import.meta.env);\n        `,\n        'package.json': dedent`\n          {\n            \"version\": \"0.1.0\",\n            \"name\": \"@snowpack/test-config-loading-package\",\n            \"snowpack\": {\n              \"buildOptions\": {\n                \"out\": \"TEST_BUILD_OUT\"\n              }\n            }\n          }\n        `,\n      },\n      {absolute: true},\n    );\n\n    expect(Object.keys(result).every((x) => x.match('/TEST_BUILD_OUT/'))).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/cssModules/index.test.js",
    "content": "const {testFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\nconst files = (ext = '.css') => ({\n  'public/index.html': dedent`\n    <!DOCTYPE html>\n    <html>\n      <head>\n        <meta charset=\"UTF-8\" />\n      </head>\n      <body>\n        <div id=\"app\"></div>\n        <script src=\"/_dist_/App.js\" type=\"module\"></script>\n      </body>\n    </html>\n  `,\n  'src/App.jsx': dedent`\n    import React from 'react';\n    import ReactDOM from 'react-dom';\n\n    import Styles from './App.module${ext}';\n\n    function App() {\n      return (\n        <div className={Styles.App}>\n          <header className={Styles['App-header']}>\n            <img src={logo} className={Styles['App-logo']} alt=\"logo\" />\n            <p>\n              Edit <code>src/App.jsx</code> and save to reload.\n            </p>\n            <p>\n              Page has been open for <code>{count}</code> seconds.\n            </p>\n            <p>\n              <a\n                className={Styles['App-link']}\n                href=\"https://reactjs.org\"\n                target=\"_blank\"\n                rel=\"noopener noreferrer\"\n              >\n                Learn React\n              </a>\n            </p>\n          </header>\n        </div>\n      );\n    }\n\n    ReactDOM.render(<App />, document.getElementById('app'));\n  `,\n  [`src/App.module${ext}`]: dedent`\n    .App {\n      text-align: center;\n    }\n    .App code {\n      background: #FFF3;\n      padding: 4px 8px;\n      border-radius: 4px;\n    }\n    .App p {\n      margin: 0.4rem;\n    }\n    .App-logo {\n      height: 40vmin;\n      pointer-events: none;\n    }\n\n    @media (prefers-reduced-motion: no-preference) {\n      .App-logo {\n        animation: App-logo-spin infinite 20s linear;\n      }\n    }\n\n    .App-header {\n      background-color: #282c34;\n      min-height: 100vh;\n      display: flex;\n      flex-direction: column;\n      align-items: center;\n      justify-content: center;\n      font-size: calc(10px + 2vmin);\n      color: white;\n    }\n\n    .App-link {\n      color: #61dafb;\n    }\n\n    @keyframes App-logo-spin {\n      from {\n        transform: rotate(0deg);\n      }\n      to {\n        transform: rotate(360deg);\n      }\n    }\n  `,\n});\n\ndescribe('cssModules', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Generates CSS Modules', async () => {\n    const result = await testFixture({\n      ...files(),\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            src: '/_dist_',\n            public: '/'\n          },\n        };\n      `,\n    });\n\n    // test 1: proxies file correctly\n    expect(result['_dist_/App.js']).toContain(`import Styles from \"./App.module.css.proxy.js\";`);\n    expect(result['_dist_/App.module.css.proxy.js']).toMatch(/\\._App_[A-Za-z0-9]+_[A-Za-z0-9]+ \\{/);\n\n    // test 2: transforms CSS classes correctly\n    expect(result['_dist_/App.module.css.proxy.js']).toContain(`let json = {\"App\":\"_App_`);\n    expect(result['_dist_/App.module.css']).not.toContain(`.App {`);\n\n    // test 3: generates JSON name map\n    expect(result['_dist_/App.module.css.json']).toBeDefined();\n  });\n\n  it('Generates CSS Modules (unmounted)', async () => {\n    const result = await testFixture({\n      ...files(),\n    });\n\n    // (same as above, just at different path)\n    expect(result['src/App.js']).toContain(`import Styles from \"./App.module.css.proxy.js\";`);\n    expect(result['src/App.module.css.proxy.js']).toMatch(/\\._App_[A-Za-z0-9]+_[A-Za-z0-9]+ \\{/);\n    expect(result['src/App.module.css.proxy.js']).toContain(`let json = {\"App\":\"_App_`);\n    expect(result['src/App.module.css']).not.toContain(`.App {`);\n    expect(result['src/App.module.css.json']).toBeDefined();\n  });\n\n  it('Generates CSS Modules from Sass', async () => {\n    const result = await testFixture({\n      ...files('.scss'),\n      'snowpack.config.js': dedent`\n        module.exports = {\n          mount: {\n            src: '/_dist_',\n            public: '/'\n          },\n          plugins: [['@snowpack/plugin-sass']],\n        };\n      `,\n    });\n\n    // (same assertions as previous test, except we’re loading a `.scss` file)\n    expect(result['_dist_/App.js']).toContain(`import Styles from \"./App.module.css.proxy.js\";`);\n    expect(result['_dist_/App.module.css.proxy.js']).toMatch(/\\._App_[A-Za-z0-9]+_[A-Za-z0-9]+ \\{/);\n    expect(result['_dist_/App.module.css.proxy.js']).toContain(`let json = {\"App\":\"_App_`);\n    expect(result['_dist_/App.module.css']).not.toContain(`.App {`);\n    expect(result['_dist_/App.module.css.json']).toBeDefined();\n  });\n\n  it('Works with buildOptions.baseUrl set', async () => {\n    const result = await testFixture({\n      ...files(),\n      'snowpack.config.js': dedent`\n        module.exports = {\n          buildOptions: {\n            baseUrl: '/subdir/'\n          }\n        };\n      `,\n    });\n    expect(result['src/App.module.css.proxy.js']).toContain(`let json = {\"App\":\"_App_`);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/import/css.ts/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('css.ts', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('.css.ts and .css.js files are imported properly', async () => {\n    const result = await testFixture({\n      'globalStyles.css': dedent`\n        * { box-sizing: border-box; }\n      `,\n      'cssModule.module.css': dedent`\n        .foo { border: 1px solid hotpink; }\n      `,\n      'styles.css.ts': dedent`\n        export const container = 'container-de42';\n      `,\n      'shared.css.js': dedent`\n        export const shadow = 'shadow-12fb';\n      `,\n      'index.js': dedent`\n        import './globalStyles.css';\n        import { foo } './cssModule.module.css';\n        import { container } from './styles.css';\n        import { shadow } from './shared.css';\n        console.log({ container, shadow, foo });\n      `,\n    });\n    expect(result['index.js']).toBeDefined();\n    expect(result['globalStyles.css']).toBeDefined();\n    expect(result['cssModule.module.css']).toBeDefined();\n    expect(result['styles.css.js']).toBeDefined();\n    expect(result['shared.css.js']).toBeDefined();\n\n    expect(result['index.js']).toMatchInlineSnapshot(`\n      \"import './globalStyles.css.proxy.js';\n      import { foo } './cssModule.module.css.proxy.js';\n      import { container } from './styles.css.js';\n      import { shadow } from './shared.css.js';\n      console.log({ container, shadow, foo });\"\n    `);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/import/dotFolder/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('dotFolder', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Importing files in a dot folder works', async () => {\n    const result = await testFixture({\n      '.dot/file.js': dedent`\n        export const a = 'b';\n      `,\n      'index.js': dedent`\n        import {a} from './.dot/file.js';\n        console.log('i got', a);\n      `,\n    });\n    expect(result['.dot/file.js']).toBeDefined();\n    expect(result['index.js']).toContain(\"import {a} from './.dot/file.js';\");\n  });\n});\n"
  },
  {
    "path": "test/snowpack/import/glob/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\nconst directory = {\n  'deep/nest/globAbsolute.js': dedent`const modules = import.meta.glob('/pages/*.js');`,\n  'deep/nest/globAlias.js': dedent`const modules = import.meta.glob('@root/pages/*.js');`,\n  'pages/a.js': dedent`export default 'a'`,\n  'pages/b.js': dedent`export default 'b'`,\n  'pages/c.js': dedent`export default 'c'`,\n  'glob.js': dedent`const modules = import.meta.glob('./pages/*.js');`,\n  'globAbsolute.js': dedent`const modules = import.meta.glob('/pages/*.js');`,\n  'globAlias.js': dedent`const modules = import.meta.glob('@root/pages/*.js');`,\n  'globCommented.js': dedent`\n    /* import.meta.glob('./pages/*.js'); */\n    // import.meta.glob('./pages/*.js');\n    \n    const modules = null; // import.meta.glob('./pages/*.js');\n    \n    /* *** //\n    * import.meta.glob('./pages/*.js');\n    */\n  `,\n  'globEager.js': dedent`const modules = import.meta.globEager('./pages/*.js');`,\n  'globSelf.js': dedent`const modules = import.meta.glob('./*.js');`,\n  'snowpack.config.js': dedent`\n    module.exports = {\n      alias: {\n        '@root': './',\n      }\n    }\n  `,\n};\n\ndescribe('glob', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Imports from directory', async () => {\n    const result = await testFixture(directory);\n    expect(result['glob.js']).toContain(`\"./pages/a.js\": () => import(\"./pages/a.js\")`);\n    expect(result['glob.js']).toContain(`\"./pages/b.js\": () => import(\"./pages/b.js\")`);\n    expect(result['glob.js']).toContain(`\"./pages/c.js\": () => import(\"./pages/c.js\")`);\n  });\n\n  it('Imports from directory using absolute paths', async () => {\n    const result = await testFixture(directory);\n    expect(result['globAbsolute.js']).toContain(`\"./pages/a.js\": () => import(\"./pages/a.js\")`);\n    expect(result['globAbsolute.js']).toContain(`\"./pages/b.js\": () => import(\"./pages/b.js\")`);\n    expect(result['globAbsolute.js']).toContain(`\"./pages/c.js\": () => import(\"./pages/c.js\")`);\n  });\n\n  it('Imports from directory using aliases', async () => {\n    const result = await testFixture(directory);\n    expect(result['globAlias.js']).toContain(`\"./pages/a.js\": () => import(\"./pages/a.js\")`);\n    expect(result['globAlias.js']).toContain(`\"./pages/b.js\": () => import(\"./pages/b.js\")`);\n    expect(result['globAlias.js']).toContain(`\"./pages/c.js\": () => import(\"./pages/c.js\")`);\n  });\n\n  it('Imports from nested directory when using absolute paths', async () => {\n    const result = await testFixture(directory);\n    expect(result['deep/nest/globAbsolute.js']).toContain(\n      `\"../../pages/a.js\": () => import(\"../../pages/a.js\")`,\n    );\n    expect(result['deep/nest/globAbsolute.js']).toContain(\n      `\"../../pages/b.js\": () => import(\"../../pages/b.js\")`,\n    );\n    expect(result['deep/nest/globAbsolute.js']).toContain(\n      `\"../../pages/c.js\": () => import(\"../../pages/c.js\")`,\n    );\n  });\n\n  it('Imports from nested directory when using aliases', async () => {\n    const result = await testFixture(directory);\n    expect(result['deep/nest/globAlias.js']).toContain(\n      `\"../../pages/a.js\": () => import(\"../../pages/a.js\")`,\n    );\n    expect(result['deep/nest/globAlias.js']).toContain(\n      `\"../../pages/b.js\": () => import(\"../../pages/b.js\")`,\n    );\n    expect(result['deep/nest/globAlias.js']).toContain(\n      `\"../../pages/c.js\": () => import(\"../../pages/c.js\")`,\n    );\n  });\n\n  it('Statically imports from directory when using eagar', async () => {\n    const result = await testFixture(directory);\n    expect(result['globEager.js']).toContain(`import * as __glob__0_0 from './pages/a.js';`);\n    expect(result['globEager.js']).toContain(`import * as __glob__0_1 from './pages/b.js';`);\n    expect(result['globEager.js']).toContain(`import * as __glob__0_2 from './pages/c.js';`);\n  });\n\n  it('Ignores commented out module imports', async () => {\n    const result = await testFixture(directory);\n    expect(result['globCommented.js']).toContain(`const modules = null;`);\n  });\n\n  it('Does not import itself', async () => {\n    const result = await testFixture(directory);\n    expect(result['globSelf.js']).not.toContain(`globSelf.js`);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/import/json/__snapshots__/index.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`json Imports JSON files correctly 1`] = `\nObject {\n  \"_snowpack/pkg/import-map.json\": \"{\n  \\\\\"imports\\\\\": {\n    \\\\\"json-test-pkg/file.json\\\\\": \\\\\"./json-test-pkg/file.json\\\\\"\n  }\n}\",\n  \"_snowpack/pkg/json-test-pkg/file.json\": \"{\\\\\"test-json-pkg\\\\\": true}\",\n  \"_snowpack/pkg/json-test-pkg/file.json.proxy.js\": \"let json = {\\\\\"test-json-pkg\\\\\":true};\nexport default json;\",\n  \"file.json\": \"{\\\\\"test\\\\\": true}\",\n  \"file.json.proxy.js\": \"let json = {\\\\\"test\\\\\":true};\nexport default json;\",\n  \"index.js\": \"import testJsonData from './file.json.proxy.js';\nimport testJsonPkgData from './_snowpack/pkg/json-test-pkg/file.json.proxy.js';\nconsole.log('loaded:', testJsonData, testJsonPkgData);\",\n  \"package.json\": \"{\n  \\\\\"private\\\\\": true,\n  \\\\\"version\\\\\": \\\\\"1.0.1\\\\\",\n  \\\\\"name\\\\\": \\\\\"@snowpack/test-import-json\\\\\",\n  \\\\\"dependencies\\\\\": {\n    \\\\\"json-test-pkg\\\\\": \\\\\"file:./packages/json-test-pkg\\\\\"\n  }\n}\",\n  \"packages/json-test-pkg/file.json\": \"{\\\\\"test-json-pkg\\\\\": true}\",\n  \"packages/json-test-pkg/package.json\": \"{\n  \\\\\"name\\\\\": \\\\\"json-test-pkg\\\\\",\n  \\\\\"version\\\\\": \\\\\"0.1.0\\\\\"\n}\",\n  \"yarn.lock\": \"# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n# yarn lockfile v1\n\n\n\\\\\"json-test-pkg@file:./packages/json-test-pkg\\\\\":\n  version \\\\\"0.1.0\\\\\"\n\",\n}\n`;\n"
  },
  {
    "path": "test/snowpack/import/json/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('json', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Imports JSON files correctly', async () => {\n    const result = await testFixture({\n      'packages/json-test-pkg/file.json': dedent`\n        {\"test-json-pkg\": true}\n      `,\n      'packages/json-test-pkg/package.json': dedent`\n        {\n          \"name\": \"json-test-pkg\",\n          \"version\": \"0.1.0\"\n        }        \n      `,\n      'file.json': dedent`\n        {\"test\": true}\n      `,\n      'index.js': dedent`\n        import testJsonData from './file.json';\n        import testJsonPkgData from 'json-test-pkg/file.json';\n        console.log('loaded:', testJsonData, testJsonPkgData);\n      `,\n      'package.json': dedent`\n        {\n          \"private\": true,\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-import-json\",\n          \"dependencies\": {\n            \"json-test-pkg\": \"file:./packages/json-test-pkg\"\n          }\n        }\n      `,\n    });\n\n    expect(result).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/import/ts/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('ts', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Typescript files are imported properly', async () => {\n    const result = await testFixture({\n      'a.ts': dedent`  \n        import Vue from 'vue/dist/vue.esm.browser.js';\n        import VueRouter from 'vue-router';\n        import type {Component} from 'vue';\n                  \n        interface TestInterface {\n          [key: string]: string;\n        }\n        \n        const testOptions: TestInterface = {};\n        console.log(Vue, VueRouter);          \n      `,\n      'b.ts': dedent`\n        import {flatten} from 'array-flatten';\n        flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]);\n      `,\n      'c.ts': dedent`\n        import('http-vue-loader/src/httpVueLoader.js').then((httpVueLoader) => {\n          new Vue({\n            el: '#app',\n            components: {\n              app: 'url:./components/app.vue',\n            },\n            template: '<app></app>',\n          });\n        });\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-include-ts\",\n          \"dependencies\": {\n            \"array-flatten\": \"^3.0.0\",\n            \"http-vue-loader\": \"^1.4.1\",\n            \"shallow-equal\": \"^1.2.1\",\n            \"vue\": \"^2.0.0\",\n            \"vue-router\": \"^3.0.0\"\n          }\n        }\n      `,\n    });\n\n    expect(result['a.js']).toBeDefined();\n    expect(result['b.js']).toBeDefined();\n    expect(result['c.js']).toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/import-sri.test.ts",
    "content": "const {generateSRI} = require('../../snowpack/lib/cjs/build/import-sri');\n\nconst EMPTY = Buffer.from('');\n\ntest('empty buffer with SHA256', () => {\n  expect(generateSRI(EMPTY, 'sha256')).toBe('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=');\n});\n\ntest('empty buffer with SHA384', () => {\n  expect(generateSRI(EMPTY, 'sha384')).toBe(\n    'sha384-OLBgp1GsljhM2TJ+sbHjaiH9txEUvgdDTAzHv2P24donTt6/529l+9Ua0vFImLlb',\n  );\n});\n\ntest('empty buffer with SHA512', () => {\n  expect(generateSRI(EMPTY, 'sha512')).toBe(\n    'sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==',\n  );\n});\n\ntest('verify that SHA384 is default SRI hash algorithm', () => {\n  expect(generateSRI(EMPTY, 'sha384')).toBe(generateSRI(EMPTY));\n});\n\ntest('undefined should return empty hash result', () => {\n  expect(generateSRI()).toBe(generateSRI(EMPTY));\n});\n"
  },
  {
    "path": "test/snowpack/moduleResolution/index.test.js",
    "content": "const {testFixture, testPrepareFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('moduleResolution', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Resolves CSS and JS modules from HTML documents', async () => {\n    const result = await testFixture({\n      'packages/css-package/package.json': dedent`\n        {\n          \"name\": \"css-package\",\n          \"version\": \"1.2.3\"\n        }\n      `,\n      'packages/css-package/style.css': dedent`\n        body {\n          color: red;\n        }\n      `,\n      'index.html': dedent`\n        <!DOCTYPE html>\n        <html lang=\"en\">\n          <head>\n            <meta charset=\"utf-8\" />\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n            <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n            <title>Snowpack App</title>\n            <style>\n              @import 'css-package/style.css';\n            </style>\n            <script type=\"module\">\n              import {flatten} from 'array-flatten';\n            </script>\n          </head>\n          <body>\n          </body>\n        </html> \n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-build-scan-imports-html\",\n          \"dependencies\": {\n            \"array-flatten\": \"^3.0.0\",\n            \"css-package\": \"file:./packages/css-package\"\n          }\n        }  \n      `,\n    });\n\n    // HTML imports of packages are scanned\n    expect(result['_snowpack/pkg/array-flatten.js']).toBeDefined();\n    expect(result['_snowpack/pkg/css-package/style.css']).toBeDefined();\n    // HTML imports of packages are rewritten\n    expect(result['index.html']).toContain(\n      `import {flatten} from './_snowpack/pkg/array-flatten.js';`,\n    );\n    expect(result['index.html']).toContain(`@import \"./_snowpack/pkg/css-package/style.css\";`);\n  });\n\n  it('Resolves modules in both JS and nested HTML documents', async () => {\n    const result = await testFixture({\n      'deep/nested/index.html': dedent`\n        <html>\n          <body>\n            <script type=\"module\">\n              import preact from 'preact';\n              import '../../index.js';\n            </script>\n          </body>\n        </html>\n      `,\n      'deep/index.html': dedent`\n        <html>\n          <body>\n            <script type=\"module\">\n              import preact from 'preact';\n              import '../index.js';\n            </script>\n          </body>\n        </html>\n      `,\n      'index.html': dedent`\n        <html>\n          <body>\n            <script type=\"module\">\n              import preact from 'preact';\n              import './index.js';\n            </script>\n          </body>\n        </html>\n      `,\n      'index.js': dedent`\n        import 'preact';\n      `,\n    });\n\n    expect(result['deep/nested/index.html']).toContain(\n      \"import preact from '../../_snowpack/pkg/preact.js';\",\n    );\n    expect(result['deep/index.html']).toContain(\"import preact from '../_snowpack/pkg/preact.js';\");\n    expect(result['index.html']).toContain(\"import preact from './_snowpack/pkg/preact.js';\");\n    expect(result['index.js']).toContain(\"import './_snowpack/pkg/preact.js';\");\n  });\n\n  it('Resolves modules with circular dependencies in mixed TS/JS', async () => {\n    const result = await testFixture({\n      'a/a.js': dedent`\n        import '/index.js';\n      `,\n      'b/b.js': dedent`\n        throw new Error('Not me either!');\n      `,\n      'b.ts': dedent`\n        import '/index.js';\n      `,\n      'index.js': dedent`\n        import { flatten } from 'array-flatten';\n        import a from './a/a.js';\n        import b from './b'; \n      `,\n      'array-flatten.js': dedent`\n        throw new Error('Not me!');\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"@snowpack/test-resolve-js\",\n          \"dependencies\": {\n            \"array-flatten\": \"^1.0.1\"\n          }\n        }\n      `,\n    });\n\n    // We are using the node_modules version, not the local 'is-array.js'\n    expect(result['_snowpack/pkg/array-flatten.js']).toBeDefined();\n    expect(result['index.js']).toContain(\n      `import { flatten } from './_snowpack/pkg/array-flatten.js';`,\n    );\n    // A URL-style import works\n    expect(result['a/a.js']).toContain(`import '../index.js';`);\n    // We don't mistakenly import an index file from a directory with the same name\n    expect(result['index.js']).toContain(`import b from './b.js';`);\n  });\n\n  it('Resolves CSS and JS modules from Astro files', async () => {\n    const result = await testPrepareFixture({\n      'packages/css-package/package.json': dedent`\n        {\n          \"name\": \"css-package\",\n          \"version\": \"1.2.3\"\n        }\n      `,\n      'packages/css-package/style.css': dedent`\n        body {\n          color: red;\n        }\n      `,\n      'page.astro': dedent`\n        ---\n        import {flatten} from 'array-flatten';\n        ---\n\n        <!doctype html>\n        <html lang=\"en\">\n          <head>\n            <title>Test</title>\n            <style>\n              @import 'css-package/style.css';\n            </style>\n          </head>\n          <body></body>\n        </html>\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-build-scan-imports-astro\",\n          \"dependencies\": {\n            \"array-flatten\": \"^3.0.0\",\n            \"css-package\": \"file:./packages/css-package\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          buildOptions: {\n           cacheDirPath: __dirname + '/.snowpack'\n          }\n        };\n      `,\n    });\n\n    // Imports of JS and CSS packages are scanned\n    expect(result['../.snowpack/build/array-flatten@3.0.0/array-flatten.js']).toBeDefined();\n    expect(result['../.snowpack/build/css-package@1.2.3/css-package/style.css']).toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/namedImport/__snapshots__/index.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`namedImport correctly uses named import 1`] = `\nObject {\n  \"_snowpack/pkg/array-flatten.js\": \"/**\n * Flatten an array indefinitely.\n */\nfunction flatten(array) {\n    var result = [];\n    $flatten(array, result);\n    return result;\n}\n/**\n * Internal flatten function recursively passes \\`result\\`.\n */\nfunction $flatten(array, result) {\n    for (var i = 0; i < array.length; i++) {\n        var value = array[i];\n        if (Array.isArray(value)) {\n            $flatten(value, result);\n        }\n        else {\n            result.push(value);\n        }\n    }\n}\n\nexport { flatten };\n\",\n  \"_snowpack/pkg/import-map.json\": \"{\n  \\\\\"imports\\\\\": {\n    \\\\\"array-flatten\\\\\": \\\\\"./array-flatten.js\\\\\"\n  }\n}\",\n  \"index.js\": \"import {flatten as _$v4} from './_snowpack/pkg/array-flatten.js';\n_$v4([1, 2, [3, 4]]);\",\n}\n`;\n"
  },
  {
    "path": "test/snowpack/namedImport/index.test.js",
    "content": "const {testFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('namedImport', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  // if this file built successfully, then the import worked\n  it('correctly uses named import', async () => {\n    const result = await testFixture(\n      dedent`\n        import {flatten as _$v4} from 'array-flatten';\n        _$v4([1, 2, [3, 4]]);\n      `,\n    );\n    expect(result['_snowpack/pkg/array-flatten.js']).toBeDefined();\n    expect(result).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/package/@nivo/index.test.js",
    "content": "const dedent = require('dedent');\nconst {testFixture, testRuntimeFixture} = require('../../../fixture-utils');\nconst {fmtjson} = require('../../../test-utils');\n\nconst pkg = {\n  'index.js': dedent`\n    import {NetworkCanvas} from '@nivo/network';\n  `,\n  'package.json': fmtjson({\n    dependencies: {\n      '@nivo/core': '^0.72.0',\n      '@nivo/network': '^0.72.0',\n    },\n  }),\n};\n\n/**\n * Fixes #3466\n * Main thing we’re testing for here is that dev server doesn’t hang on circular deps\n * Though this test is slow, it’s important to test on real npm packages and not mocked ones\n * as symlink behavior is really different here\n */\ndescribe.skip('@nivo/core', () => {\n  // note: skipped because test can be run locally, but not in GitHub for some reason\n  it('dev', async () => {\n    const server = await testRuntimeFixture(pkg);\n    const js = (await server.loadUrl('/index.js')).contents.toString('utf8');\n    expect(js).toBeTruthy(); // if this returned some response,\n    await server.cleanup(); // clean up\n  });\n\n  it('build', async () => {\n    const result = await testFixture(pkg);\n    expect(result['index.js']).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/package/bootstrap/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('package', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  /* \n\n  CLI test: test/build/package-bootstrap\n  Reason for skip: Passes locally on mac and works in an isolated project but fails on Ubuntu 10.x during CI\n  \n  Error:\n\n    TypeError: Cannot read property 'toString' of undefined\n\n    198 |     if (util_1.hasExtension(url, '.css')) {\n    199 |         // if proxying a CSS file, remove its source map (the path no longer applies)\n  > 200 |         const sanitized = code.toString().replace(/\\/\\*#\\s*sourceMappingURL=[^/]+\\//gm, '');\n        |                                ^\n    201 |         return util_1.hasExtension(url, '.module.css')\n    202 |             ? generateCssModuleImportProxy({ url, code: sanitized, hmr, config })\n    203 |             : generateCssImportProxy({ code: sanitized, hmr, config });\n\n    at Object.wrapImportProxy (snowpack/lib/build/build-import-proxy.js:200:32)\n    at flushFileQueue (snowpack/lib/commands/build.js:138:73)\n    at Object.build (snowpack/lib/commands/build.js:196:5)\n    at testFixture (test/fixture-utils.js:49:3)\n    at Object.<anonymous> (test/snowpack/package/bootstrap/index.test.js:11:20)\n  \n  */\n  it.skip('Loads bootstrap css correctly', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import 'bootstrap/dist/css/bootstrap.min.css';\n        console.log('CSS added to page!');\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-package-bootstrap\",\n          \"dependencies\": {\n            \"bootstrap\": \"^4.5.2\"\n          }\n        }\n      `,\n    });\n\n    expect(result['index.js']).toContain(\n      `import './_snowpack/pkg/bootstrap/dist/css/bootstrap.min.css.proxy.js';`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/package/tippy/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('package', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Loads tippy module correctly', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import 'tippy.js/dist/tippy.css';\n        import tippy from 'tippy.js';\n        import * as tippyJs from 'tippy.js/headless/dist/tippy-headless.esm.js';\n        \n        console.log(tippyJs);\n        \n        tippy('#myButton', {\n          content: \"I'm a Tippy tooltip!\",\n        }); \n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-package-tippy-js\",\n          \"dependencies\": {\n            \"tippy.js\": \"^6.2.5\"\n          }\n        }\n      `,\n    });\n\n    // Files were created in the correct location\n    expect(result['_snowpack/pkg/tippyjs/dist/tippy.css']).toBeDefined();\n    expect(result['_snowpack/pkg/tippyjs/dist/tippy.css.proxy.js']).toBeDefined();\n    expect(result['_snowpack/pkg/tippyjs/headless/dist/tippy-headless.esm.js']).toBeDefined();\n    // Files were imported from the correct location\n    expect(result['index.js']).toContain(\n      `import './_snowpack/pkg/tippyjs/dist/tippy.css.proxy.js';`,\n    );\n    expect(result['index.js']).toContain(`import tippy from './_snowpack/pkg/tippyjs.js';`);\n    expect(result['index.js']).toContain(\n      `import * as tippyJs from './_snowpack/pkg/tippyjs/headless/dist/tippy-headless.esm.js';`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/package/workspace/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('package', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  /* \n\n  CLI test: test/build/package-workspace\n  Reason for skip: Fails locally on mac because it cannot find a file imported by the workspace package despite it existing\n  \n  Error:\n\n    console.error\n    [22:04:41] [esinstall] /Users/---/snowpack/test/build/test-workspace-component/index.mjs\n       Import \"./Layout\" could not be resolved from file.\n\n      69 |         if (lastHistoryItem && lastHistoryItem.val === log) {\n      70 |             lastHistoryItem.count++;\n    > 71 |         }\n         |          ^\n      72 |         else {\n      73 |             this.history.push({ val: log, count: 1 });\n      74 |         }\n\n      at Object.error (snowpack/lib/logger.js:71:17)\n      at SnowpackLogger.log (snowpack/lib/logger.js:111:28)\n      at SnowpackLogger.error (snowpack/lib/logger.js:161:10)\n      at Object.error (snowpack/lib/sources/local-install.js:30:49)\n      at Object.onwarn (esinstall/src/index.ts:357:18)\n      at Object.onwarn (node_modules/rollup/dist/shared/rollup.js:19559:20)\n      at Object.warn (node_modules/rollup/dist/shared/rollup.js:18790:25)\n  \n  */\n\n  it.skip('Loads workspace module correctly', async () => {\n    const result = await testFixture({\n      'index.html': dedent`\n        <!DOCTYPE html>\n        <html lang=\"en\">\n          <head>\n            <meta charset=\"utf-8\" />\n            <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n            <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n            <title>Snowpack App</title>\n          </head>\n          <body>\n            <script type=\"module\" src=\"%PUBLIC_URL%/_dist_/index.svelte.js\"></script>\n            <!--\n              This HTML file is a template.\n              If you open it directly in the browser, you will see an empty page.\n        \n              You can add webfonts, meta tags, or analytics to this file.\n              The build step will place the bundled scripts into the <body> tag.\n            -->\n          </body>\n        </html> \n      `,\n      'index.svelte': dedent`\n        <style>\n          div {\n            color: red;\n          }\n        </style>\n        <script>\n          import TestComponent from 'test-workspace-component/SvelteComponent.svelte';\n          import * as tsFile from 'test-workspace-component/works-without-extension';\n          import * as main from 'test-workspace-component';\n          console.log(tsFile, main);\n        </script>\n\n        <TestComponent />\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          workspaceRoot: '../build',\n          plugins: [['@snowpack/plugin-svelte']],\n        };\n      `,\n    });\n\n    expect(result).toMatchSnapshot();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/babel/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('@snowpack/plugin-babel runs before esbuild', async () => {\n    const result = await testFixture({\n      'index.tsx': dedent`\n        import {StrictMode} from 'react'\n        import {render} from 'react-dom'\n        \n        render(\n          <StrictMode>\n            <span>Hello World!</span>\n          </StrictMode>,\n          document.querySelector('#root'),\n        );  \n      `,\n      'index.html': dedent`\n        <html>\n        <head><title>Test</title></head>\n        <body><script type=\"module\" src=\"/dist/index.js\"></script></body>\n        </html>\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-plugin-babel\",\n          \"devDependencies\": {\n            \"@snowpack/plugin-babel\": \"^2.1.7\",\n            \"react\": \"17.0.2\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          packageOptions: {\n            knownEntrypoints: ['react/jsx-runtime'],\n          },\n          plugins: [\n            ['@snowpack/plugin-babel', {input: ['.tsx']}]\n          ]\n        };\n      `,\n      'babel.config.js': dedent`\n        module.exports = {\n          presets: [\n            ['@babel/preset-react', {runtime: 'automatic'}],\n            '@babel/preset-typescript',\n          ],\n        }\n      `,\n    });\n\n    expect(result['index.js']).toContain(`_jsx(StrictMode`);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/buildScript/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  /*\n\n  CLI test: test/build/plugin-build-script\n  Reason for skip: Passes locally on mac and works in an isolated project but fails on Ubuntu 10.x during CI with the error:\n\n  Error:\n\n    Command failed with EPIPE: babel --filename /home/runner/work/snowpack/snowpack/test/__temp__/snowpack-fixture-knJCMA/index.ts --presets @babel/preset-typescript\n    write EPIPE\n\n    at handleInput (test/__temp__/snowpack-fixture-knJCMA/node_modules/execa/lib/stream.js:17:17)\n\n  */\n  it.skip('@snowpack/plugin-build-script', async () => {\n    const result = await testFixture({\n      'index.ts': dedent`\n        type stringType = string;\n        const msg: stringType = 'I’m a TypeScript file';\n        console.log(msg);\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-plugin-build-script\",\n          \"dependencies\": {\n            \"@babel/cli\": \"^7.13.14\",\n            \"@babel/core\": \"^7.13.15\",\n            \"@babel/preset-typescript\": \"^7.13.0\",\n            \"@snowpack/plugin-build-script\": \"^2.0.0\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          plugins: [\n            [\n              '@snowpack/plugin-build-script',\n              {\n                input: ['.ts'],\n                output: ['.js'],\n                cmd: 'babel --filename $FILE --presets @babel/preset-typescript',\n              },\n            ],\n          ],\n        };\n      `,\n    });\n\n    expect(result['index.js']).toBeDefined();\n    expect(result['index.ts']).not.toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/custom/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('custom plugin', () => {\n  it('allows custom filetypes to be created', async () => {\n    const result = await testFixture({\n      'dev/html-plugin.js': dedent`\n        module.exports = function htmlPlugin(_snowpackConfig, _pluginOptions) {\n          return {\n            name: 'html-plugin',\n            resolve: {\n              input: ['.h1'],\n              output: ['.html', '.css'],\n            },\n            async load() {\n              return {\n                '.html': { code: '<h1>Hello world</h1>' },\n                '.css': { code: '.h1 { color: red }' },\n              }\n            },\n          }\n        }\n      `,\n      'src/test.h1': ``, // empty file (generated via plugin)\n      'snowpack.config.json': dedent`\n        {\n          \"mount\": {\n            \"src\": \"/\"\n          },\n          \"plugins\": [\n            \"./dev/html-plugin.js\"\n          ]\n        }\n      `,\n    });\n\n    // Test 1: HTML is correctly output\n    expect(result['test.h1.html']).toBe(`<h1>Hello world</h1>`);\n\n    // Test 2: CSS is correctly output\n    expect(result['test.h1.css']).toBe(`.h1 { color: red }`);\n\n    // Test 3: the source file didn’t clutter up the build folder\n    expect(result['test.h1']).toBeFalsy();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/customTransform/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Custom transform hook', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        import './submodule.ts';\n        console.log('loaded');\n      `,\n      'submodule.ts': dedent`\n        console.log('ts loaded');\n      `,\n      'custom-transform-plugin.js': dedent`\n        const MagicString = require('magic-string');\n\n        module.exports = function () {\n          return {\n            transform: async ({id, fileExt, contents}) => {\n              const ms = new MagicString(contents);\n              ms.appendLeft(contents.indexOf('console.log'), \"console.log('transformed');\");\n              const map = ms.generateMap({hires: false, includeContent: true});\n              // Due to Windows issue, we set \"sources\" here (and not in generateMap())\n              map.sources = [id];\n              return {\n                contents: ms.toString(),\n                // Try returning both object and string map formats.\n                map: fileExt === '.js' ? map : map.toString(),\n              };\n            },\n          };\n        };\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-plugin-hook-transform\",\n          \"devDependencies\": {\n            \"magic-string\": \"^0.25.7\"\n          }\n        } \n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          buildOptions: {\n            sourcemap: true,\n          },\n          plugins: ['./custom-transform-plugin.js'],\n        };\n      `,\n    });\n\n    const SEARCH_STRING = `console.log('transformed');`;\n    expect(result['index.js']).toContain(SEARCH_STRING);\n    expect(result['submodule.js']).toContain(SEARCH_STRING);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/runScript/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  /* \n\n  CLI test: test/build/plugin-run-script\n  Reason for skip: Fails locally on mac because the result is returned before the built css file is written\n  \n  Error:\n\n    expect(received).toBeDefined()\n      Received: undefined\n\n        51 |     });\n        52 |\n      > 53 |     expect(result['css/index.css']).toBeDefined();\n          |                                     ^\n        54 |   });\n        55 | });\n        56 |\n\n        at Object.<anonymous> (test/snowpack/plugin/runScript/index.test.js:53:37)  \n  \n  */\n\n  it.skip('@snowpack/plugin-run-script', async () => {\n    const result = await testFixture({\n      'src/css/index.scss': dedent`\n        $body-font: \"fantasy\";\n        body {\n          font-family: $body-font;\n        }\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-plugin-run-script\",\n          \"dependencies\": {\n            \"@snowpack/plugin-run-script\": \"^2.0.0\",\n            \"sass\": \"^1.26.10\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          plugins: [\n            [\n              '@snowpack/plugin-run-script',\n              {\n                cmd: 'sass src/css:build/css --no-source-map',\n              },\n            ],\n          ],\n        };\n      `,\n    });\n\n    expect(result['css/index.css']).toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/sass/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('@snowpack/plugin-sass', async () => {\n    const result = await testFixture({\n      '_partial.scss': dedent`\n        body { color: blue; }\n      `,\n      'index.scss': dedent`\n        @use \"partial\";\n        html { background: red; }\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-plugin-sass\",\n          \"devDependencies\": {\n            \"@snowpack/plugin-sass\": \"^1.4.0\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          plugins: [['@snowpack/plugin-sass']],\n        };\n      `,\n    });\n\n    expect(result['index.css']).toBeDefined();\n    // Includes partial contents\n    expect(result['index.css']).toContain('color: blue;');\n    // Includes index contents\n    expect(result['index.css']).toContain('background: red;');\n    // Does not include the partial file\n    expect(result['_partial.css']).not.toBeDefined();\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/svelte/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('@snowpack/plugin-svelte', async () => {\n    const result = await testFixture({\n      'index.svelte': dedent`\n        <style>\n          div {\n            color: red;\n          }\n        </style>\n        <script>\n          import Icon from 'svelte-awesome';\n          import { refresh, comment, camera } from 'svelte-awesome/icons';\n        </script>\n        \n        <Icon data={refresh}/>\n        <div>Hello, test!</div>\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-plugin-build-svelte\",\n          \"dependencies\": {\n            \"svelte-awesome\": \"^2.3.0\"\n          }\n        }\n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          plugins: [['@snowpack/plugin-svelte']],\n        };\n      `,\n    });\n\n    expect(result['index.svelte.css.proxy.js']).toBeDefined();\n    expect(result['index.svelte.js']).toContain(`import './index.svelte.css.proxy.js';`);\n    expect(result['index.svelte.js']).toContain(\n      `import { refresh, comment, camera } from \"./_snowpack/pkg/svelte-awesome/icons.js\";`,\n    );\n  });\n});\n"
  },
  {
    "path": "test/snowpack/plugin/vue/index.test.js",
    "content": "const {testFixture} = require('../../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('plugin', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('@snowpack/plugin-vue', async () => {\n    const result = await testFixture({\n      'MyComponent.vue': dedent`\n        <script>\n          export default {\n            props: {}\n          }\n        </script>\n      `,\n      'index.vue': dedent`\n        <script>\n          import MyComponent from './MyComponent';\n          export default {\n            components: { MyComponent }\n          }\n        </script>\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"@snowpack/test-plugin-vue\",\n          \"devDependencies\": {\n            \"@snowpack/plugin-vue\": \"^2.3.0\"\n          }\n        }  \n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          plugins: [['@snowpack/plugin-vue']],\n        };\n      `,\n    });\n\n    expect(result['MyComponent.vue.js']).toBeDefined();\n    expect(result['index.vue.js']).toContain(`import MyComponent from './MyComponent.vue.js'`);\n  });\n});\n"
  },
  {
    "path": "test/snowpack/runtime/runtime.test.js",
    "content": "const {testRuntimeFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('runtime', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Can invalidate proxy files', async () => {\n    const fixture = await testRuntimeFixture({\n      'main.js': dedent`\n        import data from './data.json';\n\n        export function getData() {\n          return data;\n        }\n      `,\n      'data.json': dedent`\n        [ 1, 2 ]\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-runtime-invalidate\"\n        }\n      `,\n    });\n\n    let mod = await fixture.runtime.importModule('/main.js');\n\n    expect(mod.exports.getData()).toStrictEqual([1, 2]);\n\n    // Change the file\n    await fixture.writeFile(\n      'data.json',\n      dedent`\n      [ 1, 2, 3 ]\n    `,\n    );\n\n    try {\n      fixture.runtime.invalidateModule('/data.json');\n      mod = await fixture.runtime.importModule('/main.js');\n      expect(mod.exports.getData()).toStrictEqual([1, 2, 3]);\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n\n  // This test is skipped due to the way Jest runs tests, you can't use dynamic import\n  // which this test depends on. See:\n  // https://github.com/nodejs/node/issues/35889\n  it.skip('Provides import.meta.fileURL in SSR', async () => {\n    const fixture = await testRuntimeFixture({\n      'packages/dep/package.json': dedent`\n        {\n          \"name\": \"@snowpack/test-runtime-metaurl-dep\",\n          \"version\": \"0.0.1\",\n          \"main\": \"main.js\"\n        }\n      `,\n      'packages/dep/main.js': dedent`\n        import fs from 'node:fs';\n        const readFile = fs.promises.readFile;\n\n        export async function getData(url) {\n          const json = await fs.readFile(url, 'utf-8');\n          const data = JSON.parse(json);\n          return data;\n        }\n      `,\n      'main.js': dedent`\n        import fs from 'node:fs/promises';\n        import { getData as getDataDepFn } from '@snowpack/test-runtime-metaurl-dep';\n\n        const url = new URL('./data.json', import.meta.url);\n        const depUrl = new URL('./packages/dep/package.json', import.meta.url);\n\n        export async function getData() {\n          const json = await fs.readFile(url, 'utf-8');\n          const data = JSON.parse(json);\n          return data;\n        }\n\n        export async function getDepVersion() {\n          return (await getDataDepFn(depUrl)).version;\n        }\n      `,\n      'data.json': dedent`\n        [ 1, 2 ]\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-runtime-metaurl\"\n        }\n      `,\n      'snowpack.config.json': dedent`\n        {\n          \"packageOptions\": {\n            \"external\": [\"node:fs/promises\"]\n          }\n        }\n      `,\n    });\n\n    try {\n      let mod = await fixture.runtime.importModule('/main.js');\n\n      expect(await mod.exports.getData()).toStrictEqual([1, 2]);\n      expect(await mod.exports.getDepVersion()).equal('0.0.1');\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n\n  it('Can import a CommonJS module as the default export', async () => {\n    const fixture = await testRuntimeFixture({\n      'packages/other/package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"other\",\n          \"main\": \"main.js\"\n        }\n      `,\n      'packages/other/main.js': dedent`\n        module.exports = () => 'works';\n      `,\n      'main.js': dedent`\n        import fn from 'other';\n\n        export function test() {\n          return fn();\n        }\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-runtime-import-cjs\",\n          \"dependencies\": {\n            \"other\": \"file:./packages/other\"\n          }\n        }\n      `,\n      'snowpack.config.json': dedent`\n        {\n          \"packageOptions\": {\n            \"external\": [\"other\"]\n          }\n        }\n      `,\n    });\n\n    try {\n      let mod = await fixture.runtime.importModule('/main.js');\n      expect(await mod.exports.test()).toEqual('works');\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n\n  it('Can handle folders with dots', async () => {\n    const fixture = await testRuntimeFixture({\n      'public/example.com/index.html': `<html></html>\\n`,\n      'public/example/index.html': `<html></html>\\n`,\n      'snowpack.config.js': `\n        module.exports = {\n          mount: {\n            public: { url: '/', static: true }\n          }\n        }\n      `,\n    });\n    try {\n      let contents = (await fixture.loadUrl('/example.com/')).contents.toString('utf8');\n      expect(contents).toEqual('<html></html>\\n');\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n\n  it('Executes scripts in the correct order', async () => {\n    const fixture = await testRuntimeFixture({\n      'one.js': dedent`\n        global.NUM = 1;\n        export default {};\n      `,\n      'two.js': dedent`\n        global.NUM++;\n        export default global.NUM;\n      `,\n      'main.js': dedent`\n        import one from './one.js';\n        import two from './two.js';\n        export const val = two;\n      `,\n    });\n\n    try {\n      let mod = await fixture.runtime.importModule('/main.js');\n      expect(await mod.exports.val).toEqual(2);\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n\n  it('Executes scripts only once', async () => {\n    const fixture = await testRuntimeFixture({\n      'dep.js': dedent`\n        export let state = 0;\n        export default function() {\n          state++;\n        };\n      `,\n      'one.js': dedent`\n        import inc from './dep.js';\n\n        inc();\n      `,\n      'two.js': dedent`\n        import inc from './dep.js';\n\n        inc();\n      `,\n      'main.js': dedent`\n        import './one.js';\n        import './two.js';\n        import { state } from './dep.js';\n        export const val = state;\n      `,\n    });\n\n    try {\n      let mod = await fixture.runtime.importModule('/main.js');\n      expect(mod.exports.val).toEqual(2);\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n\n  it('Installs dynamic imports', async () => {\n    const fixture = await testRuntimeFixture({\n      'packages/@owner/dyn2/package.json': dedent`\n        {\n          \"version\": \"1.0.0\",\n          \"name\": \"@owner/dyn2\",\n          \"module\": \"main.js\"\n        }\n      `,\n      'packages/@owner/dyn2/sub/sibling.js': dedent`\n        export default 3;\n      `,\n      'packages/@owner/dyn2/sub/path.js': dedent`\n        const promise = import('./sibling.js');\n\n        export default async function() {\n          let mod = await promise;\n          return mod.default;\n        }\n      `,\n      'package.json': dedent`\n        {\n          \"version\": \"1.0.1\",\n          \"name\": \"@snowpack/test-runtime-import-dynamic-pkg\",\n          \"dependencies\": {\n            \"@owner/dyn2\": \"file:./packages/@owner/dyn2\"\n          }\n        }\n      `,\n      'main.js': dedent`\n        import fn from '@owner/dyn2/sub/path.js';\n\n        export default async function() {\n          let value = await fn();\n          return value;\n        }\n      `,\n    });\n\n    try {\n      let mod = await fixture.runtime.importModule('/main.js');\n      let promise = mod.exports.default();\n      let value = await promise;\n      expect(value).toEqual(3);\n    } finally {\n      await fixture.cleanup();\n    }\n  });\n});\n"
  },
  {
    "path": "test/snowpack/utf8/index.test.js",
    "content": "const {testFixture} = require('../../fixture-utils');\nconst dedent = require('dedent');\n\ndescribe('utf8', () => {\n  beforeAll(() => {\n    // Needed until we make Snowpack's JS Build Interface quiet by default\n    require('snowpack').logger.level = 'error';\n  });\n\n  it('Unicode characters are not escaped', async () => {\n    const result = await testFixture({\n      'index.js': dedent`\n        export function getText() {\n          return 'testing utf-8 characters: юникод не эскейпится 👌';\n        }\n        \n        document.body.append(getText());\n      `,\n      'index.html': dedent`\n        <!DOCTYPE html>\n        <html lang=\"ru\">\n          <head>\n            <meta charset=\"utf-8\" />\n            <title>utf-8 test</title>\n            <script src=\"index.js\" type=\"module\" defer></script>\n          </head>\n          <body>\n            <h1>Testing UTF-8: проверка юникода</h1>\n          </body>\n        </html> \n      `,\n      'snowpack.config.js': dedent`\n        module.exports = {\n          optimize: {\n            bundle: true,\n            minify: true,\n          },\n        };\n      `,\n    });\n\n    // Unicode characters aren't escaped in html\n    expect(result['index.html']).toContain('проверка юникода');\n    // Unicode characters aren't escaped in typescript\n    expect(result['index.js']).toContain('юникод не эскейпится 👌');\n  });\n});\n"
  },
  {
    "path": "test/snowpack/util.test.ts",
    "content": "const {getExtensionMatch} = require('../../snowpack/lib/cjs/util');\n\nconst EMPTY = Buffer.from('');\n\ndescribe('getExtensionMatch()', () => {\n  const TEST_EXTENSION_MAP = {\n    '.js': '.EXPECTED_JS',\n    '.one.js': '.EXPECTED_ONE_JS',\n    '.one.two.js': '.EXPECTED_ONE_TWO_JS',\n  };\n  const TEST_EXTENSION_MAP_REVERSED = {\n    '.one.two.js': '.EXPECTED_ONE_TWO_JS',\n    '.one.js': '.EXPECTED_ONE_JS',\n    '.js': '.EXPECTED_JS',\n  };\n\n  test('matches a basic file extension', () => {\n    expect(getExtensionMatch('foo.js', TEST_EXTENSION_MAP)).toEqual(['.js', '.EXPECTED_JS']);\n    expect(getExtensionMatch('foo.js', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.js',\n      '.EXPECTED_JS',\n    ]);\n  });\n\n  test('matches any valid URL', () => {\n    expect(getExtensionMatch('/foo.one.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.js',\n      '.EXPECTED_ONE_JS',\n    ]);\n    expect(getExtensionMatch('./foo.one.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.js',\n      '.EXPECTED_ONE_JS',\n    ]);\n    expect(getExtensionMatch('../foo.one.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.js',\n      '.EXPECTED_ONE_JS',\n    ]);\n    expect(getExtensionMatch('file:/a/b/foo.one.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.js',\n      '.EXPECTED_ONE_JS',\n    ]);\n    expect(\n      getExtensionMatch('file:/a.test-weird-directory/b/foo.one.js', TEST_EXTENSION_MAP),\n    ).toEqual(['.one.js', '.EXPECTED_ONE_JS']);\n  });\n\n  test('matches a basic file extension with one vanity dot', () => {\n    expect(getExtensionMatch('foo.one.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.js',\n      '.EXPECTED_ONE_JS',\n    ]);\n    expect(getExtensionMatch('foo.one.js', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.one.js',\n      '.EXPECTED_ONE_JS',\n    ]);\n  });\n\n  test('matches a basic file extension with two vanity dots', () => {\n    expect(getExtensionMatch('foo.one.two.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.two.js',\n      '.EXPECTED_ONE_TWO_JS',\n    ]);\n    expect(getExtensionMatch('foo.one.two.js', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.one.two.js',\n      '.EXPECTED_ONE_TWO_JS',\n    ]);\n  });\n\n  test('matches file extensions without case sensitivity', () => {\n    expect(getExtensionMatch('foo.ONE.two.js', TEST_EXTENSION_MAP)).toEqual([\n      '.one.two.js',\n      '.EXPECTED_ONE_TWO_JS',\n    ]);\n    expect(getExtensionMatch('foo.one.TWO.js', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.one.two.js',\n      '.EXPECTED_ONE_TWO_JS',\n    ]);\n    expect(getExtensionMatch('foo.ONE.TWO.JS', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.one.two.js',\n      '.EXPECTED_ONE_TWO_JS',\n    ]);\n  });\n\n  test('does not match an exact file name', () => {\n    expect(getExtensionMatch('.js', TEST_EXTENSION_MAP)).toEqual(undefined);\n    expect(getExtensionMatch('.js', TEST_EXTENSION_MAP_REVERSED)).toEqual(undefined);\n    expect(getExtensionMatch('.one.js', TEST_EXTENSION_MAP)).toEqual(['.js', '.EXPECTED_JS']);\n    expect(getExtensionMatch('.one.js', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.js',\n      '.EXPECTED_JS',\n    ]);\n    expect(getExtensionMatch('.one.two.js', TEST_EXTENSION_MAP)).toEqual(['.js', '.EXPECTED_JS']);\n    expect(getExtensionMatch('.one.two.js', TEST_EXTENSION_MAP_REVERSED)).toEqual([\n      '.js',\n      '.EXPECTED_JS',\n    ]);\n  });\n\n  test('returns undefined when no match is found', () => {\n    expect(getExtensionMatch('foo.one.two.js.css', TEST_EXTENSION_MAP)).toEqual(undefined);\n    expect(getExtensionMatch('foo.one.two.css', TEST_EXTENSION_MAP)).toEqual(undefined);\n    expect(getExtensionMatch('foo.js.css', TEST_EXTENSION_MAP)).toEqual(undefined);\n  });\n});\n"
  },
  {
    "path": "test/test-utils.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst {execSync} = require('child_process');\nconst glob = require('glob');\nconst slash = require('slash');\n\nconst STRIP_CHUNKHASH = /([\\w\\-]+\\-)[a-z0-9]{8}(\\.js)/g;\nconst STRIP_REV = /\\?rev=\\w+/gm;\nconst STRIP_WHITESPACE = /((\\s+$)|((\\\\r\\\\n)|(\\\\n)))/gm;\nconst UTF8_FRIENDLY_EXTS = [\n  'css',\n  'html',\n  'js',\n  'map',\n  'jsx',\n  'ts',\n  'tsx',\n  'svelte',\n  'svg',\n  'vue',\n  'json',\n]; // only read non-binary files (add more exts here as needed)\n\n/** setup for /tests/build/* */\nfunction setupBuildTest(cwd) {\n  return execSync('yarn testbuild', {cwd});\n}\nexports.setupBuildTest = setupBuildTest;\n\nfunction getFile(results, TEST_OUT, id) {\n  const foundFileLoc = path.resolve(TEST_OUT, id);\n  const foundFile = results[foundFileLoc];\n  if (!foundFile) {\n    console.log(results, id);\n    throw new Error(`TEST: Attempted to getFile(${foundFileLoc}) but not found!`);\n  }\n  return foundFile.contents;\n}\nexports.getFile = getFile;\n\n/** read a directory of files */\nfunction readFiles(directory, {ignore} = {}) {\n  if (!directory) throw new Error(`must specify directory`);\n\n  const contents = {};\n  const allFiles = glob.sync(`**/*.{${UTF8_FRIENDLY_EXTS.join(',')}}`, {\n    cwd: directory,\n    nodir: true,\n    dot: true,\n    ignore,\n  });\n\n  allFiles.forEach((filepath) => {\n    const relativePath = filepath.replace(/^\\/?/, '/');\n    contents[slash(relativePath)] = fs.readFileSync(path.join(directory, filepath), 'utf8');\n  });\n\n  return contents;\n}\nexports.readFiles = readFiles;\n\n/** strip chunk hash from URLs */\nfunction stripChunkhash(code) {\n  return code.replace(STRIP_CHUNKHASH, '$1XXXXXXXX$2');\n}\nexports.stripChunkhash = stripChunkhash;\n\n/** strip ?rev= from URLs */\nfunction stripRev(code) {\n  return code.replace(STRIP_REV, '?rev=XXXXXXXXXX');\n}\nexports.stripRev = stripRev;\n\n/** strip whitespace */\nfunction stripWS(code) {\n  return code.replace(STRIP_WHITESPACE, '');\n}\nexports.stripWS = stripWS;\n\n/** strip benchmark */\nfunction stripBenchmark(stdout) {\n  return stdout.replace(/\\s*\\[\\d+\\.?\\d+s\\](\\n?)/g, '$1'); //remove benchmark\n}\nexports.stripBenchmark = stripBenchmark;\n\n/** strip stats */\nfunction stripStats(stdout) {\n  // Need to strip leading whitespace to get around strange Node v13 behavior\n  return stdout.replace(/\\s+[\\d\\.]*? KB/g, '    XXXX KB');\n}\nexports.stripStats = stripStats;\n\n/** strip whitespace */\nfunction stripWhitespace(stdout) {\n  return stdout.replace(/((\\s+$)|((\\\\r\\\\n)|(\\\\n)))/gm, '');\n}\nexports.stripWhitespace = stripWhitespace;\n\n/** strip chunk hash */\nfunction stripChunkHash(stdout) {\n  return stdout.replace(/([\\w\\-]+\\-)[a-z0-9]{8}(\\.js)/g, '$1XXXXXXXX$2');\n}\nexports.stripChunkHash = stripChunkHash;\n\n/** strip URL hash */\nfunction stripUrlHash(stdout) {\n  return stdout.replace(/\\-[A-Za-z0-9]{20}\\//g, 'XXXXXXXX');\n}\nexports.stripUrlHash = stripUrlHash;\n\n/** strip config error path */\nfunction stripConfigErrorPath(stdout) {\n  return stdout.replace(/^\\[snowpack\\] ! (.*)package\\.json$/gm, '! XXX/package.json');\n}\nexports.stripConfigErrorPath = stripConfigErrorPath;\n\n/** strip resolve error path */\nfunction stripResolveErrorPath(stdout) {\n  return stdout.replace(/\" via \"(.*)\"/g, '\" via \"XXX\"');\n}\nexports.stripResolveErrorPath = stripResolveErrorPath;\n\n/** strip stack trace */\nfunction stripStacktrace(stdout) {\n  return stdout.replace(/^\\s+at\\s+.*/gm, ''); // this is OK to show to the user but annoying to have in a test\n}\nexports.stripStacktrace = stripStacktrace;\n\n/** strip the svelte comment */\nfunction stripSvelteComment(stdout) {\n  return stdout.replace(/^.*generated by Svelte.*$/gm, '/* XXXX generated by Svelte vX.X.X */');\n}\nexports.stripSvelteComment = stripSvelteComment;\n\n/** strip away the home path */\nfunction stripHomePath(stdout) {\n  // Use the split->join trick to replace all instances of a string instead of just the first one\n  return stdout.split(process.cwd()).join('XHOMEX').replace(/\\\\/g, '/');\n}\nexports.stripHomePath = stripHomePath;\n\n/** strip all of the things */\nfunction stripEverything(output) {\n  return stripWhitespace(\n    stripHomePath(\n      stripConfigErrorPath(\n        stripResolveErrorPath(stripBenchmark(stripChunkHash(stripStats(stripStacktrace(output))))),\n      ),\n    ),\n  );\n}\nexports.stripEverything = stripEverything;\n\n/** strip the lockfile */\nfunction stripLockfile(output) {\n  return stripWhitespace(stripUrlHash(output));\n}\nexports.stripLockfile = stripLockfile;\n\n/** Format JSON */\nfunction fmtjson(json) {\n  return JSON.stringify(json, undefined, 2);\n}\nexports.fmtjson = fmtjson;\n"
  },
  {
    "path": "test-dev/README.md",
    "content": "# Tests for `snowpack dev`\n\nWe moved the tests out of the common `test/` folder because of problems with Windows. This way, we can run the dev tests using a separate command, which we can run on CI on Ubuntu only.\n\nWe would love to figure out the problem. If you develop on a Windows machine, we would appreciate your help. See [#1171](https://github.com/withastro/snowpack/pull/1171) for more information.\n"
  },
  {
    "path": "test-dev/__snapshots__/dev.test.ts.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`snowpack dev smoke: about 1`] = `\n\"<!DOCTYPE html>\n<html>\n  <head><script>window.HMR_WEBSOCKET_PORT=8080</script>\n<script type=\\\\\"module\\\\\" integrity=\\\\\"sha384-y8il70JD9siKrwwsMhcx99P7XKCWpwH7DWMCPklzJJeQBV6Y4OY9RpL+HlYJlW2r\\\\\" src=\\\\\"/_snowpack/hmr-client.js\\\\\"></script><script type=\\\\\"module\\\\\" integrity=\\\\\"sha384-LH/mFhEGRB4jHedP0nqOoIUwc4VX8eWJxEL+qTGWtroqiLJ2vxX169J0oSBMHL5o\\\\\" src=\\\\\"/_snowpack/hmr-error-overlay.js\\\\\"></script></head>\n  <body>\n    <p>this is a template in some language that builds to .html</p>\n  </body>\n</html>\"\n`;\n\nexports[`snowpack dev smoke: html 1`] = `\n\"<!DOCTYPE html>\n<html lang=\\\\\"en\\\\\">\n  <head>\n    <meta charset=\\\\\"utf-8\\\\\" />\n    <link rel=\\\\\"icon\\\\\" href=\\\\\"/favicon.ico\\\\\" />\n    <meta name=\\\\\"viewport\\\\\" content=\\\\\"width=device-width, initial-scale=1\\\\\" />\n    <meta name=\\\\\"description\\\\\" content=\\\\\"Web site created using create-snowpack-app\\\\\" />\n    <link rel=\\\\\"stylesheet\\\\\" type=\\\\\"text/css\\\\\" href=\\\\\"/index.css\\\\\" />\n    <title>Snowpack App</title>\n  <script>window.HMR_WEBSOCKET_PORT=8080</script>\n<script type=\\\\\"module\\\\\" integrity=\\\\\"sha384-y8il70JD9siKrwwsMhcx99P7XKCWpwH7DWMCPklzJJeQBV6Y4OY9RpL+HlYJlW2r\\\\\" src=\\\\\"/_snowpack/hmr-client.js\\\\\"></script><script type=\\\\\"module\\\\\" integrity=\\\\\"sha384-LH/mFhEGRB4jHedP0nqOoIUwc4VX8eWJxEL+qTGWtroqiLJ2vxX169J0oSBMHL5o\\\\\" src=\\\\\"/_snowpack/hmr-error-overlay.js\\\\\"></script></head>\n  <body>\n    <img id=\\\\\"img\\\\\" src=\\\\\"/logo.svg\\\\\" />\n    <canvas id=\\\\\"canvas\\\\\"></canvas>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\\\\\"module\\\\\" src=\\\\\"/_dist_/index.js\\\\\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run \\`npm start\\` or \\`yarn start\\`.\n      To create a production bundle, use \\`npm run build\\` or \\`yarn build\\`.\n    -->\n  </body>\n</html>\n\"\n`;\n\nexports[`snowpack dev smoke: js 1`] = `\n\"/**\n * This file is just a silly example to show everything working in the browser.\n * When you're ready to start on your site, clear the file. Happy hacking!\n **/\n\nimport confetti from '../_snowpack/pkg/canvas-confetti.v1.4.0.js';\n\nconfetti.create(document.getElementById('canvas'), {\n  resize: true,\n  useWorker: true,\n})({particleCount: 200, spread: 200});\n\"\n`;\n"
  },
  {
    "path": "test-dev/dev.test.ts",
    "content": "const path = require('path');\n\nconst execa = require('execa');\nconst {readdirSync, readFileSync, statSync, existsSync} = require('fs');\nconst glob = require('glob');\nconst os = require('os');\nconst {get} = require('httpie');\n\nlet snowpackProcess;\n\nasync function startServer (cwd) {\n  // start the server\n  // NOTE: we tried spawning `yarn` here, but the process was not cleaned up\n  //       correctly on CI and the action got stuck. npx does not cause that problem.\n  snowpackProcess = execa(\n    path.resolve('node_modules', '.bin', 'snowpack'),\n    ['dev', '--verbose', '--output', 'stream'],\n    {cwd},\n  );\n\n  snowpackProcess.stdout.pipe(process.stdout);\n  snowpackProcess.stderr.pipe(process.stderr);\n\n  // await server to be ready and set a timeout in case something goes wrong\n  await new Promise((resolve, reject) => {\n    // start timeout in case something goes wrong.\n    const timeout = setTimeout(() => {\n      snowpackProcess.cancel();\n      console.error(output.join(''));\n      reject(new Error('Timeout: snowpack did not start server within 3 seconds.'));\n    }, 3000);\n\n    const output = [];\n    snowpackProcess.stdout.on('data', (buffer) => {\n      const line = buffer.toString();\n      output.push(line);\n      if (/Server started in/.test(line)) {\n        resolve();\n        clearTimeout(timeout);\n      }\n    });\n  });\n}\n\ndescribe('snowpack dev', () => {\n  afterEach(async () => {\n    snowpackProcess.cancel();\n    snowpackProcess.kill('SIGTERM', {\n      forceKillAfterTimeout: 2000,\n    });\n\n    try {\n      await snowpackProcess;\n    } catch (error) {\n      expect(error.killed).toEqual(true);\n    }\n  });\n\n  it('smoke', async () => {\n    expect.assertions(4);\n\n    // start the server\n    const cwd = path.join(__dirname, 'smoke');\n    await startServer(cwd);\n\n    // get HTML\n    const {data: htmlBody} = await get('http://localhost:8080');\n    expect(htmlBody).toMatchSnapshot('html');\n\n    // get built JS\n    const {data: jsBody} = await get('http://localhost:8080/_dist_/index.js');\n    expect(jsBody).toMatchSnapshot('js');\n\n    // get built HTML\n    const {data: aboutBody} = await get('http://localhost:8080/about');\n    expect(aboutBody).toMatchSnapshot('about');\n  });\n\n  // Test that server starts properly using default TLS certificate and key files.\n  it('smoke-secure-1', async () => {\n    expect.assertions(1);\n\n    // Start the server.\n    const cwd = path.join(__dirname, 'smoke-secure-1');\n    await startServer(cwd);\n  });\n\n  // Test that server starts properly using TLS certificate and key files\n  // specified using devOptions.cert and devOptions.key.\n  it('smoke-secure-2', async () => {\n    expect.assertions(1);\n\n    // Start the server.\n    const cwd = path.join(__dirname, 'smoke-secure-2');\n    await startServer(cwd);\n  });\n});\n"
  },
  {
    "path": "test-dev/smoke/package.json",
    "content": "{\n  \"dependencies\": {\n    \"@snowpack/plugin-build-script\": \"^2.0.7\",\n    \"canvas-confetti\": \"^1.2.0\",\n    \"snowpack\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "test-dev/smoke/public/about.tmpl",
    "content": "<!DOCTYPE html>\n<html>\n  <head></head>\n  <body>\n    <p>this is a template in some language that builds to .html</p>\n  </body>\n</html>\n"
  },
  {
    "path": "test-dev/smoke/public/index.css",
    "content": "#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\n\n#canvas {\n  display: block;\n  margin: 2rem auto;\n  width: 540px;\n  height: 540px;\n}\n"
  },
  {
    "path": "test-dev/smoke/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\"img\" src=\"/logo.svg\" />\n    <canvas id=\"canvas\"></canvas>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/_dist_/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "test-dev/smoke/snowpack.config.js",
    "content": "module.exports = {\n  devOptions: {\n    open: \"none\"\n  },\n  mount: {\n    public: \"/\",\n    src: \"/_dist_\"\n  },\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        input: ['.tmpl'],\n        output: ['.html'],\n        cmd: 'cat $FILE',\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "test-dev/smoke/src/index.js",
    "content": "/**\n * This file is just a silly example to show everything working in the browser.\n * When you're ready to start on your site, clear the file. Happy hacking!\n **/\n\nimport confetti from 'canvas-confetti';\n\nconfetti.create(document.getElementById('canvas'), {\n  resize: true,\n  useWorker: true,\n})({particleCount: 200, spread: 200});\n"
  },
  {
    "path": "test-dev/smoke-secure-1/package.json",
    "content": "{\n  \"dependencies\": {\n    \"@snowpack/plugin-build-script\": \"^2.0.7\",\n    \"canvas-confetti\": \"^1.2.0\",\n    \"snowpack\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "test-dev/smoke-secure-1/public/about.tmpl",
    "content": "<!DOCTYPE html>\n<html>\n  <head></head>\n  <body>\n    <p>this is a template in some language that builds to .html</p>\n  </body>\n</html>\n"
  },
  {
    "path": "test-dev/smoke-secure-1/public/index.css",
    "content": "#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\n\n#canvas {\n  display: block;\n  margin: 2rem auto;\n  width: 540px;\n  height: 540px;\n}\n"
  },
  {
    "path": "test-dev/smoke-secure-1/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\"img\" src=\"/logo.svg\" />\n    <canvas id=\"canvas\"></canvas>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/_dist_/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "test-dev/smoke-secure-1/snowpack.config.js",
    "content": "module.exports = {\n  devOptions: {\n    open: \"none\",\n    secure: true\n  },\n  mount: {\n    public: \"/\",\n    src: \"/_dist_\"\n  },\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        input: ['.tmpl'],\n        output: ['.html'],\n        cmd: 'cat $FILE',\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "test-dev/smoke-secure-1/snowpack.crt",
    "content": "-----BEGIN CERTIFICATE-----\nMIIERzCCAq+gAwIBAgIQUSVq6njLtPS7s+9BIHjGBzANBgkqhkiG9w0BAQsFADB1\nMR4wHAYDVQQKExVta2NlcnQgZGV2ZWxvcG1lbnQgQ0ExJTAjBgNVBAsMHGFyYWxA\nZGV2LmFyLmFsIChBcmFsIEJhbGthbikxLDAqBgNVBAMMI21rY2VydCBhcmFsQGRl\ndi5hci5hbCAoQXJhbCBCYWxrYW4pMB4XDTIwMTIyMTE0MTcxMloXDTIzMDMyMTE0\nMTcxMlowUDEnMCUGA1UEChMebWtjZXJ0IGRldmVsb3BtZW50IGNlcnRpZmljYXRl\nMSUwIwYDVQQLDBxhcmFsQGRldi5hci5hbCAoQXJhbCBCYWxrYW4pMIIBIjANBgkq\nhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzw5c6d2sxz7jWayEzyuZgod5bTW0VqQ8\nI5WMuflQs/oiEX8OK9IPKkJ0lzDYe70jEbUlsnIPGP2XgyEwja1GLGqyt0BqdVsH\n8vhmtBD0pICV5jA+R5v5o4jU07wsgHMC9rR4M5DPag3RjJWYsx7l5aosyEgMIpoF\nt1r4XUukl2qFRlM8xXqywFyy0IfnT187ijh7VHT7Ibm+HHcHkFqbF9oqVUkR+NsB\n0SEo4CEio5ufMCG0gmaqe4A81YGuLdUYYzPF5KOF4Hh1CAjXhKJr8dyETvixjZO3\n40DmsguPbr5+xedof6USr0zuel56AA2Z3mwT0C8zndTd4AhpWx9GzQIDAQABo3gw\ndjAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/\nBAIwADAfBgNVHSMEGDAWgBT2Ac1DO7MgFVDNm/l0GXsYfedtDzAgBgNVHREEGTAX\ngglsb2NhbGhvc3SHBH8AAAGHBMCoAvkwDQYJKoZIhvcNAQELBQADggGBAEy0WzWB\nylaXs/VVFU5bXHCoVeSfMZlR0UOdIZ5CaAnzYx8YYVTKzR40hdI8w360BZkcPhcf\neESsx4lnHFgndvlIsrNRx5BxBVVRk6dzzgQMsQ3gr6auA+gCkzxNjXjB9eGwjVhU\nrIyTQVDFhtAVq4rdBJd6dIipL8rlUuCXluVhBCcRfi3jiSPV2wNFvqGpPHN6X7yR\n8j56zP7reSeL5CczdGbgJNLzp+jimz9NYLCuY97hURTTGeNV5+QGbgz18Uojjall\nrgbWyrxIvf4SRxVOH2Y2htYtuinhB1UHQH8IuXpnBzoT1wAzT2tAxSy+Yi+QT5EK\nkG0zVqqtYHkkHkBwnnGI0IA3hvQtvTsBCWZcQHM+1zK4BaVJJvtV60/Ejy8R1phw\n2NhexVMUcLIrNNVZxS+O8l+Z5v0rBuL+rzuEB90idKWHCinJ0b4D9y7vUXdcXV6H\nx4cunqRnZTYoHHZEY3YwKfHF5ICsToEKLDDgcmfJQZBEIepcmeyOtA/9sg==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "test-dev/smoke-secure-1/snowpack.key",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDPDlzp3azHPuNZ\nrITPK5mCh3ltNbRWpDwjlYy5+VCz+iIRfw4r0g8qQnSXMNh7vSMRtSWycg8Y/ZeD\nITCNrUYsarK3QGp1Wwfy+Ga0EPSkgJXmMD5Hm/mjiNTTvCyAcwL2tHgzkM9qDdGM\nlZizHuXlqizISAwimgW3WvhdS6SXaoVGUzzFerLAXLLQh+dPXzuKOHtUdPshub4c\ndweQWpsX2ipVSRH42wHRISjgISKjm58wIbSCZqp7gDzVga4t1RhjM8Xko4XgeHUI\nCNeEomvx3IRO+LGNk7fjQOayC49uvn7F52h/pRKvTO56XnoADZnebBPQLzOd1N3g\nCGlbH0bNAgMBAAECggEBAIFqFsTNmupF8k/gNnpOY/pjto9926OzrysGlBjBLaHw\nG08YPMFC39uoAbtl+kkM5FhzAobQJ4OVLRf2rKRAwvWMEvvatS94oDVK8NZnKqGP\nBSIE0UhswtFl+rAEk0QNnrKYBfEk957v2COodPKvwz2S6b6c2Yje/+ekYkvdtZg1\nCc1LptRa4lcNjZuV2gGOTqFxNnGgGxELnCwCo1TFheL9Ckh62O+63nkmimGW4yxm\nGFgcFl0QwYV0NJEuZFdcxuzXb2cz0fPdNfTXbWCfwvCT1bnxR8ucFmZzbulAcLsc\nzcwIfYg642Hl46CYzboy4ge172rB17LkEDjmcVWfPDkCgYEA8UpiDPAJs8sLIVxv\n/KFE/uBeWhIuQZlc/UT0+/crwzbbrHXLFadwXxUWBZa0Zr/qigY5uwtcBDTQA41d\nGlY3nlZNzn1Lp+MRYJhs6lFL06szy6qf+VeGkQ2x5Z+HsSs8g8LG4MU8asAVJ+R2\n3AQaQJ9eJxmDVkBjtbg3dekGVF8CgYEA2622PSup+e8VBFpvgKOTd6ZQ0yhPxRzG\nnZIoBC1rn6p6fX0Qm2tN0sUDAPAL0kfBAJNvkJzoYpDMiOTt4hcHsdzPl0q5d7jJ\nRrIY4bAzNjdXrF50yEegUcdcP4cJ2WqvCP5purVrPuwSlJwm2XmaZsq8O+4sWwd/\naWV1hDaVlFMCgYEA2vUD2ver5kKXfBOU7+wsXxmdpSCgZxjTgGUl5svaI5DRcUOH\nIcRKvY216SZj2GXJYKzbkHdzbcG7Da4nUXHxkLaCbqHWmKf+KejH1S4moBLYsrXH\n641YaKLDzzqf+M7iYDLNJET3WWurBwNUNL1oUUINP2/wdcGCefGMKmxmOQMCgYEA\nwraJRlTyd2cTwOUL2gCjEDWphFBBzFwCK95Fe9Zqg35OzfXRh4Cn3T7kt6sNP1h8\nWK9V/t8lF2By+o+3zmNNXbhzhA0msVhnhzMK3NgZvF93ZX/fkTnzfyjuuhxOfZiT\nBqzCOEzff0kt+u0hfjfLxHrEN3aXeCQAKgJVFFhxYqMCgYEArftUDPedXbU3NNij\nhK1nwJnutgSIyMwr9sPQPiNJ3k7v9z+kQbEtfXpHU/QIg6DZqVpojCRMJb9I9ePM\nfJ5ANhExN7szGFYGEM3TtMU825t+IcUruf8zPuMK8vg82Nv4ME/WJRXdDqvUnnLG\n0bIF5Hc1radA3QZD6ZpbZjgSxrI=\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "test-dev/smoke-secure-1/src/index.js",
    "content": "/**\n * This file is just a silly example to show everything working in the browser.\n * When you're ready to start on your site, clear the file. Happy hacking!\n **/\n\nimport confetti from 'canvas-confetti';\n\nconfetti.create(document.getElementById('canvas'), {\n  resize: true,\n  useWorker: true,\n})({particleCount: 200, spread: 200});\n"
  },
  {
    "path": "test-dev/smoke-secure-2/package.json",
    "content": "{\n  \"dependencies\": {\n    \"@snowpack/plugin-build-script\": \"^2.0.7\",\n    \"canvas-confetti\": \"^1.2.0\",\n    \"snowpack\": \"^3.0.0\"\n  }\n}\n"
  },
  {
    "path": "test-dev/smoke-secure-2/public/about.tmpl",
    "content": "<!DOCTYPE html>\n<html>\n  <head></head>\n  <body>\n    <p>this is a template in some language that builds to .html</p>\n  </body>\n</html>\n"
  },
  {
    "path": "test-dev/smoke-secure-2/public/index.css",
    "content": "#img {\n  display: block;\n  margin: auto;\n  height: 128px;\n  width: 128px;\n  padding: 2rem;\n}\n\n#canvas {\n  display: block;\n  margin: 2rem auto;\n  width: 540px;\n  height: 540px;\n}\n"
  },
  {
    "path": "test-dev/smoke-secure-2/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"description\" content=\"Web site created using create-snowpack-app\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/index.css\" />\n    <title>Snowpack App</title>\n  </head>\n  <body>\n    <img id=\"img\" src=\"/logo.svg\" />\n    <canvas id=\"canvas\"></canvas>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <script type=\"module\" src=\"/_dist_/index.js\"></script>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "test-dev/smoke-secure-2/snowpack.config.js",
    "content": "const { readFileSync } = require('fs');\n\nconst cert = readFileSync(\"./tls/certificate.pem\");\nconst key = readFileSync(\"./tls/key.pem\");\n\nmodule.exports = {\n  devOptions: {\n    open: \"none\",\n    secure: { cert, key },\n  },\n  mount: {\n    public: \"/\",\n    src: \"/_dist_\"\n  },\n  plugins: [\n    [\n      '@snowpack/plugin-build-script',\n      {\n        input: ['.tmpl'],\n        output: ['.html'],\n        cmd: 'cat $FILE',\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "test-dev/smoke-secure-2/src/index.js",
    "content": "/**\n * This file is just a silly example to show everything working in the browser.\n * When you're ready to start on your site, clear the file. Happy hacking!\n **/\n\nimport confetti from 'canvas-confetti';\n\nconfetti.create(document.getElementById('canvas'), {\n  resize: true,\n  useWorker: true,\n})({particleCount: 200, spread: 200});\n"
  },
  {
    "path": "test-dev/smoke-secure-2/tls/certificate.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIERzCCAq+gAwIBAgIQUSVq6njLtPS7s+9BIHjGBzANBgkqhkiG9w0BAQsFADB1\nMR4wHAYDVQQKExVta2NlcnQgZGV2ZWxvcG1lbnQgQ0ExJTAjBgNVBAsMHGFyYWxA\nZGV2LmFyLmFsIChBcmFsIEJhbGthbikxLDAqBgNVBAMMI21rY2VydCBhcmFsQGRl\ndi5hci5hbCAoQXJhbCBCYWxrYW4pMB4XDTIwMTIyMTE0MTcxMloXDTIzMDMyMTE0\nMTcxMlowUDEnMCUGA1UEChMebWtjZXJ0IGRldmVsb3BtZW50IGNlcnRpZmljYXRl\nMSUwIwYDVQQLDBxhcmFsQGRldi5hci5hbCAoQXJhbCBCYWxrYW4pMIIBIjANBgkq\nhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzw5c6d2sxz7jWayEzyuZgod5bTW0VqQ8\nI5WMuflQs/oiEX8OK9IPKkJ0lzDYe70jEbUlsnIPGP2XgyEwja1GLGqyt0BqdVsH\n8vhmtBD0pICV5jA+R5v5o4jU07wsgHMC9rR4M5DPag3RjJWYsx7l5aosyEgMIpoF\nt1r4XUukl2qFRlM8xXqywFyy0IfnT187ijh7VHT7Ibm+HHcHkFqbF9oqVUkR+NsB\n0SEo4CEio5ufMCG0gmaqe4A81YGuLdUYYzPF5KOF4Hh1CAjXhKJr8dyETvixjZO3\n40DmsguPbr5+xedof6USr0zuel56AA2Z3mwT0C8zndTd4AhpWx9GzQIDAQABo3gw\ndjAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/\nBAIwADAfBgNVHSMEGDAWgBT2Ac1DO7MgFVDNm/l0GXsYfedtDzAgBgNVHREEGTAX\ngglsb2NhbGhvc3SHBH8AAAGHBMCoAvkwDQYJKoZIhvcNAQELBQADggGBAEy0WzWB\nylaXs/VVFU5bXHCoVeSfMZlR0UOdIZ5CaAnzYx8YYVTKzR40hdI8w360BZkcPhcf\neESsx4lnHFgndvlIsrNRx5BxBVVRk6dzzgQMsQ3gr6auA+gCkzxNjXjB9eGwjVhU\nrIyTQVDFhtAVq4rdBJd6dIipL8rlUuCXluVhBCcRfi3jiSPV2wNFvqGpPHN6X7yR\n8j56zP7reSeL5CczdGbgJNLzp+jimz9NYLCuY97hURTTGeNV5+QGbgz18Uojjall\nrgbWyrxIvf4SRxVOH2Y2htYtuinhB1UHQH8IuXpnBzoT1wAzT2tAxSy+Yi+QT5EK\nkG0zVqqtYHkkHkBwnnGI0IA3hvQtvTsBCWZcQHM+1zK4BaVJJvtV60/Ejy8R1phw\n2NhexVMUcLIrNNVZxS+O8l+Z5v0rBuL+rzuEB90idKWHCinJ0b4D9y7vUXdcXV6H\nx4cunqRnZTYoHHZEY3YwKfHF5ICsToEKLDDgcmfJQZBEIepcmeyOtA/9sg==\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "test-dev/smoke-secure-2/tls/key.pem",
    "content": "-----BEGIN PRIVATE KEY-----\nMIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDPDlzp3azHPuNZ\nrITPK5mCh3ltNbRWpDwjlYy5+VCz+iIRfw4r0g8qQnSXMNh7vSMRtSWycg8Y/ZeD\nITCNrUYsarK3QGp1Wwfy+Ga0EPSkgJXmMD5Hm/mjiNTTvCyAcwL2tHgzkM9qDdGM\nlZizHuXlqizISAwimgW3WvhdS6SXaoVGUzzFerLAXLLQh+dPXzuKOHtUdPshub4c\ndweQWpsX2ipVSRH42wHRISjgISKjm58wIbSCZqp7gDzVga4t1RhjM8Xko4XgeHUI\nCNeEomvx3IRO+LGNk7fjQOayC49uvn7F52h/pRKvTO56XnoADZnebBPQLzOd1N3g\nCGlbH0bNAgMBAAECggEBAIFqFsTNmupF8k/gNnpOY/pjto9926OzrysGlBjBLaHw\nG08YPMFC39uoAbtl+kkM5FhzAobQJ4OVLRf2rKRAwvWMEvvatS94oDVK8NZnKqGP\nBSIE0UhswtFl+rAEk0QNnrKYBfEk957v2COodPKvwz2S6b6c2Yje/+ekYkvdtZg1\nCc1LptRa4lcNjZuV2gGOTqFxNnGgGxELnCwCo1TFheL9Ckh62O+63nkmimGW4yxm\nGFgcFl0QwYV0NJEuZFdcxuzXb2cz0fPdNfTXbWCfwvCT1bnxR8ucFmZzbulAcLsc\nzcwIfYg642Hl46CYzboy4ge172rB17LkEDjmcVWfPDkCgYEA8UpiDPAJs8sLIVxv\n/KFE/uBeWhIuQZlc/UT0+/crwzbbrHXLFadwXxUWBZa0Zr/qigY5uwtcBDTQA41d\nGlY3nlZNzn1Lp+MRYJhs6lFL06szy6qf+VeGkQ2x5Z+HsSs8g8LG4MU8asAVJ+R2\n3AQaQJ9eJxmDVkBjtbg3dekGVF8CgYEA2622PSup+e8VBFpvgKOTd6ZQ0yhPxRzG\nnZIoBC1rn6p6fX0Qm2tN0sUDAPAL0kfBAJNvkJzoYpDMiOTt4hcHsdzPl0q5d7jJ\nRrIY4bAzNjdXrF50yEegUcdcP4cJ2WqvCP5purVrPuwSlJwm2XmaZsq8O+4sWwd/\naWV1hDaVlFMCgYEA2vUD2ver5kKXfBOU7+wsXxmdpSCgZxjTgGUl5svaI5DRcUOH\nIcRKvY216SZj2GXJYKzbkHdzbcG7Da4nUXHxkLaCbqHWmKf+KejH1S4moBLYsrXH\n641YaKLDzzqf+M7iYDLNJET3WWurBwNUNL1oUUINP2/wdcGCefGMKmxmOQMCgYEA\nwraJRlTyd2cTwOUL2gCjEDWphFBBzFwCK95Fe9Zqg35OzfXRh4Cn3T7kt6sNP1h8\nWK9V/t8lF2By+o+3zmNNXbhzhA0msVhnhzMK3NgZvF93ZX/fkTnzfyjuuhxOfZiT\nBqzCOEzff0kt+u0hfjfLxHrEN3aXeCQAKgJVFFhxYqMCgYEArftUDPedXbU3NNij\nhK1nwJnutgSIyMwr9sPQPiNJ3k7v9z+kQbEtfXpHU/QIg6DZqVpojCRMJb9I9ePM\nfJ5ANhExN7szGFYGEM3TtMU825t+IcUruf8zPuMK8vg82Nv4ME/WJRXdDqvUnnLG\n0bIF5Hc1radA3QZD6ZpbZjgSxrI=\n-----END PRIVATE KEY-----\n"
  },
  {
    "path": "www/.gitignore",
    "content": "node_modules\ndist\nsrc/pages/**/*.md"
  },
  {
    "path": "www/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Fred K. Schott\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "www/README.md",
    "content": "# Snowpack docs\n\nWe aim to follow the [Diátaxis documentation system](https://diataxis.fr/) though a lot of our docs are legacy and don't necessarily fit it yet.\n\n## Architecture\n\n- Markdown files that become pages are in `/template`\n- SASS files in `css`\n- templates in `_includes`\n\n## Style guide\n\n- Terminology\n  - Use \"Snowpack project\" rather than Snowpack app/webapp or Snowpack site in docs\n  - Exceptions are in blog posts or introductory material where the other terms are easier to understand\n- Sentence-style capitalization\n- Oxford comma\n- Capitalize after colons\n- Avoid using vague terms for link text like \"here\"\n\n### Vale\n\n[Vale](https://github.com/errata-ai/vale) is a text linter. A selection of rules based on our style guide are available in the Vale directory. Right now Vale usage in this repository is experimental but once we have some experience with using these we plan on integrating them as tests.\n\n### Reference documentation formatting\n\nFor reference documentation (APIs, configuration, etc.), use the following format:\n\n```\nmethod/name | `type` |  Default: `value` | _required_ : description\n```\n\n`Default` is optional and only applies if there is a default. `_required_` can be omitted if the value is optional.\n\nExample:\n\n```\ndevOptions.open | `string` | Default: `\"default\"`\n```\n\nIf it's a heading use the extended format with the rest of the information below the heading:\n\n```\n#### name\n**Type:** `string`\n\n**Default:** `value`\n\n_required_\n\nShort 1-2 sentence description ideally the same as what's in the code comments.\n\nDetails\n\nExample(s):\n```\n\n#### Types\n\nThe type notation we use is ???\n\nWe could use Swagger\nhttps://swagger.io/docs/specification/data-models/data-types/\n\nOr use TypeScript notation though will people understand that?\n\n### Code blocks\n\nCode blocks should have a top comment with information about the code:\n1st line: required if this a code snippet about a specific file\n2nd line: describe the change, not always required but recommended. Start with Example: if relevent.\n3rd line: if a dependency is implied, add the npm install script here\n\nExample:\n\n```js\n// snowpack.config.js\n// Example: Connect the Sass plugin\n// [npm install @snowpack/plugin-sass]\nmodule.exports = {\n  plugins: [\n    ['@snowpack/plugin-sass', { /* see options below */ }\n  ],\n};\n```\n"
  },
  {
    "path": "www/astro.config.mjs",
    "content": "export default {\n  projectRoot: '.',\n  pages: './src/pages',\n  dist: './dist',\n  public: './public',\n  buildOptions: {\n    site: 'https://snowpack.dev/',\n  },\n  renderers: [\n    // When testing, we used this as a bit of a kitchen sink for Astro.\n    // Keep the different mixing of frameworks just for fun, to show Astro off.\n    '@astrojs/renderer-vue',\n    '@astrojs/renderer-svelte',\n    '@astrojs/renderer-preact',\n  ],\n};\n"
  },
  {
    "path": "www/package.json",
    "content": "{\n  \"name\": \"snowpack-www\",\n  \"private\": true,\n  \"version\": \"3.0.0\",\n  \"scripts\": {\n    \"start\": \"yarn copy && astro dev\",\n    \"build\": \"yarn copy && astro build\",\n    \"copy\": \"node scripts/copy.js\"\n  },\n  \"dependencies\": {\n    \"astro\": \"^0.19.1\",\n    \"date-fns\": \"^2.19.0\",\n    \"docsearch.js\": \"^2.6.3\"\n  }\n}\n"
  },
  {
    "path": "www/public/favicon/site.webmanifest",
    "content": "{\"name\":\"\",\"short_name\":\"\",\"icons\":[{\"src\":\"/android-chrome-192x192.png\",\"sizes\":\"192x192\",\"type\":\"image/png\"},{\"src\":\"/android-chrome-512x512.png\",\"sizes\":\"512x512\",\"type\":\"image/png\"}],\"theme_color\":\"#ffffff\",\"background_color\":\"#ffffff\",\"display\":\"standalone\"}"
  },
  {
    "path": "www/public/js/index.js",
    "content": "/**\n * Debounce functions for better performance\n * (c) 2018 Chris Ferdinandi, MIT License, https://gomakethings.com\n * @param  {Function} fn The function to debounce\n */\nfunction debounce(fn) {\n  // Setup a timer\n  var timeout;\n  // Return a function to run debounced\n  return function () {\n    // Setup the arguments\n    var context = this;\n    var args = arguments;\n    // If there's a timer, cancel it\n    if (timeout) {\n      window.cancelAnimationFrame(timeout);\n    }\n    // Setup the new requestAnimationFrame()\n    timeout = window.requestAnimationFrame(function () {\n      fn.apply(context, args);\n    });\n  };\n}\n\nfunction isScrolledIntoView(el) {\n  const {top} = el.getBoundingClientRect();\n  const halfHeight = window.innerHeight / 2;\n  const isVisible = top <= halfHeight;\n  return isVisible;\n}\n\nfunction setActiveToc() {\n  if (window.innerWidth < 1240) {\n    return;\n  }\n  if (!tableOfContentsEl) {\n    return;\n  }\n\n  const headings = [\n    ...document.querySelectorAll(\n      '.content-body h1, .content-body h2, .content-body h3, .content-body h4',\n    ),\n  ].filter((el) => !!el.id);\n  const scrolledToBeginning = window.scrollY === 0;\n  const scrolledToEnd =\n    Math.ceil(window.innerHeight + window.scrollY) >=\n    Math.ceil(document.body.getBoundingClientRect().height);\n\n  let el;\n  if (scrolledToBeginning) {\n    el = headings[0]; // if we‘re at the top of the page, highlight the first item\n  } else if (scrolledToEnd) {\n    el = headings[headings.length - 1]; // if we’re at the end of the page, highlight the last item\n  } else {\n    el = headings.reverse().find(isScrolledIntoView); // otherwise highlight the one that’s at least halfway up the page\n  }\n\n  if (!el) return;\n\n  const elId = el.id;\n  const href = `#${elId}`;\n  const tocEl = tableOfContentsEl.querySelector(`a[href=\"${href}\"]`);\n  // only add the active class once, which will also prevent scroll from re-triggering while scrolling to the same element\n  if (!tocEl || tocEl.classList.contains('active')) {\n    return;\n  }\n\n  tableOfContentsEl.querySelectorAll(`a.active`).forEach((aEl) => {\n    if (aEl.getAttribute('href') !== href) aEl.classList.remove('active');\n  });\n\n  tocEl.classList.add('active');\n\n  // // update nav on desktop\n  // if (window.innerWidth >= 860) {\n  //   tocEl.scrollIntoView({behavior: 'smooth'});\n  // }\n  //   {\n  //   top:\n  //     tocEl.getBoundingClientRect().top + gridTocEl.scrollTop - PADDING_TOP,\n  //   behavior: 'smooth',\n  // });\n}\n\nconst tableOfContentsEl = document.querySelector('.toc');\nwindow.addEventListener('scroll', debounce(setActiveToc));\n/* May not be needed:\n  window.addEventListener('DOMContentLoaded', (event) => {\n    if (!window.location.hash) {\n      return;\n    }\n    const elNeedingScroll = document.getElementById(window.location.hash.substring(1));\n    if (!elNeedingScroll) {\n      return;\n    }\n    elNeedingScroll.scrollIntoView();\n    elNeedingScroll.classList.add('highlighted');\n  });\n  */\n\nwindow.addEventListener('DOMContentLoaded', (event) => {\n  if (!tableOfContentsEl) {\n    return;\n  }\n  document.querySelectorAll('.content h3, .content h4').forEach((headerEl) => {\n    const linkEl = document.createElement('a');\n    // linkEl.setAttribute('target', \"_blank\");\n    linkEl.setAttribute('href', '#' + headerEl.id);\n    linkEl.classList.add('header-link');\n    linkEl.innerText = '#';\n    headerEl.appendChild(linkEl);\n  });\n  setActiveToc();\n});\n"
  },
  {
    "path": "www/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "www/public/styles/_animations.scss",
    "content": "@use './var' as *;\n\n$easeOutSine: cubic-bezier(0.61, 1, 0.88, 1);\n$easeInExpo: cubic-bezier(0.7, 0, 0.84, 0);\n$easeInOutSine: cubic-bezier(0.37, 0, 0.63, 1);\n$easeInOutCubic: cubic-bezier(0.65, 0, 0.35, 1);\n$easeInOutBack: cubic-bezier(0.68, -0.6, 0.32, 1.6);\n$easeInCirc: cubic-bezier(0.55, 0, 1, 0.45);\n$easeOutExpo: cubic-bezier(0.16, 1, 0.3, 1);\n$easeInQuad: cubic-bezier(0.11, 0, 0.5, 0);\n$quintic: cubic-bezier(0.76, 0.05, 0.86, 0.06);\n$transition-fast: 40ms;\n$transition-medium: 500ms;\n$transition-slow: 1s;\n\n@keyframes pulse {\n  0% {\n    color: #2a85ca;\n    border-color: #2a85ca;\n  }\n\n  100% {\n  }\n}\n\n@mixin animation-copy-button {\n  transition: transform $transition-fast $easeInExpo,\n    border-color $transition-fast linear, box-shadow $transition-fast linear;\n\n  svg,\n  span {\n    transition: color $transition-fast linear;\n  }\n\n  &:hover {\n    box-shadow: 0 2px 2px 0 #2e5e8266;\n    transform: translateY(-1px);\n    border-color: #2a85ca;\n    svg,\n    span {\n      color: #2a85ca;\n    }\n  }\n}\n"
  },
  {
    "path": "www/public/styles/_card-grid.scss",
    "content": ".card-grid {\n    display: grid;\n    grid-column-gap: 15px;\n    grid-row-gap: 15px;\n    grid-auto-flow: dense;\n  }\n  \n  .card-grid-3 {\n    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n  }\n  .card-grid-4 {\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n  }\n  .discord-banner {\n    grid-column: 1 / -1;\n    border: 1px solid #2e2077;\n    background-color: #545eec;\n    display: flex;\n    align-items: center;\n    font-size: 16px;\n    color: white;\n    font-weight: 500;\n    padding: 1.25rem;\n    margin: 1.5rem 0 1rem;\n    background: #545eec;\n    box-shadow: 6px 6px 20px #4750c966, -6px -6px 20px #616cff66;\n  }\n  .discord-banner > * {\n    display: block;\n  }\n  \n  @media (max-width: 700px) {\n    .discord-banner {\n      flex-direction: column;\n    }\n    .discord-banner > div {\n      margin-top: 1rem;\n    }\n  }\n  \n  .card {\n    display: flex;\n    grid-column: span 1;\n    overflow: hidden;\n    font-family: Open Sans, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI,\n      Roboto, sans-serif;\n    color: #1a202c;\n    -webkit-font-smoothing: antialiased;\n    box-sizing: border-box;\n    border: 1px solid #e2e8f0;\n  }\n  .card:hover {\n    border-color: #2a85ca;\n    box-shadow: 0 2px 2px 0 rgba(46, 94, 130, 0.4);\n  }\n  .card:hover .card-image {\n    opacity: 0.9;\n  }\n  \n  .card-image {\n    width: 100%;\n    object-fit: cover;\n    opacity: 0.8;\n  }\n  \n  \n  .card-image-small {\n    flex-grow: 1;\n    height: 120px;\n  }\n  \n  .card-image-large {\n   height: 200px;\n  }\n  .card-text {\n    padding: 1rem;\n  }\n  .card-title {\n    margin: 0 0 0.25rem 0;\n    font-weight: 600;\n    font-size: 20px;\n    font-family: 'Overpass';\n    line-height: 1.1;\n  }\n  .content-title {\n    font-family: 'Overpass';\n  }\n  \n  .card:nth-child(4n + 0) .card-image {\n    background: #f2709c;\n    background: linear-gradient(30deg, #ff9472, #f2709c);\n  }\n  .card:nth-child(4n + 1) .card-image {\n    background: #fbd3e9;\n    background: linear-gradient(30deg, #bb377d, #fbd3e9);\n  }\n  .card:nth-child(4n + 2) .card-image {\n    background: #b993d6;\n    background: linear-gradient(30deg, #8ca6db, #b993d6);\n  }\n  \n  .card:nth-child(4n + 3) .card-image {\n    background: #00d2ff;\n    background: linear-gradient(30deg, #3a7bd5, #00d2ff);\n  }"
  },
  {
    "path": "www/public/styles/_github-markdown.scss",
    "content": ".markdown-body .anchor {\n  float: left;\n  margin-left: -20px;\n  padding-right: 4px;\n  line-height: 1;\n}\n\n.markdown-body .anchor:focus {\n  outline: none;\n}\n\n.markdown-body h1:hover .anchor,\n.markdown-body h2:hover .anchor,\n.markdown-body h3:hover .anchor,\n.markdown-body h4:hover .anchor,\n.markdown-body h5:hover .anchor,\n.markdown-body h6:hover .anchor {\n  text-decoration: none;\n}\n\n.markdown-body {\n  -ms-text-size-adjust: 100%;\n  -webkit-text-size-adjust: 100%;\n  color: #24292e;\n  line-height: 1.6;\n  word-wrap: break-word;\n}\n\n.markdown-body .pl-c {\n  color: #6a737d;\n}\n\n.markdown-body .pl-c1,\n.markdown-body .pl-s .pl-v {\n  color: #005cc5;\n}\n\n.markdown-body .pl-e,\n.markdown-body .pl-en {\n  color: #6f42c1;\n}\n\n.markdown-body .pl-s .pl-s1,\n.markdown-body .pl-smi {\n  color: #24292e;\n}\n\n.markdown-body .pl-ent {\n  color: #22863a;\n}\n\n.markdown-body .pl-k {\n  color: #d73a49;\n}\n\n.markdown-body .pl-pds,\n.markdown-body .pl-s,\n.markdown-body .pl-s .pl-pse .pl-s1,\n.markdown-body .pl-sr,\n.markdown-body .pl-sr .pl-cce,\n.markdown-body .pl-sr .pl-sra,\n.markdown-body .pl-sr .pl-sre {\n  color: #032f62;\n}\n\n.markdown-body .pl-smw,\n.markdown-body .pl-v {\n  color: #e36209;\n}\n\n.markdown-body .pl-bu {\n  color: #b31d28;\n}\n\n.markdown-body .pl-ii {\n  color: #fafbfc;\n  background-color: #b31d28;\n}\n\n.markdown-body .pl-c2 {\n  color: #fafbfc;\n  background-color: #d73a49;\n}\n\n.markdown-body .pl-c2::before {\n  content: '^M';\n}\n\n.markdown-body .pl-sr .pl-cce {\n  color: #22863a;\n  font-weight: 700;\n}\n\n.markdown-body .pl-ml {\n  color: #735c0f;\n}\n\n.markdown-body .pl-mh,\n.markdown-body .pl-mh .pl-en,\n.markdown-body .pl-ms {\n  color: #005cc5;\n  font-weight: 700;\n}\n\n.markdown-body .pl-mi {\n  color: #24292e;\n  font-style: italic;\n}\n\n.markdown-body .pl-mb {\n  color: #24292e;\n  font-weight: 700;\n}\n\n.markdown-body .pl-md {\n  color: #b31d28;\n  background-color: #ffeef0;\n}\n\n.markdown-body .pl-mi1 {\n  color: #22863a;\n  background-color: #f0fff4;\n}\n\n.markdown-body .pl-mc {\n  color: #e36209;\n  background-color: #ffebda;\n}\n\n.markdown-body .pl-mi2 {\n  color: #f6f8fa;\n  background-color: #005cc5;\n}\n\n.markdown-body .pl-mdr {\n  color: #6f42c1;\n  font-weight: 700;\n}\n\n.markdown-body .pl-ba {\n  color: #586069;\n}\n\n.markdown-body .pl-sg {\n  color: #959da5;\n}\n\n.markdown-body .pl-corl {\n  color: #032f62;\n  text-decoration: underline;\n}\n\n.markdown-body details {\n  display: block;\n}\n\n.markdown-body summary {\n  display: list-item;\n}\n\n.markdown-body a {\n  background-color: transparent;\n}\n\n.markdown-body a:active,\n.markdown-body a:hover {\n  outline-width: 0;\n}\n\n.markdown-body strong {\n  font-weight: inherit;\n  font-weight: bolder;\n}\n\n.markdown-body h1 {\n  margin: 0.67em 0;\n  font-size: 2em;\n}\n\n.markdown-body img {\n  border-style: none;\n}\n\n.markdown-body hr {\n  box-sizing: content-box;\n  height: 0;\n  overflow: visible;\n}\n\n.markdown-body input {\n  margin: 0;\n  font: inherit;\n}\n\n.markdown-body input {\n  overflow: visible;\n}\n\n.markdown-body [type='checkbox'] {\n  box-sizing: border-box;\n  padding: 0;\n}\n\n.markdown-body * {\n  box-sizing: border-box;\n}\n\n.markdown-body input {\n  font-size: inherit;\n  font-family: inherit;\n  line-height: inherit;\n}\n\n.markdown-body a {\n  color: #0366d6;\n  text-decoration: none;\n}\n\n.markdown-body a:hover {\n  text-decoration: underline;\n}\n\n.markdown-body strong {\n  font-weight: 600;\n}\n\n.markdown-body hr {\n  height: 0;\n  margin: 15px 0;\n  overflow: hidden;\n  background: transparent;\n  border: 0;\n  border-bottom: 1px solid #dfe2e5;\n}\n\n.markdown-body hr::before {\n  display: table;\n  content: '';\n}\n\n.markdown-body hr::after {\n  display: table;\n  clear: both;\n  content: '';\n}\n\n.markdown-body table {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n\n.markdown-body table {\n  display: block;\n  width: 100%;\n  overflow: auto;\n}\n\n.markdown-body table td,\n.markdown-body table th {\n  padding: 6px 13px;\n}\n\n.markdown-body table tr {\n  background-color: #fff;\n}\n\n.markdown-body table tr:nth-child(2n) {\n  background-color: #f6f8fa;\n}\n\n.markdown-body details summary {\n  cursor: pointer;\n}\n\n.markdown-body h1,\n.markdown-body h2,\n.markdown-body h3,\n.markdown-body h4,\n.markdown-body h5,\n.markdown-body h6 {\n  margin-top: 0;\n  margin-bottom: 0;\n}\n\n.markdown-body h1 {\n  font-size: 32px;\n}\n\n.markdown-body h1,\n.markdown-body h2 {\n  font-weight: 600;\n}\n\n.markdown-body h2 {\n  font-size: 24px;\n}\n\n.markdown-body h3 {\n  font-size: 20px;\n}\n\n.markdown-body h3,\n.markdown-body h4 {\n  font-weight: 600;\n}\n\n.markdown-body h4 {\n  font-size: 16px;\n}\n\n.markdown-body h5 {\n  font-size: 14px;\n}\n\n.markdown-body h5,\n.markdown-body h6 {\n  font-weight: 600;\n}\n\n.markdown-body h6 {\n  font-size: 12px;\n}\n\n.markdown-body p {\n  margin-top: 0;\n  margin-bottom: 10px;\n}\n\n.markdown-body blockquote {\n  margin: 0;\n}\n\n.markdown-body ol,\n.markdown-body ul {\n  margin-top: 0;\n  margin-bottom: 0;\n  padding-left: 0;\n}\n\n.markdown-body ol ol,\n.markdown-body ul ol {\n  list-style-type: lower-roman;\n}\n\n.markdown-body ol ol ol,\n.markdown-body ol ul ol,\n.markdown-body ul ol ol,\n.markdown-body ul ul ol {\n  list-style-type: lower-alpha;\n}\n\n.markdown-body dd {\n  margin-left: 0;\n}\n\n.markdown-body input::-webkit-inner-spin-button,\n.markdown-body input::-webkit-outer-spin-button {\n  margin: 0;\n  -webkit-appearance: none;\n  appearance: none;\n}\n\n.markdown-body .border {\n  border: 1px solid #e1e4e8 !important;\n}\n\n.markdown-body .border-0 {\n  border: 0 !important;\n}\n\n.markdown-body .border-bottom {\n  border-bottom: 1px solid #e1e4e8 !important;\n}\n\n.markdown-body .rounded-1 {\n  border-radius: 3px !important;\n}\n\n.markdown-body .bg-white {\n  background-color: #fff !important;\n}\n\n.markdown-body .bg-gray-light {\n  background-color: #fafbfc !important;\n}\n\n.markdown-body .text-gray-light {\n  color: #6a737d !important;\n}\n\n.markdown-body .mb-0 {\n  margin-bottom: 0 !important;\n}\n\n.markdown-body .my-2 {\n  margin-top: 8px !important;\n  margin-bottom: 8px !important;\n}\n\n.markdown-body .pl-0 {\n  padding-left: 0 !important;\n}\n\n.markdown-body .py-0 {\n  padding-top: 0 !important;\n  padding-bottom: 0 !important;\n}\n\n.markdown-body .pl-1 {\n  padding-left: 4px !important;\n}\n\n.markdown-body .pl-2 {\n  padding-left: 8px !important;\n}\n\n.markdown-body .py-2 {\n  padding-top: 8px !important;\n  padding-bottom: 8px !important;\n}\n\n.markdown-body .pl-3,\n.markdown-body .px-3 {\n  padding-left: 16px !important;\n}\n\n.markdown-body .px-3 {\n  padding-right: 16px !important;\n}\n\n.markdown-body .pl-4 {\n  padding-left: 24px !important;\n}\n\n.markdown-body .pl-5 {\n  padding-left: 32px !important;\n}\n\n.markdown-body .pl-6 {\n  padding-left: 40px !important;\n}\n\n.markdown-body .f6 {\n  font-size: 12px !important;\n}\n\n.markdown-body .lh-condensed {\n  line-height: 1.25 !important;\n}\n\n.markdown-body .text-bold {\n  font-weight: 600 !important;\n}\n\n.markdown-body::before {\n  display: table;\n  content: '';\n}\n\n.markdown-body::after {\n  display: table;\n  clear: both;\n  content: '';\n}\n\n.markdown-body > :first-child {\n  margin-top: 0 !important;\n}\n\n.markdown-body > :last-child {\n  margin-bottom: 0 !important;\n}\n\n.markdown-body a:not([href]) {\n  color: inherit;\n  text-decoration: none;\n}\n\n.markdown-body blockquote,\n.markdown-body dl,\n.markdown-body ol,\n.markdown-body p,\n.markdown-body table,\n.markdown-body ul {\n  margin-top: 0;\n  margin-bottom: 16px;\n}\n\n.markdown-body hr {\n  height: 0.25em;\n  margin: 24px 0;\n  padding: 0;\n  background-color: #e1e4e8;\n  border: 0;\n}\n\n.markdown-body blockquote {\n  padding: 0 1em;\n  color: #6a737d;\n  border-left: 0.25em solid #dfe2e5;\n}\n\n.markdown-body blockquote > :first-child {\n  margin-top: 0;\n}\n\n.markdown-body blockquote > :last-child {\n  margin-bottom: 0;\n}\n\n.markdown-body kbd {\n  display: inline-block;\n  padding: 3px 5px;\n  color: #444d56;\n  font-size: 11px;\n  line-height: 10px;\n  vertical-align: middle;\n  background-color: #fafbfc;\n  border: 1px solid #c6cbd1;\n  border-bottom-color: #959da5;\n  border-radius: 3px;\n  box-shadow: inset 0 -1px 0 #959da5;\n}\n\n.markdown-body h1,\n.markdown-body h2,\n.markdown-body h3,\n.markdown-body h4,\n.markdown-body h5,\n.markdown-body h6 {\n  margin-top: 42px;\n  margin-bottom: 16px;\n  font-weight: 600;\n  line-height: 1.25;\n}\n\n.markdown-body h1 {\n  font-size: 2em;\n}\n\n.markdown-body h1,\n.markdown-body h2 {\n  /* border-bottom: 1px solid #eaecef; */\n\n  /* padding-bottom: 0.3em; */\n}\n\n.markdown-body h1 {\n  margin-bottom: 0;\n  padding-bottom: 0;\n  font-size: 4em;\n}\n\n.markdown-body h2 {\n  font-size: 2.6em;\n}\n\n.markdown-body h3 {\n  font-size: 1.8em;\n}\n\n.markdown-body h4 {\n  font-size: 1.12em;\n}\n\n.markdown-body h5 {\n  font-size: 0.875em;\n}\n\n.markdown-body h6 {\n  color: #6a737d;\n  font-size: 0.85em;\n}\n\n.markdown-body ol,\n.markdown-body ul {\n  padding-left: 2em;\n}\n\n.markdown-body ol ol,\n.markdown-body ol ul,\n.markdown-body ul ol,\n.markdown-body ul ul {\n  margin-top: 0;\n  margin-bottom: 0;\n}\n\n.markdown-body li {\n  word-wrap: break-all;\n}\n\n.markdown-body li > p {\n  margin-top: 16px;\n}\n\n.markdown-body li + li {\n  margin-top: 0.25em;\n}\n\n.markdown-body img {\n  box-sizing: content-box;\n  max-width: 100%;\n  background-color: #fff;\n}\n\n.markdown-body img[align='right'] {\n  padding-left: 20px;\n}\n\n.markdown-body img[align='left'] {\n  padding-right: 20px;\n}\n\n.markdown-body iframe {\n  max-width: 100%;\n}\n"
  },
  {
    "path": "www/public/styles/_globals.scss",
    "content": "@use './var' as *;\n\nbody {\n  min-height: 100vh;\n}\n\nhtml,\nbody {\n  margin: 0;\n  font-family: $body;\n}\n\n* {\n  box-sizing: border-box;\n}\n\nimg,\nvideo {\n  max-width: 100%;\n  height: auto;\n}\n\np {\n  line-height: 1.3;\n}\n\npre {\n  max-width: calc(100vw - 4rem);\n}\n\n.pretty-font,\n.version-number {\n  font-weight: 600;\n  font-family: $heading;\n}\n\nbody.is-nav-open {\n  height: 100%;\n  overflow: hidden;\n}\n"
  },
  {
    "path": "www/public/styles/_prism.scss",
    "content": "pre,\ncode {\n  color: #d4d4d4;\n  font-size: 14px;\n  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n  line-height: 1.5;\n  direction: ltr;\n  white-space: pre;\n  text-align: left;\n  text-shadow: none;\n  word-break: normal;\n  word-spacing: normal;\n  -moz-tab-size: 4;\n  -o-tab-size: 4;\n  tab-size: 4;\n  -webkit-hyphens: none;\n  -moz-hyphens: none;\n  -ms-hyphens: none;\n  hyphens: none;\n}\n\npre::selection,\ncode::selection {\n  text-shadow: none;\n  background: #b3d4fc;\n}\n\n@media print {\n  pre,\n  code {\n    text-shadow: none;\n  }\n}\n\npre {\n  margin: 0.5rem 0 16px;\n  padding: 0.8rem 1rem 0.9rem;\n  overflow: auto;\n  background: #282a36;\n  border-radius: 4px;\n}\n\n:not(pre) > code {\n  padding: 0.1em 0.3em;\n  color: #db4c69;\n  background: #f9f2f4;\n  border-radius: 0.3em;\n  white-space: pre-wrap;\n}\n\n/*********************************************************\n* Tokens\n*/\n.namespace {\n  opacity: 0.7;\n}\n\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n  color: #6a9955;\n}\n\n.token.punctuation {\n  color: #d4d4d4;\n}\n\n.token.property,\n.token.tag,\n.token.boolean,\n.token.number,\n.token.constant,\n.token.symbol {\n  color: #b5cea8;\n}\n\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin {\n  color: #ce9178;\n}\n\n.token.deleted {\n  background-color: #254439;\n  color: #ff7d47;\n}\n\n.token.inserted {\n  background-color: #244016;\n  color: #96e16f;\n}\n\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string {\n  color: #d4d4d4;\n  background: rgb(45, 55, 72);\n}\n\n.token.atrule,\n.token.attr-value,\n.token.keyword {\n  color: #c586c0;\n}\n\n.token.function {\n  color: #dcdcaa;\n}\n\n.token.regex,\n.token.important,\n.token.variable {\n  color: #d16969;\n}\n\n.token.important,\n.token.bold {\n  font-weight: bold;\n}\n\n.token.italic {\n  font-style: italic;\n}\n\n.token.constant {\n  color: #9cdcfe;\n}\n\n.token.class-name {\n  color: #4ec9b0;\n}\n\n.token.parameter {\n  color: #9cdcfe;\n}\n\n.token.interpolation {\n  color: #9cdcfe;\n}\n\n.token.punctuation.interpolation-punctuation {\n  color: #569cd6;\n}\n\n.token.boolean {\n  color: #569cd6;\n}\n\n.token.property {\n  color: #9cdcfe;\n}\n\n.token.selector {\n  color: #d7ba7d;\n}\n\n.token.tag {\n  color: #569cd6;\n}\n\n.token.attr-name {\n  color: #9cdcfe;\n}\n\n.token.attr-value {\n  color: #ce9178;\n}\n\n.token.entity {\n  color: #4ec9b0;\n  cursor: unset;\n}\n\n.token.namespace {\n  color: #4ec9b0;\n}\n\n/*********************************************************\n* Language Specific\n*/\npre[class*='language-javascript'],\ncode[class*='language-javascript'] {\n  color: #4ec9b0;\n}\n\npre[class*='language-css'],\ncode[class*='language-css'] {\n  color: #ce9178;\n}\n\npre[class*='language-html'],\ncode[class*='language-html'] {\n  color: #d4d4d4;\n}\n\n.language-html .token.punctuation {\n  color: #808080;\n}\n\n/*********************************************************\n* Line highlighting\n*/\npre[data-line] {\n  position: relative;\n}\n\npre > code {\n  position: relative;\n  z-index: 1;\n}\n\n.line-highlight {\n  position: absolute;\n  right: 0;\n  left: 0;\n  z-index: 0;\n  margin-top: 1em;\n  padding: inherit 0;\n  line-height: inherit;\n  white-space: pre;\n  background: #f7ebc6;\n  box-shadow: inset 5px 0 0 #f7d87c;\n  pointer-events: none;\n}\n\npre[class*='language-bash'] .token.function {\n  color: #d4d4d4;\n}\n.token.comment {\n  color: #fff7;\n}\n"
  },
  {
    "path": "www/public/styles/_typography.scss",
    "content": "@use './var' as *;\n\na {\n  color: #0366d6;\n  text-decoration: none;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n  font-weight: 600;\n  font-family: $heading;\n  line-height: 1.2;\n}\n\nh1 {\n  font-size: 3em;\n  letter-spacing: -0.025em;\n\n  @media (min-width: 600px) {\n    font-size: 3.25em;\n  }\n}\n\nh2 {\n  font-size: 2.75em;\n  letter-spacing: -0.02em;\n\n  @media (min-width: 600px) {\n    font-size: 3em;\n  }\n}\n\nh3 {\n  font-size: 2em;\n  letter-spacing: -0.0125em;\n\n  @media (min-width: 600px) {\n    font-size: 2.25em;\n  }\n}\n\nh4 {\n  font-size: 1em;\n  letter-spacing: -0.0125em;\n\n  @media (min-width: 600px) {\n    font-size: 1.2em;\n  }\n}\n\nul li,\nol li {\n  margin-top: 0.5em;\n  margin-bottom: 0.5em;\n  line-height: 1.4;\n}\n\np {\n  margin-top: 1.5em;\n  margin-bottom: 1.5em;\n  line-height: 1.7;\n}\n\nblockquote {\n  margin: 0;\n  padding: 1rem 2rem;\n  color: #2e5e82;\n  font-weight: 300;\n  font-size: 1.1em;\n  background: linear-gradient(-30deg, #c9efd8, #f9ddff);\n  border-left: none;\n\n  @media (min-width: $breakpoint-m) {\n    border-radius: 0.5rem;\n    box-shadow: 0 1px 2px rgba(50, 127, 177, 0.1),\n      0 1.5rem 3rem rgba(50, 125, 177, 0.1);\n  }\n\n  & *:first-child {\n    margin-top: 0;\n  }\n  & *:last-child {\n    margin-bottom: 0;\n  }\n}\n"
  },
  {
    "path": "www/public/styles/_utils.scss",
    "content": "/**\n * Utils\n */\n\n// margin & padding\n@for $i from 0 through 36 {\n  .ma#{$i} { margin: #{0.5 * $i}rem; }\n  .mt#{$i} { margin-top: #{0.5 * $i}rem; }\n  .mr#{$i} { margin-right: #{0.5 * $i}rem; }\n  .mb#{$i} { margin-bottom: #{0.5 * $i}rem; }\n  .ml#{$i} { margin-left: #{0.5 * $i}rem; }\n  .pa#{$i} { padding: #{0.5 * $i}rem; }\n  .pt#{$i} { padding-top: #{0.5 * $i}rem; }\n  .pr#{$i} { padding-right: #{0.5 * $i}rem; }\n  .pb#{$i} { padding-bottom: #{0.5 * $i}rem; }\n  .pl#{$i} { padding-left: #{0.5 * $i}rem; }\n}\n\n// text align\n.tac { text-align: center; }\n.tal { text-align: left; }\n.tar { text-align: right; }\n\n// wrapper\n.wrapper {\n  max-width: 1400px;\n  padding-left: 2rem;\n  padding-right: 2rem;\n}\n"
  },
  {
    "path": "www/public/styles/_var.scss",
    "content": "// typography\n$body: -apple-system, 'BlinkMacSystemFont', 'Helvetica Neue', 'Segoe UI',\n  'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', sans-serif;\n$heading: 'Overpass', $body;\n$code: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;\n\n// breakpoints\n$breakpoint-m: 800px;\n$breakpoint-l: 1240px;\n\n// nav bar height mobile\n$nav-height: 3.5rem;\n$algolia-height: 4rem;\n\n// colors\n$blue: #0a5e9d;\n$dark-blue: #2e5e82;\n$lightest-blue: #cfe2f2;\n$orange: #fa6400;\n\n$color-primary: $dark-blue;\n$color-secondary: $blue;\n$color-light: $lightest-blue;\n$color-strong-contrast: $orange;\n$grey: #717171;\n$dark-grey: #393939;\n$light-grey: #c1c1c1;\n$darkest-grey: #333;\n$white: #fff;\n\n$light-rainbow-blue: #c9efd8;\n$light-rainbow-pink: #f9ddff;\n$rainbow-purple: #b224d0;\n$rainbow-blue: #267dd6;\n$rainbow-green: #24bf62;\n$rainbow-yellow: #f0db4f;\n\n$layers: (\n  'base': 1,\n  'nav-view': 9,\n  'nav': 10,\n);\n"
  },
  {
    "path": "www/public/styles/global.scss",
    "content": "@use './_github-markdown';\n@use './_prism';\n@use './_card-grid';\n@use './_globals';\n@use './_typography';\n@use './utils';\n"
  },
  {
    "path": "www/scripts/copy.js",
    "content": "const {promises: fs} = require('fs');\nconst path = require('path');\n\nconst getAllFiles = async (dir) => {\n  const all = await fs.readdir(dir, {withFileTypes: true});\n  return [].concat(\n    ...(await Promise.all(\n      all.map((ent) =>\n        ent.isFile() ? path.join(dir, ent.name) : getAllFiles(path.join(dir, ent.name)),\n      ),\n    )),\n  );\n};\n\nasync function copy() {\n  const docsDir = path.resolve(__dirname, '../../docs');\n  const docs = await getAllFiles(docsDir);\n\n  await Promise.all(\n    docs.map((src) => {\n      if (['README.md', '.DS_Store'].includes(path.basename(src))) return;\n\n      const dest = path.join(__dirname, '..', 'src', 'pages', src.replace(docsDir, ''));\n      return fs.mkdir(path.dirname(dest), {recursive: true}).then(() => fs.copyFile(src, dest));\n    }),\n  );\n\n  return process.exit(0);\n}\n\ncopy();\n"
  },
  {
    "path": "www/src/components/Banner.astro",
    "content": "<style lang=\"scss\">\n.notification {\n  padding: .5rem;\n  color: #fff;\n  font-weight: bold;\n  background-color: #b224d0;\n  text-align: center;\n\n  a {\n    color: white;\n  }\n}\n</style>\n\n<section class=\"grid-banner\">\n  <div class=\"notification\">\n    <div class=\"wrapper\">\n      Snowpack 3.0 is out now!\n      <a href=\"/posts/2021-01-13-snowpack-3-0\">\n        Read the announcement post →\n      </a>\n    </div>\n  </div>\n</section>\n"
  },
  {
    "path": "www/src/components/BaseHead.astro",
    "content": "---\nconst { title, description, permalink } = Astro.props;\n---\n\n<meta charset=\"utf-8\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\" />\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/favicon/apple-touch-icon.png\" />\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon/favicon-32x32.png\" />\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicon/favicon-16x16.png\" />\n<link rel=\"manifest\" href=\"/favicon/site.webmanifest\" />\n\n<!-- Primary Meta Tags -->\n<title>{title}</title>\n<meta name=\"title\" content={title} />\n<meta name=\"description\" content=\"{description}\" />\n\n<!-- Open Graph / Facebook -->\n<meta property=\"og:type\" content=\"website\" />\n<meta property=\"og:url\" content={permalink} />\n<meta property=\"og:title\" content={title} />\n<meta property=\"og:description\" content={description} />\n<meta property=\"og:image\" content=\"https://www.snowpack.dev/img/social-2.jpg\" />\n\n<!-- Twitter -->\n<meta property=\"twitter:card\" content=\"summary_large_image\" />\n<meta property=\"twitter:url\" content={permalink} />\n<meta property=\"twitter:title\" content={title} />\n<meta property=\"twitter:description\" content={description} />\n<meta property=\"twitter:image\" content=\"https://www.snowpack.dev/img/social-2.jpg\" />\n\n<!-- Global Stylesheets -->\n<link rel=\"stylesheet\" href=\"/styles/global.css\" />\n<link href=\"https://fonts.googleapis.com/css2?family=Overpass:wght@400;700;900&display=swap\" rel=\"stylesheet\" />\n"
  },
  {
    "path": "www/src/components/BaseLayout.astro",
    "content": "---\nimport Banner from './Banner.astro';\nimport Nav from './Nav.astro';\n\nconst version = await fetch('https://registry.npmjs.org/snowpack/latest')\n  .then((res) => res.json())\n  .then((manifest) => manifest.version);\n---\n\n<!-- <Banner /> -->\n<Nav version={version} />\n\n<slot></slot>\n\n<!-- Global site tag (gtag.js) - Google Analytics -->\n<script async=\"async\" src=\"https://www.googletagmanager.com/gtag/js?id=UA-130280175-9\"></script>\n<script>\n  window.dataLayer = window.dataLayer || [];\n  function gtag() {\n    dataLayer.push(arguments);\n  }\n  gtag('js', new Date());\n  gtag('config', 'UA-130280175-9', { page_path: location.pathname === '/' ? (location.pathname + location.hash) : (location.pathname) });\n</script>\n"
  },
  {
    "path": "www/src/components/Button.astro",
    "content": "---\nconst { style } = Astro.props;\n---\n\n<style lang=\"scss\">\n@use '../../public/styles/var' as *;\n\n.btn {\n  box-sizing: border-box;\n  margin-top: 2px;\n  margin-bottom: 2px;\n  display: inline-block;\n  padding: 0.6em 1em 0.4em;\n  line-height: 1;\n  font-weight: bold;\n  font-size: 1.3em;\n  font-family: inherit;\n  letter-spacing: -0.025em;\n  font-family: 'Overpass', sans-serif;\n  white-space: nowrap;\n  text-align: center;\n  text-decoration: none;\n  vertical-align: middle;\n  background-color: #fefefe;\n  border: 1px solid #ccc;\n  border-radius: 4px;\n  box-shadow: 0 0px 2px 0 rgba(0, 0, 0, 0);\n  cursor: pointer;\n  text-decoration: none;\n  user-select: none;\n  transition: transform 100ms cubic-bezier(0.7, 0, 0.84, 0), box-shadow 100ms linear, border-color 40ms linear;\n\n  &:hover,\n  &:focus {\n    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);\n    border-color: #bbb;\n    transform: translateY(-1px);\n  }\n\n  &:focus {\n    border-color: #00f;\n  }\n\n  &__primary {\n    color: #fff;\n    background: linear-gradient(45deg, $rainbow-green, $rainbow-blue, $rainbow-purple);\n    border-color: $rainbow-blue;\n\n    &:hover {\n      border-color: $rainbow-blue;\n    }\n  }\n}\n</style>\n\n<span class={`btn${style ? ` btn__${style}`: ''}`}><slot /></span>\n"
  },
  {
    "path": "www/src/components/Card.css",
    "content": ".card {\n  display: flex;\n  grid-column: span 1;\n  overflow: hidden;\n  font-family: Open Sans, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI,\n    Roboto, sans-serif;\n  color: #1a202c;\n  -webkit-font-smoothing: antialiased;\n  box-sizing: border-box;\n  border: 1px solid #e2e8f0;\n}\n\n.card:hover {\n  border-color: #2a85ca;\n  box-shadow: 0 2px 2px 0 rgba(46, 94, 130, 0.4);\n}\n\n.card:hover .card-image {\n  opacity: 0.9;\n}\n\n.card:nth-child(4n + 0) .card-image {\n  background: #f2709c;\n  background: linear-gradient(30deg, #ff9472, #f2709c);\n}\n\n.card:nth-child(4n + 1) .card-image {\n  background: #fbd3e9;\n  background: linear-gradient(30deg, #bb377d, #fbd3e9);\n}\n\n.card:nth-child(4n + 2) .card-image {\n  background: #b993d6;\n  background: linear-gradient(30deg, #8ca6db, #b993d6);\n}\n\n.card:nth-child(4n + 3) .card-image {\n  background: #00d2ff;\n  background: linear-gradient(30deg, #3a7bd5, #00d2ff);\n}\n\n.card-image {\n  width: 100%;\n  object-fit: cover;\n  opacity: 0.8;\n}\n\n.card-image__sm {\n  flex-grow: 1;\n  height: 120px;\n}\n\n.card-image__lg {\n  height: 200px;\n}\n\n.card-text {\n  padding: 1rem;\n}\n\n.card-title {\n  margin: 0 0 0.25rem 0;\n  font-weight: 600;\n  font-size: 20px;\n  font-family: 'Overpass';\n  line-height: 1.1;\n}\n"
  },
  {
    "path": "www/src/components/Card.jsx",
    "content": "import { h } from 'preact';\nimport { format as formatDate, parseISO } from 'date-fns';\nimport './Card.css';\n\nexport default function Card({ item }) {\n  return (\n    <article class=\"card\">\n      <a\n        href={item.url}\n        style=\"text-decoration: none; color: initial; flex-grow: 1;\"\n      >\n        {item.img ? (\n          <img\n            class=\"card-image card-image__sm\"\n            src={item.img}\n            alt=\"\"\n            style={{ background: item.imgBackground || undefined }}\n          />\n        ) : (\n          <div class=\"card-image card-image__sm\"></div>\n        )}\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">{item.title}</h3>\n          {item.date && (\n            <time class=\"snow-toc-link\">\n              {formatDate(parseISO(item.date), 'MMMM\td, yyyy')}\n            </time>\n          )}\n          {item.description && (\n            <p style=\"margin: 0.5rem 0 0.25rem;\">{item.description}</p>\n          )}\n        </div>\n      </a>\n    </article>\n  );\n}\n"
  },
  {
    "path": "www/src/components/CompanyLogo.jsx",
    "content": "import { h } from 'preact';\n\nexport default function CompanyLogo({ user }) {\n  return (\n    <a href={user.url} target=\"_blank\" rel=\"noopener noreferrer nofollow\">\n      {user.img ? (\n        <img class=\"company-logo\" src={user.img} alt={user.name} />\n      ) : (\n        <span>{user.name}</span>\n      )}\n    </a>\n  );\n}\n"
  },
  {
    "path": "www/src/components/Hero.astro",
    "content": "---\nimport Button from './Button.astro';\n---\n\n<style lang=\"scss\">\n  @use '../../public/styles/var' as *;\n  @use '../../public/styles/animations' as *;\n\n  .hero {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    height: 50vh;\n    max-height: 24rem;\n    color: #111;\n    line-height: 1.5;\n    background: #2a85ca40;\n    background-image: url(\"data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512' title='mountain' class='logo' fill='%23FFFB'%3E%3Cpath d='M634.92 462.7l-288-448C341.03 5.54 330.89 0 320 0s-21.03 5.54-26.92 14.7l-288 448a32.001 32.001 0 0 0-1.17 32.64A32.004 32.004 0 0 0 32 512h576c11.71 0 22.48-6.39 28.09-16.67a31.983 31.983 0 0 0-1.17-32.63zM320 91.18L405.39 224H320l-64 64-38.06-38.06L320 91.18z' /%3E%3C/svg%3E\");\n    background-repeat: no-repeat;\n    background-position: calc(100% + 100px) calc(100% + 64px);\n    background-size: 50%;\n    border-bottom: 1px solid #0003;\n    //margin-top: $nav-height;\n\n    @media (min-width: $breakpoint-l) {\n      margin: 0;\n      min-height: 24rem;\n      max-height: 30rem;\n    }\n\n    a {\n      color: white;\n    }\n\n    > svg {\n      display: block;\n      margin: auto;\n      opacity: 0.9;\n    }\n\n    .logo {\n      position: absolute;\n      right: 0;\n      width: 100%;\n    }\n    .logo path {\n      fill: #fff;\n    }\n\n    .section {\n      padding: 1rem * 2;\n    }\n  }\n\n  .hero-cta {\n    display: flex;\n    justify-content: center;\n    margin: 1.5rem auto 0;\n  }\n\n  .header-link {\n    padding-left: 2px;\n  }\n\n  .header-logo {\n    display: flex;\n    align-items: center;\n    float: left;\n    margin: 0 -20px 0 0;\n    font-weight: bold;\n    font-size: 36px;\n    line-height: 1;\n\n    @media (min-width: $breakpoint-m) {\n      margin: 0 20px 0 0;\n    }\n\n    svg {\n      width: 31px;\n      height: 31px;\n      margin-right: 8px;\n      margin-left: 2px;\n      padding: 0;\n      color: #fff;\n    }\n  }\n\n  .header-snowpack {\n    margin: 0 auto 0.75rem;\n    font-weight: 900;\n    font-size: 3.5rem;\n    font-weight: 900;\n    font-family: $heading;\n    line-height: 1;\n    letter-spacing: -0.07em;\n    text-align: center;\n    opacity: 0.9;\n\n    @media (min-width: $breakpoint-m) {\n      max-width: none;\n      font-size: 5.75rem;\n      opacity: 1;\n    }\n  }\n\n  .header-snowpack-subtitle {\n    margin: 0;\n    margin: auto;\n    font-weight: 500;\n    font-family: $heading;\n    font-size: 2rem;\n    line-height: 1;\n    letter-spacing: -0.05em;\n    text-align: center;\n\n    @media (min-width: $breakpoint-m) {\n      font-size: 3rem;\n    }\n  }\n\n  .copy-button {\n    display: none;\n    flex: none;\n    align-items: center;\n    justify-content: center;\n    box-sizing: border-box;\n    min-width: 292px;\n    padding: 0.5em 1em;\n    font-size: 100%;\n    font-family: \"Menlo\", \"ui-monospace\", \"SFMono-Regular\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace;\n    line-height: 1.5rem;\n    background-color: white;\n    border: 1px solid #0006;\n    border-radius: 4px;\n    cursor: pointer;\n    @include animation-copy-button;\n\n    @media (min-width: $breakpoint-m) {\n      display: flex;\n    }\n\n    svg,\n    .faded {\n      color: #ccc;\n      transition: color 0.1s ease-out;\n    }\n  }\n</style>\n\n<div class=\"hero\">\n  <div class=\"section\">\n    <h1 class=\"header-snowpack\">Snowpack</h1>\n    <p class=\"header-snowpack-subtitle\">The faster frontend build tool.</p>\n\n    <div class=\"hero-cta\">\n      <a href=\"/tutorials/quick-start\"><Button style=\"primary\">Get started</Button></a>\n      <div style=\"margin: 0.5rem\"></div>\n      <button id=\"copy-button\" class=\"copy-button hidden-mobile\" data-clipboard-text=\"npm install snowpack\">\n        <span class=\"faded\" style=\"margin-right: 0.75rem;\">$</span>\n        <span id=\"copy-button-text\">npm install snowpack</span>\n        <svg style=\"height: 22px;width: 22px;margin: -0.1rem -0.1rem 0 0.75rem;\" aria-hidden=\"true\" focusable=\"false\"\n          data-prefix=\"far\" data-icon=\"clone\" class=\"svg-inline--fa fa-clone fa-w-16\" role=\"img\"\n          xmlns=\"http://www.w3.org/2000/svg\" viewbox=\"0 0 512 512\">\n          <path fill=\"currentColor\"\n            d=\"M464 0H144c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h320c26.51 0 48-21.49 48-48v-48h48c26.51 0 48-21.49 48-48V48c0-26.51-21.49-48-48-48zM362 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h42v224c0 26.51 21.49 48 48 48h224v42a6 6 0 0 1-6 6zm96-96H150a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h308a6 6 0 0 1 6 6v308a6 6 0 0 1-6 6z\">\n          </path>\n        </svg>\n      </button>\n      <script type=\"module\">\n        import Clipboard from 'https://cdn.skypack.dev/pin/clipboard@v2.0.6-eJjsV6JYCJOnOsq3YfEc/min/clipboard.js';\n        const clippy = new Clipboard('.copy-button');\n        const copyText = document.getElementById('copy-button').innerHTML;\n        clippy.on('success', function (e) {\n          document.getElementById('copy-button').style.minWidth = document.getElementById('copy-button').offsetWidth;\n          console.info('Trigger:', e);\n          document.getElementById('copy-button').innerHTML = '<span>copied to clipboard!</span>';\n          document.getElementById('copy-button').addEventListener(\"mouseleave\", function (event) {\n            document.getElementById('copy-button').innerHTML = copyText;\n          }, false);\n\n          setTimeout(() => {\n            e\n              .trigger\n              .classList\n              .remove('active')\n          }, 1000);\n          e.clearSelection();\n        });\n      </script>\n    </div>\n    <div class=\"hero-cta\">\n      <!-- Place this tag where you want the button to render. -->\n      <div class=\"hidden-mobile\" style=\"text-align: center; height: 36px;\">\n        <a class=\"github-button\" href=\"https://github.com/FredKSchott/snowpack\" data-icon=\"octicon-star\"\n          data-size=\"large\" data-show-count=\"true\" aria-label=\"Star FredKSchott/snowpack on GitHub\">Star</a>\n      </div>\n    </div>\n  </div>\n</div>\n"
  },
  {
    "path": "www/src/components/MainLayout.astro",
    "content": "---\nimport BaseLayout from './BaseLayout.astro';\nimport Menu from './Menu.astro';\n---\n\n<style lang=\"scss\">\n    @use \"../../public/styles/var\" as *;\n    $nav-height: 3.5rem; // height of top nav bar\n\n    $height: calc(100vh - #{$nav-height});\n\n    .layout {\n      display: grid;\n      grid-template-areas: \"contents\" \"main\";\n      grid-gap: 2rem;\n\n      @media (min-width: $breakpoint-m) {\n        grid-template-areas: \"nav contents\" \"nav main\";\n      }\n\n      @media (min-width: $breakpoint-l) {\n        grid-template-areas: \"nav main contents\";\n        grid-template-columns: 16rem auto 20rem;\n      }\n\n      // components\n      &-nav {\n        grid-area: nav;\n\n        @media (min-width: $breakpoint-m) {\n          position: sticky;\n          min-height: $height;\n          height: $height;\n          top: $nav-height;\n        }\n      }\n\n      &-main {\n        grid-area: main;\n        min-width: 0;\n        padding: 24px 0 24px 0;\n      }\n\n      &-contents {\n        @media (min-width: $breakpoint-l) {\n          position: sticky;\n          min-height: $height;\n          height: $height;\n          top: $nav-height;\n        }\n      }\n    }\n\n    :global(h3) {\n      position: relative;\n    }\n\n    :global(.header-link) {\n      position: absolute;\n      top: 0;\n      right: 100%;\n      height: 100%;\n      display: flex;\n      align-items: center;\n      font-weight: 400;\n      font-size: 0.75em;\n      padding-left: 0.5rem;\n      padding-right: 0.5rem;\n      color: $light-grey;\n      opacity: 0;\n      transition: opacity 100ms linear, color 100ms linear;\n    }\n\n    :global(.header-link:hover) {\n      color: $rainbow-blue;\n    }\n\n    :global(h3:hover .header-link) {\n      opacity: 1;\n    }\n</style>\n<BaseLayout>\n  <div class=\"wrapper\">\n    <section class=\"layout\">\n      <aside id=\"nav-primary\" class=\"layout-nav\">\n        <Menu />\n      </aside>\n\n      <article class=\"layout-main\">\n        <slot></slot>\n      </article>\n\n    </section>\n  </div>\n</BaseLayout>\n"
  },
  {
    "path": "www/src/components/Menu.astro",
    "content": "<style lang=\"scss\">\n  @use '../../public/styles/var' as *;\n\n  .nav {\n    display: none;\n    position: fixed;\n    top: $nav-height;\n    left: 0;\n    width: 100%;\n    padding-top: $algolia-height;\n    padding-right: 1.5rem;\n    padding-left: 1.5rem;\n    overflow-y: scroll;\n    background: $dark-blue;\n    transition: padding 0.2s ease-out, opacity 0.2s ease-in-out;\n    z-index: map-get($map: $layers, $key: 'nav');\n\n    @media (min-width: $breakpoint-m) {\n      display: block;\n      position: static;\n      padding-top: 0;\n      padding-right: 0;\n      padding-left: 0;\n      background: none;\n      overflow-y: auto;\n    }\n\n    :global(body.is-nav-open) & {\n      display: block;\n    }\n  }\n\n  .contents {\n    margin: 0;\n    height: calc(100vh - #{$nav-height + $algolia-height});\n    padding: 2rem 0;\n    list-style: none;\n  }\n\n  .section {\n    + .section {\n      margin-top: 1.5rem;\n    }\n  }\n\n  .header {\n    display: block;\n    margin-top: 0;\n    margin-bottom: 0.75rem;\n    color: rgba($white, 0.6);\n    font-weight: 600;\n    font-size: 20px;\n    font-family: $heading;\n    line-height: 1.2;\n\n    @media (min-width: $breakpoint-m) {\n      color: $dark-grey;\n    }\n  }\n\n  .items {\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  .link,\n  .subnav a {\n    position: relative;\n    display: block;\n    color: $white;\n    text-decoration: none;\n    border: none;\n    transition: color 0.3s;\n\n    @media (min-width: $breakpoint-m) {\n      color: $grey;\n    }\n\n    &::before {\n      position: absolute;\n      top: -2px;\n      left: -19px;\n      font-weight: 400;\n      font-size: 26px;\n      line-height: 1;\n      opacity: 0;\n      transition: left 0.14s ease-out;\n      content: '▸';\n    }\n\n    &:hover {\n      text-decoration: underline;\n    }\n\n    &.active {\n      color: #0c8cec;\n      text-decoration: underline;\n\n      &::before {\n        left: -17px;\n        opacity: 1;\n      }\n    }\n  }\n</style>\n\n<nav class=\"nav\">\n  <ol class=\"contents\">\n    <li class=\"section\">\n      <span class=\"header\">Concepts</span>\n      <ol class=\"items\">\n        <li><a class=\"link\" href=\"/concepts/how-snowpack-works\">How Snowpack Works</a></li>\n        <li><a class=\"link\" href=\"/concepts/dev-server\">The Dev Server</a></li>\n        <li><a class=\"link\" href=\"/concepts/build-pipeline\">The Build Pipeline</a></li>\n        <li><a class=\"link\" href=\"/concepts/hot-module-replacement\">Fast Refresh & HMR</a></li>\n      </ol>\n    </li>\n\n    <li class=\"section\">\n      <span class=\"header\">Getting Started</span>\n      <ol class=\"items\">\n        <li><a class=\"link\" href=\"/tutorials/quick-start\">Quick Start</a></li>\n        <li><a class=\"link\" href=\"/tutorials/getting-started\">Getting Started</a></li>\n        <li><a class=\"link\" href=\"/tutorials/react\">React</a></li>\n        <li><a class=\"link\" href=\"/tutorials/svelte\">Svelte</a></li>\n        <li><a class=\"link\" href=\"/tutorials/vue\">Vue</a></li>\n      </ol>\n    </li>\n\n    <li class=\"section\">\n      <a class=\"link\" href=\"/guides\"><span class=\"header\">Guides</span></a>\n    </li>\n\n    <li class=\"section\">\n      <span class=\"header\">Reference</span>\n      <ol class=\"items\">\n        <li><a class=\"link\" href=\"/reference/configuration\">snowpack.config.js</a></li>\n        <li><a class=\"link\" href=\"/reference/cli-command-line-interface\">Command Line API</a></li>\n        <li><a class=\"link\" href=\"/reference/javascript-interface\">JavaScript API</a></li>\n        <li><a class=\"link\" href=\"/reference/plugins\">Plugin API</a></li>\n        <li><a class=\"link\" href=\"/reference/environment-variables\">Environment Variables</a></li>\n        <li><a class=\"link\" href=\"/reference/hot-module-replacement\">HMR API</a></li>\n        <li><a class=\"link\" href=\"/reference/supported-files\">Supported Files</a></li>\n        <li><a class=\"link\" href=\"/reference/common-error-details\">Common Errors</a></li>\n      </ol>\n    </li>\n\n    <li class=\"section\">\n      <a class=\"link\" href=\"/plugins\"><span class=\"header\">Plugin Catalog</span></a>\n    </li>\n\n    <li class=\"section\">\n      <a class=\"link\" href=\"/news\"><span class=\"header\">Community & News</span></a>\n    </li>\n  </ol>\n</nav>\n"
  },
  {
    "path": "www/src/components/Nav.astro",
    "content": "---\nconst { version } = Astro.props;\n---\n\n<style lang=\"scss\">\n  @use '../../public/styles/var' as *;\n\n  .nav {\n    position: sticky;\n    top: 0;\n    z-index: map-get($map: $layers, $key: 'nav') + 1;\n    display: grid;\n    grid-template-areas:\n      'mobile logo version'\n      'search search search';\n    grid-template-rows: $nav-height $nav-height;\n    grid-template-columns: 1fr 2fr 1fr;\n    align-items: center;\n    height: $nav-height;\n    padding-right: 0.5rem;\n    padding-left: 0.625rem;\n    color: $white;\n    background-color: $dark-blue;\n\n    @media (min-width: $breakpoint-m) {\n      display: flex;\n      height: $nav-height;\n      padding-right: 0;\n    }\n  }\n\n  .hamburger {\n    width: 1em;\n    height: 1em;\n    fill: currentColor;\n  }\n\n  .link {\n    display: inline-block;\n    padding: 0.5em;\n    color: $white;\n    font-weight: 500;\n    text-decoration: none;\n    opacity: 0.7;\n    transition: opacity 150ms linear;\n\n    &:focus,\n    &:hover {\n      opacity: 1;\n    }\n\n    &__desktop {\n      display: none;\n\n      @media (min-width: $breakpoint-m) {\n        display: block;\n      }\n    }\n  }\n\n  .logo {\n    display: flex;\n    align-items: center;\n    grid-area: logo;\n    justify-content: center;\n    padding: 0.5rem;\n    color: $white;\n    font-size: 24px;\n    text-decoration: none;\n\n    @media (min-width: $breakpoint-m) {\n      justify-content: flex-start;\n      padding: 0.5rem 1.25rem;\n    }\n  }\n\n  .logo-icon {\n    display: block;\n    width: 1em;\n    height: 1em;\n    margin-right: 0.25em;\n    margin-bottom: 0.15rem;\n    fill: currentColor;\n  }\n\n  .logo-type {\n    font-weight: 700;\n    font-family: $heading;\n    letter-spacing: -0.03em;\n    padding-top: 0.2rem;\n  }\n\n  .mobile-open {\n    display: flex;\n    grid-area: mobile;\n    align-items: center;\n    justify-content: center;\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n    color: $white;\n    font-size: 16px;\n    background: none;\n    border: none;\n    appearance: none;\n\n    @media (min-width: $breakpoint-m) {\n      display: none;\n    }\n  }\n\n  .search {\n    display: none;\n    background: $dark-blue;\n    position: relative;\n    z-index: 1000;\n    flex-grow: 1;\n    grid-area: search;\n    max-width: calc(100vw - 1.25rem);\n    padding-left: 0.75rem;\n    padding-right: 0.7rem;\n\n    > * {\n      flex-grow: 1;\n    }\n\n    > :global(.algolia-autocomplete) {\n      width: 100%;\n    }\n\n    :global(body.is-nav-open) & {\n      display: flex;\n    }\n\n    @media (min-width: $breakpoint-m) {\n      display: flex;\n      width: 600px;\n      max-width: 600px;\n      margin-right: auto;\n    }\n  }\n\n  .sr-only {\n    position: absolute;\n    right: 1000px;\n  }\n\n  .search-hint {\n    position: absolute;\n    top: 0;\n    right: 0.75rem;\n    display: none;\n    height: 100%;\n    width: 3.5rem;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    letter-spacing: 0.125em;\n    color: #c2ced9;\n    font-size: 16px;\n    pointer-events: none;\n\n    & * {\n      font-family: $code;\n    }\n\n    &::before {\n      display: inline-block;\n      width: 1px;\n      height: 1.5em;\n      margin-right: 0.625em;\n      vertical-align: -35%;\n      background-color: rgba($white, 0.25);\n      content: '';\n    }\n\n    @media (min-width: $breakpoint-m) {\n      display: flex;\n    }\n  }\n\n  .search-input {\n    flex-grow: 1;\n    box-sizing: border-box;\n    width: 100%;\n    margin: 0;\n    padding-top: 0.5rem;\n    padding-right: 1rem;\n    padding-bottom: 0.5rem;\n    padding-left: 1rem;\n    overflow: visible;\n    color: #fff;\n    font-weight: 500;\n    font-size: 100%;\n    font-family: inherit;\n    line-height: inherit;\n    background-color: #446e8f;\n    border-color: rgba($white, 0.25);\n    border-style: solid;\n    border-width: 1px;\n    border-radius: 0.25rem;\n    outline: 0;\n    transition-timing-function: ease-in-out;\n    transition-duration: 0.2s;\n    transition-property: border-color, color;\n    -webkit-font-smoothing: antialiased;\n\n    &:focus {\n      color: white;\n      border-color: rgba($white, 0.75);\n\n      &::placeholder {\n        color: rgba($white, 0.8);\n      }\n    }\n    &::placeholder {\n      color: #c2ced9;\n    }\n\n    &__desktop {\n      display: none;\n\n      @media (min-width: $breakpoint-m) {\n        display: block;\n      }\n    }\n  }\n\n  .version {\n    grid-area: version;\n    margin-left: 0.5em;\n    font-size: 0.8em;\n    font-family: $code;\n    text-align: right;\n\n    @media (min-width: $breakpoint-m) {\n      text-align: left;\n\n      &::after {\n        display: inline-block;\n        width: 1px;\n        height: 1.5em;\n        margin-left: 1em;\n        vertical-align: -25%;\n        background-color: rgba($white, 0.25);\n        content: '';\n      }\n    }\n  }\n\n  .social {\n    width: 1em;\n    height: 1em;\n    fill: currentColor;\n  }\n</style>\n\n<nav class=\"nav\">\n  <button id=\"toc-drawer-button\" class=\"mobile-open\" type=\"button\" aria-expanded=\"false\"\n    aria-controls=\"nav-primary\">\n    <svg focusable=\"false\" class=\"hamburger\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewbox=\"0 0 448 512\">\n      <title>Toggle mobile menu</title>\n      <path\n        d=\"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z\">\n      </path>\n    </svg>\n  </button>\n  <a class=\"logo\" href=\"/\">\n    <svg class=\"logo-icon\" viewbox=\"0 0 640 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\n      xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n      <g transform=\"translate(-1.000000, 0.000000)\" fill-rule=\"nonzero\">\n        <path\n          d=\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\"\n          id=\"Shape\"></path>\n      </g>\n    </svg>\n    <span class=\"logo-type\">Snowpack</span>\n  </a>\n  <div class=\"search\">\n    <input type=\"text\" name=\"search\" placeholder=\"Search documentation...\" class=\"search-input\"\n      id=\"search-form-input\">\n    <span class=\"search-hint\">\n      <span class=\"sr-only\">Press </span>\n      <kbd class=\"font-sans\"><abbr title=\"Command\" style=\"text-decoration: none;\">⌘</abbr></kbd>\n      <span class=\"sr-only\"> and </span>\n      <kbd class=\"font-sans\">K</kbd>\n      <span class=\"sr-only\"> to search</span>\n    </span>\n  </div>\n\n  <a href=\"https://github.com/FredKSchott/snowpack/releases\" target=\"_blank\" class=\"link version\">\n    {`v${version}`}\n  </a>\n  <a href=\"https://github.com/FredKSchott/snowpack\" target=\"_blank\" class=\"link link__desktop\">\n    <svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fab\" data-icon=\"github\" class=\"social\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewbox=\"0 0 496 512\"><path d=\"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z\"></path></svg>\n  </a>\n</nav>\n\n<script>\n  function handleMobileNav(evt) {\n    evt.preventDefault();\n    /*If hidden-mobile class is enabled that means we are on desktop do overflow normal but we\n      if we are at mobile fixed body position, so that its not scrollable(which currently causing bug) and navbar  handling its\n      owns scroll. Case to consider there are chance use can open navbar using toggle button and user when click on any link\n      body postion should be unset\n      */\n    document.body.classList.toggle('is-nav-open');\n    const isOpen = document.body.classList.contains('is-nav-open');\n    if (isOpen) {\n      evt.target.setAttribute('aria-expanded', 'true');\n    } else {\n      evt.target.setAttribute('aria-expanded', 'false');\n    }\n  }\n\n  const mobileNavBtn = document.getElementById('toc-drawer-button');\n  mobileNavBtn.addEventListener('click', handleMobileNav);\n  mobileNavBtn.addEventListener('touchend', handleMobileNav);\n  if (window.location.pathname.startsWith('/posts')) {\n    mobileNavBtn.style.display = 'none';\n  }\n\n  const searchFormInputEl = document.getElementById('search-form-input');\n  searchFormInputEl.addEventListener('keyup', () => {\n    const gridTocEl = document.querySelector('#nav-primary');\n    if (searchFormInputEl.value) {\n      gridTocEl.classList.add('is-mobile-hidden');\n    } else {\n      gridTocEl.classList.remove('is-mobile-hidden');\n    }\n  });\n\n  document.onkeydown = function (e) {\n    if ((e.ctrlKey || e.metaKey) && e.which == 75) {\n      e.preventDefault();\n      searchFormInputEl.focus();\n    }\n  };\n</script>\n<script type=\"module\" src=\"./docsearch.js\"></script>\n<doc-search api-key=\"562139304880b94536fc53f5d65c5c19\" selector=\"#search-form-input\"></doc-search>\n"
  },
  {
    "path": "www/src/components/NewsAssets.svelte",
    "content": "<script>\n\t//let name = 'world';\n\t// TODO make this dynamic?\n</script>\n\n<h3>Assets</h3>\n\n<ul>\n\t<li><a href=\"(img/snowpack-logo-white.png\">Snowpack Logo (PNG, White)</a></li>\n\t<li><a href=\"(img/snowpack-logo-dark.png\">Snowpack Logo (PNG, Dark)</a></li>\n\t<li><a href=\"(img/snowpack-logo-black.png\">Snowpack Logo (PNG, Black)</a></li>\n\t<li><a href=\"(img/snowpack-wordmark-white.png\">Snowpack Wordmark (PNG, White)</a></li>\n\t<li><a href=\"(img/snowpack-wordmark-black.png\">Snowpack Wordmark (PNG, Black)</a></li>\n</ul>"
  },
  {
    "path": "www/src/components/NewsTitle.vue",
    "content": "<template>\n  <h2 class=\"content-title\">\n    {{ title }}\n  </h2>\n</template>\n<script>\nexport default {\n  props: {\n    title: {\n      type: String,\n      required: true\n    }\n  }\n}\n</script>\n"
  },
  {
    "path": "www/src/components/PluginSearchPage.jsx",
    "content": "import {h, Fragment} from 'preact';\nimport {useEffect, useState} from 'preact/hooks';\nimport Styles from './PluginSearchPage.module.css';\n\nasync function searchPlugins(val) {\n  const params3 = new URLSearchParams([\n    ['q', 'snowpack plugin ' + (val || '')],\n    ['count', '100'],\n  ]);\n  const res = await fetch(`https://api.skypack.dev/v1/search?${params3.toString()}`);\n  const jsonres = await res.json();\n  return jsonres.results;\n}\n\nfunction Card({result}) {\n  const updatedAtFormatted = Intl.DateTimeFormat('en', {\n    month: 'long',\n    day: 'numeric',\n    year: 'numeric',\n  }).format(Date.parse(result.updatedAt));\n  return (\n    <li class={Styles.Card}>\n      <img class={Styles.Icon__Plugin} src=\"/img/plug-light.svg\" />\n      <header class={Styles.CardHeader}>\n        <h3 class={Styles.CardName}>\n          <a href={`https://www.npmjs.com/package/${result.name}`} target=\"_blank\">\n            <span itemprop=\"name\">{result.name}</span>\n          </a>\n        </h3>\n      </header>\n      <p class={Styles.CardDesc} itemprop=\"description\">\n        {result.description.split('. ')[0]}\n      </p>\n      <p class={Styles.CardSubtitle}>\n        Updated&nbsp;\n        <time class=\"\" datetime={result.updatedAt}>\n          {updatedAtFormatted}\n        </time>\n      </p>\n    </li>\n  );\n}\n\nfunction PluginSearchPageLive() {\n  const searchParams = new URLSearchParams(\n    import.meta.env.SSR ? undefined : window.location.search,\n  );\n  const [results, setResults] = useState(null);\n  const [searchQuery, setSearchQuery] = useState(searchParams.get('q'));\n  useEffect(() => {\n    (async () => {\n      setResults(await searchPlugins(searchParams.get('q')));\n    })();\n  }, []);\n\n  async function onFormSubmit(e) {\n    if (import.meta.env.SSR) return;\n    e.preventDefault();\n    const form = new FormData(e.target);\n    const formula = form.get('q');\n    // document.getElementById('loading-message').style.display = 'block';\n    const searchParams = new URLSearchParams(window.location.search);\n    searchParams.set('q', formula);\n    window.history.pushState(null, null, '?' + searchParams.toString());\n    setSearchQuery(formula);\n    setResults(await searchPlugins(formula));\n    return false;\n  }\n\n  return (\n    <>\n      <form\n        name=\"myform\"\n        id=\"myform\"\n        class={Styles.Form}\n        action=\"https://www.npmjs.com/search\"\n        method=\"GET\"\n        onSubmit={onFormSubmit}\n      >\n        <input\n          type=\"search\"\n          name=\"q\"\n          defaultValue={searchQuery}\n          placeholder=\"search Sass, sitemaps, image optimization...\"\n          class={Styles.Input}\n        />\n        <button type=\"submit\" class={Styles.Submit}>\n          Search\n        </button>\n      </form>\n      <div class={Styles.Count} id=\"total-result-count\">\n        {!searchQuery && results && results.length > 50 && `${results.length}+ plugins available!`}\n      </div>\n      <section id=\"search-results\" class={Styles.Results}>\n        {!results && (\n          <div id=\"loading-message\" class={Styles.Loading}>\n            Loading...\n          </div>\n        )}\n        {results && results.length === 0 && (\n          <ul class={Styles.CardList}>\n            <li style=\"margin: 1rem; text-align: center;\">No results found.</li>\n          </ul>\n        )}\n        {results && results.length > 0 && (\n          <ul class={Styles.CardList}>\n            {results.map((r) => (\n              <Card result={r} />\n            ))}\n          </ul>\n        )}\n      </section>\n    </>\n  );\n}\n\nexport default function PluginSearchPage(props) {\n  return import.meta.env.astro ? <div>Loading...</div> : <PluginSearchPageLive {...props} />;\n}\n"
  },
  {
    "path": "www/src/components/PluginSearchPage.module.css",
    "content": ".Card {\n  margin: 0.5rem 0.25em;\n  border-radius: 4px;\n  padding: 0.25rem 0.5rem 0.5rem 3.5rem;\n  flex-direction: column;\n  position: relative;\n  display: flex;\n  grid-column: span 1;\n  overflow: hidden;\n  font-family: Open Sans, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans,\n    sans-serif, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;\n  color: #1a202c;\n  -webkit-font-smoothing: antialiased;\n  box-sizing: border-box;\n  border: 1px solid #e2e8f0;\n}\n\n.Card:nth-child(3n + 2) .Icon__Plugin {\n  filter: hue-rotate(-60deg);\n}\n\n.Card:nth-child(3n + 3) .Icon__Plugin {\n  filter: hue-rotate(-120deg);\n}\n\n.CardList {\n  list-style: none;\n  max-width: 600px;\n  padding-left: 0;\n}\n\n.CardName {\n  margin: 0;\n  font-size: 24px;\n  font-weight: 500;\n}\n\n.CardHeader {\n  font-size: 1.1447rem;\n}\n\n.CardDesc {\n  max-width: 80ch;\n  margin-top: 0.25em;\n  margin-bottom: 0.25em;\n  line-height: 1.25;\n}\n\n.CardSubtitle {\n  margin: 0;\n  color: #7986a5;\n  font-size: 0.8735804647362989em;\n}\n\n.Count {\n  max-width: 600px;\n  min-height: 24px;\n  margin: 0.5rem 0 1rem;\n  color: rgba(black, 0.6);\n  font-weight: 300;\n  font-size: 1em;\n  font-style: italic;\n  text-align: center;\n\n  @media (min-width: 600px) {\n    font-size: 1.2em;\n  }\n}\n\n.Form {\n  display: flex;\n  width: 100%;\n  max-width: 600px;\n}\n\n.Icon__Plugin {\n  height: 52px;\n  width: 52px;\n  opacity: 0.5;\n  transform: rotate(45deg);\n  /* background: radial-gradient(to top,red,blue); */\n  position: absolute;\n  top: 13px;\n  left: 0px;\n}\n\n.Loading {\n  margin: 1rem;\n  text-align: center;\n}\n\n.Input {\n  flex-grow: 1;\n  flex-shrink: 0;\n  box-sizing: border-box;\n  padding: 0.25em 0.75em;\n  font-size: 1em;\n  border-width: 1px 0 1px 1px;\n  border-radius: 4px 0 0 4px;\n  box-shadow: 0 0 0 2px rgba(46, 94, 130, 0);\n  transition: box-shadow 150ms linear;\n  appearance: none;\n}\n\n.Input:focus {\n  border-color: #2e5e82;\n  outline: none;\n  box-shadow: 0 0 0 2px rgba(46, 94, 130, 1);\n}\n\n.Input:focus + .Submit {\n  box-shadow: 0 0 0 2px rgba(46, 94, 130, 1);\n}\n\n.Results {\n  max-width: 600px;\n}\n\n.Submit {\n  padding: 0.5em 1em;\n  color: white;\n  font-weight: 700;\n  font-size: 1em;\n  font-family: 'Overpass', sans-serif;\n  background-color: #2e5e82;\n  border: none;\n  border-radius: 0 4px 4px 0;\n  box-shadow: 0 0 0 2px rgba(46, 94, 130, 0);\n  transition: box-shadow 150ms linear;\n  appearance: none;\n}\n"
  },
  {
    "path": "www/src/components/PokemonLookup.astro",
    "content": "---\nlet { number } = Astro.props;\n\nconst pokemonDataReq = await fetch(`https://pokeapi.co/api/v2/pokemon/${number}`);\nconst pokemonData = await pokemonDataReq.json();\n---\n\n<style>\n  .mb1 {\n    margin-bottom: 1rem;\n  }\n</style>\n\n<div class=\"notification mb1\">\n  <div class=\"wrapper\">\n    Pokemon #{number} is: {pokemonData.name}\n  </div>\n</div>\n"
  },
  {
    "path": "www/src/components/Subnav.astro",
    "content": "---\nconst { title, inputPath, headers } = Astro.props;\n---\n\n<style lang=\"scss\">\n@use \"../../public/styles/var\" as *;\n\n.header {\n  margin-top: 0;\n  margin-bottom: 8px;\n  color: rgba($white, 0.6);\n  font-weight: 600;\n  font-size: 20px;\n  font-family: $heading;\n  line-height: 1.2;\n\n  @media (min-width: $breakpoint-m) {\n    color: $dark-grey;\n  }\n}\n\n.subnav {\n  position: static;\n  z-index: 1;\n  padding: 2rem 0 24px 0;\n\n  @media (min-width: 1240px) {\n    position:-webkit-sticky;\n    position: sticky;\n    top: 56px;\n    z-index: 1;\n    display: block;\n    max-height: calc(100vh - 56px);\n    color: inherit;\n    background: none;\n    -webkit-overflow-scrolling: touch;\n    overflow-y: auto;\n  }\n\n\n  .header {\n    color: $dark-grey;\n  }\n\n  hr {\n    display: block;\n    height: 1px;\n    margin: 1rem 0;\n    background-color: $light-grey;\n    border: none;\n    appearance: none;\n  }\n\n  ol {\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\na {\n    color: $grey;\n  }\n}\n</style>\n\n<script type=\"module\" defer src=\"/js/index.js\"></script>\n<aside class=\"subnav\">\n  {headers.length > 0 && (\n    <div>\n      <h4 class=\"header\">On this page</h4>\n      <nav class=\"toc\">\n        <ol>\n          {headers.map((heading) => {\n          return <li><a href={\"#\" + heading.slug}>{heading.text}</a></li>\n          })}\n        </ol>\n      </nav>\n      <hr />\n    </div>\n  )}\n\n  <h4 class=\"header\">Suggest a change</h4>\n  <a href=\"https://github.com/FredKSchott/snowpack/blob/main/docs\">Edit this page on GitHub</a>\n</aside>\n"
  },
  {
    "path": "www/src/components/docsearch.js",
    "content": "import docsearch from 'docsearch.js/dist/cdn/docsearch.min.js';\nimport 'docsearch.js/dist/cdn/docsearch.min.css';\n\ncustomElements.define(\n  'doc-search',\n  class extends HTMLElement {\n    connectedCallback() {\n      if (!this._setup) {\n        const apiKey = this.getAttribute('api-key');\n        const selector = this.getAttribute('selector');\n        docsearch({\n          apiKey: apiKey,\n          indexName: 'snowpack',\n          inputSelector: selector,\n          debug: true, // Set debug to true if you want to inspect the dropdown\n        });\n        this._setup = true;\n      }\n    }\n  },\n);\n"
  },
  {
    "path": "www/src/components/index.ts",
    "content": "console.log('Hello world!');\n"
  },
  {
    "path": "www/src/data/news.json",
    "content": "[\n  {\n    \"title\": \"Snowpack v2.0\",\n    \"description\": \"Build web applications with less tooling and faster iteration.\",\n    \"date\": \"2020-05-26T00:00:00.000Z\",\n    \"url\": \"https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release\",\n    \"img\": \"https://www.snowpack.dev/img/social-2.jpg\"\n  },\n  {\n    \"title\": \"Svelte + Snowpack\",\n    \"date\": \"2020-06-27T00:00:00.000Z\",\n    \"url\": \"https://www.youtube.com/watch?v=BxDaIQ1LNvI\",\n    \"img\": \"https://i.ytimg.com/vi/BxDaIQ1LNvI/hqdefault.jpg\"\n  },\n  {\n    \"title\": \"The Web Platform Podcast - Pika and Snowpack\",\n    \"date\": \"2020-06-28T00:00:00.000Z\",\n    \"url\": \"https://thewebplatformpodcast.com/200-pika-and-snowpack\",\n    \"img\": \"https://thewebplatformpodcast.com/assets/img/social/social-twp-twitter-default.jpg\"\n  },\n  {\n    \"title\": \"Creating a TypeScript React application using Snowpack\",\n    \"date\": \"2020-07-01T00:00:00.000Z\",\n    \"url\": \"https://www.youtube.com/watch?v=gjFDiaR3P5w\",\n    \"img\": \"https://i.ytimg.com/vi/gjFDiaR3P5w/hqdefault.jpg\"\n  },\n  {\n    \"title\": \"Snowpack v2.7\",\n    \"description\": \"A new plugin API plus smaller, faster production builds.\",\n    \"date\": \"2020-07-30T00:00:00.000Z\",\n    \"url\": \"https://www.snowpack.dev/posts/2020-07-30-snowpack-2-7-release\",\n    \"img\": \"https://www.snowpack.dev/img/social-2.jpg\"\n  },\n  {\n    \"title\": \"Up and running with Snowpack and Svelte in seconds\",\n    \"date\": \"2020-08-20T00:00:00.000Z\",\n    \"url\": \"https://dev.to/dailydotdev/up-and-running-with-snowpack-and-svelte-in-seconds-15po\",\n    \"img\": \"https://res.cloudinary.com/practicaldev/image/fetch/s--IoChIDsm--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/lmzyc4tuan79b6i8tro5.png\"\n  },\n  {\n    \"title\": \"Using Azure Static Web Apps with Snowpack for TypeScript\",\n    \"date\": \"2020-09-01T00:00:00.000Z\",\n    \"url\": \"https://dev.to/david_whitney/using-azure-static-web-apps-with-snowpack-for-typescript-in-your-frontend-22cc\",\n    \"img\": \"https://res.cloudinary.com/practicaldev/image/fetch/s--rC8eB2Gx--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/gf3bfom00lsemcfevqdq.png\"\n  },\n  {\n    \"title\": \"Speakeasy JS – Snowpack: Faster web tooling, powered by ESM (Fred K Schott)\",\n    \"date\": \"2020-10-09T00:00:00.000Z\",\n    \"url\": \"https://www.youtube.com/watch?v=PJcfKX_PKaM\",\n    \"img\": \"https://i.ytimg.com/vi/PJcfKX_PKaM/hqdefault.jpg\"\n  },\n  {\n    \"title\": \"Getting started with Snowpack, React & Tailwind CSS\",\n    \"date\": \"2020-11-11T00:00:00.000Z\",\n    \"url\": \"https://scribbble.io/subhero/getting-started-with-snowpack-react-and-tailwind/\"\n  },\n  {\n    \"title\": \"New Official Guide: React\",\n    \"date\": \"2020-12-01T00:00:00.000Z\",\n    \"url\": \"https://next.snowpack.dev/tutorials/react\",\n    \"img\": \"https://next.snowpack.dev/img/ReactGuide.jpg\"\n  },\n  {\n    \"title\": \"New Official Guide: Svelte\",\n    \"date\": \"2020-12-01T00:00:00.000Z\",\n    \"url\": \"https://next.snowpack.dev/tutorials/svelte\",\n    \"img\": \"https://next.snowpack.dev/img/SvelteGuide.jpg\"\n  },\n  {\n    \"title\": \"Snowpack v3.0\",\n    \"description\": \"Snowpack v3.0 is here!\",\n    \"date\": \"2021-01-13T00:00:00.000Z\",\n    \"url\": \"https://www.snowpack.dev/posts/2021-01-13-snowpack-3-0\",\n    \"img\": \"https://www.snowpack.dev/img/social-snowpackv3.jpg\"\n  },\n  {\n    \"title\": \"Learn Snowpack in 15 minutes\",\n    \"description\": \"A video tutorial on creating a React app with Snowpack\",\n    \"date\": \"2021-01-20T00:00:00.000Z\",\n    \"url\": \"https://www.youtube.com/watch?v=QAwW0E9BXKc\",\n    \"img\": \"/img/news/learn-snow-youtube.jpg\"\n  },\n  {\n    \"title\": \"Create a 3D product landing page\",\n    \"description\": \"Using ThreeJS + React + Snowpack \",\n    \"date\": \"2021-01-20T00:00:00.000Z\",\n    \"url\": \"https://dev.to/takeshape/create-a-3d-product-landing-page-with-threejs-and-react-3coh\",\n    \"img\": \"/img/news/3d-product.jpeg\"\n  }\n]\n"
  },
  {
    "path": "www/src/data/users.json",
    "content": "[\n  {\n    \"name\": \"The Internet Archive\",\n    \"img\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Internet_Archive_logo_and_wordmark.svg/1200px-Internet_Archive_logo_and_wordmark.svg.png\",\n    \"url\": \"https://github.com/internetarchive/dweb-archive\"\n  },\n  {\n    \"name\": \"Alibaba 1688\",\n    \"img\": \"https://s.cafebazaar.ir/1/icons/com.alibaba.intl.android.apps.poseidon_512x512.png\",\n    \"url\": \"https://www.1688.com\"\n  },\n  {\n    \"name\": \"Intel\",\n    \"img\": \"https://upload.wikimedia.org/wikipedia/commons/4/4e/Intel_logo_%282006%29.svg\",\n    \"url\": \"https://twitter.com/kennethrohde/status/1227273971831332865\"\n  },\n  {\n    \"name\": \"CircleHD\",\n    \"img\": \"https://www.circlehd.com/img/logo-sm.svg\",\n    \"url\": \"https://www.circlehd.com/\"\n  },\n  {\n    \"name\": \"Svelvet\",\n    \"img\": \"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/237/spool-of-thread_1f9f5.png\",\n    \"url\": \"https://github.com/jakedeichert/svelvet\"\n  },\n  {\n    \"name\": \"Pika.dev\",\n    \"img\": \"https://www.pika.dev/static/img/logo5.svg\",\n    \"url\": \"https://www.pika.dev\"\n  },\n  {\n    \"name\": \"Toast\",\n    \"img\": \"https://www.toast.dev/toast-icon-300.png\",\n    \"url\": \"https://www.toast.dev\"\n  },\n  {\n    \"name\": \"Maskable.app\",\n    \"img\": \"https://maskable.app/favicon/favicon_196.png\",\n    \"url\": \"https://maskable.app/\"\n  },\n  {\n    \"name\": \"Web Skills\",\n    \"img\": \"https://andreasbm.github.io/web-skills/www/icon.svg\",\n    \"url\": \"https://andreasbm.github.io/web-skills\"\n  },\n  {\n    \"name\": \"SwissDev JavaScript Jobs\",\n    \"img\": \"https://static.swissdevjobs.ch/pictures/swissdev-javascript-jobs.svg\",\n    \"url\": \"https://swissdevjobs.ch/jobs/JavaScript/All\"\n  },\n  {\n    \"name\": \"Tradie Training\",\n    \"img\": \"https://tt.edu.au/images/logo.png\",\n    \"url\": \"https://tt.edu.au\"\n  },\n  {\n    \"name\": \"wemake.services\",\n    \"img\": \"https://avatars0.githubusercontent.com/u/19639014?s=200&v=4\",\n    \"url\": \"https://github.com/wemake-services\"\n  },\n  {\n    \"name\": \"airhacks.com\",\n    \"img\": \"https://airhacks.com/logo.svg\",\n    \"url\": \"https://airhacks.com\"\n  },\n  {\n    \"name\": \"tongdun\",\n    \"img\": \"https://www.tongdun.cn/static/favicon.ico\",\n    \"url\": \"https://www.tongdun.cn/\"\n  },\n  {\n    \"name\": \"Blessing Skin\",\n    \"img\": \"https://blessing.netlify.app/logo.png\",\n    \"url\": \"https://github.com/bs-community\"\n  },\n  {\n    \"name\": \"TRPG Engine\",\n    \"img\": \"https://trpgdoc.moonrailgun.com/img/trpg_logo.png\",\n    \"url\": \"https://trpgdoc.moonrailgun.com/\"\n  },\n  {\n    \"name\": \"SHEIN\",\n    \"img\": \"https://sheinsz.ltwebstatic.com/she_dist/images/touch-icon-ipad-144-47ceee2d97.png\",\n    \"url\": \"https://www.shein.com/\"\n  },\n  {\n    \"name\": \"SeekInnovation\",\n    \"img\": \"https://assets.website-files.com/5e2c3e23d2e067287ea582e4/5e6a5bca2d401204ada76b95_SeekInnovationLogoRound_Vector.svg\",\n    \"url\": \"https://seekinnovation.at\"\n  },\n  {\n    \"name\": \"Vipatra\",\n    \"img\": \"https://vigneshksaithal.github.io/img/vipatra-logo-with-text.png\",\n    \"url\": \"https://vipatra.in\"\n  }\n]\n"
  },
  {
    "path": "www/src/layouts/content-with-cover.astro",
    "content": "---\nimport Subnav from '../components/Subnav.astro';\nimport Menu from '../components/Menu.astro';\nimport BaseHead from '../components/BaseHead.astro';\nimport BaseLayout from '../components/BaseLayout.astro';\n\nconst { content } = Astro.props;\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <style lang=\"scss\">\n    @use \"../../public/styles/var\" as *;\n\n    .cover-wrapper {\n      width: 100%;\n      height: 44vh;\n      min-height: 20rem;\n      max-height: 30rem;\n      position: relative;\n      background: #2a85ca40;\n      overflow: hidden;\n    }\n    .cover,\n    .cover-blur {\n      position: absolute;\n      top: 0;\n      left: 0;\n      bottom: 0;\n      right: 0;\n      height: 100%;\n      width: 100%;\n    }\n    .cover-blur {\n      object-fit: cover;\n      filter: blur(3px) brightness(1.5);\n      transform: scale(1.1);\n    }\n    .cover {\n      object-fit: contain;\n      filter: brightness(1.5);\n    }\n    @media (max-width: 1200px) {\n      .cover-blur {\n        object-fit: cover;\n      }\n      .cover {\n        object-fit: cover;\n      }\n    }\n\n\n\n    $nav-height: 3.5rem; // height of top nav bar\n\n    $height: calc(100vh - #{$nav-height});\n\n    .layout {\n      display: grid;\n      grid-template-areas: \"contents\" \"main\";\n      grid-gap: 2rem;\n\n      @media (min-width: $breakpoint-m) {\n        grid-template-areas: \"nav contents\" \"nav main\";\n      }\n\n      @media (min-width: $breakpoint-l) {\n        grid-template-areas: \"nav main contents\";\n        grid-template-columns: 16rem auto 20rem;\n      }\n\n      // components\n      &-nav {\n        grid-area: nav;\n\n        @media (min-width: $breakpoint-m) {\n          position: sticky;\n          min-height: $height;\n          height: $height;\n          top: $nav-height;\n        }\n      }\n\n      &-main {\n        grid-area: main;\n        min-width: 0;\n        padding: 24px 0 24px 0;\n      }\n\n      &-contents {\n        @media (min-width: $breakpoint-l) {\n          position: sticky;\n          min-height: $height;\n          height: $height;\n          top: $nav-height;\n        }\n      }\n    }\n\n    :global(h3) {\n      position: relative;\n    }\n\n    :global(.header-link) {\n      position: absolute;\n      top: 0;\n      right: 100%;\n      height: 100%;\n      display: flex;\n      align-items: center;\n      font-weight: 400;\n      font-size: 0.75em;\n      padding-left: 0.5rem;\n      padding-right: 0.5rem;\n      color: $light-grey;\n      opacity: 0;\n      transition: opacity 100ms linear, color 100ms linear;\n    }\n\n    :global(.header-link:hover) {\n      color: $rainbow-blue;\n    }\n\n    :global(h3:hover .header-link) {\n      opacity: 1;\n    }\n  </style>\n  <BaseHead title={content.title} description={content.description} permalink=\"TODO\" />\n</head>\n\n<body>\n  <BaseLayout>\n\n    <div class=\"cover-wrapper\">\n      <img class=\"cover-blur\" src={content.cover} alt=\"\"/>\n      <img class=\"cover\" src={content.cover} alt=\"\"/>\n    </div>\n\n    <div class=\"wrapper\">\n      <section class=\"layout\">\n        <aside id=\"nav-primary\" class=\"layout-nav\">\n          <Menu />\n        </aside>\n\n        <div>\n          <Subnav title={content.title} headers={content.astro.headers} />\n        </div>\n\n        <article class=\"layout-main\">\n          <div class=\"content\">\n            <h2 class=\"content-title\">\n              {content.title}\n            </h2>\n            <div class=\"content-layout\">\n              <div class=\"content-body\">\n                <slot></slot>\n              </div>\n            </div>\n          </div>\n        </article>\n\n      </section>\n    </div>\n  </BaseLayout>\n</body>\n\n</html>\n"
  },
  {
    "path": "www/src/layouts/content.astro",
    "content": "---\nimport Subnav from '../components/Subnav.astro';\nimport Menu from '../components/Menu.astro';\nimport BaseHead from '../components/BaseHead.astro';\nimport BaseLayout from '../components/BaseLayout.astro';\n\nconst { content } = Astro.props;\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <BaseHead title={content.title} description={content.description} permalink=\"TODO\" />\n  <style lang=\"scss\">\n    @use \"../../public/styles/var\" as *;\n\n    $nav-height: 3.5rem; // height of top nav bar\n\n    $height: calc(100vh - #{$nav-height});\n\n    .layout {\n      display: grid;\n      grid-template-areas: \"contents\" \"main\";\n      grid-gap: 2rem;\n\n      @media (min-width: $breakpoint-m) {\n        grid-template-areas: \"nav contents\" \"nav main\";\n      }\n\n      @media (min-width: $breakpoint-l) {\n        grid-template-areas: \"nav main contents\";\n        grid-template-columns: 16rem auto 20rem;\n      }\n\n      // components\n      &-nav {\n        grid-area: nav;\n\n        @media (min-width: $breakpoint-m) {\n          position: sticky;\n          min-height: $height;\n          height: $height;\n          top: $nav-height;\n        }\n      }\n\n      &-main {\n        grid-area: main;\n        min-width: 0;\n        padding: 24px 0 24px 0;\n      }\n\n      &-contents {\n        @media (min-width: $breakpoint-l) {\n          position: sticky;\n          min-height: $height;\n          height: $height;\n          top: $nav-height;\n        }\n      }\n    }\n\n    :global(h3) {\n      position: relative;\n    }\n\n    :global(.header-link) {\n      position: absolute;\n      top: 0;\n      right: 100%;\n      height: 100%;\n      display: flex;\n      align-items: center;\n      font-weight: 400;\n      font-size: 0.75em;\n      padding-left: 0.5rem;\n      padding-right: 0.5rem;\n      color: $light-grey;\n      opacity: 0;\n      transition: opacity 100ms linear, color 100ms linear;\n    }\n\n    :global(.header-link:hover) {\n      color: $rainbow-blue;\n    }\n\n    :global(h3:hover .header-link) {\n      opacity: 1;\n    }\n  </style>\n</head>\n\n<body>\n  <BaseLayout>\n    <div class=\"wrapper\">\n      <section class=\"layout\">\n        <aside id=\"nav-primary\" class=\"layout-nav\">\n          <Menu />\n        </aside>\n\n        <div>\n          <Subnav title={content.title} headers={content.astro.headers} />\n        </div>\n\n        <article class=\"layout-main\">\n          <div class=\"content\">\n            <h2 class=\"content-title\">\n              {content.title}\n            </h2>\n            <div class=\"content-layout\">\n              <div class=\"content-body\">\n                <slot></slot>\n              </div>\n            </div>\n          </div>\n        </article>\n\n      </section>\n    </div>\n  </BaseLayout>\n</body>\n\n</html>\n"
  },
  {
    "path": "www/src/layouts/post.astro",
    "content": "---\nimport BaseHead from '../components/BaseHead.astro';\nimport BaseLayout from '../components/BaseLayout.astro';\nimport { format as formatDate, parseISO } from 'date-fns';\n\nconst { content } = Astro.props;\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <style lang=\"scss\">\n    @use '../../public/styles/var' as *;\n\n    .hero {\n      background: linear-gradient(45deg, $rainbow-green, $rainbow-blue, $rainbow-purple);\n      color: white;\n      border-bottom: 1px solid #555;\n      padding: 3rem;\n\n      &-inner {\n        display: flex;\n        flex-direction: column;\n        justify-content: center;\n        align-items: center;\n        padding: 3rem;\n        background: rgba(white, 0.2);\n      }\n\n      a {\n        color: white;\n        text-decoration: underline;\n      }\n    }\n\n    .title {\n      font-weight: 900;\n      font-size: 4em;\n      line-height: 1.4;\n      margin: 0;\n    }\n\n    .tagline {\n      margin: 1rem 0;\n      font-weight: 400;\n      font-size: 1.25em;\n    }\n\n    .meta {\n      font-size: 1em;\n    }\n\n    .wrapper {\n      margin-left: auto;\n      margin-right: auto;\n      max-width: 55em;\n    }\n  </style>\n  <BaseHead title={content.title} description={content.description} permalink=\"TODO\" />\n</head>\n\n<body>\n  <BaseLayout>\n    <header class=\"hero\">\n      <div class=\"hero-inner\">\n        <svg height=\"80px\" style=\"padding-left: 8px;\" viewBox=\"0 0 640 512\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"\n          xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n          <g stroke=\"none\" stroke-width=\"1\" fill=\"currentColor\" fill-rule=\"evenodd\">\n            <g transform=\"translate(-1.000000, 0.000000)\" fill-rule=\"nonzero\"><path d=\"M635.92,462.7 L347.92,14.7 C342.03,5.54 331.89,0 321,0 C310.11,0 299.97,5.54 294.08,14.7 L6.08,462.7 C-0.250773249,472.547007 -0.699487627,485.064987 4.91,495.34 C10.522069,505.612419 21.2945349,512 33,512 L609,512 C620.71,512 631.48,505.61 637.09,495.33 C642.699457,485.058495 642.250708,472.543372 635.92,462.7 Z M321,91.18 L406.39,224 L321,224 L257,288 L218.94,249.94 L321,91.18 Z\"></path></g>\n          </g>\n        </svg>\n        <h1 class=\"title\">{content.title}</h1>\n\n        <h2 class=\"tagline\">\n          {content.tagline && <div style=\"margin-bottom: 1rem;\">{content.tagline}</div>}\n          <small class=\"meta\">\n            Published <a href='#published-at'>{formatDate(parseISO(content.date), 'MMMM d, yyyy')}</a>\n            by <a href=\"https://twitter.com/FredKSchott\">Fred K. Schott</a>\n          </small>\n        </h2>\n\n        <!-- Place this tag where you want the button to render. -->\n        <div class=\"hidden-mobile\" style=\"text-align: center; margin-top: 0.5rem; filter: scale(2);\">\n          <a class=\"github-button\" href=\"https://github.com/FredKSchott/snowpack\" data-icon=\"octicon-star\" data-size=\"large\"\n            data-show-count=\"true\" aria-label=\"Star FredKSchott/snowpack on GitHub\">Star</a>\n        </div>\n        <!-- Place this tag in your head or just before your close body tag. -->\n        <script defer src=\"https://buttons.github.io/buttons.js\"></script>\n      </div>\n    </header>\n\n    <main class=\"wrapper wrapper__readable pt6 pb6\">\n      <article class=\"content markdown-body\">\n        <slot></slot>\n      </article>\n    </main>\n  </BaseLayout>\n</body>\n\n</html>\n"
  },
  {
    "path": "www/src/pages/404.astro",
    "content": "---\nimport BaseHead from '../components/BaseHead.astro';\nimport MainLayout from '../components/MainLayout.astro';\n\nlet title = 'Not Found';\nlet description = 'Snowpack is a lightning-fast frontend build tool, designed for the modern web.';\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <BaseHead title={title} description={description} permalink=\"TODO\" />\n</head>\n\n<body>\n  <MainLayout>\n    <h2 class=\"content-title\">\n      {title}\n    </h2>\n    <div class=\"content\">\n      <a href=\"/\">Go Home</a>\n    </div>\n  </MainLayout>\n</body>\n\n</html>"
  },
  {
    "path": "www/src/pages/guides.astro",
    "content": "---\nimport {Markdown} from 'astro/components';\nimport Card from '../components/Card.jsx';\nimport BaseHead from '../components/BaseHead.astro';\nimport MainLayout from '../components/MainLayout.astro';\n\n// mocked for now, to be added later\n// 1. import {paginate} from 'magicthing';\n// 2. export default function ({paginate}) {\nfunction paginate(options) {\n  if (options.tag === 'guide') {\n    return [\n      { title: 'Test guide 1', href: \"#\" },\n      { title: 'Test guide 2', href: \"#\" },\n    ];\n  }\n  if (options.tag === 'communityGuides') {\n    return [{ title: 'Test communityGuides', href: \"#\" }];\n  }\n  return [];\n}\n\nlet title = 'Guides';\nlet description = 'Snowpack\\'s usage and integration guides.';\nlet guides;\nlet communityGuides;\n\n\n  guides = paginate({\n    files: '/posts/guides/*.md',\n    // sort: ((a, b) => new Date(b) - new Date(a)),\n    tag: 'guide',\n    limit: 10,\n    // page: query.page,\n  });\n  communityGuides = paginate({\n    files: '/posts/guides/*.md',\n    // sort: ((a, b) => new Date(b) - new Date(a)),\n    tag: 'communityGuides',\n    limit: 10,\n  });\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <BaseHead title={title} description={description} permalink=\"TODO\" />\n</head>\n\n<body>\n  <MainLayout>\n    <h2 class=\"content-title\">\n      {title}\n    </h2>\n\n    <h3 class=\"content-title\">\n      Using Snowpack\n    </h3>\n\n    <div class=\"content\">\n      <Markdown>\n        - [Routing](/guides/routing)\n        - [Server-Side Rendering](/guides/server-side-render)\n        - [SSL, HTTPS, and HTTP/2 in Development](/guides/https-ssl-certificates)\n        - [Connecting Third-Party Tools](/guides/connecting-tools)\n        - [Optimize & Bundle for Production](/guides/optimize-and-bundle)\n        - [Streaming Imports](/guides/streaming-imports)\n        - [Testing](/guides/testing)\n        - [Creating Your Own Plugin](/guides/plugins)\n        - [Snowpack Upgrade Guide (from v1, v2)](/guides/upgrade-guide)\n      </Markdown>\n    </div>\n\n    <br />\n    <br />\n\n    <h3 class=\"content-title\">\n      Popular Integration Guides\n    </h3>\n    <div class=\"card-grid card-grid-4\">\n      <article class=\"card\">\n        <a href=\"/tutorials/react/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/ReactGuide.jpg\" alt=\"\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Getting Started with React</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/tutorials/svelte/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/SvelteGuide.jpg\" alt=\"\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Getting Started with Svelte</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/tutorials/vue/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"\" alt=\"\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Getting Started with Vue</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/babel/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/babel.svg\" alt=\"\" style=\"background: #323330\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Babel</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/jest/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/jest.svg\" alt=\"\" style=\"background: #d14c53\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Jest</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/postcss/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/postcss.svg\" alt=\"\" style=\"background: #f8f8f2\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">PostCSS</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/preact/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/preact.svg\" alt=\"\" style=\"background: #333333\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Preact</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/sass/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/sass.svg\" alt=\"\" style=\"background: #bf4080\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Sass</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/tailwind-css/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/tailwind.svg\" alt=\"\" style=\"background: #f2f8f8\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Tailwind CSS</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/wasm/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/wasm.svg\" alt=\"\" style=\"background: #f2f2f8\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">WASM</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/web-test-runner/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <img class=\"card-image card-image-small\" src=\"/img/logos/modern-web.svg\" alt=\"\" style=\"background: #f2f2f8\">\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">@web/test-runner</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/web-worker/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <div class=\"card-image card-image-small\"></div>\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Web Workers</h3>\n        </div>\n        </a>\n      </article>\n      <article class=\"card\">\n        <a href=\"/guides/workbox/\" style=\"text-decoration: none; color: initial; flex-grow: 1;\">\n      <div class=\"card-image card-image-small\"></div>\n        <div class=\"card-text\">\n          <h3 class=\"card-title\">Workbox</h3>\n        </div>\n        </a>\n      </article>\n    </div>\n  </MainLayout>\n</body>\n\n</html>\n"
  },
  {
    "path": "www/src/pages/index.astro",
    "content": "---\nimport Button from '../components/Button.astro';\nimport Menu from '../components/Menu.astro';\nimport Hero from '../components/Hero.astro';\nimport BaseHead from '../components/BaseHead.astro';\nimport BaseLayout from '../components/BaseLayout.astro';\n\nlet title = 'Snowpack';\nlet description = 'Snowpack is a lightning-fast frontend build tool, designed for the modern web.';\n---\n\n<!doctype html>\n<html>\n<head>\n  <style lang=\"scss\">\n    @use '../../public/styles/var' as *;\n\n    blockquote {\n      margin: 1rem 0;\n    }\n    blockquote a {\n      font-weight: bold;\n    }\n    .layout {\n      display: grid;\n      grid-template-areas: \"main\";\n\n      @media (min-width: $breakpoint-m) {\n        grid-template-areas: \"nav main\";\n        grid-template-columns: 16rem auto;\n      }\n\n      &-nav {\n        grid-area: nav;\n      }\n\n      &-main {\n        grid-area: main;\n      }\n    }\n\n    .top {\n      text-align: left;\n    }\n\n    .img-banner {\n      background: #f0db4f;\n      display: block;\n      text-align: center;\n\n      img {\n        max-width: min(32rem, 100%);\n      }\n    }\n\n    .bullets {\n      display: grid;\n      grid-row-gap: 1em;\n      grid-column-gap: 2em;\n      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n      margin: 2.5em 0 !important;\n      padding: 0.1em !important;\n      list-style: none;\n\n      .bullet-heading {\n        margin: 0 0 0.25em 0;\n        font-size: 1.25em;\n      }\n    }\n\n    .bullet {\n      padding: 0.25em;\n      border-radius: 4px;\n\n      h3 {\n        display: flex;\n        align-items: center;\n\n        &::before {\n          content: \"✅\";\n          font-size: 0.75em;\n          display: block;\n          margin-right: 0.5rem;\n        }\n      }\n    }\n\n    .buttons {\n      margin: 2em 0;\n      text-align: center;\n\n      > * {\n        margin-left: 0.5rem;\n        margin-right: 0.5rem;\n      }\n    }\n  </style>\n  <BaseHead title={title} description={description} permalink=\"TODO\" />\n</head>\n\n<body>\n  <BaseLayout>\n    <Hero bar=\"{title}\" />\n    <div foo=\"{title}\" class=\"wrapper\" style=\"margin: 0 auto\">\n      <section class=\"layout pt6 pb6\">\n        <aside id=\"nav-primary\" class=\"layout-nav\">\n          <Menu></Menu>\n        </aside>\n\n        <article class=\"layout-main\">\n          <a class=\"img-banner\" href=\"https://osawards.com/javascript/2020\" target=\"_blank\"\n            rel=\"noopener noreferrer\">\n            <img src=\"/img/JSAwardWinner.png\" alt=\"2020 JavaScript Open Source Award Winner banner\" />\n          </a>\n\n          <blockquote>\n            <p><strong>Update (April 20, 2022):</strong> Snowpack is no longer actively maintained and is not recommended for new projects.</p>\n            <p>Check out <a href=\"https://vitejs.dev/\" rel=\"nofollow\">Vite</a> for a well-maintained Snowpack alternative.<br>\n            See also: <a href=\"https://esbuild.github.io/\" rel=\"nofollow\">esbuild</a>, <a href=\"https://parceljs.org/\" rel=\"nofollow\">parcel</a></p>\n          </blockquote>\n\n          <div class=\"markdown-body feature-list\">\n            <div class={'t' + 'o' + 'p'}>\n              <h2 id=\"what-is-snowpack%3F\">What is Snowpack?</h2>\n              <p>\n                <strong>Snowpack is a lightning-fast frontend build tool, designed\n                  for the modern web.</strong>\n                It is an alternative to heavier, more complex bundlers like\n                webpack or Parcel in your development workflow. Snowpack\n                leverages JavaScript's native module system (<a\n                  href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import\">known\n                  as\n                  ESM</a>) to avoid unnecessary work and stay fast no matter how big\n                your project grows.\n              </p>\n              <p>\n                Once you try it, it's impossible to go back to anything else.\n              </p>\n            </div>\n\n            <ul class=\"bullets\">\n              <li class=\"bullet\">\n                <h3 class=\"bullet-heading\">Instant startup</h3>\n                Snowpack's unbundled web development server\n                <strong>starts up in 50ms or less</strong>\n                and stays fast in large projects.\n              </li>\n              <li class=\"bullet\">\n                <h3 class=\"bullet-heading\">Build once, cache forever</h3>\n                Snowpack never builds the same file twice. Powered by\n                JavaScript’s native module system (ESM) in the browser.\n              </li>\n              <li class=\"bullet\">\n                <h3 class=\"bullet-heading\">HMR feat. Fast Refresh</h3>\n                No refresh required. See changes reflected instantly in the\n                browser with\n                <a href=\"/concepts/hot-module-replacement\">HMR + Fast Refresh</a>\n                for React, Preact & Svelte.\n              </li>\n              <li class=\"bullet\">\n                <h3 class=\"bullet-heading\">Out-of-the-box support</h3>\n                Enjoy Snowpack's built-in support for JSX, TypeScript, React,\n                Preact, CSS Modules\n                <a href=\"/reference/supported-files\">and more.</a>\n              </li>\n              <li class=\"bullet\">\n                <h3 class=\"bullet-heading\">Optimize for production</h3>\n                Build for production with built-in optimizations and plugin\n                support for your favorite bundlers.\n              </li>\n              <li class=\"bullet\">\n                <h3 class=\"bullet-heading\">Plugins? Plugins!</h3>\n                Babel? Sass? MDX? Browse the entire\n                <a href=\"/plugins\">Snowpack Plugin Catalog</a>\n                to connect your favorite build tool (or\n                <a href=\"/reference/plugins\">create your own!</a>)\n              </li>\n            </ul>\n\n            <div class=\"buttons\">\n              <a href=\"/tutorials/quick-start\"><Button style=\"primary\">Get started</Button></a>\n              <a href=\"/concepts/how-snowpack-works\"><Button>Learn more</Button></a>\n            </div>\n          </div>\n        </article>\n      </section>\n    </div>\n  </BaseLayout>\n  <!-- Place this tag in your head or just before your close body tag. -->\n  <script async=\"async\" defer=\"defer\" src=\"https://buttons.github.io/buttons.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "www/src/pages/news.astro",
    "content": "---\nimport Card from '../components/Card.jsx';\nimport BaseHead from '../components/BaseHead.astro';\nimport MainLayout from '../components/MainLayout.astro';\n\n// When testing, we used this as a bit of a kitchen sink for Astro.\n// Keep the different mixing of frameworks just for fun, to show Astro off.\nimport CompanyLogo from '../components/CompanyLogo.jsx';\nimport NewsAssets from '../components/NewsAssets.svelte';\nimport NewsTitle from '../components/NewsTitle.vue';\n\n// Using Snowpack? Want to be featured on snowpack.dev?\n// Add your project, organization, or company to the end of this list!\nimport news from '../data/news.json';\nimport users from '../data/users.json';\n\nconst title = 'Community & News';\nconst description = 'Snowpack community news and companies that use Snowpack.';\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <BaseHead title={title} description={description} permalink=\"TODO\" />\n</head>\n\n<body>\n  <MainLayout>\n    <NewsTitle title={title} />\n    <p>\n      Get the latest news, blog posts, and tutorials on Snowpack. <a href=\"/feed.xml\">Also available via RSS.</a>\n    </p>\n\n    <p>\n      Got something that you think we should feature?\n      <a href=\"https://github.com/FredKSchott/snowpack/discussions/categories/ideas\">Submit it!</a>\n    </p>\n\n    <div class=\"card-grid card-grid-3\">\n      {news.reverse().map((item: any) => <Card item={item} />)}\n    </div>\n\n    <div class=\"content\">\n\n      <h3>Who's Using Snowpack?</h3>\n\n      <div class=\"company-logos\">\n\n        {users.map((user) =>\n        <CompanyLogo user={user} />)}\n\n        <a href=\"https://github.com/FredKSchott/snowpack/edit/main/www/_template/news.md\" target=\"_blank\"\n          title=\"Add Your Project/Company!\" class=\"add-company-button\">\n          <svg style=\"height: 22px; margin-right: 8px;\" aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\"\n            data-icon=\"plus\" class=\"company-logo\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\">\n            <path fill=\"currentColor\"\n              d=\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\">\n            </path>\n          </svg>\n          Add your logo\n        </a>\n      </div>\n\n      <NewsAssets />\n    </div>\n  </MainLayout>\n</body>\n\n</html>\n"
  },
  {
    "path": "www/src/pages/plugins.astro",
    "content": "---\nimport PluginSearchPage from '../components/PluginSearchPage.jsx';\nimport BaseHead from '../components/BaseHead.astro';\nimport MainLayout from '../components/MainLayout.astro';\n\nlet title = 'The Snowpack Plugin Catalog';\nlet description = 'Snowpack plugins allow for configuration-minimal tooling integration.';\n---\n\n<!doctype html>\n<html>\n\n<head>\n  <BaseHead title={title} description={description} permalink=\"TODO\" />\n  <style lang=\"scss\">\n    .intro {\n      margin-top: 1rem;\n      margin-bottom: 1rem;\n      line-height: 1.5;\n      text-align: left;\n\n      a {\n        color: #2e5e82;\n      }\n    }\n\n    .subheading {\n      margin-top: -2.5rem;\n      margin-bottom: 0;\n      color: #2e5e82;\n      font-weight: 500;\n      font-size: 1em;\n      font-family: 'Overpass', sans-serif;\n      letter-spacing: -0.02em;\n      text-align: left;\n\n      @media (min-width: 600px) {\n        font-size: 1.5em;\n      }\n    }\n\n    .zero-heading {\n      margin-top: 1.5rem;\n      margin-bottom: 1.5rem;\n      font-weight: 700;\n      font-size: 1.4em;\n      text-align: left;\n\n      @media (min-width: 600px) {\n        font-size: 1.5em;\n      }\n    }\n  </style>\n</head>\n\n<body>\n  <MainLayout>\n    <h2 class=\"content-title\">{ title }</h2>\n\n    <h3 class=\"pluginPage-subheading\">\n      Customize Snowpack with optimized build plugins.\n    </h3>\n    <p class=\"pluginPage-intro\">\n      To learn more about our plugin system, check out the\n      <a href=\"/reference/plugins\">Plugin API.</a><br />Can't find what you need?\n      <a href=\"/reference/plugins\">Creating your own plugin is easy!</a>\n    </p>\n\n    <div style=\"margin-top:4rem;\"></div>\n\n    <PluginSearchPage:load />\n  </MainLayout>\n</body>\n\n</html>\n"
  }
]